I'm constructing a submesh. I want to know how I can get the index mapping between the submesh and the parent mesh.
Many thanks
If sub_mesh is a SubMesh of dimension 2, then you can get the mappings by
vertex_indices = sub_mesh.data().array("parent_vertex_indices", 0) cell_indices = sub_mesh.data().array("parent_cell_indices", 2)
Maybe older syntax is:
sub_mesh.data().mesh_function('parent_vertex_indices') # returns MeshFunction sub_mesh.data().mesh_function('parent_vertex_indices').array() # returns numpy.array