Required elements vs required faces in 3d


Is there something to be aware of regarding required triangles in 3d ? Required triangles are not preserved in my case.
Here is the context: I have a part of the domain (tets) that I require to enforce a relationship between meshes.
I also set the surface triangles of the domain to be required, I labeled them to be able to compute displacement and metric based on the distance to the object. In the latter, the surface corresponds to the 0 of the distance levelset.
The strategy goes south with these triangles not being preserved. Any insights about why they would not be preserved?
The tets are properly preserved so I can certainly change the strategy and use them instead .
Best regards

Hi Christophe,

I am not sure to understand the issue (maybe a picture of the mesh can help): are you trying to preserve non-surfacic triangles (triangles that are not at the interface of tetra with different references)?

If yes, Mmg will ignore these triangles in default mode but you can enforce their preservation using the opnbdy mode (MMG3D_IPARAM_opnbdy). If your triangles are “true” boundary triangles and are required, Mmg should be able to preserve it.


I am trying to preserve triangles at the interface between two materials, they are not on the boundary of the domain.

The documentation says:
Preserve triangles at interface of 2 domains with same reference

The triangles have indeed the same reference but I guess you are talking about the domains, no ?
in that case the labels of the domains are different.

I understood reference as label but maybe it is identifier? In that case the faces keep their id throughout the remeshing?


It is always hard to find a common vocabulary: for Mmg, a reference is the integer associated to the entity that allows to identify to which material (for a volume element) it belongs or which boundary condition (for a boundary entity) must be applied. If you are used to Gmsh, the Mmg reference matches with the Gmsh physical tag.

If by identifier you mean the face index: no, Mmg doesn’t preserve the numbering.

To get back to your initial issue: if you provide required triangles between two different materials, Mmg should preserve it…

This is not the case, the required triangles are not preserved. May be there is something wrong in my code. I will check one more time.

Could there be an issue if the required face is a face of a required tet? I would not see why but I ask anyway.
I implemented a workaround that reconstruct the set of faces and the number remains constant as expected (required tets work well in my case)
Thank you for your help


Normally required faces and tetra are compatible…
I will try to take a look at your code. I keep you aware.