Savemesh does not work properly

I have several discrete meshes and I join them on Freefem++ using the following command. The mesh is created perfectly and I can plot it. But there is an error while saving the mesh. As a check, I am also able to create a FE space on the mesh.

mesh th1 = readmesh(“meshgh1c.msh”);
mesh th2 = readmesh(“meshgh2c.msh”);
mesh th3 = readmesh(“meshgh3c.msh”);
mesh th4 = readmesh(“meshgh4c.msh”);
mesh th5 = readmesh(“meshgh5c.msh”);
mesh th6 = readmesh(“meshgh6c.msh”);
mesh th7 = readmesh(“meshgh7c.msh”);

mesh gha = th2 + th3;
mesh ghb = th4 + th5 + th6 + th7;
mesh ghf = th1 + gha + ghb;
fespace Vh(ghf,P2);
Vh tempx, tempy;
savemesh(ghf,“meshghf.mesh”);

The error I get is as follows:
we loss some 288 edges other 1334
Fatal error in the meshgenerator 1100
current line = 28
Meshing error: Bamg
number : 1100,
Meshing error: Bamg
number : 1100,
err code 4 , mpirank 0

Any suggestions will be appreciated. Thank you very much in advance.

maybe the file extension .mesh is incorrect for 2d. Did you try .msh extension?

savemesh(ghf,“meshghf.msh”);

Thank you @julienG I did try .msh extension but it didn’t work either.

mesh ghf = th1 + gha + ghb;
Is the
plot(ghg) ;
work perfectly ?

Hi @Daoudi Yes, it works perfectly.

How do you build your 7 Meshes ?
Freefem or an other software ( like GMSH…)

Hi @Daoudi I built all the 7 meshes on Freefem++