# Read a simple 2D mesh

**URL:** https://community.freefem.org/t/read-a-simple-2d-mesh/1569
**Category:** General Discussion
**Created:** [March 3, 2022, 2:12pm UTC](https://community.freefem.org/t/read-a-simple-2d-mesh/1569 "2022-03-03T14:12:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)
#### Post date: [March 3, 2022, 2:12pm UTC](https://community.freefem.org/t/read-a-simple-2d-mesh/1569/1 "2022-03-03T14:12:53Z")

</div>

[grid2D.mesh](https://community.freefem.org/uploads/short-url/etPBcHFT2CWJDqBP62Qb1W4OLCK.mesh) (1.4 KB)

Hello all,

I am trying to read a simple 2D mesh done using SALOME, classically:

```auto
mesh TH=readmesh("grid2D.mesh");

```

However, I get an error. The log file is:

```auto
Dimension
    Vertices
   Nb of Vertices = 16
    .6666666666667
     Warning we skip the field .6666666666667 at line 17
    5
    0
    0
    -1.6666666666667
    1.6666666666667
    0
    0
    1.6666666666667
    1.6666666666667
    0
    0
    -1.6666666666667
    -1.6666666666667
    0
    0
    1.6666666666667
    -1.6666666666667
    0
    0
    Edges
     Record Edges: Nb of Edge 12 edges 0x5587345ba890
     hmin 0
    End
 ## Warning: Mesh without geometry we construct a geometry (theta =-57.2958 degres )
  -- construction of the geometry from the 2d mesh 
 Fatal error in the mesh generator 101
  current line = 7
Meshing error: Bamg
 number : 101, 
Meshing error: Bamg
 number : 101, 
 err code 5 , mpirank 0

```

It is the first time, I get this error.

Could someone help me to understand what does it mean ? I have attached the mesh used.

Thank you in advance;

Best regards,

Loïc

---

<div class="post-metadata">

### Author: ![mojtaba.barzegari](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mojtaba.barzegari/32/20_2.png) [@mojtaba.barzegari](https://community.freefem.org/u/mojtaba.barzegari)
#### Post date: [March 4, 2022, 12:10pm UTC](https://community.freefem.org/t/read-a-simple-2d-mesh/1569/2 "2022-03-04T12:10:23Z")

</div>

hi,

the mesh files contains nothing but a rectangular curve and a set of nodes on it, so it’s not a mesh actually. how did you generate it using SALOME?

you can check the mesh in GMSH and see that it doesn’t contain any element or surface, required by `readmesh` function to be considered as a 2D mesh in FF.

---

<div class="post-metadata">

### Author: ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)
#### Post date: [March 7, 2022, 6:36am UTC](https://community.freefem.org/t/read-a-simple-2d-mesh/1569/3 "2022-03-07T06:36:59Z")

</div>

Hello,

Thank you for your reply,

I have now the solution:

In order that a SALOME mesh is considered as a **2D mesh** and not as a **meshS** in FreeFEM, we have to save it under the **.msh** format, **version 2** and not 4, or translate the .MED file with gmsh in .msh file, and open it with **gmshload()**.

Loïc,
