# Savegmsh ? seems not to work

**URL:** <https://community.freefem.org/t/savegmsh-seems-not-to-work/1455>\
**Category:** General Discussion\
**Created:** [January 27, 2022, 8:32pm UTC](https://community.freefem.org/t/savegmsh-seems-not-to-work/1455 "2022-01-27T20:32:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.fabre](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@david.fabre](https://community.freefem.org/u/david.fabre)\
**Post date:** [January 27, 2022, 8:32pm UTC](https://community.freefem.org/t/savegmsh-seems-not-to-work/1455/1 "2022-01-27T20:32:08Z")

</div>

Hello all !

I was asked by a collegue to export a mesh generated by FreeFem++ in a format readable by Fenics.  
I first thought about using gmsh format.  
There is a command “savegmsh” documented in the manual but it does not seem to work  
(see below the log for a basic example).

Any hope for this to work ? or any suggestion about other format we could use ?

Thanks  
David

Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue parallelempi  
1 :  
2 : mesh Th = square(20, 20, [x, y]);  
3 : load “gmsh”  
4 : savegmsh(Th, “Th”) error operator ( ,   
List of choices  
( **: , \<NSt3\_\_112basic\_stringIcNS\_11char\_traitsIcEENS\_9allocatorIcEEEE\> )  
( : , \<NSt3\_\_112basic\_stringIcNS\_11char\_traitsIcEENS\_9allocatorIcEEEE\> )  
( : , \<NSt3\_\_112basic\_stringIcNS\_11char\_traitsIcEENS\_9allocatorIcEEEE\> )**

 

Error line number 4, in file ExportMesh\_GMSH.edp, before token )

current line = 4 mpirank 0 / 1  
Compile error :  
line number :4, )  
error Compile error :  
line number :4, )  
code = 1 mpirank: 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [January 28, 2022, 6:15am UTC](https://community.freefem.org/t/savegmsh-seems-not-to-work/1455/2 "2022-01-28T06:15:37Z")

</div>

It does not work for 2D meshes.

```auto
$ git grep savegmsh \*.cpp
plugin/seq/gmsh.cpp: Global.Add("savegmsh", "(", new OneOperator2< bool, pmesh3, string * >(SaveGMSH));
plugin/seq/gmsh.cpp: Global.Add("savegmsh", "(", new OneOperator2< bool, pmeshS, string * >(SaveGMSH));
plugin/seq/gmsh.cpp: Global.Add("savegmsh", "(", new OneOperator2< bool, pmeshL, string * >(SaveGMSH));

```

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [January 28, 2022, 4:03pm UTC](https://community.freefem.org/t/savegmsh-seems-not-to-work/1455/3 "2022-01-28T16:03:30Z")

</div>


