OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::twoD::checkpoint Namespace Reference

Typedefs

using Archive = detail::CompletedSourceArchive
 

Functions

void meshState (detail::CompletedSourceArchive &, SurfaceStateData &)
 Archive and validate accepted mesh hydraulic, species and optional snow/thermal runtime.
 
void material (Archive &a, ThermalMaterial &m)
 Archive a ground-column material's explicitly stored thermal properties.
 
void radiative (Archive &a, RadiativeConfig &r)
 Archive the explicit radiative forcing configuration.
 
void sediment (Archive &a, SedimentConfig &s)
 Archive the explicit sediment and ground-exchange configuration fields.
 
void heatConfig (Archive &a, HeatConfigData &h)
 Archive heat configuration fields used to construct model identity.
 
void groundHeat (Archive &a, GroundHeatState &h, bool model)
 Archive model-identity fields or runtime receipts of a prepared ground-heat state.
 
std::string groundHeatModelIdentity (const GroundHeatState &state)
 Encode an owned byte identity of the ground thermal model and initial state.
 
std::string meshHeatModelIdentity (const MeshHeatState &state)
 Encode mesh thermal ownership, options and initial inventories as a model identity.
 
void meshHeat (Archive &a, MeshHeatState &h)
 Archive accepted mesh heat runtime state against a separately prepared model.
 

Typedef Documentation

◆ Archive

Function Documentation

◆ groundHeat()

void openswmm::twoD::checkpoint::groundHeat ( Archive & a,
GroundHeatState & h,
bool model )
inline

Archive model-identity fields or runtime receipts of a prepared ground-heat state.

Parameters
[in,out]aSequential writer or reader. Fields are visited in order; read failures may leave a partially decoded state, so callers restore into a private candidate before publication.
[in,out]hGround state to encode or decode. An active archived state requires a nonnull borrowed configuration. Runtime decoding requires matching prepared layer/material/species metadata and vector extents for fixed-size inventories; external context/configuration pointers are neither serialized nor transferred.
[in]modelTrue selects model-identity properties, geometry and initial inventories; false selects runtime temperatures, water/heat/solute inventories, reservations and cumulative receipts.
Exceptions
std::runtime_errorOn missing active configuration, invalid archive shape/profile, or runtime nonfinite/invalid inventories and thermodynamic/reservation values.
Note
An archived inactive flag returns immediately without clearing h. Model-mode options, parameters, authored keys and snow-contact mask are temporary copies, so reading that mode is not complete model reconstruction. Runtime profile text is consumed; only the SIGMA receipt profile has an explicit text equality check here. Runtime units retain SI water volumes m3, energy J, capacities J/K, conductivity W/(m K), and temperatures degrees C; species inventories retain their configured native mass, age or temperature representation. Allocation failures propagate. The caller owns archive framing, trailing-byte checks and transactional publication.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ groundHeatModelIdentity()

std::string openswmm::twoD::checkpoint::groundHeatModelIdentity ( const GroundHeatState & state)
inline

Encode an owned byte identity of the ground thermal model and initial state.

Parameters
[in]stateStable prepared ground state whose borrowed configuration must remain alive for this call. Runtime receipts are excluded through groundHeat() model mode.
Returns
Owned binary string, suitable for exact model-compatibility comparison, including the inactive marker when no ground thermal model is active.
Exceptions
std::runtime_errorIf an active state lacks its configuration or archive encoding fails.
Note
The state is copied before archiving; inputs are unchanged and allocation errors propagate. This is a version-specific internal identity, with no portable interchange guarantee.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ heatConfig()

void openswmm::twoD::checkpoint::heatConfig ( Archive & a,
HeatConfigData & h )
inline

Archive heat configuration fields used to construct model identity.

Parameters
[in,out]aSequential archive. Writer use is intended; read errors propagate after any already decoded fields have changed.
[in,out]hConfiguration containing exchange flags, radiative/sediment settings, override rows, solar/cloud settings and global source temperatures. Temperatures retain degrees C, solar coordinates degrees, timezone hours and explicit atmospheric field units.
Note
Override rows are archived through a local copy, so reading does not publish them back to h.overrides.rows. This helper is not a complete configuration restoration API and does not validate physics or resolve referenced series.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ material()

void openswmm::twoD::checkpoint::material ( Archive & a,
ThermalMaterial & m )
inline

Archive a ground-column material's explicitly stored thermal properties.

Parameters
[in,out]aSequential writer or reader; archive errors and allocation failures propagate.
[in,out]mMaterial to encode, or progressively replace when reading. Stored values retain native SI units: density kg/m3, specific heat J/(kg K), conductivity W/(m K), volumetric water heat capacity J/(m3 K), and dimensionless porosity/mixing selector.
Note
This field helper performs no physical validation and offers no rollback on read failure.

◆ meshHeat()

void openswmm::twoD::checkpoint::meshHeat ( Archive & a,
MeshHeatState & h )
inline

Archive accepted mesh heat runtime state against a separately prepared model.

Parameters
[in,out]aSequential writer or reader; caller supplies the matching model identity, archive framing and final trailing-byte check.
[in,out]hPrepared mesh heat state to encode or progressively decode. Disabled states consume no bytes. Enabled states include current ground temperature (degrees C), bed energy J, capacity J/K, thermal receipts J, evaporation m3, failure counts and species/age ledgers, followed by standalone ground runtime. Model options and borrowed context pointers are excluded.
Exceptions
std::runtime_errorOn a ground/mesh cell-count mismatch, archive error or, when reading, invalid shapes, nonfinite values, nonpositive bed capacity, negative evaporation/failure counts or negative carried species inventories.
Note
Species arrays use cell-major blocks of bed_species entries; optional arrays may be empty. Reading can resize vectors and mutate prior fields before validation fails. Restore into a private candidate to obtain transactional publication; allocation exceptions also propagate.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshHeatModelIdentity()

std::string openswmm::twoD::checkpoint::meshHeatModelIdentity ( const MeshHeatState & state)
inline

Encode mesh thermal ownership, options and initial inventories as a model identity.

Parameters
[in]stateStable mesh heat state. Any borrowed simulation context and groundwater configuration must remain alive and unchanged during copying and encoding.
Returns
Owned binary identity string. Disabled states contain only the leading option fields; enabled states also include ownership masks, initial bed inventories, standalone ground identity and the heat configuration when a context exists.
Note
No runtime ledgers or external pointer addresses are encoded. Encoding copies the input, can allocate and propagate archive errors, and supplies no cross-version binary compatibility.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshState()

void openswmm::twoD::checkpoint::meshState ( detail::CompletedSourceArchive & a,
SurfaceStateData & s )

Archive and validate accepted mesh hydraulic, species and optional snow/thermal runtime.

Archive the accepted mesh runtime payload using the shared physical-state validator.

Arguments in order Sequential internal reader/writer archive, then mutable prepared
SurfaceStateData. Read mode requires matching model/profile and preallocated fixed-array extents. Fields retain SI/native solver units; geometry, borrowed owners and provider configuration are handled by the caller.
Exceptions
std::runtime_errorOn unsupported participant profiles, archive shape or invalid finite/water/species/age/bed runtime values. Allocation errors propagate.
Note
Reading can change earlier fields before failure; restore into a private candidate for transactional publication. Saves validate the same canonical state. No model reconstruction, whole-engine framing or ownership transfer occurs here.
Parameters
[in,out]aSequential archive with matching prepared model and fixed extents.
[in,out]sSurface runtime state, progressively decoded on read and validated in both modes.
Exceptions
std::runtime_errorOn unsupported profiles, shape/value or participant errors.
Note
Delegates to meshStateImpl(); no rollback, model reconstruction or pointer ownership transfer occurs. Callers stage private state before publishing a restore.

◆ radiative()

void openswmm::twoD::checkpoint::radiative ( Archive & a,
RadiativeConfig & r )
inline

Archive the explicit radiative forcing configuration.

Parameters
[in,out]aSequential writer or reader; errors propagate and may leave a partial decode.
[in,out]rConfiguration to encode or overwrite, including shortwave W/m2, dimensionless optical factors, landcover temperature in degrees C, forcing mode and time-series index.
Note
No referenced time series is serialized and no parameter bounds are validated here.
Here is the caller graph for this function:

◆ sediment()

void openswmm::twoD::checkpoint::sediment ( Archive & a,
SedimentConfig & s )
inline

Archive the explicit sediment and ground-exchange configuration fields.

Parameters
[in,out]aSequential writer or reader; errors propagate with no field rollback.
[in,out]sConfiguration encoded or progressively overwritten: flags and series indices, porosity, diffusivities in m2/s, depths in m, velocities in m/s, density in kg/m3, specific heat in J/(kg K), and temperatures in degrees C.
Note
Referenced external series and runtime thermal state are excluded; values are not validated.
Here is the caller graph for this function: