I am getting started in using the cecile/mixed-dimensional branch. I have a 3D cube geometry with a cylindric hole at the center. I have defined the inner surface of the cylinder as a 2D subdomain using
My question is how do I map the vertex of the submesh to the parent mesh and vice-versa? Is there an easy way of doing this? I tried with some functions of MeshView but I can’t make it work.
The mapping between parent and child mesh vertices (and cells) is built when building the MeshView object. You can access these from the topology of your submesh :
Note : In your code you redefine the variable marker after having marked your entities, making it zero for all entities so I suspect your submesh to be empty.
Hello,
There is no such mapping for mesh facets. Note that if your submesh is of codimension 1, then the submesh cells are facets in the parent mesh that you can access through the corresponding cell_map()
In fact, I was asking this question in relation with this post. Such a mapping would have been useful to recover facet labels on a submesh (of codimension 0) after using MeshView, but I will have to find another way then.
Hi @cdaversin. Nice approach. My question is that is it also possible to get the vertex_map() and cell_map() from the entity submesh if it was not created in same .py script rather was created by same MeshView but in some other .py code and wrote in .h5 file and then read it in separate code file by reading submesh from that .h5 file?
I am currently working with the scripts where mesh generation using MeshView is done in some dedicated code file and they are read to other scripts using .h5 files. Thanks!
When creating a submesh with MeshView, the new Mesh object which is generated embeds a map of the mappings it has with other meshes (parent or sibling meshes), as indicated in my previous post :
submesh.topology().mapping()
Unfortunately this info is not stored when writing your submesh as a .h5 (or .xdmf) file. Here is the code sample I wrote to check this :
The submesh generated in this script is mapped with its parent of index 0, while the same submesh loaded from a .h5 file doesn’t have any mapping. So I am afraid you will have to do that in the same script, or find a way to store the mappings in a separate file.