Mmg2d: Description of the input format of the mesh file and boundary name

Hello, there,
I have a question, I want to know the specific meaning of each parameter of Vertices Edges in the input file, and how to set the boundary name of grid .
Many thanks in advance,
Peng Jin

Hello,

I am not sure to understand your questions. For the .mesh file format, you can refer to the section 7.2.1 of the following report : https://hal.inria.fr/inria-00069921/document.
See also the very small example of a 2D mesh:

MeshVersionFormatted 2 # <- header
Dimension 2 # <- mesh dimension

Vertices 4 # <- 4 vertices in the mesh
0. 0.  21 # <- the first vertex has the coordinates 0. 0.  and the reference 21
1. 0.  21 # <- the second vertex has the coordinates 1. 0.  and the reference 21
1. 1. 21 # <- the 3d vertex has the coordinates 1. 1. and the reference 21
0. 1. 22 # <- the 4th vertex has the coordinates 0. 1. and the reference 22

Edges 4 # <- 4 edges in the mesh
1 2 11 # <- the first edge has vertices 1 and 2 as extremities and the reference 11
2 3 12 # <- the 2d edge has vertices 2 and 3 as extremities and the reference 12
3 4 13 # <- the 3d edge has vertices 3 and 4 as extremities and the reference 13
4 1 14 # <- the 4th edge has vertices 4 and 1 as extremities and the reference 14

Triangles 2 # <- 2 tria in the mesh
1 2 3 1 # <- the first tria has vertices 1, 2 and 3 and the reference 1
1 3 4 2 # <- the second tria has vertices 2, 3 and 4 and the reference 2

End # <- end of file

Note that you must remove the comments (# …) to make the .mesh file readable.

The references allow to assign boundary conditions or materials to the entities (vertices references are not used by Mmg and if not useful in your software, it is better to set it to 0).

Regarding the filename, the Medit file format doesn’t provides a specific keyword but you can add your own ones, they will be ignored. For example:

MeshVersionFormatted 2 # <- header
Dimension 2 # <- mesh dimension

Filename
"titi.mesh"

...

I hope that it will help,

Best