I have:
cellMeshFunction
, defined upon a mesh
sigmaFunctionSpace
, defined upon a submesh
of that mesh
When I try:
sigmaFunctionSpace = FunctionSpace (subMesh, 'DG', 0)
sigma = Function(sigmaFunctionSpace)
choices = [segmentsOnIndex[index].sigma for index in sigmaIndices]
sigma.vector()[:] = numpy.choose (cellMeshFunction.array().astype(int), choices)
I get the following error:
RuntimeError: non matching dimensions on input
I think that instead of cellMeshFunction
, defined on the original whole mesh I need a function (to be called cellSubMeshFunction
), defined only on the subMesh
, but with the same values on the submesh
that the original cellMeshFunction
had. How can I obtain such a function cellSubMeshFunction
, given cellMeshFunction
that is defined on the whole mesh?
Kind regards
J. de Hooge