gmsh


Introduction:

GMSH is a mesh generator that can operate on descriptions of
1D, 2D or 3D regions, producing a mesh that represents the discretized
geometry.

GMSH allows the user to work with a visual interface, or with script files.
A user can begin by preparing a "geo" file, which, in a typical 2D
region, would specify specific points and lines used to outline
the region and to construct any interior walls. GMSH reads in this
geometry file and creates a suitable mesh. The user can adjust
the properties of the mesh, by specifing a maximum element size,
or an associated density function, or a partition of the region.
The result is a mesh file, which can be stored in GMSH's default
".msh" format, or in formats appropriate for immediate input to
various application programs.

Users of the OPENFOAM program should know that a mesh created by
GMSH can be converted for input to OPENFOAM using the program
gmshToFoam.

Available formats include:

  • .bdf: Nastran bulk data file;
  • .celum: CELUM;
  • .dat: Tochnog;
  • .diff: Diffpack;
  • .inp: Abaqus;
  • .ir3: Iridum
  • .mail: CEA triangulation;
  • .med: MED;
  • .mesh: INRIA Medit;
  • .msh: the native GMSH format;
  • .p3d: Plot3d structured mesh;
  • .ply2: PLY2 surface;
  • .stl: STL surface;
  • .su2: SU2 format;
  • .unv: I-deas Universal
  • .vtk: Visual Toolkit;
  • .wrl: VRML surface;

Web site:


http://geuz.org/gmsh/

Reference:

  • 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.

Usage:

On any ARC cluster, check the installation details
by typing "module spider gmsh".

GMSH requires that several modules be loaded before it can be run.
One version of the appropriate commands for use on NewRiver is:

module purge
module load gcc/5.2.0
module load openblas/0.2.14
module load gmsh/2.12.0
    

Examples:

The file stenosis.geo describes the outline of a channel with
a narrowed section. The following batch file asks GMSH to mesh this
region.

#! /bin/bash
#PBS -l walltime=00:05:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=newriver
#PBS -q open_q
#PBS -j oe

cd $PBS_O_WORKDIR

module purge
module load gcc/5.2.0
module load openblas/0.2.14
module load gmsh/2.12.0
#
#  "-2" means perform 2D mesh generation, then exit.
#
gmsh stenosis.geo -2 > stenosis_newriver.txt
#
#  Check that the MSH mesh file was created.
#
ls -l stenosis.msh

A complete set of files to carry out a similar process are available in
gmsh_example.tar