GMSH 3D and Freefem++

Dear freefem community,

I know GMSH has already been posted, but with the current GMSH and Freefem++ 4.6 (last version on windows), it doesn’t work any more.

My geo file is rather simple (just a beam with few elements), physical volume and surfaces defined (with use of Open-Cascade). And I saw this error message error below…

Could you help me ? What’s wrong ? Which options should we use definitively in GMSH ( Mesh.Algorithm = 6; ? Mesh.Format=1; ? Mesh.MshFileVersion = 2.2; ? Mesh 3;
Coherence Mesh;)
and which option in ASCII v2 or v4 (I tested both) with which option(s) ?

It would be useful for everybody that use GMSH to know the correct options in order to work with freefem in 3D.

Thanks in advance! :slight_smile:


2052 vertices
closing file 6724 3456
6724 tetrahedrons
3456 triangles
10180 numElements
– GMesh3 , n V: 2052 , n Elm: 6724 , n B Elm: 3456mes 150 370 , bb: (0 0 -1) , (5 30 0)
– BuildAdj:nva= 3 4 3456
– warning true boundary element 0 is no in correct orientation
– warning true boundary element 1 is no in correct orientation
– warning true boundary element 2 is no in correct orientation
– warning true boundary element 3 is no in correct orientation
– warning true boundary element 4 is no in correct orientation
– warning true boundary element 5 is no in correct orientation
– warning true boundary element 6 is no in correct orientation
– warning true boundary element 7 is no in correct orientation
– warning true boundary element 8 is no in correct orientation
Warning change orientation of 3456 faces
Warning error in boundary oriention 3456 faces
– BuildAdj:0x10e10ad0 nb Elememt 6724 nb vertices 2052
: nb adj = 15176 on border 3456 nea = 4 nva = 3 nb no manifold border 0

~HashTable:   Cas moyen : 4.06181

number of real boundary element 3456
– End of read: mesure = 150 border mesure 370
GTree: box: 0 0 -1 5 30 0 -2.5 -15 -1.5 7.5 45 0.5 nbv : 2052
MaxISize 1073741824
nb equi be : 0
etc…

First the last version freefem on window is 4.14

So this the raison of your problem,

But you can send the .geo flesh file and the command line to buil the mesh so we can try.

Thank you Mr Hecht for your answer, and information => I just installed the 4.14 (w64) version and I got the same results. Perhaps it is not a problem?

The edp file :

verbosity = 10;
load “msh3”
load “tetgen”
load “gmsh”
load “medit”
load “iovtk”
mesh3 Th3 = gmshload3(“maillage.msh”);

and the geo file, the simplest one :

SetFactory(“OpenCASCADE”);
h = 1;lx = 2;ly = 10;
Box(1) = {0., 0., 0., lx, ly, h};
Coherence;
Physical Volume(1) = {1};
Physical Surface(10) = {1,2,3,5,6};
Physical Surface(11) = {4};
Mesh 3;
Coherence Mesh;

I wonder if the message " – warning true boundary element 0 is no in correct orientation" etc is a problem or not ? (because we see another messages “reorientation of faces”). I would like to be sure that the starting point i.e. the mesh is ok.

Thank you again.

The GMSH .geo code, I use to save the .msh file

Mesh.Format = 1;
Mesh.MshFileVersion = 2.2; 
Mesh.SaveAll = 0;
Mesh.Binary = 0;

Save "foo.msh";

And the code snippet to import the mesh in FreeFEM ++,

load "msh3"
load "gmsh"

mesh3 Th = gmshload3("cyl.msh");
plot(Th,wait=1);
int[int] labs = labels(Th);

Make sure you don’t include any recombine surface command in .geo as quadrilaterals and hexahedron elements are not accepted in FreeFEM. Hope it helps !

Hello dear freefem user,

Thank you for your answer.
I already converged towards your solution. But my question remains : why such a message : “– warning true boundary element 0 is no in correct orientation…etc… reorientation…”

Perhaps it is quite normal, and Freefem++ transforms the data from GMSH to FF++ format and “reorient” the boundary elements.

In fact, I juste would like to be sure that meshes from GMSH are correctly input in Freefem.

Thanks again.

One way would be to export it in vtk format and check labels whether they are the same or not. For me they stay the same.