All geometrical, mesh, solver and post-processing instructions are prescribed either interactively using the graphical user interface (GUI) or in text files using Gmsh’s own scripting language. Interactive actions generate language bits in the input files, and vice versa. This makes it possible to automate all treatments, using loops, conditionals and external system calls.
Gmsh uses a boundary representation (“BRep”) to describe geometries. Models are created in a bottom-up flow by successively defining points, oriented lines (line segments, circles, ellipses, splines,..), oriented surfaces (plane surfaces, ruled surfaces, triangulated surfaces, ...) and volumes. Gmsh’s scripting language allows all geometrical entities to be fully parametrized.
A finite element mesh is a tessellation of a given subset of the three-dimensional space by elementary geometrical elements of various shapes (in Gmsh’s 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 are considered as “unstructured”, even if they were generated in a “structured” way (e.g., by extrusion). This implies that the elementary geometrical elements are defined only by an ordered list of their nodes but that no predefined order relation is assumed between any two elements.
Image.1) A Gmsh generated hybrid mesh for use in an OpenFOAM analysis of a 2D hydrofoil case.
External solvers can be interfaced with Gmsh through Unix or TCP/IP sockets, which permits to modify solver parameters, launch external computations and process the results directly from within Gmsh’s post-processing module. The default solver interfaced with Gmsh is GetDP.
Gmsh can load and manipulate multiple post-processing scalar, vector or tensor maps along with the geometry and the mesh. Scalar fields are represented by iso-value lines/surfaces or color maps, while vector fields are represented by three-dimensional arrows or displacement maps. Scripting permits to automate all post-processing operations, as for example to create animations.
Gmsh can be used at three levels:
- as a stand-alone graphical program, driven by an interactive graphical user interface (GUI);
- as a stand-alone script-driven program;
- as a library.