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

In-memory hot start file data. More...

#include <HotStartManager.hpp>

Collaboration diagram for openswmm::HotStartFile:

Public Member Functions

bool set_node_depth (const std::string &id, double v)
 Edit the first exact-ID stored node depth and mark the file dirty.
 
bool set_node_head (const std::string &id, double v)
 Edit the first exact-ID stored node hydraulic head and mark the file dirty.
 
bool set_link_flow (const std::string &id, double v)
 Edit the first exact-ID stored link flow and mark the file dirty.
 
bool set_link_depth (const std::string &id, double v)
 Edit the first exact-ID stored link depth and mark the file dirty.
 
bool set_subcatch_runoff (const std::string &id, double v)
 Edit the first exact-ID stored subcatchment runoff and mark the file dirty.
 

Public Attributes

std::string snow_state
 V14: native degree-day and UEB accepted/held states.
 
std::string engine_checkpoint
 V15: complete accepted engine/2D state for qualified native restarts (may be empty from V16)
 
std::string fv_dry_state
 V18: named disconnected FV scalar inventories.
 
std::string gw_transport_state
 V17: canonical SIGMA chemistry, edge receipts and clocks.
 
std::string surface_state
 V16: subcatchment ponded water, groundwater flow and surface quality (StateAccessors::get_surface_state)
 
HotStartHeader header
 
std::vector< HotStartNodeRecord > nodes
 
std::vector< HotStartLinkRecord > links
 
std::vector< HotStartSubcatchRecord > subcatches
 
std::vector< std::string > species
 
std::vector< double > node_species
 
std::vector< double > link_species
 
uint32_t gw_n_cells = 0
 
uint32_t gw_m_layers = 0
 
std::vector< double > gw_hg
 saturated thickness (m)
 
std::vector< double > gw_hu
 unsaturated storage (m of water)
 
std::vector< double > gw_theta_sigma
 closure-B layers, layer-major
 
std::vector< std::vector< double > > gw_interface
 V12: receiving interface; V13 appends pending/cumulative ET and held surface evaporation.
 
std::vector< double > gw_ledger
 the cumulative terms (m3): 9, +link since G-X3
 
std::vector< std::string > gw_species
 row names, in file order
 
std::vector< double > gw_sat_mass
 saturated-zone mass
 
std::vector< double > gw_unsat_mass
 column-store mass
 
std::vector< double > gw_species_ledger
 
std::string path
 File path (for flush-on-close)
 
bool dirty = false
 True if set_*() was called.
 
std::vector< std::string > warnings
 Populated by HotStartManager::apply()
 

Static Public Attributes

static constexpr int kGwSpeciesLedgerTerms = 13
 

Detailed Description

In-memory hot start file data.

Created by HotStartManager::save() or HotStartManager::open(). The C API casts HotStartFile* to/from void* SWMM_HotStart.

Member Function Documentation

◆ set_link_depth()

bool openswmm::HotStartFile::set_link_depth ( const std::string & id,
double v )

Edit the first exact-ID stored link depth and mark the file dirty.

Changes only this scalar and dirty flag; does not recompute related depths/heads/volumes, update opaque full engine checkpoints, apply to a live model or flush to disk.

Parameters
[in]idBorrowed byte-exact record ID, case-sensitive; no engine name-index lookup.
[in]vNew link depth in ft; no finite/range validation.
Returns
True on a matching record, false with no mutation when absent.

◆ set_link_flow()

bool openswmm::HotStartFile::set_link_flow ( const std::string & id,
double v )

Edit the first exact-ID stored link flow and mark the file dirty.

Changes only this scalar and dirty flag; does not recompute related depths/heads/volumes, update opaque full engine checkpoints, apply to a live model or flush to disk.

Parameters
[in]idBorrowed byte-exact record ID, case-sensitive; no engine name-index lookup.
[in]vNew link flow in cfs in stored link orientation; no finite/range validation.
Returns
True on a matching record, false with no mutation when absent.

◆ set_node_depth()

bool openswmm::HotStartFile::set_node_depth ( const std::string & id,
double v )

Edit the first exact-ID stored node depth and mark the file dirty.

Changes only this scalar and dirty flag; does not recompute related depths/heads/volumes, update opaque full engine checkpoints, apply to a live model or flush to disk.

Parameters
[in]idBorrowed byte-exact record ID, case-sensitive; no engine name-index lookup.
[in]vNew node depth in ft above invert; no finite/range validation.
Returns
True on a matching record, false with no mutation when absent.

◆ set_node_head()

bool openswmm::HotStartFile::set_node_head ( const std::string & id,
double v )

Edit the first exact-ID stored node hydraulic head and mark the file dirty.

Changes only this scalar and dirty flag; does not recompute related depths/heads/volumes, update opaque full engine checkpoints, apply to a live model or flush to disk.

Parameters
[in]idBorrowed byte-exact record ID, case-sensitive; no engine name-index lookup.
[in]vNew node hydraulic head in ft elevation; no finite/range validation.
Returns
True on a matching record, false with no mutation when absent.

◆ set_subcatch_runoff()

bool openswmm::HotStartFile::set_subcatch_runoff ( const std::string & id,
double v )

Edit the first exact-ID stored subcatchment runoff and mark the file dirty.

Changes only this scalar and dirty flag; does not recompute related depths/heads/volumes, update opaque full engine checkpoints, apply to a live model or flush to disk.

Parameters
[in]idBorrowed byte-exact record ID, case-sensitive; no engine name-index lookup.
[in]vNew subcatchment runoff in cfs; no finite/range validation.
Returns
True on a matching record, false with no mutation when absent.

Member Data Documentation

◆ dirty

bool openswmm::HotStartFile::dirty = false

True if set_*() was called.

◆ engine_checkpoint

std::string openswmm::HotStartFile::engine_checkpoint

V15: complete accepted engine/2D state for qualified native restarts (may be empty from V16)

◆ fv_dry_state

std::string openswmm::HotStartFile::fv_dry_state

V18: named disconnected FV scalar inventories.

◆ gw_hg

std::vector<double> openswmm::HotStartFile::gw_hg

saturated thickness (m)

◆ gw_hu

std::vector<double> openswmm::HotStartFile::gw_hu

unsaturated storage (m of water)

◆ gw_interface

std::vector<std::vector<double> > openswmm::HotStartFile::gw_interface

V12: receiving interface; V13 appends pending/cumulative ET and held surface evaporation.

◆ gw_ledger

std::vector<double> openswmm::HotStartFile::gw_ledger

the cumulative terms (m3): 9, +link since G-X3

◆ gw_m_layers

uint32_t openswmm::HotStartFile::gw_m_layers = 0

◆ gw_n_cells

uint32_t openswmm::HotStartFile::gw_n_cells = 0

G1 (2026-09-07) — V5 block: the two-zone groundwater state.

A run restarted without this reruns the entire wetting history from a dry table, which for an aquifer is not an approximation — the whole point of the kernel is that it has memory measured in seasons. Cells are carried by INDEX, not name, because a mesh has no cell ids; a file whose gw_n_cells does not match the model is reported and skipped rather than applied to the wrong cells.

gw_theta_sigma is layer-major [layer * n_cells + cell], the SoA's own order, and is empty when no cell uses closure B. The ledger terms ride along so a restarted run's continuity check continues the original's instead of starting from zero against a non-zero storage.

◆ gw_sat_mass

std::vector<double> openswmm::HotStartFile::gw_sat_mass

saturated-zone mass

◆ gw_species

std::vector<std::string> openswmm::HotStartFile::gw_species

row names, in file order

T7.5 (2026-09-21) — V6 block: the aquifer's TRANSPORTED tuple.

Without it a restarted run keeps the water table's memory (V5) and throws away what is dissolved in it, which for a plume is the whole state. Species are carried by NAME, not by row index: a row layout depends on [POLLUTANTS], the MSX species list and the AGE / TEMPERATURE switches, any of which can differ between the run that wrote the file and the run that reads it. A species the reader does not have is dropped with a warning; one it has and the file does not simply starts from its [GW_INITIAL_QUALITY] seed.

Both stores are species-major [s * n_cells + cell], the kernel's own order. gw_species_ledger is [s * kGwSpeciesLedgerTerms + t].

◆ gw_species_ledger

std::vector<double> openswmm::HotStartFile::gw_species_ledger

per species, cumulative

◆ gw_theta_sigma

std::vector<double> openswmm::HotStartFile::gw_theta_sigma

closure-B layers, layer-major

◆ gw_transport_state

std::string openswmm::HotStartFile::gw_transport_state

V17: canonical SIGMA chemistry, edge receipts and clocks.

◆ gw_unsat_mass

std::vector<double> openswmm::HotStartFile::gw_unsat_mass

column-store mass

◆ header

HotStartHeader openswmm::HotStartFile::header

◆ kGwSpeciesLedgerTerms

int openswmm::HotStartFile::kGwSpeciesLedgerTerms = 13
staticconstexpr

init, infil_in, node_in, link_in, lateral_net, deep, node_out, link_out, dunne, et, reaction, source_in, source_out — the residual is derived, never stored, so a file can never disagree with itself about it.

◆ link_species

std::vector<double> openswmm::HotStartFile::link_species

◆ links

std::vector<HotStartLinkRecord> openswmm::HotStartFile::links

◆ node_species

std::vector<double> openswmm::HotStartFile::node_species

◆ nodes

std::vector<HotStartNodeRecord> openswmm::HotStartFile::nodes

◆ path

std::string openswmm::HotStartFile::path

File path (for flush-on-close)

◆ snow_state

std::string openswmm::HotStartFile::snow_state

V14: native degree-day and UEB accepted/held states.

◆ species

std::vector<std::string> openswmm::HotStartFile::species

U2 (2026-09-07, D-IQ5) — V4 species block: per-element concentrations for every [POLLUTANTS] entry and every reactions-component species, keyed by NAME so a file applies to a model whose species order differs. node_species / link_species are [element * n + s] with the same element order as nodes / links. Age keeps its per-record field (V3); temperature is not carried (its seed paths are per engine — a follow-up).

◆ subcatches

std::vector<HotStartSubcatchRecord> openswmm::HotStartFile::subcatches

◆ surface_state

std::string openswmm::HotStartFile::surface_state

V16: subcatchment ponded water, groundwater flow and surface quality (StateAccessors::get_surface_state)

◆ warnings

std::vector<std::string> openswmm::HotStartFile::warnings

The documentation for this struct was generated from the following files: