47#ifndef OPENSWMM_ENGINE_NODE_DATA_HPP
48#define OPENSWMM_ENGINE_NODE_DATA_HPP
754 int count() const noexcept {
return static_cast<int>(
type.size()); }
769 const auto un =
static_cast<std::size_t
>(n);
782 depth.assign(un, 0.0);
783 head.assign(un, 0.0);
827 tags.assign(un, std::string{});
870 const auto un =
static_cast<std::size_t
>(n);
871 auto g = [&](
auto& vec,
auto def) { vec.resize(un, def); };
880 g(
is_inlet,
static_cast<uint8_t
>(0));
919 tags.resize(un, std::string{});
974 const auto un =
static_cast<std::size_t
>(n);
975 if (
type.capacity() >= un)
977 auto r = [&](
auto& vec) { vec.reserve(un); };
1065 const auto ui =
static_cast<std::size_t
>(idx);
1066 auto e = [&](
auto& v) {
1068 v.erase(v.begin() +
static_cast<std::ptrdiff_t
>(idx));
1152 const auto base = ui * np;
1153 auto erase2d = [&](
auto& v) {
1154 if (base + np <= v.size())
1155 v.erase(v.begin() +
static_cast<std::ptrdiff_t
>(base),
1156 v.begin() +
static_cast<std::ptrdiff_t
>(base + np));
1168 if (ui <
hrt.size())
1169 hrt.erase(
hrt.begin() +
static_cast<std::ptrdiff_t
>(idx));
1175 const auto base = ui * np;
1179 static_cast<std::ptrdiff_t
>(base + np));
1194 if (n_pollutants > 0) {
1195 auto total =
static_cast<std::size_t
>(
count()) *
static_cast<std::size_t
>(n_pollutants);
1213 if (n_pollutants > 0) {
1214 auto total =
static_cast<std::size_t
>(
count()) *
static_cast<std::size_t
>(n_pollutants);
1215 conc.assign(total, 0.0);
1217 hrt.assign(
static_cast<std::size_t
>(
count()), 0.0);
1237 type.shrink_to_fit();
1249 depth.shrink_to_fit();
1250 head.shrink_to_fit();
1274 conc.shrink_to_fit();
1292 tags.shrink_to_fit();
1339 for (std::size_t i = 0; i <
inflow.size(); ++i) {
1365 const auto n =
depth.size();
1367 for (std::size_t i = 0; i < n; ++i) {
1398 std::fill(
conc.begin(),
conc.end(), 0.0);
Definition ExchangeLaw.hpp:60
StorageShape
Storage-unit surface-area relation.
Definition NodeData.hpp:99
@ CONICAL
Elliptical cone (p1, p2 = base axes, p3 = side slope)
Definition NodeData.hpp:103
@ PYRAMIDAL
Rectangular pyramid (p1 = length, p2 = width, p3 = side slope)
Definition NodeData.hpp:105
@ PARABOLOID
Elliptical paraboloid(p1, p2 = top axes, p3 = height ≠ 0)
Definition NodeData.hpp:104
@ CYLINDRICAL
Elliptical cylinder (p1 = major axis, p2 = minor axis)
Definition NodeData.hpp:102
@ FUNCTIONAL
Area = c + a*d^b.
Definition NodeData.hpp:101
@ STORAGE
Definition LidLayerSpeciesData.hpp:52
@ WEIR
Definition LinkData.hpp:58
OutfallType
Outfall boundary condition type.
Definition NodeData.hpp:71
@ NORMAL
Definition NodeData.hpp:71
@ FREE
Definition NodeData.hpp:71
@ FIXED
Definition NodeData.hpp:71
@ TIDAL
Definition NodeData.hpp:71
NodeType
Node type codes.
Definition NodeData.hpp:65
@ JUNCTION
Definition NodeData.hpp:65
@ DIVIDER
Definition NodeData.hpp:65
DividerType
Flow divider type.
Definition NodeData.hpp:77
@ CUTOFF
Definition NodeData.hpp:78
@ TABULAR
Definition NodeData.hpp:80
@ OVERFLOW_DIV
Renamed from OVERFLOW to avoid macOS math.h macro collision.
Definition NodeData.hpp:79
@ TIMESERIES
Data from an in-file [TIMESERIES].
Definition GageData.hpp:58
@ OUTFALL
tailwater + discharge mechanism, not an exchange law
Definition NodeCoupling2DData.hpp:42
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:125
std::vector< double > coupling_inflow
2D ↔ 1D coupling exchange flow at the node (project flow units).
Definition NodeData.hpp:297
std::vector< double > stat_lat_inflow_vol
Definition NodeData.hpp:702
bool coupling_tuple_temp
Definition NodeData.hpp:372
int count() const noexcept
Number of nodes.
Definition NodeData.hpp:754
std::vector< double > depth
Current water depth above invert (project length units).
Definition NodeData.hpp:223
std::vector< double > invert_elev
Invert elevation (project length units).
Definition NodeData.hpp:138
std::vector< double > ext_inflow
External (timeseries/baseline) inflows (project flow units).
Definition NodeData.hpp:265
std::vector< double > conc_old
Previous-step quality at each node.
Definition NodeData.hpp:473
std::vector< double > iface_inflow
Interface file (upstream model coupling) inflows (project flow units).
Definition NodeData.hpp:274
std::vector< double > coupling_queue
Delivery queue for the 1D↔2D junction exchange (1D units, ft³).
Definition NodeData.hpp:336
std::vector< double > qual_mass_in
Accumulated quality mass inflow rate per (node, pollutant).
Definition NodeData.hpp:381
void save_hyd_state() noexcept
Snapshot depth, volume, inflow and net inflow for a routed hydraulic step.
Definition NodeData.hpp:1334
std::vector< double > stat_vol_flooded
Total volume of water lost as overflow (project volume units).
Definition NodeData.hpp:623
std::vector< double > stat_time_courant_critical
CFL time-step critical count per node.
Definition NodeData.hpp:738
std::vector< double > old_inflow
Total inflow at the previous timestep (for output interpolation).
Definition NodeData.hpp:577
void erase_at(int idx)
Erase one node row from the columns visited by this helper.
Definition NodeData.hpp:1064
std::vector< double > coupling_age_vol_inflow
Definition NodeData.hpp:369
std::vector< double > hrt
Hydraulic residence time for storage nodes (seconds).
Definition NodeData.hpp:476
std::vector< double > old_depth
Depth at the previous timestep.
Definition NodeData.hpp:565
void reset_state() noexcept
Apply initial node depths and clear the hydraulic/quality state visited here.
Definition NodeData.hpp:1364
std::vector< double > qual_vol_in
Accumulated volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:384
std::vector< double > coupling_volume
Pending 1D↔2D exchange VOLUME for the next routing step (1D units, ft³).
Definition NodeData.hpp:312
std::vector< double > old_volume
Volume at the previous timestep.
Definition NodeData.hpp:568
std::vector< double > stat_total_outflow_vol
Definition NodeData.hpp:709
std::vector< uint8_t > aquifer2d_bed
Definition NodeData.hpp:318
std::vector< double > user_conc_mass_flux
User-forced quality mass flux at each node (mass/sec).
Definition NodeData.hpp:487
void reserve_to(int n)
Reserve capacity for n nodes without changing count().
Definition NodeData.hpp:971
std::vector< double > coupling_temp_vol_inflow
Definition NodeData.hpp:370
std::vector< double > coupling_age_vol_queue
S4 — the tuple's age-volume and temperature-volume halves, per node (age·ft³ / °C·ft³ queued; age·ft³...
Definition NodeData.hpp:367
bool coupling_tuple_age
set by SurfaceRouter2D at initialize
Definition NodeData.hpp:371
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition NodeData.hpp:1236
std::vector< double > stat_max_surcharge_height
Definition NodeData.hpp:678
std::vector< double > lid_drain_qual_vol_old
Previous runoff step's lid_drain_qual_vol (the q half of the pair).
Definition NodeData.hpp:446
std::vector< double > stat_max_overflow
Maximum reported overflow rate (project flow units).
Definition NodeData.hpp:641
std::vector< char > rpt_flag
Whether this node is included in report/output (0=no, 1=yes).
Definition NodeData.hpp:613
std::vector< double > outflow
Current total outflow from the node (project flow units).
Definition NodeData.hpp:502
void clearInflowSources() noexcept
Zero routing-phase inflow source arrays.
Definition NodeData.hpp:1412
std::vector< double > dwf_qual_mass
Per-node DWF pollutant mass-rate ADJUSTMENT (mass/sec), net of the global default: row mass (q·patter...
Definition NodeData.hpp:419
std::vector< double > overflow
Current overflow / ponded flow (project flow units).
Definition NodeData.hpp:508
std::vector< double > old_net_inflow
Net inflow from previous timestep (inflow - outflow) for averaging.
Definition NodeData.hpp:538
std::vector< double > stat_storage_max_outflow
Definition NodeData.hpp:698
std::vector< uint8_t > is_virtual
Virtual-junction flag (0 = regular node, 1 = virtual junction).
Definition NodeData.hpp:174
std::vector< double > stat_max_depth_date
Definition NodeData.hpp:662
std::vector< double > stat_max_lat_inflow
Definition NodeData.hpp:688
std::vector< double > stat_outfall_max_flow
Outfall maximum flow (project flow units).
Definition NodeData.hpp:715
std::vector< double > volume
Current water volume (project volume units).
Definition NodeData.hpp:235
std::vector< double > rpt_full_volume
Full volume in the LEGACY convention (legacy Node.fullVolume as node_validate leaves it): 0 for junct...
Definition NodeData.hpp:558
int conc_n_pollutants
Number of pollutants in the quality arrays.
Definition NodeData.hpp:490
std::vector< double > iface_qual_mass
Routing interface file quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:394
std::vector< double > lat_flow
Current lateral inflow (project flow units).
Definition NodeData.hpp:241
std::vector< double > ponded_area
Ponding area at the surface (sq project length units).
Definition NodeData.hpp:162
std::vector< double > storage_area
Physical junction area (ft2); zero retains legacy behavior.
Definition NodeData.hpp:163
std::vector< double > stat_total_inflow_vol
Cumulative total inflow volume at each node (ft3).
Definition NodeData.hpp:705
std::vector< double > stat_storage_max_volume
Maximum stored volume, capped at full volume (ft3).
Definition NodeData.hpp:657
std::vector< double > coupling_temp_vol_queue
Definition NodeData.hpp:368
std::vector< double > sur_depth
Maximum depth allowed at the node (ponding or surcharge limit).
Definition NodeData.hpp:156
std::vector< double > stat_storage_max_volume_date
Date of the first maximum stored volume.
Definition NodeData.hpp:658
std::vector< double > crown_elev
Crown elevation — top of highest connecting conduit (project length units).
Definition NodeData.hpp:520
std::vector< double > stat_max_inflow_date
Definition NodeData.hpp:670
std::vector< double > old_lat_flow
Lateral flow at the previous timestep.
Definition NodeData.hpp:571
std::vector< double > stat_outfall_avg_flow
Outfall cumulative average flow (flow units × reporting periods).
Definition NodeData.hpp:684
std::vector< double > inflow
Current total inflow to the node (project flow units).
Definition NodeData.hpp:496
void save_state() noexcept
Snapshot current state into old-step arrays before solving.
Definition NodeData.hpp:1322
std::vector< double > stat_time_surcharged
Definition NodeData.hpp:674
std::vector< double > stat_max_depth
Maximum reported depth (project length units).
Definition NodeData.hpp:635
std::vector< double > coupling_qual_queue
S3 — species MASS queue for the 2D→1D junction drain, per (node, pollutant), 1D mass units (conc × ft...
Definition NodeData.hpp:352
std::vector< double > lid_drain_qual_load_old
Definition NodeData.hpp:444
std::vector< long > stat_outfall_periods
Outfall number of non-zero flow periods.
Definition NodeData.hpp:721
void resize_loads(int n_pollutants)
Set the pollutant load stride and zero positive-sized load storage.
Definition NodeData.hpp:1192
std::vector< double > conc
Current quality concentration at each node.
Definition NodeData.hpp:470
std::vector< double > ext_qual_mass
Direct external inflow quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:408
std::vector< int > degree
legacy Node.degree: the OUTFLOW-link count (toposort_sortLinks, a reversed conduit counted from its o...
Definition NodeData.hpp:532
std::vector< uint8_t > is_inlet
Inlet-junction flag (0 = plain node, 1 = inlet junction).
Definition NodeData.hpp:186
std::vector< double > lid_drain_qual_vol
LID drain volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:438
std::vector< double > runoff_inflow
Interpolated surface runoff from subcatchments (project flow units).
Definition NodeData.hpp:259
std::vector< double > rim_depth
Rendering-only rim (ground) depth above the invert, project length units. 0 = unset.
Definition NodeData.hpp:202
std::vector< double > dwf_inflow
Dry weather flow inflows (project flow units).
Definition NodeData.hpp:268
std::vector< double > stat_time_flooded
Total duration the node was flooded (seconds).
Definition NodeData.hpp:629
std::vector< std::string > tags
Per-object tag from the INP [TAGS] section.
Definition NodeData.hpp:605
std::vector< double > lid_drain_qual_load
LID drain quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:430
std::vector< double > stat_sum_volume
Definition NodeData.hpp:655
std::vector< double > stat_sum_depth
Definition NodeData.hpp:648
std::vector< double > stat_max_rpt_depth
Definition NodeData.hpp:666
std::vector< double > init_depth
Initial water depth (project length units).
Definition NodeData.hpp:150
std::vector< double > stat_total_load
Cumulative pollutant loads at each node.
Definition NodeData.hpp:746
void resize(int n)
Replace the base node store with a requested row count.
Definition NodeData.hpp:768
void save_lat_qual_state() noexcept
Snapshot lateral inflow and pollutant concentrations every routing step.
Definition NodeData.hpp:1351
std::vector< double > coupling_qual_inflow
S3 — this step's delivered 2D→1D species mass RATE per (node, pollutant) (mass/sec); read by QualityS...
Definition NodeData.hpp:355
std::vector< int > stat_non_converged_count
Count of non-converging steps per node.
Definition NodeData.hpp:729
std::vector< double > full_volume
Full volume at node (project volume units).
Definition NodeData.hpp:544
std::vector< double > stat_max_overflow_date
Date/time when maximum overflow occurred (OADate (days since 12/30/1899)).
Definition NodeData.hpp:644
std::vector< std::string > comments
Object comment from the INP file (lines with a single ';' prefix immediately above this object's data...
Definition NodeData.hpp:592
std::vector< double > losses
Node losses (evaporation + seepage) (project flow units).
Definition NodeData.hpp:514
std::vector< double > lid_drain_inflow
LID drain WATER inflow rate per node (ft3/sec) — the routing twin of lid_drain_qual_vol.
Definition NodeData.hpp:459
void grow_to(int n)
Extend base node columns while preserving existing prefixes.
Definition NodeData.hpp:867
std::vector< NodeType > type
Node type for each node.
Definition NodeData.hpp:132
std::vector< double > full_depth
Full depth of the node (project length units).
Definition NodeData.hpp:144
std::vector< double > stat_max_total_inflow
Definition NodeData.hpp:692
std::vector< double > rdii_inflow
RDII unit hydrograph inflows (project flow units).
Definition NodeData.hpp:271
void resize_quality(int n_pollutants)
Set the pollutant stride and replace positive-sized quality arrays.
Definition NodeData.hpp:1211
std::vector< double > head
Current water surface head (project length units = invert + depth).
Definition NodeData.hpp:229
std::vector< double > gw_inflow
Interpolated groundwater flow from subcatchments (project flow units).
Definition NodeData.hpp:262
std::vector< double > user_lat_flow
User-forced lateral inflow set via the API (project flow units).
Definition NodeData.hpp:250
int stat_n_pollutants
Definition NodeData.hpp:747