Keep only one subdomain


Hi all,

I use mmg2d to generate triangular meshes from set of edges as boundaries. In some case I get as result several sub-domains since the set of edges forms loops inside one big loop.

Do you have any suggestion or hint to keep only the vertices and triangles corresponding to the biggest/enclosing domain.
In other words, I would like to get one domain with holes.



Hi Pierre,

You can choose the identity of the subdomain that you want to save using the -nsd option followed by the subdomain reference.

For example, starting from the acdc_bdy.mesh (2.7 KB) set of edges, if I run:
mmg2d acdc_bdy.mesh
I obtain the following result:

To save only the domain with the reference 1:
mmg2d acdc_bdy.mesh -nsd 1

To save only the domain with the reference 3:
mmg2d acdc_bdy.mesh -nsd 1

Note that -nsd 0 correspond to the default behaviour and save you entire mesh.




Hi Algiane,

thanks for the answer. It is exactly that I want.

Best regards