25#ifndef OPENSWMM_ENGINE_NODE_DATA_HPP
26#define OPENSWMM_ENGINE_NODE_DATA_HPP
96 std::vector<NodeType>
type;
376 int count() const noexcept {
return static_cast<int>(
type.size()); }
386 const auto un =
static_cast<std::size_t
>(n);
417 depth.assign(un, 0.0);
418 head.assign(un, 0.0);
452 if (n_pollutants > 0) {
453 auto total =
static_cast<std::size_t
>(
count()) *
454 static_cast<std::size_t
>(n_pollutants);
467 for (std::size_t i = 0; i <
inflow.size(); ++i) {
474 const auto n =
depth.size();
476 std::fill(
head.begin(),
head.end(), 0.0);
Definition Controls.cpp:24
OutfallType
Outfall boundary condition type.
Definition NodeData.hpp:53
NodeType
Node type codes.
Definition NodeData.hpp:42
DividerType
Flow divider type.
Definition NodeData.hpp:65
@ OVERFLOW_DIV
Renamed from OVERFLOW to avoid macOS math.h macro collision.
@ TIMESERIES
Data from an in-file [TIMESERIES].
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:89
std::vector< double > stat_lat_inflow_vol
Definition NodeData.hpp:345
int count() const noexcept
Number of nodes.
Definition NodeData.hpp:376
std::vector< double > depth
Current water depth above invert (project length units).
Definition NodeData.hpp:211
std::vector< double > invert_elev
Invert elevation (project length units).
Definition NodeData.hpp:102
std::vector< double > exfil_imd
Green-Ampt initial moisture deficit for exfiltration (0-1).
Definition NodeData.hpp:173
std::vector< std::string > divider_link_name
Diversion link name (for deferred resolution).
Definition NodeData.hpp:198
std::vector< double > stat_vol_flooded
Total volume of water lost as overflow (project volume units).
Definition NodeData.hpp:309
std::vector< double > storage_b
Functional storage area parameter B.
Definition NodeData.hpp:161
std::vector< int > divider_curve
Diversion curve index for TABULAR dividers (-1 = none).
Definition NodeData.hpp:192
std::vector< std::string > divider_curve_name
Diversion curve name (for deferred resolution, TABULAR only).
Definition NodeData.hpp:201
std::vector< double > old_depth
Depth at the previous timestep.
Definition NodeData.hpp:293
void reset_state() noexcept
Zero all state variables (for a cold start).
Definition NodeData.hpp:473
std::vector< double > divider_cd
Weir discharge coefficient for WEIR dividers.
Definition NodeData.hpp:186
std::vector< double > old_volume
Volume at the previous timestep.
Definition NodeData.hpp:296
std::vector< double > exfil_suction
Green-Ampt suction head for exfiltration (in or mm, converted to ft).
Definition NodeData.hpp:169
std::vector< double > outfall_param
Fixed outfall stage or tidal curve / time series index.
Definition NodeData.hpp:140
std::vector< double > storage_a
Functional storage area parameter A (area = A * depth^B + C).
Definition NodeData.hpp:159
std::vector< double > stat_max_overflow
Maximum reported overflow rate (project flow units).
Definition NodeData.hpp:327
std::vector< int > divider_link
Diversion link index (-1 = not set).
Definition NodeData.hpp:195
std::vector< double > outflow
Current total outflow from the node (project flow units).
Definition NodeData.hpp:250
std::vector< double > overflow
Current overflow / ponded flow (project flow units).
Definition NodeData.hpp:256
std::vector< double > old_net_inflow
Net inflow from previous timestep (inflow - outflow) for averaging.
Definition NodeData.hpp:280
std::vector< double > stat_max_lat_inflow
Definition NodeData.hpp:337
std::vector< double > stat_outfall_max_flow
Outfall maximum flow (project flow units).
Definition NodeData.hpp:354
std::vector< double > volume
Current water volume (project volume units).
Definition NodeData.hpp:223
std::vector< double > lat_flow
Current lateral inflow (project flow units).
Definition NodeData.hpp:229
std::vector< double > ponded_area
Ponding area at the surface (sq project length units).
Definition NodeData.hpp:126
std::vector< double > stat_total_inflow_vol
Cumulative total inflow volume at each node (ft3).
Definition NodeData.hpp:348
std::vector< double > sur_depth
Maximum depth allowed at the node (ponding or surcharge limit).
Definition NodeData.hpp:120
std::vector< double > crown_elev
Crown elevation — top of highest connecting conduit (project length units).
Definition NodeData.hpp:268
std::vector< double > old_lat_flow
Lateral flow at the previous timestep.
Definition NodeData.hpp:299
std::vector< double > stat_outfall_avg_flow
Outfall cumulative average flow (flow units × reporting periods).
Definition NodeData.hpp:333
std::vector< double > inflow
Current total inflow to the node (project flow units).
Definition NodeData.hpp:244
void save_state() noexcept
Snapshot current state into old-step arrays before solving.
Definition NodeData.hpp:462
std::vector< double > stat_max_depth
Maximum reported depth (project length units).
Definition NodeData.hpp:321
std::vector< long > stat_outfall_periods
Outfall number of non-zero flow periods.
Definition NodeData.hpp:360
std::vector< int > storage_curve
Storage curve index into TableData (CURVE_STORAGE).
Definition NodeData.hpp:153
void resize_loads(int n_pollutants)
Resize pollutant load arrays after pollutant count is known.
Definition NodeData.hpp:450
std::vector< DividerType > divider_type
Divider method (DividerType enum value).
Definition NodeData.hpp:180
std::vector< double > divider_max_depth
Weir max depth for WEIR dividers.
Definition NodeData.hpp:189
std::vector< bool > outfall_has_flap_gate
True if the outfall has a gated flap.
Definition NodeData.hpp:143
std::vector< int > degree
Node degree — number of connecting links (+ve downstream, -ve upstream terminal).
Definition NodeData.hpp:274
std::vector< double > stat_time_flooded
Total duration the node was flooded (seconds).
Definition NodeData.hpp:315
std::vector< double > init_depth
Initial water depth (project length units).
Definition NodeData.hpp:114
std::vector< double > stat_total_load
Cumulative pollutant loads at each node.
Definition NodeData.hpp:368
void resize(int n)
Resize all arrays to hold exactly n nodes.
Definition NodeData.hpp:385
std::vector< double > storage_seep_rate
Seepage rate from storage node (project units/day).
Definition NodeData.hpp:166
std::vector< double > exfil_ksat
Green-Ampt saturated hydraulic conductivity for exfiltration (in/hr or mm/hr, converted to ft/sec).
Definition NodeData.hpp:171
std::vector< double > full_volume
Full volume at node (project volume units).
Definition NodeData.hpp:286
std::vector< std::string > storage_curve_name
Curve name for deferred resolution (populated during parsing).
Definition NodeData.hpp:156
std::vector< double > losses
Node losses (evaporation + seepage) (project flow units).
Definition NodeData.hpp:262
std::vector< NodeType > type
Node type for each node.
Definition NodeData.hpp:96
std::vector< double > full_depth
Full depth of the node (project length units).
Definition NodeData.hpp:108
std::vector< double > stat_max_total_inflow
Definition NodeData.hpp:341
std::vector< double > storage_c
Functional storage area parameter C (baseline area).
Definition NodeData.hpp:163
std::vector< double > head
Current water surface head (project length units = invert + depth).
Definition NodeData.hpp:217
std::vector< OutfallType > outfall_type
Outfall boundary condition type.
Definition NodeData.hpp:133
std::vector< double > divider_cutoff
Cutoff flow for CUTOFF dividers.
Definition NodeData.hpp:183
std::vector< double > user_lat_flow
User-forced lateral inflow set via the API (project flow units).
Definition NodeData.hpp:238
int stat_n_pollutants
Definition NodeData.hpp:369