Supported Mesh Formats
MFEM supports a number of mesh formats, including:
- MFEM's built-in formats, including arbitrary high-order curvilinear meshes and non-conforming (AMR) meshes.
- VTK format (XML VTU format and legacy ASCII format).
- The CUBIT meshes through the Genesis (NetCDF) binary format.
- The NETGEN triangular and tetrahedral mesh formats.
- The TrueGrid hexahedral mesh format.
See below for more details and information on the specific formats that are supported. All of these mesh formats are also supported by MFEM's native visualization tool, GLVis.
MFEM Mesh Formats
Detailed description of these formats can be found on MFEM's mesh formats page.
- MFEM's mesh v1.0 format for straight meshes.
- MFEM's mesh v1.0 format for arbitrary high-order curvilinear and more general meshes.
- MFEM's mesh v1.2 format, which adds support for parallel meshes.
- MFEM's NC mesh v1.0 format, supporting non-conforming (AMR) meshes.
- MFEM's format for NURBS meshes.
VTK Mesh Formats
Specifically, MFEM supports:
- Meshes with high-order Lagrange elements.
- Mixed meshes with all element types.
XMLformat with inline or appended binary data, including
Gmsh Mesh Formats
MFEM supports reading version 2.2 of the Gmsh ASCII and binary formats for 2D and 3D meshes. High-order elements (up to order 9) are supported, as are periodic meshes.
Note that newer versions of Gmsh output files in version 4.1 of the Gmsh format,
which is not compatible with MFEM. Users should either specify
Mesh.MshFileVersion = 2.2; in their geometry file or run Gmsh with
msh22 from the command line.
Elements' physical tags in Gmsh correspond to their attribute numbers in MFEM. MFEM only supports strictly positive (≥ 1) attributes, so users should be sure to define all physical groups with strictly positive tag numbers. The one exception to this is in cases where all elements have physical tag zero (which happens by default in Gmsh when no physical groups are defined). In this case, MFEM will reassign all the elements to have attribute number 1 instead of failing to read the mesh.