Keep only one subdomain


#1

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.

Best
Pierre


#2

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.

Regards,

Algiane


#3

Hi Algiane,

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

Best regards
Pierre


#4

Hi Algiane and MMG devs,

I have a model with concentric subdomains.
Do you have any hints for finding the number of the most external subdomain ?
I do not understand how the numbering is done, nor how to test it since I have to set the “iparameter numsubdomain” before meshing.

Thanks a lot for your help
Pierre


#5

Hi Pierre,

There is no way to know automatically the index of a subdomain before meshing it. A way to guess it is to use the command line tool and the -nsd 0 option to create the whole mesh (with all the subdomains).
In this mesh, the subdomains are numbered starting from 2.

You can then look at the index of one element of the subdomain that you want to keep. If I note idx this index, you can save the associate domaine by asking to keep subdomain of index idx-1.

I hope that it will help.

Regards,

Algiane


#6