Ok. Could you create a MWE?
If that is the case and your entire mesh comprises of the left and right subdomains, with \alpha only existing on one of them, then one way that I can see is by creating a SubMesh
, so effectively doing
from dolfin import *
mesh = UnitCubeMesh(2,1,1)
rightMesh = SubMesh(mesh, CompiledSubDomain("x[0] >= 0.5"))
Vr = FunctionSpace(rightMesh, "DG", 0)
alph = Function(Vr)
alpha_values = [10 , 6 , 8 , 15 , 3 , 7]
alph.vector()[:] = alpha_values #this assigns the value in the order of rightmesh.cells()
This should assign the values in the order of rightMesh.cells()
which should map to global indices rightMesh.data().array("parent_cell_indices", mesh.geometric_dimension())
.