Problems when remeshing using level set

Hello !
First of all thanks for the awesome mmg tool, it works like a charm in general ! :slight_smile:

I’m having some trouble using mmg to remesh using a level-set function, the context is the following:
I’m working in a shape optimization problem using a level set method, for accuracy requirements (I have to compute some quantities on the 0 level set) on each iteration I remesh my working domain using -ls option of mmg. However, sometimes when disconnected regions begin to merge mmg becomes unable to continue the remeshing and then the algorithm got stuck with an non-updated mesh, compromising the whole computation.

Whenever this happens, the output of mmg is:

Error: MMG5_minQualCheck: too bad quality for the worst element: (elt 2440 -> 0.000000e+00)

Warning: MMG2D_pack: unexpected edge table… Ignored data.

The input line I use:
mmg2d_O3 -hmax 0.01 -hmin 0.001 -hausd 0.01 aux.mesh -ls aux.sol -out auxLS.mesh

Is there any command or strategy to avoid this problem?
Thank you very much for your help !


Thank you for this feedback on Mmg.

The “too bad quality” phenomenon that appears during the iterations of shape optimization solver is very hard to solve because most of time it is a degenerative effect: at each iteration, the new mesh is worst than the previous one, leading to a worst shape for the level-set, leading to a worst mesh, etc.

It happens when disconnected regions are merging because the level set may define very thin area between this regions (such as only degenerated elements can fit in this regions) or may contain small bubbles.

A way to help Mmg is to clean the level-set before giving it to the remesher (you can for example remove the small bubbles, you can also try to modify the level-set such as two 0 level-sets that are too close are merged).

The ‘develop’ branch of Mmg provides a new option (in ß test), the -rmc option, that allows to remove small bubbles inside the level-set, it can maybe help you?

Otherwise, do not hesitate to send me your mesh and level-set file so I can try to figure out what happens exactly in your test case.



Dear Algiane,

Thank you very much for your prompt reply :slight_smile:
Fortunately, I took a look into the forum, so I have seen your post about the -rmc option, and it actually works most of the times! (sometimes it is not enough, but then I change a little bit my optimization parameters and it keep working until convergence)

Greetings !