[Gmsh] freefemm++

Geordie McBain gdmcbain at freeshell.org
Fri Jun 26 09:05:26 CEST 2009


On Thu, Jun 25, 2009 at 8:20 PM, Dimitrios
Eftaxiopoulos<eftaxiop at central.ntua.gr> wrote:
> I recently managed to import a .mesh file to freefem++. The mesh was created in
> gmsh and was exported to the .mesh format within gmsh. No particular
> intervention was needed.
>
> Regards
> Dimitris

Thank you very much for your reply, Dimitris.  But how odd.  Can there
be something awry with my Gmsh (2.3.1) or FreeFem++ (3.3-3) (both
compiled from source on openSUSE 10.2)?  With the simple input file
box.geo and "gmsh -3 -format mesh -algo netgen box.geo", I get a mesh
file of a 2x3x5 cuboid with 80 triangles and 91 tetrahedra.  Then if I
feed it to FreeFem++ with the simple input file box.edp ("FreeFem++-nw
box.edp"), which does int3d (Th) (1.0), it tells me the volume is -30.
   Would you be so kind as to verify that that your Gmsh & FreeFem++
give a positive volume?
   Further, if I copy and paste the Vertices and Tetrahedra blocks
from box.mesh into GNU Octave arrays and compute the volume there
using the formula for each tetrahedron that the volume is one sixth of
the determinant with a row for each vertex prepended with a one
(Zienkiewicz & Cheung 1967, p. 76; Hughes 2000, p. 172), I again get
-30.

octave:38> vol = 0; for elt = 1:rows (Tetrahedra); vol += det (horzcat
(ones (4, 1), Vertices (Tetrahedra (elt, 1:4), 1:3)))/6; endfor, vol
vol = -30.000

Zienkiewicz & Cheung (p. 75) describe the numbering convention as
counting the remaining vertices anti-clockwise viewed from the first.
The opposite sign convention to the tetrahedron draw on p. 76 of the
Gmsh manual  (S. 9.3 Node ordering), so that the minus sign is
expected in this formula; however, negative volumes for elements are
unwelcome in FreeFem++.
  As I said, I have a workaround (piping from Gmsh through Gawk to
FreeFem++), but I'm puzzled.  It seems to me that the vertices are
numbered correctly according to the Gmsh convention which is opposite
to the Zienkiewicz & Cheung convention and I'm supposing FreeFem++ is
following Zienkiewicz & Cheung, so the numbers from Gmsh should be
permuted when exporting to .mesh.  But I'm puzzled if you can use the
Gmsh .mesh directly and get positive volumes.
  Thanks for your time.

Geordie McBain

References

Hughes, T. J. R. (2000). The Finite Element Method. Mineola, New York: Dover.

Zienkiewicz, O. C. and Y. K. Cheung (1967). The Finite Element Method
in Structural and Continuum Mechanics. London: McGraw-Hill.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: box.geo
Type: application/octet-stream
Size: 474 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090626/a5cb2416/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: box.edp
Type: application/octet-stream
Size: 143 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090626/a5cb2416/attachment.edp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: box.mesh
Type: model/mesh
Size: 5878 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090626/a5cb2416/attachment.mesh>