Skip to main content

Module io

Module io 

Source
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

§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 FoamFile ASCII dictionary format: tokeniser, AST, parser, writer.
field
Time-directory field file read/write (0/p, 0/U, …).
poly_mesh
constant/polyMesh read/write.

Enums§

IoError
Errors raised while reading or writing OpenFOAM ASCII case files.