How does mmg2d use the metric field?

Hello!

First of all, thank you for this awesome library and all the hard work behind it! It’s greatly appreciated!

I am working on curved mesh generation in 2D, and I use mmg2d in my current pipeline. I was wondering how mmg2d evaluates the metric field during the vertices generation : do you evaluate the metric once at the current position, then place a neighboring vertex on the unit ball of this metric (and work on the tangent plane), or do you reevaluate the metric at a few positions while traveling away from the starting vertex (do you update the metric along the way)? Or maybe is it another way completely? The library almost seems" too fast" to reevaluate the metric along the way…

Thank you very much for your time!
Arthur

Hello @arthurbawin,

Thank you for using Mmg.

During mesh generation process from either a set of edges or a set of nodes (without input triangles) the node insertion is done without computing the metric at new nodes. Then, the mesh adaptation process is called on the generated mesh.

Mesh adaptation process (that starts with a set of triangles) always insert new nodes at the middle of the edges: we compute the simultaneous reduction of the 2 metrics (M1 and M2) at edge extremities. The simultaneous reduction basis allows to diagonalize both metrics and will provide the main directions of the metric at the new point. We compute the new sizes as the linear interpolation of the diagonal values of the metrics M1 and M2. Then we go back to the to the canonical basis. You can read the section 2.5 of the following paper of P.J. Frey and F. Alauzet for a more detailed description and an illustration of metrics interpolation and intersections: https://www.ljll.math.upmc.fr/~frey/publications/cmame05-3.pdf

In a more generic point of vue, Mmg uses an iterative process that interleaves remeshing operators: as collapses, edge swaps and node relocations will modify the created edges, it is useless to create directly an edge of perfect length and it is sufficient to split too long edges in half.

Best Regards,

Algiane