Expand description
OpenFOAM ASCII case I/O — FoamFile dictionaries, polyMesh read/write,
time-directory field read/write, and whole-case reading.
OpenFOAM ASCII case I/O — read and write OpenFOAM cases the way the
upstream utilities do.
This module is the foundation the OUTRAM PARK CLI reads/writes OpenFOAM
cases with. The format and algorithms are OpenFOAM-derived (the FoamFile
dictionary grammar, the polyMesh list layout, the time-directory field
layout); this is an independent Rust re-implementation of the ASCII reader
and writer, not the official OpenFOAM software.
§What lives here
dict— theFoamFiledictionary format: a tokeniser (strips//and/* */comments; treats( ) { } ; [ ]as delimiters), an in-memory AST (FoamDict,FoamEntry,FoamValue,Dimensioned), theFoamHeaderblock, and an exact-round-trip writer. Handlessystem/controlDict,fvSchemes,fvSolution-style dictionaries.poly_mesh—PolyMesh: read/writeconstant/polyMesh/{points, faces, owner, neighbour, boundary}and convert to the crate’s geometry-carryingcrate::mesh::FvMeshviaPolyMesh::to_fv_mesh.field— read/write a time-directory field file (0/pvolScalarField,0/UvolVectorField): thedimensions,internalField, andboundaryFieldblocks ↔ the crate’scrate::fields::VolScalarField/crate::fields::VolVectorField.case—FoamCase: read a whole case directory (system/…,constant/polyMesh,0/…) into memory, with a best-effort writer.
§Round-trip guarantee
The writer and parser are inverse at the AST level: constructing a
FoamDict /
PolyMesh / field, serialising it, and parsing it back
reproduces an equal in-memory value. (It is not a byte-for-byte re-emitter
of an arbitrary pre-existing file — comment banners and incidental
whitespace are normalised — but every value round-trips.)
Re-exports§
pub use case::FoamCase;pub use dict::Dimensioned;pub use dict::FoamDict;pub use dict::FoamEntry;pub use dict::FoamHeader;pub use dict::FoamValue;pub use field::read_vol_scalar_field;pub use field::read_vol_vector_field;pub use field::write_vol_scalar_field;pub use field::write_vol_vector_field;pub use poly_mesh::MeshFace;pub use poly_mesh::PolyMesh;
Modules§
- case
- Whole-case reader (
system/,constant/polyMesh, a time directory). - dict
- The
FoamFileASCII dictionary format: tokeniser, AST, parser, writer. - field
- Time-directory field file read/write (
0/p,0/U, …). - poly_
mesh constant/polyMeshread/write.
Enums§
- IoError
- Errors raised while reading or writing OpenFOAM ASCII case files.