Meshing implicit domain with thin layers


Dear mmg team,

Thank you for creating this forum.
My whish is to use mmg to remesh an implicit domain with very small thickness, say a crack.
I attach an example to explain my problems.
The support mesh has already been adapted (using a metric file and mmg) so to have high resolution in the neighorhood of the zero level set.
mmg runs with the following options
mmg3d_O3 -nr -hmax 0.0707107 -hmin 0.0125081 -hausd 0.09 input.o.mesh -ls levelsetmesh.sol
During the process I get several warnings of kind
_MMG5_chkmanicoll: we should rarely passed here.
The input mesh and level set as well as the result are attached.
When the thickness is large everything works perfectly.
When the two borders of the crack come closer and closer the quality of the geometry is seriously compromised:
-the borders are connected by very small bridges of tetras

  • very sharp tetras not connecting the two boundaries appear on the surface
    Also, the topology is lost.
    It seems that there is an offset used to cut the level set. Is there a way to change this parameter ?
    I had the same problem in 2d but solved by playing with parameters.
    Any hint to help fix this problem?
    Thank you in advance for any help you can provide.


Hi Chiara,

Welcome to this forum and thank you for using Mmg.

Did you have the same issues when your mesh has an higher resolution (for example half the size or 3 times smaller than what you have for now in your input mesh) on the the neighborhood of the zero level set?




Dear Algiane,

thank you for your quick answer. By paying the price of increasing the mesh resolution the topology is respected but the surface looks still " straircased ". The new parameters are
-nr -hmax 0.141421 -hmin 0.00502325 -hausd 0.09
and i don’t get mmg warnings anymore.
The new data are attached.
Thank you for your help


Hi Chiara,

Because in some areas, the 2 “walls” depicted by your level-set are very close to each other (and to the cube faces), it is needed to have small edges (at least on this areas). I think that with edges half the size of the span between the walls it must be sufficient… but of course, you don’t know this span in advance!

For the “staircased” effect, Mmg tries to split on your zero level-set and to stay very close from this level-set (it doesn’t smooth the surface). From your input data, I think that the level-set itself is staircased. I join a picture of the isosurface visulaization using the Medit software and the configuration file that I have used for Medit (input.o.medit (537 Bytes)).

Best Regards,



Hi Algiane,

thank you for letting me aware of the level set problem. mmg does its job correctly indeed !
You make a good point. You don’t know in advance the span and you have to compute it. But also you might prefer to maintain you resolution higher than a certain minimal value (to be faster) and pay the price to loose details that are smaller than this tolerance, but still preserving a proper geometry. And in this case maybe you have to modify locally the level set.