# "Err border element not in mesh" importing 3D mesh from gmsh

**URL:** <https://community.freefem.org/t/err-border-element-not-in-mesh-importing-3d-mesh-from-gmsh/1317>\
**Category:** General Discussion\
**Created:** [November 10, 2021, 11:36am UTC](https://community.freefem.org/t/err-border-element-not-in-mesh-importing-3d-mesh-from-gmsh/1317 "2021-11-10T11:36:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruffi92](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ruffi92/32/921_2.png) [@ruffi92](https://community.freefem.org/u/ruffi92)\
**Post date:** [November 10, 2021, 11:36am UTC](https://community.freefem.org/t/err-border-element-not-in-mesh-importing-3d-mesh-from-gmsh/1317/1 "2021-11-10T11:36:28Z")

</div>

Hi to all, i’m trying to import a 3D mesh .msh from gmsh 2.2 to FreeFem++ but i receive the following error:

Loading packages… 916619 vertices  
closing file 5196967 4972572  
5196967 tetrahedrons  
4972572 triangles  
10169539 numElements  
– GMesh3 , n V: 916619 , n Elm: 5196967 , n B Elm: 4972572mes 0.193817 150.574 , bb: (-0.85656 0.383135 0.122828) , (-0.33292 0.906775 1.02283)  
Err Border element not in mesh  
3 : 0 1 676596  
4 : 0 2 28  
7 : 0 26 28  
9 : 0 26 230  
15 : 0 230 676671  
16 : 0 676596 676597  
17 : 0 676597 676671  
19 : 1 3 29  
20 : 1 3 225974  
– warning true boundary element 4680679 is no in correct orientation  
– warning true boundary element 4942052 is no in correct orientation  
Warning change orientation of 2 faces  
Warning error in boundary oriention 2 faces  
current line = 19  
Assertion fail : (err==0)  
line :1008, in file …/femlib/GenericMesh.hpp  
~HashTable: Cas moyen : 5.22306  
Assertion fail : (err==0)  
line :1008, in file …/femlib/GenericMesh.hpp  
err code 6 , mpirank 0  
close MUMPS\_SEQ: MPI\_Finalize

How can i solve this issue? Thanks in advance to all

---

<div class="post-metadata">

**Author:** ![marcodeba](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marcodeba](https://community.freefem.org/u/marcodeba)\
**Post date:** [November 11, 2021, 7:26am UTC](https://community.freefem.org/t/err-border-element-not-in-mesh-importing-3d-mesh-from-gmsh/1317/2 "2021-11-11T07:26:40Z")

</div>

Hi!  
I’m not fully sure of what the error message stands for, but I can read for sure "boundary element (…) is no in correct orientation.  
I often had that kind of error and I solved it including the mesh loading between this two code lines:

```auto
lockOrientation = false;
mesh3 Th = readmesh3("meshname.mesh"); 
lockOrientation = true;

```

I hope that this could help!

btw the gmsh version you are mentioning is pretty old, maybe passing to the last release may help too!

I really hope that this will help you.

Yours sincerely,

Marco

---

<div class="post-metadata">

**Author:** ![ruffi92](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ruffi92/32/921_2.png) [@ruffi92](https://community.freefem.org/u/ruffi92)\
**Post date:** [November 11, 2021, 9:29am UTC](https://community.freefem.org/t/err-border-element-not-in-mesh-importing-3d-mesh-from-gmsh/1317/3 "2021-11-11T09:29:29Z")

</div>

unfortunatly this instruction had no effect, the bad orientation remain. Thanks anyway for the help!
