2d meshing and domain selection

Hello,

I would like to discretize the top face “T” shown in the picture: a ring, only the top face, using mmg2D

After discretizing the two edges of the ring the “outer” and “inner” boundaries of the ring are the ones shown in figure (a few points used)

From command line, or using API, and without specifying the required domain the meshing result is shown in the figure

exactly as explained in

https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-tutorials/mmg-remesher-mmg2d/mesh-generation

: all domains are discretized.
If, using API, I issue

MMG2D_Set_iparameter(mmgMesh,mmgSol,MMG2D_IPARAM_numsubdomain,2);

(or using the command line) that is “keep only domain number 2”, the following result is obtained

Question: how can I know => in advance <= what will be the number of the domain I decided to mesh? Here: I would like to mesh the ring: how can I know in advance that the ring domain is labelled “2”, and not “1”?

Grazie mille
Buona giornata
Giovanni

P.S. I attach the boundary

ring.mesh (2.5 KB)

After a short investigation I found this answer

https://forum.mmgtools.org/t/keep-only-one-subdomain/227/4

“There is no way to know automatically the index of a subdomain before meshing it.”
So there is no way for knowing in advance the domain number
Ciao
Giovanni

Dear Giovanni,

Unfortunately, it is not possible to guess in advance which number will be assigned to each subdomain, since it depends on the order in which the mesh will be travelled. For example, simply rearranging input vertices could lead to a different numbering. Of course, the output is deterministic and will always be the same for a given input mesh.

Kind regards,
Corentin

Thank you very much,
I apologize for the post, since the answer was already present in

Buona giornata
Giovanni