![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Serialise a SimulationContext to the columnar HDF5 model format. More...
#include <string>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::h5io |
Functions | |
| int | openswmm::h5io::write_model (const std::string &path, const SimulationContext &ctx, std::vector< std::string > *warnings=nullptr) |
| Write a complete native model and analysis columns to HDF5. | |
Variables | |
| constexpr int | openswmm::h5io::kSchemaVersionMajor = 1 |
| constexpr int | openswmm::h5io::kSchemaVersionMinor = 0 |
| constexpr const char * | openswmm::h5io::kSchemaVersion = "1.0" |
Serialise a SimulationContext to the columnar HDF5 model format.
Design and rationale: src/engine/io/hdf5/STRATEGY.md.
Two decisions carry most of the weight:
1. **Authored units, exactly like the `.inp`** (STRATEGY §4). The
writer runs the same `convert_internal_to_display` +
`convert_internal_to_authored` pass on a copy that InpWriter
does, so the numbers in the file are the numbers the modeller
typed. GeoPackage made the opposite choice — internal units with
a single display-unit island for the cross-section geoms — and
the file-IO audit found that island is a standing trap.
2. **References are written as NAMES, not indices.** A file that
says `node1 = "J1"` survives renumbering and is legible in
h5py; resolution happens once on read.