Error reading gmsh file

Hello,

I’m trying to read a msh file and I’m getting the following error

 SetOfEdges4::add
overflow de la pile 24 24
 Fatal error in the mesh generator 888
  current line = 34
Meshing error: Bamg
 number : 888, 
Meshing error: Bamg
 number : 888, 
 err code 5 ,  mpirank 0

This is the file octogon_Lshaped1.msh:

35 8 42
0.0000000000000000 0.0000000000000000 1
0.1666666666666667 0.0000000000000000 2
0.3333333333333333 0.0000000000000000 3
0.5000000000000000 0.0000000000000000 4
0.6666666666666666 0.0000000000000000 5
0.8333333333333333 0.0000000000000000 6
1.0000000000000000 0.0000000000000000 7
0.0000000000000000 0.2500000000000000 8
0.1666666666666667 0.2500000000000000 9
0.3333333333333333 0.2500000000000000 10
0.5000000000000000 0.2500000000000000 11
0.6666666666666666 0.2500000000000000 12
0.8333333333333333 0.2500000000000000 13
1.0000000000000000 0.2500000000000000 14
0.0000000000000000 0.5000000000000000 15
0.1666666666666667 0.5000000000000000 16
0.3333333333333333 0.5000000000000000 17
0.5000000000000000 0.5000000000000000 18
0.6666666666666666 0.5000000000000000 19
0.8333333333333333 0.5000000000000000 20
1.0000000000000000 0.5000000000000000 21
0.0000000000000000 0.7500000000000000 22
0.1666666666666667 0.7500000000000000 23
0.3333333333333333 0.7500000000000000 24
0.5000000000000000 0.7500000000000000 25
0.6666666666666666 0.7500000000000000 26
0.8333333333333333 0.7500000000000000 27
1.0000000000000000 0.7500000000000000 28
0.0000000000000000 1.0000000000000000 29
0.1666666666666667 1.0000000000000000 30
0.3333333333333333 1.0000000000000000 31
0.5000000000000000 1.0000000000000000 32
0.6666666666666666 1.0000000000000000 33
0.8333333333333333 1.0000000000000000 34
1.0000000000000000 1.0000000000000000 35
1 2 3 10 9 16 15 1
3 4 5 12 11 18 17 2
5 6 7 14 21 20 13 3
9 10 17 18 25 24 23 4
11 12 13 20 27 26 19 5
15 16 23 24 31 30 29 6
18 19 26 33 32 31 24 7
20 21 28 35 34 33 26 8
1 2 1 1
2 3 1 2
3 4 1 3
4 5 1 4
5 6 1 5
6 7 1 6
9 10 0 7
11 12 0 8
12 13 0 9
15 16 0 10
17 18 0 11
18 19 0 12
20 21 0 13
23 24 0 14
24 25 0 15
26 27 0 16
29 30 3 17
30 31 3 18
31 32 3 19
32 33 3 20
33 34 3 21
34 35 3 22
1 8 4 23
3 10 0 24
5 12 0 25
7 14 2 26
8 15 4 27
9 16 0 28
10 17 0 29
11 18 0 30
13 20 0 31
14 21 2 32
15 22 4 33
16 23 0 34
18 25 0 35
19 26 0 36
20 27 0 37
21 28 2 38
22 29 4 39
24 31 0 40
26 33 0 41
28 35 2 42

what I’m doing in the code:

mesh calP = readmesh("octogon_Lshaped1.msh");

anyone might know what I did wrong?

The same with this file:

4 1 4
0.0000000000000000 0.0000000000000000 1
1.0000000000000000 0.0000000000000000 2
0.0000000000000000 1.0000000000000000 3
1.0000000000000000 1.0000000000000000 4
1 2 4 3 1
1 2 1 1
3 4 3 2
1 3 4 3
2 4 2 4

Are you using the gmshload function?
https://doc.freefem.org/references/external-libraries.html#gmsh

Make sure you’re saving your gmsh msh file with the old version 2.2.

Note: There are better approaches for compatibility with gmsh using DMPlex if you’re using PETSc.

No, I’m using readmesh

I did a shell script to transform a mesh generate by triangle to a msh file as show in here Mesh Generation

when I try I get the following:

 The points 3 and 4 are to close 
 The points 4 and 5 are to close 
 The points 5 and 6 are to close 
 The points 6 and 7 are to close 
 The points 7 and 8 are to close 
 The points 8 and 9 are to close 
 The points 9 and 10 are to close 
 The points 10 and 11 are to close 
 The points 11 and 12 are to close 
 The points 12 and 13 are to close 
mshptg bug 2 
 Sorry Error build delaunay triangle   error = 2
  current line = 35
Exec error : Error mshptg8_
   -- number :1
Exec error : Error mshptg8_
   -- number :1
 err code 8 ,  mpirank 0

How did you produce your .msh file?
At least, the short file of your second post is not respecting the format needed for readmesh, which is described in the freefem doc.
A correct file corresponding to the unit square with two triangles is for example

4 2 4
0.0000000000000000 0.0000000000000000 1
1.0000000000000000 0.0000000000000000 2
0.0000000000000000 1.0000000000000000 3
1.0000000000000000 1.0000000000000000 4
1 2 4 0
1 4 3 0
1 2 1
2 4 2
4 3 3
3 1 4

Its from a unit_quad file from triangle, the elemets as suposed to be squares
The first file, the elements are L-shaped

Sorry but this file is not a FreeFem++ mesh file

the element must be triangle so with 4 value ( vertex number, and region number)
not

1 2 3 10 9 16 15 1
3 4 5 12 11 18 17 2
5 6 7 14 21 20 13 3
9 10 17 18 25 24 23 4
11 12 13 20 27 26 19 5
15 16 23 24 31 30 29 6
18 19 26 33 32 31 24 7
20 21 28 35 34 33 26 8

I think you make a missed a gmsh file