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

Complete simulation state snapshot at one output time step. More...

#include <SimulationSnapshot.hpp>

Collaboration diagram for openswmm::SimulationSnapshot:

Public Attributes

double sim_time = 0.0
 Simulation date/time (SWMM DateTime: days since 12/31/1899).
 
std::int64_t wall_time_unix = 0
 Wall-clock Unix timestamp when snapshot was taken.
 
int output_step_index = 0
 Sequential output step index (0-based).
 
int node_count = 0
 Number of nodes.
 
int link_count = 0
 Number of links.
 
int subcatch_count = 0
 Number of subcatchments.
 
int gage_count = 0
 Number of rain gages.
 
int pollut_count = 0
 Number of pollutants.
 
NodeSnapshot nodes
 Node state.
 
LinkSnapshot links
 Link state.
 
SubcatchSnapshot subcatch
 Subcatchment state.
 
GageSnapshot gages
 Gage state.
 
double sys_temperature = 0.0
 Air temperature.
 
double sys_rainfall = 0.0
 Average rainfall over all gages.
 
double sys_snow_depth = 0.0
 Total snow depth.
 
double sys_evap = 0.0
 Total evaporation loss.
 
double sys_infil = 0.0
 Total infiltration loss.
 
double sys_runoff = 0.0
 Total runoff flow.
 
double sys_dw_inflow = 0.0
 Total dry weather inflow.
 
double sys_gw_inflow = 0.0
 Total groundwater inflow.
 
double sys_ii_inflow = 0.0
 Total RDII inflow.
 
double sys_ext_inflow = 0.0
 Total external inflow.
 
double sys_flooding = 0.0
 Total flooding.
 
double sys_outflow = 0.0
 Total outflow.
 
double sys_storage = 0.0
 Total storage volume.
 
double sys_pet = 0.0
 Potential evapotranspiration.
 
bool has_subcatchments = true
 Whether the model has any subcatchments.
 
std::vector< double > node_quality
 Node pollutant concentrations.
 
std::vector< double > link_quality
 Link pollutant concentrations.
 
std::vector< double > subcatch_quality
 Subcatchment pollutant loadings.
 
const std::vector< std::string > * node_ids = nullptr
 Node IDs in index order. Pointer to engine-managed strings.
 
const std::vector< std::string > * link_ids = nullptr
 Link IDs in index order.
 
const std::vector< std::string > * subcatch_ids = nullptr
 Subcatchment IDs in index order.
 
const std::vector< std::string > * gage_ids = nullptr
 Gage IDs in index order.
 
const std::vector< std::string > * pollut_names = nullptr
 Pollutant names in index order.
 
const char * flow_units = nullptr
 Flow unit string (e.g., "CFS", "LPS").
 
const char * length_units = nullptr
 Length unit string (e.g., "FEET", "METERS").
 
int flow_units_code = 0
 Flow units code (FlowUnits enum value: 0=CFS, 3=CMS, etc.).
 
int surface_tri_count = 0
 Number of cells (faces): triangles + quads.
 
int surface_vert_count = 0
 Number of vertices (nodes)
 
int surface_quad_count = 0
 Number of quadrilateral cells (0 = all triangles)
 
int surface_edge_stride = 3
 
std::vector< uint8_t > surface_cell_nv
 
std::vector< double > surface_depth
 Overland flow depth ψ_o (m), per face.
 
std::vector< double > surface_head
 Total head h_o = z_s + ψ_o (m), per face.
 
std::vector< double > surface_grad_hx
 Unlimited head gradient ∂h/∂x, per face.
 
std::vector< double > surface_grad_hy
 Unlimited head gradient ∂h/∂y, per face.
 
std::vector< double > surface_grad_hx_lim
 Slope-limited head gradient ∂h/∂x, per face.
 
std::vector< double > surface_grad_hy_lim
 Slope-limited head gradient ∂h/∂y, per face.
 
std::vector< double > surface_rainfall
 Rainfall intensity (m/s), per face.
 
std::vector< double > surface_coupling_flux
 Coupling flux to SWMM node (m/s, + = into 2D), per face.
 
std::vector< double > surface_net_source
 Net source/sink (m/s), per face.
 
std::vector< double > surface_infil_rate
 Held infiltration loss rate (m/s, ≥ 0), per face — all zero when no [2D_INFILTRATION*] model resolved.
 
std::vector< double > surface_infil_cum
 Cumulative infiltrated depth (m), per face.
 
std::vector< double > surface_rain_cum
 Cumulative rainfall volume (m³), per face.
 
std::vector< double > surface_species_conc
 2D surface species concentration (overland transport S1/S2).
 
int surface_species_count = 0
 
const std::vector< std::string > * surface_species_names = nullptr
 
std::vector< double > surface_edge_flux
 Normal flux through each edge, flat [tri*3+edge].
 
std::vector< double > surface_vert_head
 Reconstructed head at vertices (m) — SOLVER field (dry-cell head = bed)
 
std::vector< double > surface_vert_depth
 SIGNED vertex depth η_v − z_v (m) — wet-masked, wetted-contact-gated render reconstruction; > 0 where water reaches the vertex, 0 = no-data sentinel (older engines also emitted negatives on the dry side of partially wet cells — readers stay negative-tolerant)
 
std::vector< double > surface_face_vx
 Cell-centred velocity X (m/s), per face.
 
std::vector< double > surface_face_vy
 Cell-centred velocity Y (m/s), per face.
 
std::vector< double > surface_continuity_err
 Per-cell continuity residual (m³/s), per face.
 
std::vector< double > surface_stat_max_depth
 Max overland depth ψ_o (m), per face.
 
std::vector< double > surface_stat_max_velocity
 Max cell speed |v| (m/s), per face.
 
std::vector< double > surface_stat_max_cont_err
 Max |continuity residual| (m³/s), per face.
 

Detailed Description

Complete simulation state snapshot at one output time step.

Created by the main simulation thread when output is due, then posted to the IOThread write queue. Plugins receive a const reference to this during IOutputPlugin::update().

Member Data Documentation

◆ flow_units

const char* openswmm::SimulationSnapshot::flow_units = nullptr

Flow unit string (e.g., "CFS", "LPS").

◆ flow_units_code

int openswmm::SimulationSnapshot::flow_units_code = 0

Flow units code (FlowUnits enum value: 0=CFS, 3=CMS, etc.).

◆ gage_count

int openswmm::SimulationSnapshot::gage_count = 0

Number of rain gages.

◆ gage_ids

const std::vector<std::string>* openswmm::SimulationSnapshot::gage_ids = nullptr

Gage IDs in index order.

◆ gages

GageSnapshot openswmm::SimulationSnapshot::gages

Gage state.

◆ has_subcatchments

bool openswmm::SimulationSnapshot::has_subcatchments = true

Whether the model has any subcatchments.

Legacy assigns SYS_TEMPERATURE and SYS_PET — and applies the SI temperature conversion — at the end of output_saveSubcatchResults, which is called only behind if (Nobjects[SUBCATCH] > 0) (output.c:489-490). With no subcatchments both stay at the zero-initialised value of SysResults and are never converted, so a raw 0 is reported whatever the unit system. Carried on the snapshot because the display-unit conversion is where that has to be honoured: the degF->degC conversion is AFFINE, so converting a zero yields -17.78 degC rather than zero.

◆ length_units

const char* openswmm::SimulationSnapshot::length_units = nullptr

Length unit string (e.g., "FEET", "METERS").

◆ link_count

int openswmm::SimulationSnapshot::link_count = 0

Number of links.

◆ link_ids

const std::vector<std::string>* openswmm::SimulationSnapshot::link_ids = nullptr

Link IDs in index order.

◆ link_quality

std::vector<double> openswmm::SimulationSnapshot::link_quality

Link pollutant concentrations.

Layout: [link_index * pollut_count + pollut_index]

◆ links

LinkSnapshot openswmm::SimulationSnapshot::links

Link state.

◆ node_count

int openswmm::SimulationSnapshot::node_count = 0

Number of nodes.

◆ node_ids

const std::vector<std::string>* openswmm::SimulationSnapshot::node_ids = nullptr

Node IDs in index order. Pointer to engine-managed strings.

◆ node_quality

std::vector<double> openswmm::SimulationSnapshot::node_quality

Node pollutant concentrations.

Layout: [node_index * pollut_count + pollut_index] Size: node_count * pollut_count doubles.

◆ nodes

NodeSnapshot openswmm::SimulationSnapshot::nodes

Node state.

◆ output_step_index

int openswmm::SimulationSnapshot::output_step_index = 0

Sequential output step index (0-based).

◆ pollut_count

int openswmm::SimulationSnapshot::pollut_count = 0

Number of pollutants.

◆ pollut_names

const std::vector<std::string>* openswmm::SimulationSnapshot::pollut_names = nullptr

Pollutant names in index order.

◆ sim_time

double openswmm::SimulationSnapshot::sim_time = 0.0

Simulation date/time (SWMM DateTime: days since 12/31/1899).

◆ subcatch

SubcatchSnapshot openswmm::SimulationSnapshot::subcatch

Subcatchment state.

◆ subcatch_count

int openswmm::SimulationSnapshot::subcatch_count = 0

Number of subcatchments.

◆ subcatch_ids

const std::vector<std::string>* openswmm::SimulationSnapshot::subcatch_ids = nullptr

Subcatchment IDs in index order.

◆ subcatch_quality

std::vector<double> openswmm::SimulationSnapshot::subcatch_quality

Subcatchment pollutant loadings.

◆ surface_cell_nv

std::vector<uint8_t> openswmm::SimulationSnapshot::surface_cell_nv

Vertices per cell (3 or 4), sized surface_tri_count. Empty when the mesh is all triangles (consumers may treat empty as "all 3").

◆ surface_continuity_err

std::vector<double> openswmm::SimulationSnapshot::surface_continuity_err

Per-cell continuity residual (m³/s), per face.

◆ surface_coupling_flux

std::vector<double> openswmm::SimulationSnapshot::surface_coupling_flux

Coupling flux to SWMM node (m/s, + = into 2D), per face.

◆ surface_depth

std::vector<double> openswmm::SimulationSnapshot::surface_depth

Overland flow depth ψ_o (m), per face.

◆ surface_edge_flux

std::vector<double> openswmm::SimulationSnapshot::surface_edge_flux

Normal flux through each edge, flat [tri*3+edge].

◆ surface_edge_stride

int openswmm::SimulationSnapshot::surface_edge_stride = 3

Edge slots per cell row in surface_edge_flux (3 | 4)

◆ surface_face_vx

std::vector<double> openswmm::SimulationSnapshot::surface_face_vx

Cell-centred velocity X (m/s), per face.

◆ surface_face_vy

std::vector<double> openswmm::SimulationSnapshot::surface_face_vy

Cell-centred velocity Y (m/s), per face.

◆ surface_grad_hx

std::vector<double> openswmm::SimulationSnapshot::surface_grad_hx

Unlimited head gradient ∂h/∂x, per face.

◆ surface_grad_hx_lim

std::vector<double> openswmm::SimulationSnapshot::surface_grad_hx_lim

Slope-limited head gradient ∂h/∂x, per face.

◆ surface_grad_hy

std::vector<double> openswmm::SimulationSnapshot::surface_grad_hy

Unlimited head gradient ∂h/∂y, per face.

◆ surface_grad_hy_lim

std::vector<double> openswmm::SimulationSnapshot::surface_grad_hy_lim

Slope-limited head gradient ∂h/∂y, per face.

◆ surface_head

std::vector<double> openswmm::SimulationSnapshot::surface_head

Total head h_o = z_s + ψ_o (m), per face.

◆ surface_infil_cum

std::vector<double> openswmm::SimulationSnapshot::surface_infil_cum

Cumulative infiltrated depth (m), per face.

◆ surface_infil_rate

std::vector<double> openswmm::SimulationSnapshot::surface_infil_rate

Held infiltration loss rate (m/s, ≥ 0), per face — all zero when no [2D_INFILTRATION*] model resolved.

◆ surface_net_source

std::vector<double> openswmm::SimulationSnapshot::surface_net_source

Net source/sink (m/s), per face.

◆ surface_quad_count

int openswmm::SimulationSnapshot::surface_quad_count = 0

Number of quadrilateral cells (0 = all triangles)

◆ surface_rain_cum

std::vector<double> openswmm::SimulationSnapshot::surface_rain_cum

Cumulative rainfall volume (m³), per face.

◆ surface_rainfall

std::vector<double> openswmm::SimulationSnapshot::surface_rainfall

Rainfall intensity (m/s), per face.

◆ surface_species_conc

std::vector<double> openswmm::SimulationSnapshot::surface_species_conc

2D surface species concentration (overland transport S1/S2).

Layout: [species * surface_tri_count + face], species-major to match the engine's own cell store. surface_species_count rows in the 1D row order (pollutants, MSX, age, temperature — see surface_species_names). A dry cell reports 0 (its mass is held, not divided). Empty when the model carries no 2D transport.

◆ surface_species_count

int openswmm::SimulationSnapshot::surface_species_count = 0

◆ surface_species_names

const std::vector<std::string>* openswmm::SimulationSnapshot::surface_species_names = nullptr

S4: the 2D row names in row order (pollutant ids, MSX ids, __WATER_AGE__, __TEMPERATURE__) — surface_species_count entries. Null before S4 / when 2D transport is off; consumers fall back to pollut_names.

◆ surface_stat_max_cont_err

std::vector<double> openswmm::SimulationSnapshot::surface_stat_max_cont_err

Max |continuity residual| (m³/s), per face.

◆ surface_stat_max_depth

std::vector<double> openswmm::SimulationSnapshot::surface_stat_max_depth

Max overland depth ψ_o (m), per face.

◆ surface_stat_max_velocity

std::vector<double> openswmm::SimulationSnapshot::surface_stat_max_velocity

Max cell speed |v| (m/s), per face.

◆ surface_tri_count

int openswmm::SimulationSnapshot::surface_tri_count = 0

Number of cells (faces): triangles + quads.

◆ surface_vert_count

int openswmm::SimulationSnapshot::surface_vert_count = 0

Number of vertices (nodes)

◆ surface_vert_depth

std::vector<double> openswmm::SimulationSnapshot::surface_vert_depth

SIGNED vertex depth η_v − z_v (m) — wet-masked, wetted-contact-gated render reconstruction; > 0 where water reaches the vertex, 0 = no-data sentinel (older engines also emitted negatives on the dry side of partially wet cells — readers stay negative-tolerant)

◆ surface_vert_head

std::vector<double> openswmm::SimulationSnapshot::surface_vert_head

Reconstructed head at vertices (m) — SOLVER field (dry-cell head = bed)

◆ sys_dw_inflow

double openswmm::SimulationSnapshot::sys_dw_inflow = 0.0

Total dry weather inflow.

◆ sys_evap

double openswmm::SimulationSnapshot::sys_evap = 0.0

Total evaporation loss.

◆ sys_ext_inflow

double openswmm::SimulationSnapshot::sys_ext_inflow = 0.0

Total external inflow.

◆ sys_flooding

double openswmm::SimulationSnapshot::sys_flooding = 0.0

Total flooding.

◆ sys_gw_inflow

double openswmm::SimulationSnapshot::sys_gw_inflow = 0.0

Total groundwater inflow.

◆ sys_ii_inflow

double openswmm::SimulationSnapshot::sys_ii_inflow = 0.0

Total RDII inflow.

◆ sys_infil

double openswmm::SimulationSnapshot::sys_infil = 0.0

Total infiltration loss.

◆ sys_outflow

double openswmm::SimulationSnapshot::sys_outflow = 0.0

Total outflow.

◆ sys_pet

double openswmm::SimulationSnapshot::sys_pet = 0.0

Potential evapotranspiration.

◆ sys_rainfall

double openswmm::SimulationSnapshot::sys_rainfall = 0.0

Average rainfall over all gages.

◆ sys_runoff

double openswmm::SimulationSnapshot::sys_runoff = 0.0

Total runoff flow.

◆ sys_snow_depth

double openswmm::SimulationSnapshot::sys_snow_depth = 0.0

Total snow depth.

◆ sys_storage

double openswmm::SimulationSnapshot::sys_storage = 0.0

Total storage volume.

◆ sys_temperature

double openswmm::SimulationSnapshot::sys_temperature = 0.0

Air temperature.

◆ wall_time_unix

std::int64_t openswmm::SimulationSnapshot::wall_time_unix = 0

Wall-clock Unix timestamp when snapshot was taken.


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