File of .mesh from GMSH (INRIA Medit) cannot be opened

Dear all,

I faced a problem. The file of .mesh from GMSH (INRIA Medit) cannot be opened by freefem++.

FreeFem reminded that " Return type false, your mesh is MeshS type, use gmshloadS function". However, the 3D geometry has been meshed by “Mesh << 3D” in Gmsh.

The freefem code:
"load “msh3”
load “gmsh”

mesh3 Th=gmshload3(“Background.mesh”);
plot (Th,wait=1);".

The Gmsh code:
"SetFactory(“OpenCASCADE”);
Box(1) = {0, 0, 0, 1, 1, 1};

Physical Volume(“background”) = {1};
lcar1 = .05;
MeshSize{ PointsOf{ Volume{:}; } } = lcar1;

Point(20009) = {0.45, 0.45, 1, 0.05};
//+
Point(20010) = {0.55, 0.45, 1, 0.05};
//+
Point(20011) = {0.55, 0.55, 1, 0.05};
//+
Point(20012) = {0.45, 0.55, 1, 0.05};
//+
Line(20013) = {20009, 20010};
//+
Line(20014) = {20010, 20011};
//+
Line(20015) = {20011, 20012};
//+
Line(20016) = {20012, 20009};
//+
Curve Loop(20017) = {20016, 20013, -20014, -20015};

Surface(1001)={20017};
Physical Surface(“Source”,1002)={1001};
Point(30009) = {0.45, 0, 0.45, 0.05};
//+
Point(30010) = {0.55, 0, 0.45, 0.05};
//+
Point(30011) = {0.55, 0, 0.55, 0.05};
//+
Point(30012) = {0.45, 0, 0.55, 0.05};
//+
Line(30013) = {30009, 30010};
//+
Line(30014) = {30010, 30011};
//+
Line(30015) = {30011, 30012};
//+
Line(30016) = {30012, 30009};
//+
Curve Loop(30017) = {30016, 30013, -30014, -30015};

Surface(2001)={30017};
Physical Surface(“Source2”,2002)={2001};
BooleanFragments{ Volume{1}; Delete; }{ Surface{1001,2001}; Delete; }".

The save processes of .mesh file: “File >> Export >> Mesh INRIA Medit.mesh >> Background.mesh.”.

Please give me some advice. I’d appreciate it.

Best regards

Liu

Can you send the Background.mesh , if it is possible
I think you bug is in mesh part !

Dear Prof. Hecht,

Thank you so much for your reply.
I am sorry that I cannot attached the Background.mesh, because I am a new registrant.
I post a part of the contents of the mesh file here. Please have a look. Thank you very much.
" MeshVersionFormatted 2
Dimension
3
Vertices
7151
0.45 0.45 1 20009
0.55 0.45 1 20010
0.55 0.55 1 20011
0.45 0.55 1 20012
0.45 0 0.45 30009
0.55 0 0.45 30010
0.55 0 0.55 30011
0.45 0 0.55 30012
0 0 1 30013
0 0 0 30014
0 1 1 30015
0 1 0 30016
1 0 1 30017
1 0 0 30018
1 1 1 30019
1 1 0 30020
0.5 0.45 1 20013
0.55 0.5 1 20014
0.5 0.55 1 20015
0.45 0.5 1 20016
0.5 0 0.45 30013
0.55 0 0.5 30014
0.5 0 0.55 30015
0.45 0 0.5 30016
0 0 0.05 30017
0 0 0.1 30017
0 0 0.15 30017
0 0 0.2 30017
0 0 0.25 30017
0 0 0.3 30017
0 0 0.35 30017
0 0 0.4 30017
0 0 0.45 30017
0 0 0.5 30017
0 0 0.55 30017
0 0 0.6 30017
0 0 0.65 30017
0 0 0.7 30017
0 0 0.75 30017
0 0 0.8 30017
0 0 0.85 30017
0 0 0.9 30017
0 0 0.95 30017
0 0.05 1 30018
0 0.1 1 30018
0 0.15 1 30018
0 0.2 1 30018
0 0.25 1 30018
0 0.3 1 30018
0 0.35 1 30018
0 0.4 1 30018
0 0.45 1 30018
0 0.5 1 30018
0 0.55 1 30018
0 0.6 1 30018
0 0.65 1 30018
0 0.7 1 30018
0 0.75 1 30018
0 0.8 1 30018
0 0.85 1 30018
0 0.9 1 30018
0 0.95 1 30018
0 1 0.05 30019
0 1 0.1 30019
0 1 0.15 30019
0 1 0.2 30019
0 1 0.25 30019
0 1 0.3 30019
0 1 0.35 30019
0 1 0.4 30019
0 1 0.45 30019
0 1 0.5 30019
0 1 0.55 30019
0 1 0.6 30019
0 1 0.65 30019
0 1 0.7 30019
0 1 0.75 30019
0 1 0.8 30019
0 1 0.85 30019
0 1 0.9 30019
0 1 0.95 30019
0 0.05 0 30020
0 0.1 0 30020
0 0.15 0 30020
0 0.2 0 30020
0 0.25 0 30020
0 0.3 0 30020
0 0.35 0 30020
0 0.4 0 30020
0 0.45 0 30020
0 0.5 0 30020
0 0.55 0 30020
0 0.6 0 30020
0 0.65 0 30020
0 0.7 0 30020
0 0.75 0 30020
0 0.8 0 30020
0 0.85 0 30020
0 0.9 0 30020
0 0.95 0 30020
1 0 0.05 30021
1 0 0.1 30021
1 0 0.15 30021
1 0 0.2 30021
1 0 0.25 30021
1 0 0.3 30021
1 0 0.35 30021
1 0 0.4 30021
1 0 0.45 30021
1 0 0.5 30021
1 0 0.55 30021
1 0 0.6 30021
1 0 0.65 30021
1 0 0.7 30021
1 0 0.75 30021
1 0 0.8 30021
1 0 0.85 30021
1 0 0.9 30021
1 0 0.95 30021
1 0.05 1 30022
1 0.1 1 30022
1 0.15 1 30022
1 0.2 1 30022
1 0.25 1 30022
1 0.3 1 30022
1 0.35 1 30022
1 0.4 1 30022
1 0.45 1 30022
1 0.5 1 30022
1 0.55 1 30022
1 0.6 1 30022
1 0.65 1 30022
1 0.7 1 30022
1 0.75 1 30022
1 0.8 1 30022
1 0.85 1 30022
1 0.9 1 30022
1 0.95 1 30022
1 1 0.05 30023
1 1 0.1 30023
1 1 0.15 30023
1 1 0.2 30023
1 1 0.25 30023
1 1 0.3 30023
1 1 0.35 30023
1 1 0.4 30023
1 1 0.45 30023
1 1 0.5 30023
1 1 0.55 30023
1 1 0.6 30023
1 1 0.65 30023
1 1 0.7 30023
1 1 0.75 30023
1 1 0.8 30023
1 1 0.85 30023
1 1 0.9 30023
1 1 0.95 30023
1 0.05 0 30024
1 0.1 0 30024
1 0.15 0 30024
1 0.2 0 30024
1 0.25 0 30024
1 0.3 0 30024
1 0.35 0 30024
1 0.4 0 30024
1 0.45 0 30024
1 0.5 0 30024
1 0.55 0 30024
1 0.6 0 30024
1 0.65 0 30024
1 0.7 0 30024
1 0.75 0 30024


"

Sincerely yours,
Liu

You have no Triangle and No Tetrahedron i the mesh file, so no way your problem is in gmsh.

Dear Prof. Hecht,

Thank you very much for your valuable reply.
I have successfully run the file of .msh (Gmsh MSH_version 2 ) using FreeFem++.
What are the differences between the two formats (i.e., .mesh and .msh)?
Could I use the file of .msh rather than .mesh?

Best regards,
Liu

mes .msh is the mesh format

Sorry the previous mail is send too early.

the .msh are Gmsh File and …mesh are inria mesh file .
so to read .msh use loadgmsh() function or
rea .mesh with readmesh() function.

Best Regards,

Frédéric Hecht.

Dear Prof. Hecht,

Thank you so much for your message.

Best regards,
Liu