[Gmsh] Medit file format

Geordie McBain gdmcbain at freeshell.org
Tue May 4 01:19:23 CEST 2010

2010/4/20 Martin Vymazal <martin.vymazal at vki.ac.be>:
> Hello gmsh community,
>  I would like to ask if it is possible to save a 3D mesh generated by gmsh
> in medit file format. I have a cube, I set both the faces of the cube and
> its volume as physical before saving the mesh as a medit file. However, when
> I re-open the saved file with gmsh, I see only 2D faces of the cube meshed,
> the 3D elements in the interior of the cube are missing.
>  I found some older posts in the mailing list archive (2007) with the same
> question. The reply was 'the support of medit file format is highly
> experimental and not recommended to use'. What's the status today?

Today it works fine.  I regularly generate 3-D MEDIT meshes using Gmsh.

There were some significant improvements in September and October
2009.  Are you using a version of Gmsh more recent than that?

>  If gmsh cannot save directly correct medit files, does anyone know of any
> other way of converting msh -> medit? Thanks for any ideas/suggestions.

I did write a translator for msh -> medit, but I do not believe it is
required any longer.

Try the following at the command line:

$ gmsh -3 -format mesh -string 'Mesh.SaveElementTagType=2;' cuboid.geo

with the attached .geo geometry file.  I also attach the resulting
MEDIT mesh; it correctly contains vertices, triangles, and tetrahedra.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cuboid.mesh
Type: model/mesh
Size: 41926 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20100504/c4ac6774/attachment.mesh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cuboid.geo
Type: application/octet-stream
Size: 449 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20100504/c4ac6774/attachment.geo>