Many thanks to Dmitrijs and to you for your answers and example.
I did not know neither sed nor awk but I think they will be very helpful.

Best regards,

Julien

 


 

 

-----E-mail d'origine-----
De : Geordie McBain <[email protected]>
A : [email protected]
Cc : [email protected]
Envoyé le : Mercredi, 24 Février 2010 0:20
Sujet : Re: [Gmsh] Third coordinate Z not wanted


On Tue, Feb 23, 2010 at 7:14 PM,  <[email protected]> wrote:
> Hi,
>
> I would like to use gmsh to perform simple 2D meshes. I use for the moment
> the option -2 in command line, but the dimension in the resulting mesh file
> is still 3. The solver code I use reads .mesh files but does not read the
> 3rd coordinate Z.
> Does anybody knows an option to specify that the 3rd coordinate must not be
> written in the .mesh file ? I searched along the reference manual and
> messages but did not find it out.

I came across this problem too, for the solver FreeFem++ before it
acquired the ability to read Gmsh's .msh format.  I thought about
modifying Gmsh to output two-dimensional MEDIT .mesh files, but I read
in the MEDIT documentation that that wasn't compliant, so I took the
path recommended by D. L. and used a simple script to strip the
spurious third coordinate; Sed would no doubt serve, but I used Gawk.
I attach it in the hope you'll find it useful.  Run as "gawk -f
3to2.awk yourmesh3.mesh > yourmesh2.mesh".

 
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to