# Savemesh does not work properly

**URL:** https://community.freefem.org/t/savemesh-does-not-work-properly/966
**Category:** General Discussion
**Created:** [May 7, 2021, 2:59pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966 "2021-05-07T14:59:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![sgkkr](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@sgkkr](https://community.freefem.org/u/sgkkr)
#### Post date: [May 7, 2021, 2:59pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/1 "2021-05-07T14:59:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![julienG](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/julieng/32/222_2.png) [@julienG](https://community.freefem.org/u/julienG)
#### Post date: [May 7, 2021, 3:07pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/2 "2021-05-07T15:07:56Z")

</div>

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

> savemesh(ghf,“meshghf.msh”);

---

<div class="post-metadata">

### Author: ![sgkkr](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@sgkkr](https://community.freefem.org/u/sgkkr)
#### Post date: [May 7, 2021, 3:27pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/3 "2021-05-07T15:27:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Daoudi](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daoudi](https://community.freefem.org/u/Daoudi)
#### Post date: [May 8, 2021, 1:18pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/4 "2021-05-08T13:18:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sgkkr](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@sgkkr](https://community.freefem.org/u/sgkkr)
#### Post date: [May 8, 2021, 2:27pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/5 "2021-05-08T14:27:53Z")

</div>

Hi @Daoudi Yes, it works perfectly.

---

<div class="post-metadata">

### Author: ![Daoudi](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daoudi](https://community.freefem.org/u/Daoudi)
#### Post date: [May 8, 2021, 2:43pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/6 "2021-05-08T14:43:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sgkkr](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@sgkkr](https://community.freefem.org/u/sgkkr)
#### Post date: [May 8, 2021, 6:08pm UTC](https://community.freefem.org/t/savemesh-does-not-work-properly/966/7 "2021-05-08T18:08:50Z")

</div>

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