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 name | nek5000 |
| Extensions | .re2, .fld |
| Read / Write | ✓ / ✓ (.re2 read/write; #std .fld/.f00001 read) |
| Extra dependencies | None |
Reading
python
import meshioplusplus
mesh = meshioplusplus.read("box.re2")
field = meshioplusplus.read("box0.f00001", file_format="nek5000")- Binary
.re2(#v002and#v004): detects endianness automatically from the6.54321float32 tag, deduplicates shared corner vertices intoquad(2-D) orhexahedron(3-D) cells, records any curved-side count infield_data["nek5000:num_curved"], and maps non-empty boundary condition tags (W,v,O,SYM, etc.) toRegionentries of kind"side"(RegionKind::Sidein C++). - Spectral-element
#std.fld/.f00001files (single or double precision, automatic endianness detection): maps per-element(nx, ny[, nz])Gauss–Lobatto–Legendre (GLL) tensor grids ontoquad/hexahedron(linear) orvtk_lagrange_quadrilateral/vtk_lagrange_hexahedron(higher order) via VTK Lagrange node ordering, readsvelocity,pressure,temperature, andscalar_<k>point data according tordcode, and stores the simulation time infield_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.