Chapter 4
NekMesh

NekMesh is a utility bundled with Nektar++ which has two purposes:

Note: NekMesh replaces a previous utility called MeshConvert. This change is to reflect the fact that the program no longer only converts and manipulates meshes but can now also generate them from a CAD definition. This mesh generator is in an early stage of development and as such is disabled by default. For the time being those not using the mesh generator can use NekMesh as they would have used MeshConvert, none of the functionality or methodology has changed.

There is also some limited support for other output formats. We begin by running through a basic example to show how a mesh can be converted from the widely-used mesh-generator Gmsh to the XML file format.

Note: The default since January 2016 is to output the .xml files in a compressed form where the VERTEX, EDGES, FACES, ELEMENTS and CURVED information is compressed into binary format which is then converted into base64. This is identified for each section by the attribute COMPRESSED="B64Z-LittleEndian”. To output in ascii format add the module option “:xml:uncompress” to the .xml file, i.e.
NekMesh file.msh newfile.xml:xml:uncompress

 4.1 Exporting a mesh from Gmsh
 4.2 Defining physical surfaces and volumes
 4.3 Converting the MSH to Nektar++ format
 4.4 NekMesh modules
  4.4.1 Input modules
  4.4.2 Output modules
  4.4.3 Extract surfaces from a mesh
  4.4.4 Negative Jacobian detection
  4.4.5 Spherigon patches
  4.4.6 Periodic boundary condition alignment
  4.4.7 Boundary layer splitting
  4.4.8 High-order cylinder generation
  4.4.9 Linearisation
  4.4.10 Extracting interface between tetrahedra and prismatic elements
  4.4.11 Boundary identification
  4.4.12 Scalar function curvature
  4.4.13 Link Checking
  4.4.14 2D mesh extrusion
  4.4.15 Variational Optimisation
 4.5 Mesh generation
  4.5.1 Methodology
  4.5.2 Mesh generation manual