# The mesh file doesn't contain vertices in FreeFEM

**URL:** <https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069>\
**Category:** General Discussion\
**Created:** [March 27, 2024, 4:26pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069 "2024-03-27T16:26:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [March 27, 2024, 4:26pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/1 "2024-03-27T16:26:31Z")

</div>

Hello FreeFEM community,  
I used Gmsh to generate a 3D mesh. By the fact, the Gmsh code is extracted from a Gmsh tutorial (t19.geo).  
Unfortunately I got the following error when reading the mesh with FreeFEM:  
ERROR: The mesh file doesn’t contain vertices

The FreeFEM code is:  
‘’’  
load “gmsh”  
system(“gmsh -3 -o noVertices.msh noVertices.geo”);  
mesh3 Th(“noVertices.msh”);  
plot(Th,wait=1);  
‘’’  
and the geo file for Gmsh is as follows:  
‘’’  
SetFactory(“OpenCASCADE”);  
nturns = 1;  
npts = 20;  
r = 1;  
h = 1 \* nturns;  
For i In {0 : npts - 1}  
theta = i \* 2_Pi_nturns/npts;  
Point(1000 + i) = {r \* Cos(theta), r \* Sin(theta), i \* h/npts};  
EndFor  
Spline(1000) = {1000 : 1000 + npts - 1};  
Wire(1000) = {1000};  
Disk(1000) = {1,0,0, 0.2};  
Rotate {{1, 0, 0}, {0, 0, 0}, Pi/2} { Surface{1000}; }  
Extrude { Surface{1000}; } Using Wire {1000}  
Delete{ Surface{1000}; }  
Geometry.NumSubEdges = 1000;  
Mesh.MeshSizeFromCurvature = 20;  
Mesh.MeshSizeMin = 0.001;  
Mesh.MeshSizeMax = 0.3;  
Surface Loop(2) = {1003, 1002, 1001};  
‘’’  
Many Thanks for your support  
Dominique

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [March 27, 2024, 4:30pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/2 "2024-03-27T16:30:56Z")

</div>

As a start, you must add the argument `-format msh22` when you run Gmsh.

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [March 28, 2024, 1:00pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/3 "2024-03-28T13:00:31Z")

</div>

Chris, thanks for your answer.  
Unfortunately the problem persists even after forcing the version of msh (either console mode or with the Gmsh application). I tried with an example out of the gmsh tutorial (t19.geo), and still the problem.  
The versions of my installations are gmsh 4.11.1 and FreeFEM++ 4.13.  
I will pursue the investigations because I’m stuck to use FreeFEM++ for solving my problem.

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [March 28, 2024, 1:42pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/4 "2024-03-28T13:42:20Z")

</div>

It also looks like you havent defined a volume? You can try to use [this example](https://github.com/cmd8/ff-bifbox/blob/main/examples/marquet_larsson_2015/plate.geo) for troubleshooting.

If you later have a problem with element orientations, you can try this trick:

```auto
lockOrientation = false;
mesh3 Th1 = gmshload3("noVertices.msh"); // load mesh stored in Gmsh .mesh format
lockOrientation = true;
mesh3 Th = Th1;

```

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [March 29, 2024, 7:31am UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/5 "2024-03-29T07:31:24Z")

</div>

Chris,  
the case you provided gave the same error:  
“-- Mesh3 : plate.msh2, space dimension 3, num Tetrahedron elts 0, num Vertice 0 num Bordary elts 0”  
No elements were found.  
For my own case, I introduced a volume so that it looks like:

* * *

SetFactory(“OpenCASCADE”);

nturns = 1;  
npts = 20;  
r = 1;  
h = 1 \* nturns;  
For i In {0 : npts - 1}  
theta = i \* 2_Pi_nturns/npts;  
Point(1000 + i) = {r \* Cos(theta), r \* Sin(theta), i \* h/npts};  
EndFor  
Spline(1000) = {1000 : 1000 + npts - 1};  
Wire(1000) = {1000};

Disk(1000) = {1,0,0, 0.2};  
Rotate {{1, 0, 0}, {0, 0, 0}, Pi/2} { Surface{1000}; }  
Extrude { Surface{1000}; } Using Wire {1000}  
Volume(1) = {1};  
Delete{ Surface{1000}; }

Physical Volume(“fluid”, 1005) = {1};  
Physical Surface(“inlet”, 1006) = {1003};  
Physical Surface(“outlet”, 1007) = {1000};  
Physical Surface(“wall”, 1008) = {1002};

* * *

and the call for FreeFEM:

* * *

load “msh3”  
system(“gmsh -format msh22 -3 -o noVertices.msh2 noVertices.geo”);  
mesh3 Th(“noVertices.msh2”);  
plot(Th,wait=1);

* * *

But still the same error (no elements found).  
For the two cases (yours and mine), I tried exporting from Gmsh using “version 2 ASCII”, with all the possible combinations with “Save all elements” and “Save parametric coordinates”.

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [March 29, 2024, 8:24am UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/6 "2024-03-29T08:24:29Z")

</div>

Chris,  
after so many trials I got my case running **when running gmsh from the edp file** :

* * *

load “msh3”  
load “gmsh”

lockOrientation = false;

system(“gmsh -format msh22 -3 -o noVertices.msh noVertices.geo”);  
mesh3 Th = gmshload3(“noVertices.msh”); // load mesh stored in Gmsh .mesh format  
lockOrientation = true;

plot(Th,wait=1);

* * *

Unfortunately, I was unable to get results for the case plate.geo you provided.  
I failed using the meshes exported by gmsh, whatever the case.  
Now I need to find how to refine the mesh when using the command line:  
system(“gmsh -format msh22 -3 -o noVertices.msh noVertices.geo”);

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [March 29, 2024, 1:24pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/7 "2024-03-29T13:24:15Z")

</div>

I’m not sure I understand your question. You can control mesh resolution a number a different ways as described in the GMSH manual.

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [April 1, 2024, 2:29pm UTC](https://community.freefem.org/t/the-mesh-file-doesnt-contain-vertices-in-freefem/3069/8 "2024-04-01T14:29:20Z")

</div>

Thanks Chris,  
Everything is clearer after many trials, and I understood how to refine the mesh in the geo file. My first goal is achieved and the next step is to handle multi-properties (properties material) and multi-physics calculations domain (conduction is one part and conduction/convection in a second part).
