Hi
I'd like to use something containing subdomain number as a variable coefficient. First I've tried to return the number itself in an Expression:
subdomains = MeshFunction("size_t", mesh, "mesh_physical_region.xml")
class subExpression(Expression):
def __init__(self, subdomains):
Expression.__init__(self)
self.subdomains = subdomains
def eval(self, values, cell):
values [0] = self.subdomains.array()[cell.global_index()]
and get following error: 'numpy.ndarray' object has no attribute 'global_index'.
I don't know how to find cell index properly (what's the structure of the 'cell' object).