Error from inporting 3D mesh in FreeFem++

Hello I am very new to FreeFem++. I am getting a error message while trying to import a 3D mesh built in Gmsh . The error message is this

read mesh ok 1Mesh3, num Tetra:= 0, num Vertice:= 0 num boundary Triangles:= 0
– Mesh3::Mesh3 Erreur opening cube1.msh
current line = 21
Assertion fail : (0)
line :161, in file …/femlib/Mesh3dn.cpp
Assertion fail : (0)
line :161, in file …/femlib/Mesh3dn.cpp
err code 6 , mpirank 0

My .edp file file is

load “gmsh”
load “medit”
load “msh3”
mesh3 TH = readmesh3(“gmsh_mesh.msh”); // version 4 ASCII

.geo file is
// Gmsh project created on Sat Mar 7 14:18:22 2020
SetFactory(“OpenCASCADE”);
//+
Box(1) = {-0.2, -0.9, -0.2, 1, 1, 1};
//+
Surface Loop(2) = {5, 1, 3, 2, 6, 4};
//+
Surface Loop(3) = {5, 1, 3, 2, 6, 4};
//+
Surface Loop(4) = {4, 5, 1, 3, 2, 6};
//+
Surface Loop(5) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(6) = {5, 1, 3, 2, 6, 4};
//+
Surface Loop(7) = {6, 1, 3, 5, 4, 2};
//+
Surface Loop(8) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(9) = {1, 3, 5, 4, 2, 6};
//+
Surface Loop(10) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(11) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(12) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(13) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(14) = {1, 3, 5, 4, 2, 6};
//+
Surface Loop(15) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(16) = {2, 3, 5, 1, 6, 4};
//+
Surface Loop(17) = {4, 5, 1, 3, 2, 6};
//+
Surface Loop(18) = {4, 5, 1, 3, 2, 6};
//+
Surface Loop(19) = {4, 5, 1, 3, 2, 6};
//+
Surface Loop(20) = {1, 3, 5, 4, 2, 6};

You have to use the gmshload3 function to load Gmsh mesh, not readmesh3

1 Like

Thank you ! now it is working !