Skip to content

Nek5000 / NekRS — binary meshes and spectral-element fields (.re2, .fld) ​

Nek5000 and NekRS store meshes in binary .re2 files (#v002 and #v004) and spectral-element field dumps in #std .fld / .f00001 files (roadmap 2.4.9.2). Both engines read .re2 and #std .fld files and write #v002 .re2 meshes with no external library (formats/nek5000.cpp; meshioplusplus.nek5000).

Format namenek5000
Extensions.re2, .fld
Read / Write✓ / ✓ (.re2 read/write; #std .fld/.f00001 read)
Extra dependenciesNone

Reading ​

python
import meshioplusplus

mesh = meshioplusplus.read("box.re2")
field = meshioplusplus.read("box0.f00001", file_format="nek5000")
  • Binary .re2 (#v002 and #v004): detects endianness automatically from the 6.54321 float32 tag, deduplicates shared corner vertices into quad (2-D) or hexahedron (3-D) cells, records any curved-side count in field_data["nek5000:num_curved"], and maps non-empty boundary condition tags (W, v, O, SYM, etc.) to Region entries of kind "side" (RegionKind::Side in C++).
  • Spectral-element #std .fld / .f00001 files (single or double precision, automatic endianness detection): maps per-element (nx, ny[, nz]) Gauss–Lobatto–Legendre (GLL) tensor grids onto quad/hexahedron (linear) or vtk_lagrange_quadrilateral/vtk_lagrange_hexahedron (higher order) via VTK Lagrange node ordering, reads velocity, pressure, temperature, and scalar_<k> point data according to rdcode, and stores the simulation time in field_data["meshio:time"].

Writing ​

python
meshioplusplus.write("out.re2", mesh)

Writes a little-endian #v002 .re2 file from a 2-D quad or 3-D hexahedron mesh, emitting all "side" regions as boundary condition records.

Released under the MIT License.