Skip to content

PyFR — flux-reconstruction HDF5 meshes and solutions (.pyfrm, .pyfrs) ​

PyFR stores unstructured high-order meshes in HDF5 .pyfrm files and solutions in companion .pyfrs files (roadmap 2.4.9.1). Both engines read and write .pyfrm and read companion .pyfrs solutions (formats/pyfr.cpp on detail/hdf5_util.hpp; meshioplusplus.pyfr through h5py).

Format namepyfr
Extensions.pyfrm
Read / Write✓ / ✓ (.pyfrm read/write; companion .pyfrs solution read)
Extra dependenciesHDF5 (MESHIOPLUSPLUS_WITH_HDF5) in the core; h5py for the Python reference

Reading ​

python
import meshioplusplus

mesh = meshioplusplus.read("cylinder.pyfrm")
mesh = meshioplusplus.pyfr.read("cylinder.pyfrm", solution="cylinder-01.00.pyfrs")
  • Shape-point datasets spt_<type>_p<n> (tri, quad, tet, pyr, pri, hex) of shape (n_spts, n_elems, ndims) are read in deterministic (type, partition) order with exact coordinate deduplication into shared points. Linear elements become triangle, quad, tetra, pyramid, wedge, and hexahedron; higher-order elements map to triangle6/quad9/tetra10/hexahedron27/wedge15/wedge18/pyramid13 or the corresponding vtk_lagrange_* cell types.
  • Boundary condition compound datasets bcon_<name>_p<n> become Region entries of kind "side" (RegionKind::Side in C++).
  • When solution= (PyfrReadOptions::mSolution in C++) names a .pyfrs file, stats is parsed for field names (fields = ...) and simulation time (tcurr = ..., stored in field_data["meshio:time"]), and each soln_<type>_p<n> dataset of shape (n_upts, n_vars, n_elems) is averaged over solution points to per-cell cell_data.

Writing ​

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

Writes mesh_uuid, spt_<type>_p<n> shape-point datasets for triangle/quad/tetra/pyramid/wedge/hexahedron (and their high-order counterparts), and bcon_<name>_p<n> compound datasets for every "side" region.

Released under the MIT License.