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 in NekPy
 4.5 NekMesh modules
  4.5.1 Input modules
  4.5.2 Output modules
  4.5.3 Extract surfaces from a mesh
  4.5.4 Negative Jacobian detection and histogram visualisation
  4.5.5 Spherigon patches
  4.5.6 Periodic boundary condition alignment
  4.5.7 Boundary layer splitting
  4.5.8 High-order cylinder generation
  4.5.9 Linearisation
  4.5.10 Extracting interface between tetrahedra and prismatic elements
  4.5.11 Boundary identification
  4.5.12 Scalar function curvature
  4.5.13 Link Checking
  4.5.14 2D mesh extrusion
  4.5.15 2D mesh revolution
  4.5.16 Variational Optimisation
  4.5.17 r-adaptation: interpolation file
  4.5.18 r-adaptation: CAD curves
  4.5.19 Mesh projection
  4.5.20 Mesh combine
 4.6 Mesh generation
  4.6.1 Methodology
  4.6.2 Mesh generation manual