# Problem reading gmsh mesh in FreeFem

**URL:** <https://community.freefem.org/t/problem-reading-gmsh-mesh-in-freefem/982>\
**Category:** General Discussion\
**Created:** [May 18, 2021, 8:26am UTC](https://community.freefem.org/t/problem-reading-gmsh-mesh-in-freefem/982 "2021-05-18T08:26:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcodeba](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marcodeba](https://community.freefem.org/u/marcodeba)\
**Post date:** [May 18, 2021, 8:26am UTC](https://community.freefem.org/t/problem-reading-gmsh-mesh-in-freefem/982/1 "2021-05-18T08:26:27Z")

</div>

Dear FreeFem++ developers and users,  
I’m wrtiting to you since I have encountered an issue in the loading of a mesh produced with the software gmsh in my freefem code. I commonly use this software and I have never encountered this problem before. When loading the mesh file simply writing:

```
mesh3 Th = readmesh3("cpj_better.mesh");

```

The code provides me the following output:

read mesh ok 0Mesh3, num Tetra:= 3725, num Vertice:= 1325 num boundary Triangles:= 2486  
Mesh3::meshS, num Triangles:= 2486, num Vertice:= 1243 num boundary Edges:= 304  
Fatal error: some vertex are not at least in one element

(attached picture for more details)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/be99c24503b7e02fe32c699c468ad91dae0d816d.png)

I actually can’t understand the reason since comparing the .mesh file with others previously used it seems to be very close.

I’m attaching here also the .mesh file and the .geo used to produce the geometry.

Thanks a lot to everyone will help me!

Yours sincerely

Marco  
[cpj\_better.mesh](https://community.freefem.org/uploads/short-url/entAvDDSABE7vj8X2grSjZPvGfH.mesh) (228.4 KB)

.geo file:

```
SetFactory("OpenCASCADE");
Mesh.MeshSizeMin = 0.1;
Mesh.MeshSizeMax = 0.1;

rc = 0.1;
rj = 0.13;
xc = 1.0;
yc = 0.0;
zc = 0.0;

Disk(1) = {xc,yc,zc,rc};
Disk(2) = {xc,yc,zc,rj};

xp = 0.0;
yp = 0.0;
zp = 0.0;
R = 1.0;
ss = 0.0001;

//path
Point(21) = {xp+R,yp,zp,ss};
Point(22) = {xp,yp,zp+R,ss};
Point(23) = {xp-R,yp,zp,ss};
Point(24) = {xp,yp,zp-R,ss};
Point(25) = {0.9998476952,0,-0.01745240644,ss};
//Point(25) = {xp+R,yp,zp,ss};
Point(26) = {xp,yp,zp,ss};

Circle(27) = {21,26,22};
Circle(28) = {22,26,23};
Circle(29) = {23,26,24};
Circle(30) = {24,26,25};

Wire(31) = {27,28,29,30};

Extrude{Surface{1,2};} Using Wire{31}
Delete{ Surface{1,2}; }

BooleanDifference{ Volume{2}; Delete;}{ Volume{1}; Delete;}
```
