This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Vertex map from a SubMesh back to parent Mesh.

+1 vote

I have a 3D simulation, running in parallel, with a Mesh that evolves over time. I need to extract the surface of the problem as a 2D Mesh, for which a solution was developed here.

Unfortunately, there is no way to save the updated Mesh in parallel, nor is it possible to create a SubMesh in parallel.

Is there a way to map vertex values from a SubMesh back to a Mesh directly without interpolation? This would bipass the interpolation step and allow conversion of the Function outside the parallel environment.

The SubMesh page does mention a "parent_vertex_indices,” but I do not see any such variable in my SubMesh instance.

asked Dec 5, 2013 by pf4d FEniCS User (2,970 points)
edited Dec 5, 2013 by pf4d

Does it help to use something like submesh.set_parent(mesh)?

that'll setup the parent mesh, but that does not provide access to any new mappings...

1 Answer

+3 votes
 
Best answer

The parent_vertex_indices are stored in a MeshData object acquired from SubMesh.data().

answered Dec 18, 2013 by johanhake FEniCS Expert (22,480 points)
selected Mar 18, 2015 by pf4d

running

d = submesh.data()

with the latest dolfin-stable and unstable, I'm not seeing this.

In IPython tab-complete:

In [10]: d
Out[10]: <dolfin.cpp.mesh.MeshData; proxy of <Swig Object of type 'boost::shared_ptr< dolfin::MeshData > *' at 0x37c6990> >

In [11]: d.
d.array                 d.exists                d.parameters
d.clear                 d.id                    d.rename
d.create_array          d.label                 d.str
d.create_mesh_function  d.mesh_function         d.this
d.erase_array           d.name                  d.thisown

I believe the correct syntax to access this in the latest dolfin versions is:

submesh.data().array('parent_vertex_indices', 0)

Does this do what you want?

LOL! yes, thank you.

...