3D Finite Element Method Mesh Generator

GMSH: examples which illustrate the use of the gmsh program, a 3D mesh generator for the finite element method (FEM).

gmsh allows the user to work with a visual interface, or with script files. The examples given here will all be given using the gmsh scripting language.

The meshes created by gmsh can be saved in any of the following formats:

The gmsh program is available from


The computer code and data files made available on this web page are distributed under the GNU LGPL license.

Related Data and Programs:

DOLFIN-CONVERT, a Python program which can convert mesh file from Gmsh, MEDIT, METIS or SCOTCH format to an XML format suitable for use by DOLFIN or FENICS, by Anders Logg.

FENICS, programs which illustrate the use of a collection of free software with an extensive list of features for automated, efficient solution of differential equations.

MESHLAB, examples which illustrate the use of the meshlab program, an advanced mesh processing system for automatic or user-assisted editing, cleaning, filtering, converting and rendering of large unstructured 3D triangular meshes. MESHLAB can read and write 3DS, OBJ, OFF, PLY, and STL graphics files.

MSH, a data directory of examples of MSH files, the native 3D mesh format used by gmsh.

TETGEN, examples of the use of TETGEN, a program which can compute the convex hull and Delaunay tetrahedralization of a set of 3D points, or can start with a 3D region defined by its boundaries, and construct a boundary-constrained conforming quality Delaunay mesh, by Hang Si.

TETHEX, examples which illustrate the use of TETHEX, a C++ program which can read a Gmsh file defining a mesh of triangles or tetrahedrons, and subdivide the mesh into quadrilaterals or hexahedrons, which are suitable for use by the DEALII finite element program, by Mikhail Artemiev.

TRIANGULATION_TO_GMSH, a MATLAB program which reads a file of node coordinates and a file of elements defined by node indices, and creates a corresponding Gmsh mesh file.


  1. Christophe Geuzaine, Jean-Francois Remacle,
    Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities,
    International Journal for Numerical Methods in Engineering,
    Volume 79, Number 11, pages 1309-1331, 2009.

Examples and Tests:

TEST is a 2D channel formed by starting with a long rectangular channel and creating a narrow neck by removing elliptical portions from the top and bottom. The resulting mesh has 4,325 nodes and 8,656 elements.

TEST02 is an upside-down L-shaped region, using 124 vertices and 206 cells, for the Mitchell test problem #2.

TEST03 is the square [-1,+1]x[-1,+1] with a slit from (0,0) to (1,0), for the Mitchell test problem #3.

TEST05 is the battery problem, with internal contstraint lines, for the Mitchell test problem #5. GMSH fails when I try to mesh this region!

You can go up one level to the EXAMPLES directory.

Last revised on 22 August 2014.