Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities

Christophe Geuzaine and Jean-François Remacle

Version 1.42, 18 March 2003

Description | Documentation | Mailing lists | Download | Licensing | Authors and credits | Screenshots | Links

Description

Gmsh is an automatic three-dimensional finite element mesh generator, primarily Delaunay, with built-in pre- and post-processing facilities. Its primal design goal is to provide a simple meshing tool for academic test cases with parametric input and up to date visualization capabilities. One of the strengths of Gmsh is its ability to respect a characteristic length field for the generation of adapted meshes on lines, surfaces and volumes. These adapted meshes can be mixed with simple structured (transfinite, elliptic, etc.) meshes in order to augment the flexibility. Gmsh is structured around four modules: geometry, mesh, solver and post-processing. The specification of any input to these modules is done either interactively, or in text data files (interactive specifications generate language bits in the input file, and vice versa). The accessibility of most features in the ASCII text file makes it possible to automate all treatments (loops, tests and external access methods permit advanced scripting capabilities). A brief description of the four modules is given hereafter.

Geometry: geometrical entity definition

Geometries are created in a bottom-up flow by successively defining points, oriented curves (segments, circles, ellipses, splines, etc.), oriented surfaces (plane surfaces, ruled surfaces, etc.) and volumes. Compound groups of geometrical entities can be defined, based on these elementary parametrized geometric entities. Data can be defined either interactively thanks to the menu system, or directly in the ASCII input files. The scripting possibilities (with loops, tests, arrays of variables, etc.) allow fully parametrized definitions of all geometrical entities.

Mesh: finite element mesh generation

A finite element mesh is a tessellation of a given subset of R3 by elementary geometrical elements of various shapes (in this case lines, triangles, quadrangles, tetrahedra, prisms, hexahedra and pyramids), arranged in such a way that if two of them intersect, they do so along a face, an edge or a node, and never otherwise. All the finite element meshes produced by Gmsh as unstructured, even if they were generated in a structured way. This implies that the elementary geometrical elements are defined only by an ordered list of their vertices (which allows the orientation of all their lower order geometrical entities) but no predefined relation is assumed between any two elementary elements.

The mesh generation is performed in the same order as the geometry creation: curves are discretized first; the mesh of the curves is then used to mesh the surfaces; then the mesh of the surfaces is used to mesh the volumes. This automatically assures the continuity of the mesh when, for example, two surfaces share a common curve. Every meshing step is constrained by the characteristic length field, which can be uniform, specified by characteristic length associated to elementary geometrical entities, or associated to another mesh (the background mesh).

For each meshing step (i.e. the discretization of lines, surfaces and volumes), all structured mesh directives are executed first, and serve as additional constraints for the unstructured parts. The implemented Delaunay algorithm is subdivided in the following five steps for surface/volume discretization:

  1. trivial meshing of a box including the convex polygon/polyhedron defined by the boundary nodes resulting from the discretization of the curves/surfaces;
  2. creation of the initial mesh by insertion of all the nodes on the curves/surfaces thanks to the Bowyer algorithm;
  3. boundary restoration to force all the edges/faces of the curves/surfaces to be present in the initial mesh;
  4. suppression of all the unwanted triangles/tetrahedra (in particular those containing the nodes of the initial box);
  5. insertion of new nodes by the Bowyer algorithm until the characteristic size of each simplex is lower or equal to the characteristic length field evaluated at the center of its circumscribed circle/sphere.

Solver: external solver interface

External solvers can be interfaced with Gmsh through a socket mechanism, which permits to easily launch computations either locally or on remote computers, and to collect and exploit the simulation results within Gmsh. The default solver interfaced with Gmsh is GetDP. Check the solver examples to see how to define your own solver (be sure to also read the answer to the question 6.1 in the FAQ).

Post-processing: scalar and vector field visualization

Multiple post-processing scalar or vector maps can be loaded and manipulated (globally or individually) along with the geometry and the mesh. Scalar fields are represented by iso-value curves/surfaces or color maps and vector fields by three-dimensional arrows or displacement maps. Post-processing functions include arbitrary section computation, offset, elevation, boundary extraction, color map and range modification, animation, vector graphic output, etc. All post-processing options can be accessed either interactively or through the input ASCII text files. Scripting permits to automate all the post-processing operations (e.g. for the creation of complex animations).

Documentation

 

Mailing lists

Download

Gmsh is distributed under the terms of the GNU General Public License (GPL). Pre-compiled binaries (dynamically linked with OpenGL1) are available for Windows, Linux and Mac OS X. The tutorial and demo files are included in the archives.

Older versions are also still available: source, binaries.

1You need the OpenGL libraries installed on your system (and in the path of the library loader). A free replacement for OpenGL can be found at http://mesa3d.sourceforge.net. Remember that you may have to reconfigure the loader (ldconfig under Linux) or modify the LD_LIBRARY_PATH/SHLIB_PATH/etc. environment variable in order for Gmsh to find the libraries.

2You need the GSL (> 1.2) and FLTK (1.1.x) libraries properly installed on your system in order to compile Gmsh. Non-graphical versions can be compiled without FLTK. Compiling the Windows version requires the Cygwin tools and compilers.

Authors and credits

Gmsh is developed by Jean-François Remacle (currently with the Catholic University of Louvain) and Christophe Geuzaine (currently with the California Institute of Technology). The CONTRIBUTORS file has more information.

Please use gmsh@geuz.org instead of our personal e-mails to send questions or bug reports.

Licensing

Gmsh is copyright (C) 1997-2003 by C. Geuzaine and J.-F. Remacle and is distributed under the terms of the GNU General Public License (GPL).

In short, this means that everyone is free to use Gmsh and to redistribute it on a free basis. Gmsh is not in the public domain; it is copyrighted and there are restrictions on its distribution (see the license and the FAQ). For example, you cannot integrate this version of Gmsh (in full or in parts) in any closed-source software you plan to distribute (commercially or not).

If you want to integrate Gmsh into a closed-source software, or want to sell a modified closed-source version of Gmsh, please contact us in person. You can purchase a version of Gmsh under a different license, with "no strings attached" (for example allowing you to take parts of Gmsh and integrate them into your own commercial, closed-source software).

Screenshots

Everybody loves screenshots... So here are some: screenshot 1 (small), screenshot 2 (small), screenshot 3 (small), screenshot 4 (small).

Some other pictures made with Gmsh:

Links

Check out GetDP, a scientific computation software for the numerical solution of integro-differential equations, using finite element and integral type methods.

The mesh database that will be used by Gmsh in the future has its own homepage: take a look at AOMD, the Algorithm Oriented Mesh Database.

Back to geuz.org