# Error reading Gmsh mesh in FreeFem++

**URL:** https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416
**Category:** General Discussion
**Created:** [January 7, 2022, 1:02am UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416 "2022-01-07T01:02:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![lukas](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@lukas](https://community.freefem.org/u/lukas)
#### Post date: [January 7, 2022, 1:02am UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/1 "2022-01-07T01:02:35Z")

</div>

Hi !  
I have an error reading a Gmesh mesh in Freefem++  
#FreeFem++ script:

load “gmsh”  
mesh Th = gmshload(“mesh.msh”);

#FreeFem++ output:  
**Element of type 5 is not considered in Freefem++**

#Gmsh .geo script:

Point(1)={0,0,0,0.1};  
Point(2)={1,0,0,0.1};  
Point(3)={1,8,0,0.1};  
Point(4)={0,8,0,0.1};

Line(1)={1,2};  
Line(2)={2,3};  
Line(3)={3,4};  
Line(4)={4,1};

Curve Loop(1) ={1,2,3,4};

Surface(1) = {1};

Rotate {{0, 0, 1}, {0,0,0}, -Pi/3} {  
Surface{1};  
}  
Mesh 2;

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 10, 2022, 5:43pm UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/2 "2022-01-10T17:43:56Z")

</div>

**Element of type 5 is not considered in Freefem++** is 8-node hexahedron  
and no hexahedron in freefem.

---

<div class="post-metadata">

### Author: ![lukas](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@lukas](https://community.freefem.org/u/lukas)
#### Post date: [January 10, 2022, 7:11pm UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/3 "2022-01-10T19:11:52Z")

</div>

Thanks Frédéric !! It’s possible make a finite volume method on Freefem++ ??

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 11, 2022, 12:12pm UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/4 "2022-01-11T12:12:55Z")

</div>

Yes but to day is tricky.

---

<div class="post-metadata">

### Author: ![Aysha007](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@Aysha007](https://community.freefem.org/u/Aysha007)
#### Post date: [December 25, 2025, 3:48pm UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/5 "2025-12-25T15:48:52Z")

</div>

Hi,

I am getting warning like this when i try to load mesh exported from Gmsh, Warning: – Your set of boundary condition is incompatible with the mesh label.  
Warning: – Your set of boundary condition is incompatible with the mesh label.  
Warning: – Your set of boundary condition is incompatible with the mesh label.  
Warning: – Your set of boundary condition is incompatible with the mesh label.  
Warning: – Your set of boundary condition is incompatible with the mesh label.

load “gmsh”

real Lx = 100.0 \* d;  
real Ly = 50.0 \* d;

border b1(t=0, Lx/2) {x=t; y=d; label=1;}  
border b2(t=d, 0) {x=Lx/2; y=t; label=2;}  
border b3(t=Lx/2, Lx) {x=t; y=0; label=3;}  
border b4(t=0, Ly) {x=Lx; y=t; label=4;}  
border b5(t=Lx, 0) {x=t; y=Ly; label=5;}  
border b6(t=Ly, 0) {x=0; y=t; label=6;}

mesh Th = gmshload(“mesh3011.msh”);

boundary condition…

- on(1,3, u=0, v=0)
- on(2, u=Uj, v=0)
- on(4, u=-Uinf, v=0)
- on(5, v=0)
- on(6, p=0);

mesh3011.msh file looks like…

$MeshFormat  
2.2 0 8  
$EndMeshFormat  
$PhysicalNames  
6  
1 1 “b1”  
1 2 “b2”  
1 3 “b3”  
1 4 “b4”  
1 5 “b5”  
1 6 “b6”  
$EndPhysicalNames  
$Nodes  
80782  
1 0 0.0254 0  
2 1.27 0.0254 0  
3 1.27 0 0  
4 3.81 0 0  
5 3.81 1.27 0  
6 0 1.27 0  
7 0.009927406534577778 0.0254 0  
8 0.01981601162725292 0.0254 0  
9 0.0296659664128969 0.0254 0

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 28, 2026, 10:28am UTC](https://community.freefem.org/t/error-reading-gmsh-mesh-in-freefem/1416/6 "2026-01-28T10:28:21Z")

</div>

Your get the list of labels in mesh this functions

int[int] lab=labels(Th);

to understand some thing.
