I am trying to build a simple 2D mesh with Gmsh and use it in FreeFem.
I save the mesh with File → Export → Mesh - INRIA Medit (*.mesh), with “Physical entities” and “Save all elements” checked. I obtain a mesh file that start like this:
I see. So now I am saving with File → Export → Guess from extension → test.msh → Version 2 ASCII. I leave both “Save all elements” and “Save parametric coordinates” unchecked.
Reading the mesh with Th = gmshload(meshdir+"/test.msh"); seems to work. Also, the output of cout << labels(Th) << endl; is:
6
2 3 4 11 12 13
which seems to agree with the labels (2, 3, 4, 11, 12, 13) I assigned to the boundaries in Gmesh (with e.g. Physical Line(11) = {2};).