4.3 Converting the MSH to Nektar++ format

Assuming that you have compiled Nektar++ according to the compilation instructions, run the command

NekMesh test.msh test.xml

to generate the XML file.

Note: This file contains only the geometry definition (and a default EXPANSIONS definition). In order to use this mesh, a CONDITIONS section must be supplied detailing the solver and parameters to use.
To validate the mesh visually, we can use a utility such as Paraview or VisIt. To do this, we can use the FieldConvert command using:

FieldConvert test.xml test.vtu

which generates an unstructured VTK file test.vtu.

It is possible that, when the high-order information was inserted into the mesh by Gmsh, invalid elements are generated which self intersect. In this case, the Jacobian of the mapping defining the curvature will have negative regions, which will generate warnings such as:

Warning: Level 0 assertion violation 
3D deformed Jacobian not positive (element ID = 48) (first vertex ID = 105)

This tells you the element ID that is invalid, and the ID of the first vertex of the element. Whilst a resulting simulation may run, the results may not be valid because of this problem, or excessively large amounts of time may be needed to solve the resulting linear system.