What is the meaning "ref " in MMG3D_Set_tetrahedron()

Dear sir:
In the MMG3D_Set_tetrahedron(), there is a parameter “int ref”, I found that after I change the value of “ref”, the mesh generated by the MMG3D also changed evidently.
I set “ref” to the index of the Tet cell in my program. I don’t know what had happed.


ref” is a value attached to each mesh entities (points, triangles, tetra…).
This value is seen by Mmg as the domain (or material) identification. It allows for exemple to identify:

  • boundary areas on which different boundary conditions will be applied;
  • Or 2 domains with different physical properties.

The reference is an important value because Mmg will try to preserve the interfaces between different references (this interfaces will be remeshed but with normal / tangent preservation).

For example, I attach a picture of the mesh of an ellipsoid embedded inside a cube:

  • The tetrahedra inside the ellipsoid have the ref (=reference) 3, which is associated to the yellow color;
  • Tetra outside the ellipsoid have the ref 2, associated to the green color;
  • The triangles at cube boundaries have the ref 1 (red).

  • If you have 1 domain only, just set the 0 reference everywhere.
  • In any case, it is better for Mmg to always set points references to 0.



I got it. Thank you very much.