[Gmsh] Saving a mesh in 2D

Geordie McBain gdmcbain at freeshell.org
Tue May 4 01:56:17 CEST 2010


2010/4/29 Alexis Blasselle <alexis.blasselle at gmail.com>:
> Hi everybody,
>
> I first thank all the developers, because Gmsh helps me a lot !
>
> I have a very stupid question: I generate a plane 2D mesh, but I would like
> to save it as a 2D mesh, not as a 3D one, under the format .mesh.
> Is it possible, and if yes, how can I do ?
>
> For the moment, when saving it in .mesh, I obtain a file whose beginning is
> MeshVersionFormatted 1
>  Dimension
>  3
>
> I thank you in advance for your answer, and wish you a great day,

This came up a couple of months ago:

  http://www.geuz.org/pipermail/gmsh/2010/005247.html

Gmsh doesn't really work with plane meshes, but it's easy enough to
translate a space mesh to a plane mesh using e.g. Gawk, and a program
was attached there.

(In case the reason you want plane MEDIT meshes is for FreeFem++, I
note that since last year FreeFem++ has been able to read native Gmsh
.msh meshes with the gmshload function from its "gmsh" module.
Personally I have found this to be the way to go for two-dimensional
work, though I still use MEDIT format for three-dimensional problems,
meshing in Gmsh and solving in FreeFem++.)