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

Structure-of-Arrays storage for all links. More...

#include <LinkData.hpp>

Collaboration diagram for openswmm::LinkData:

Public Member Functions

void add_lstep_sample (int j, double dt, double dur, double rs) noexcept
 Accumulate one link-local step sample weighted by simulated duration.
 
int count () const noexcept
 Count link rows from the type column.
 
void resize (int n)
 Replace the base link store with a requested row count.
 
void grow_to (int n)
 Extend base link columns while preserving existing prefixes.
 
void reserve_to (int n)
 Reserve capacity for n links without changing count().
 
void erase_at (int idx)
 Erase one link row from the columns visited by this helper.
 
void resize_loads (int n_pollutants)
 Set the pollutant load stride and zero positive-sized load storage.
 
void resize_quality (int n_pollutants)
 Set the pollutant stride and replace positive-sized quality arrays.
 
void shrink_to_fit ()
 Release excess vector capacity accumulated during parsing.
 
void save_state () noexcept
 Snapshot both hydraulic and quality link state.
 
void save_hyd_state () noexcept
 Snapshot current link flow, depth and volume for a routed step.
 
void save_qual_state () noexcept
 Legacy link_setOldQualState — every routing step.
 
void reset_state () noexcept
 Clear the link dynamic arrays visited here for a cold start.
 

Static Public Member Functions

static int lstep_bin (double dt, double rs) noexcept
 Classify a local routing duration into five relative log2 bins.
 

Public Attributes

std::vector< LinkType > type
 Link type.
 
std::vector< int > node1
 Upstream node index.
 
std::vector< int > node2
 Downstream node index.
 
std::vector< double > offset1
 Link offset at upstream node (project length units above invert).
 
std::vector< double > offset2
 Link offset at downstream node.
 
std::vector< double > q0
 Initial flow rate (project flow units).
 
std::vector< double > q_limit
 Maximum allowable flow rate (project flow units, 0 = unlimited).
 
std::vector< XsectShape > xsect_shape
 Cross-section shape.
 
std::vector< double > xsect_y_full
 Full depth of cross-section (project length units).
 
std::vector< double > xsect_a_full
 Full-flow area of cross-section (sq project length units).
 
std::vector< double > xsect_w_max
 Full hydraulic width of cross-section.
 
std::vector< double > xsect_geom1
 Raw [XSECTIONS] geometry parameters as supplied (display units), retained purely for lossless serialization.
 
std::vector< double > xsect_geom2
 
std::vector< double > xsect_geom3
 
std::vector< double > xsect_geom4
 
std::vector< int > xsect_curve
 Shape curve index (for IRREGULAR / CUSTOM shapes).
 
std::vector< double > xsect_r_full
 Full-pipe hydraulic radius.
 
std::vector< double > xsect_s_full
 Full-pipe section factor.
 
std::vector< double > xsect_s_max
 Maximum section factor (at depth of max conveyance).
 
std::vector< double > xsect_y_bot
 Bottom depth for FILLED_CIRCULAR, RECT_TRIANG, RECT_ROUND shapes.
 
std::vector< double > xsect_a_bot
 Bottom area for FILLED_CIRCULAR, RECT_TRIANG shapes.
 
std::vector< double > xsect_s_bot
 Multi-purpose shape param: side slope (RECT_TRIANG), C-factor (FORCE_MAIN), number of open sides (RECT_OPEN), etc.
 
std::vector< double > xsect_r_bot
 Multi-purpose shape param: wall length (RECT_TRIANG), wetted perimeter (FILLED_CIRCULAR).
 
std::vector< double > xsect_yw_max
 Depth at maximum width.
 
std::vector< int > xsect_batch_shape
 Cached batch (XSectBatch) shape code, translated from XsectShape at init.
 
std::vector< double > setting
 Current link setting (0-1 for pumps/orifices/weirs, 1.0 default for conduits).
 
std::vector< double > target_setting
 Target setting from control rules.
 
std::vector< double > time_last_set
 Absolute date (decimal days) when target_setting last crossed an open<->closed boundary. Consulted by the control engine for LINK_TIMEOPEN / LINK_TIMECLOSED premises. Updated by the routing layer (SWMMEngine::stepRouting) only on open<->closed transitions, matching legacy routing.c:295-299.
 
std::vector< int > direction
 Flow direction: +1 = node1→node2, -1 = reversed.
 
std::vector< std::string > pump_curve_name
 Pump curve name (for deferred resolution).
 
std::vector< uint8_t > has_flap_gate
 Flap gate on this conduit (uint8_t: 0=no, 1=yes).
 
std::vector< double > dqdh
 Derivative dQ/dH for inlet-controlled culvert flow.
 
std::vector< double > flow
 Current flow rate (project flow units, +ve = node1→node2).
 
std::vector< double > kw_inflow
 
std::vector< double > depth
 Current water depth at midpoint (project length units).
 
std::vector< double > volume
 Current full-flow volume (project volume units).
 
std::vector< double > slot_volume
 Portion of volume held in the Preissmann slot (ft³).
 
std::vector< double > stat_slot_vol_dt
 ∫ slot_volume dt over the run (ft³·s).
 
std::vector< double > stat_vol_dt
 ∫ volume dt over the run (ft³·s) — the share denominator.
 
std::vector< double > stat_peak_slot_share
 Peak instantaneous slot share (slot_volume/volume, 0..1).
 
std::vector< double > stat_time_slot_above
 Time (s) the instantaneous slot share exceeded 1 %.
 
std::vector< double > froude
 Current froude number (absolute).
 
std::vector< FlowClass > flow_class
 Current flow class (DRY, SUBCRITICAL, etc.).
 
std::vector< uint8_t > is_closed
 True if the link is closed by a control rule (uint8_t: 0=no, 1=yes).
 
std::vector< double > old_flow
 Flow at the previous timestep.
 
std::vector< double > old_depth
 Depth at the previous timestep.
 
std::vector< double > old_volume
 Volume at the previous timestep.
 
std::vector< double > conc
 Current quality concentration in each link.
 
std::vector< double > conc_old
 Previous-step quality in each link.
 
int conc_n_pollutants = 0
 Number of pollutants in the quality arrays.
 
std::vector< std::string > comments
 Object comment from the INP file (';'-prefixed lines immediately above this link's data row), joined by literal "\\n". Empty string means no comment.
 
std::vector< std::string > tags
 Per-object tag from the INP [TAGS] section.
 
std::vector< char > rpt_flag
 Whether this link is included in report/output (0=no, 1=yes).
 
std::vector< double > stat_vol_flow
 Total volume conveyed by this link (project volume units).
 
std::vector< double > stat_max_flow
 Maximum reported flow rate (project flow units).
 
std::vector< double > stat_max_veloc
 Maximum reported flow velocity (project length/time units).
 
std::vector< double > stat_max_filling
 Maximum reported filling ratio (depth / full depth).
 
std::vector< double > stat_time_surcharged
 Total duration of surcharge (seconds).
 
std::vector< double > stat_flow_class
 Seconds in each flow class (legacy timeInFlowClass)
 
std::vector< double > stat_norm_ltd
 Seconds normal-flow limited (legacy timeNormalFlow)
 
std::vector< double > stat_inlet_ctrl
 Seconds under inlet control (legacy timeInletControl)
 
std::vector< double > stat_max_flow_date
 
std::vector< double > stat_time_full_upstream
 
std::vector< double > stat_time_full_dnstream
 
std::vector< double > stat_time_full_both
 
std::vector< double > stat_time_capacity_limited
 
std::vector< double > stat_total_load
 Cumulative pollutant loads transported through each link.
 
int stat_n_pollutants = 0
 
std::vector< int > stat_pump_cycles
 Number of pump on→off + off→on transitions per pump.
 
std::vector< double > stat_pump_on_time
 Time pump was running (seconds).
 
std::vector< double > stat_pump_volume
 Total volume pumped (ft³).
 
std::vector< double > stat_pump_energy
 Total pump energy consumed (kWh).
 
std::vector< double > stat_pump_sum_flow
 Sum of active-period flows for legacy arithmetic mean (CFS).
 
std::vector< long > stat_pump_periods
 Count of active routing periods.
 
std::vector< double > stat_pump_off_curve_low
 Active seconds below the pump curve range.
 
std::vector< double > stat_pump_off_curve_high
 Active seconds above the pump curve range.
 
std::vector< bool > stat_pump_was_on
 Previous pump state for cycle detection (true = on).
 
std::vector< long > stat_flow_turns
 Count of flow direction reversals per link.
 
std::vector< int > stat_flow_turn_sign
 Sign of previous flow change for flow-turn detection.
 
std::vector< double > stat_time_courant_critical
 CFL time-step critical count per link.
 
std::vector< double > stat_lstep_min
 Smallest local step (0 = no sample)
 
std::vector< double > stat_lstep_max
 Largest local step.
 
std::vector< double > stat_lstep_dt_time
 Sum of step * duration.
 
std::vector< double > stat_lstep_time
 Sum of duration.
 
std::vector< double > stat_lstep_bin_time
 Flat 2D [link * N_LSTEP_BINS + bin], duration.
 
std::vector< long > stat_conv_steps
 DW steps with both end nodes converged.
 
std::vector< long > stat_conv_total
 DW steps sampled for convergence.
 

Static Public Attributes

static constexpr int N_FLOW_CLASSES = 7
 Per-link flow classification step counts.
 
static constexpr int N_LSTEP_BINS = 5
 Number of log2 step bins: (RS/2,RS], (RS/4,RS/2], ..., (0,RS/16].
 

Detailed Description

Structure-of-Arrays storage for all links.

All arrays indexed by link index [0, count). Use SimulationContext::link_names to translate name → index.

Member Function Documentation

◆ add_lstep_sample()

void openswmm::LinkData::add_lstep_sample ( int j,
double dt,
double dur,
double rs )
inlinenoexcept

Accumulate one link-local step sample weighted by simulated duration.

Updates min/max, sum(dt*dur), sum(dur) and duration in one log2 bin. No bounds, finite-value or report-option check.

Parameters
[in]jExisting link index with all local-step statistic arrays allocated/aligned.
[in]dtLocal time-step duration in seconds; caller supplies finite positive input.
[in]durSimulated time represented by this sample in seconds; caller supplies finite nonnegative input.
[in]rsPositive reference routing step in seconds for histogram binning.
Here is the call graph for this function:

◆ count()

int openswmm::LinkData::count ( ) const
inlinenoexcept

Count link rows from the type column.

Returns
type.size() converted to int; does not inspect names, subtype stores or parallel-column alignment.
Here is the caller graph for this function:

◆ erase_at()

void openswmm::LinkData::erase_at ( int idx)
inline

Erase one link row from the columns visited by this helper.

Visits owned base columns plus flow-class, local-step histogram, quality and load strides when present. Caller separately repairs subtype rows, topology references, names and spatial geometry; no engine lifecycle check occurs here. Following rows shift down and element references/iterators are invalidated. Does not make inconsistent stores transactional.

Parameters
[in]idxCaller-validated existing row index; aligned dimensions and representable size products required.
Here is the caller graph for this function:

◆ grow_to()

void openswmm::LinkData::grow_to ( int n)
inline

Extend base link columns while preserving existing prefixes.

New rows use the corresponding resize() defaults. Does not grow flattened pollutant matrices, name indexes, subtype stores or spatial arrays; caller resizes those separately. Requires initially aligned columns and valid size products; allocation failure can interrupt extension.

Parameters
[in]nRequested total count; <=count() is a no-op, including negatives.
Here is the call graph for this function:

◆ lstep_bin()

static int openswmm::LinkData::lstep_bin ( double dt,
double rs )
inlinestaticnoexcept

Classify a local routing duration into five relative log2 bins.

No validation; values above rs also enter bin zero, and nonpositive steps fall into the last bin for positive rs.

Parameters
[in]dtLocal step in seconds; expected finite positive.
[in]rsReference routing step in seconds; expected finite positive.
Returns
Bin 0..N_LSTEP_BINS-1; ties at rs/2^k enter the smaller-step bin.
Here is the caller graph for this function:

◆ reserve_to()

void openswmm::LinkData::reserve_to ( int n)
inline

Reserve capacity for n links without changing count().

Parsing grows these arrays one row at a time via grow_to(), so each of the ~65 parallel vectors reallocates and copies O(log n) times over a section — the dominant memory traffic in handler dispatch on a large model.

This reserves capacity only. It deliberately does NOT resize: count() is the vector size, and PostParseResolver compares it against the final name count and calls resize() when they differ — a call with destructive assign semantics. Growing the SIZE speculatively here would trip that path and wipe parsed data. Capacity is invisible to all of it.

Over-reserving is harmless, so callers pass the section's row count as an upper bound.

Parameters
[in]nNonnegative target capacity for the base columns; flat-array products must fit size_t.
Note
Capacity requests can allocate/throw and invalidate element references. They do not grow sizes or synchronize external name/spatial/subtype data.
Here is the caller graph for this function:

◆ reset_state()

void openswmm::LinkData::reset_state ( )
inlinenoexcept

Clear the link dynamic arrays visited here for a cold start.

Zeroes flow/kinematic inflow/depth/volume/Froude, old flow/depth/volume and pollutant concentrations; flow_class becomes DRY. Leaves settings, closure flags, slot state, static geometry and accumulated statistics unchanged. Runtime initialization completes solver-specific state.

◆ resize()

void openswmm::LinkData::resize ( int n)
inline

Replace the base link store with a requested row count.

Replaces base-link geometry/state/statistic columns with defaults: CONDUIT, CIRCULAR, unresolved end nodes/curve, setting/target=1 and direction=1. pump_curve_name uses resize and preserves its retained prefix; concentration and pollutant load matrices require separate sizing. Names, subtype rows and spatial geometry are external. Independent assignments can fail without rollback; borrowed elements may be invalidated.

Parameters
[in]nNonnegative row count; unchecked conversion to size_t, with valid size products for flat statistics.
Here is the caller graph for this function:

◆ resize_loads()

void openswmm::LinkData::resize_loads ( int n_pollutants)
inline

Set the pollutant load stride and zero positive-sized load storage.

Always assigns stat_n_pollutants. Nonpositive counts preserve the existing stat_total_load vector rather than clearing it. Does not resize concentration state or update names.

Parameters
[in]n_pollutantsPollutants per link; positive count sizes count()*n_pollutants, product must fit size_t.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize_quality()

void openswmm::LinkData::resize_quality ( int n_pollutants)
inline

Set the pollutant stride and replace positive-sized quality arrays.

Always stores conc_n_pollutants; nonpositive counts leave existing vectors unchanged. Zeroes current and old pollutant concentrations only. Allocation failure may leave partial assignments. No pollutant registry update or initial-concentration seeding.

Parameters
[in]n_pollutantsPollutants per link; positive count requires count()*n_pollutants to fit size_t.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_hyd_state()

void openswmm::LinkData::save_hyd_state ( )
inlinenoexcept

Snapshot current link flow, depth and volume for a routed step.

Copies to old_flow/old_depth/old_volume without allocation; all destination lengths must match. Skip this call when steady routing is bypassed to preserve the old/new report pair.

Here is the caller graph for this function:

◆ save_qual_state()

void openswmm::LinkData::save_qual_state ( )
inlinenoexcept

Legacy link_setOldQualState — every routing step.

Here is the caller graph for this function:

◆ save_state()

void openswmm::LinkData::save_state ( )
inlinenoexcept

Snapshot both hydraulic and quality link state.

Calls save_hyd_state and save_qual_state; destination old arrays must already be allocated to source lengths. Engine steady-step scheduling may require calling the halves separately.

Here is the call graph for this function:

◆ shrink_to_fit()

void openswmm::LinkData::shrink_to_fit ( )
inline

Release excess vector capacity accumulated during parsing.

Member Data Documentation

◆ comments

std::vector<std::string> openswmm::LinkData::comments

Object comment from the INP file (';'-prefixed lines immediately above this link's data row), joined by literal "\\n". Empty string means no comment.

◆ conc

std::vector<double> openswmm::LinkData::conc

Current quality concentration in each link.

Size = n_links * n_pollutants.

See also
Legacy: Link[i].newQual[]

◆ conc_n_pollutants

int openswmm::LinkData::conc_n_pollutants = 0

Number of pollutants in the quality arrays.

◆ conc_old

std::vector<double> openswmm::LinkData::conc_old

Previous-step quality in each link.

◆ depth

std::vector<double> openswmm::LinkData::depth

Current water depth at midpoint (project length units).

See also
Legacy: Link[i].newDepth

◆ direction

std::vector<int> openswmm::LinkData::direction

Flow direction: +1 = node1→node2, -1 = reversed.

See also
Legacy: Link[j].direction

◆ dqdh

std::vector<double> openswmm::LinkData::dqdh

Derivative dQ/dH for inlet-controlled culvert flow.

See also
Legacy: Link[j].dqdh

◆ flow

std::vector<double> openswmm::LinkData::flow

Current flow rate (project flow units, +ve = node1→node2).

See also
Legacy: Link[i].newFlow

◆ flow_class

std::vector<FlowClass> openswmm::LinkData::flow_class

Current flow class (DRY, SUBCRITICAL, etc.).

◆ froude

std::vector<double> openswmm::LinkData::froude

Current froude number (absolute).

See also
Legacy: Link[i].froude

◆ has_flap_gate

std::vector<uint8_t> openswmm::LinkData::has_flap_gate

Flap gate on this conduit (uint8_t: 0=no, 1=yes).

See also
Legacy: Link[j].hasFlapGate

◆ is_closed

std::vector<uint8_t> openswmm::LinkData::is_closed

True if the link is closed by a control rule (uint8_t: 0=no, 1=yes).

◆ kw_inflow

std::vector<double> openswmm::LinkData::kw_inflow

Kinematic-wave accepted upstream flow, all barrels (cfs). Published by each hydraulic solve before transport; not persisted in hotstarts.

◆ N_FLOW_CLASSES

int openswmm::LinkData::N_FLOW_CLASSES = 7
staticconstexpr

Per-link flow classification step counts.

Flat 2D: [link * N_FLOW_CLASSES + class], where N_FLOW_CLASSES = 7. Indexed by FlowClass enum (DRY=0..DN_CRITICAL=6).

See also
Legacy: LinkStats[i].timeInFlowClass[]

◆ N_LSTEP_BINS

int openswmm::LinkData::N_LSTEP_BINS = 5
staticconstexpr

Number of log2 step bins: (RS/2,RS], (RS/4,RS/2], ..., (0,RS/16].

◆ node1

std::vector<int> openswmm::LinkData::node1

Upstream node index.

See also
Legacy: Link[i].node1

◆ node2

std::vector<int> openswmm::LinkData::node2

Downstream node index.

See also
Legacy: Link[i].node2

◆ offset1

std::vector<double> openswmm::LinkData::offset1

Link offset at upstream node (project length units above invert).

See also
Legacy: Link[i].offset1

◆ offset2

std::vector<double> openswmm::LinkData::offset2

Link offset at downstream node.

See also
Legacy: Link[i].offset2

◆ old_depth

std::vector<double> openswmm::LinkData::old_depth

Depth at the previous timestep.

◆ old_flow

std::vector<double> openswmm::LinkData::old_flow

Flow at the previous timestep.

◆ old_volume

std::vector<double> openswmm::LinkData::old_volume

Volume at the previous timestep.

◆ pump_curve_name

std::vector<std::string> openswmm::LinkData::pump_curve_name

Pump curve name (for deferred resolution).

◆ q0

std::vector<double> openswmm::LinkData::q0

Initial flow rate (project flow units).

See also
Legacy: Link[i].q0

◆ q_limit

std::vector<double> openswmm::LinkData::q_limit

Maximum allowable flow rate (project flow units, 0 = unlimited).

See also
Legacy: Link[i].qLimit

◆ rpt_flag

std::vector<char> openswmm::LinkData::rpt_flag

Whether this link is included in report/output (0=no, 1=yes).

See also
Legacy: Link[j].rptFlag

◆ setting

std::vector<double> openswmm::LinkData::setting

Current link setting (0-1 for pumps/orifices/weirs, 1.0 default for conduits).

See also
Legacy: Link[j].setting

◆ slot_volume

std::vector<double> openswmm::LinkData::slot_volume

Portion of volume held in the Preissmann slot (ft³).

FV routing only — Σ max(0, cell_a − a_crown)·dx per conduit (Router::publishFv). Always a subset of volume; stays 0.0 under the dynamic-wave router and below the pipe crown. No legacy counterpart: legacy never separates slot storage.

◆ stat_conv_steps

std::vector<long> openswmm::LinkData::stat_conv_steps

DW steps with both end nodes converged.

◆ stat_conv_total

std::vector<long> openswmm::LinkData::stat_conv_total

DW steps sampled for convergence.

◆ stat_flow_class

std::vector<double> openswmm::LinkData::stat_flow_class

Seconds in each flow class (legacy timeInFlowClass)

◆ stat_flow_turn_sign

std::vector<int> openswmm::LinkData::stat_flow_turn_sign

Sign of previous flow change for flow-turn detection.

+1 or -1 indicating the sign of (newFlow - oldFlow) at the previous routing step (matching legacy LinkStats[i].flowTurnSign).

See also
Legacy: stats_updateLinkStats()

◆ stat_flow_turns

std::vector<long> openswmm::LinkData::stat_flow_turns

Count of flow direction reversals per link.

Incremented when the sign of (newFlow - oldFlow) reverses and the magnitude exceeds 0.001 (matching legacy LinkStats[i].flowTurns).

See also
Legacy: stats_updateLinkStats()

◆ stat_inlet_ctrl

std::vector<double> openswmm::LinkData::stat_inlet_ctrl

Seconds under inlet control (legacy timeInletControl)

◆ stat_lstep_bin_time

std::vector<double> openswmm::LinkData::stat_lstep_bin_time

Flat 2D [link * N_LSTEP_BINS + bin], duration.

◆ stat_lstep_dt_time

std::vector<double> openswmm::LinkData::stat_lstep_dt_time

Sum of step * duration.

◆ stat_lstep_max

std::vector<double> openswmm::LinkData::stat_lstep_max

Largest local step.

◆ stat_lstep_min

std::vector<double> openswmm::LinkData::stat_lstep_min

Smallest local step (0 = no sample)

◆ stat_lstep_time

std::vector<double> openswmm::LinkData::stat_lstep_time

Sum of duration.

◆ stat_max_filling

std::vector<double> openswmm::LinkData::stat_max_filling

Maximum reported filling ratio (depth / full depth).

See also
Legacy: LinkStats[i].maxFroude

◆ stat_max_flow

std::vector<double> openswmm::LinkData::stat_max_flow

Maximum reported flow rate (project flow units).

See also
Legacy: LinkStats[i].maxFlow

◆ stat_max_flow_date

std::vector<double> openswmm::LinkData::stat_max_flow_date

Date/time when maximum flow occurred (OADate (days since 12/30/1899)).

See also
Legacy: LinkStats[i].maxFlowDate

◆ stat_max_veloc

std::vector<double> openswmm::LinkData::stat_max_veloc

Maximum reported flow velocity (project length/time units).

See also
Legacy: LinkStats[i].maxVeloc

◆ stat_n_pollutants

int openswmm::LinkData::stat_n_pollutants = 0

◆ stat_norm_ltd

std::vector<double> openswmm::LinkData::stat_norm_ltd

Seconds normal-flow limited (legacy timeNormalFlow)

◆ stat_peak_slot_share

std::vector<double> openswmm::LinkData::stat_peak_slot_share

Peak instantaneous slot share (slot_volume/volume, 0..1).

◆ stat_pump_cycles

std::vector<int> openswmm::LinkData::stat_pump_cycles

Number of pump on→off + off→on transitions per pump.

◆ stat_pump_energy

std::vector<double> openswmm::LinkData::stat_pump_energy

Total pump energy consumed (kWh).

See also
Legacy PumpStats[].energy, computed as link_getPower(j) * dt / 3600 where link_getPower = |dh| * |q| / 8.814 * KWperHP.

◆ stat_pump_off_curve_high

std::vector<double> openswmm::LinkData::stat_pump_off_curve_high

Active seconds above the pump curve range.

◆ stat_pump_off_curve_low

std::vector<double> openswmm::LinkData::stat_pump_off_curve_low

Active seconds below the pump curve range.

◆ stat_pump_on_time

std::vector<double> openswmm::LinkData::stat_pump_on_time

Time pump was running (seconds).

◆ stat_pump_periods

std::vector<long> openswmm::LinkData::stat_pump_periods

Count of active routing periods.

◆ stat_pump_sum_flow

std::vector<double> openswmm::LinkData::stat_pump_sum_flow

Sum of active-period flows for legacy arithmetic mean (CFS).

◆ stat_pump_volume

std::vector<double> openswmm::LinkData::stat_pump_volume

Total volume pumped (ft³).

◆ stat_pump_was_on

std::vector<bool> openswmm::LinkData::stat_pump_was_on

Previous pump state for cycle detection (true = on).

◆ stat_slot_vol_dt

std::vector<double> openswmm::LinkData::stat_slot_vol_dt

∫ slot_volume dt over the run (ft³·s).

◆ stat_time_capacity_limited

std::vector<double> openswmm::LinkData::stat_time_capacity_limited

Time above full normal flow (seconds).

See also
Legacy: LinkStats[i].timeCapacityLimited

◆ stat_time_courant_critical

std::vector<double> openswmm::LinkData::stat_time_courant_critical

CFL time-step critical count per link.

Incremented when the link's CFL condition produces the smallest adaptive timestep (matching legacy LinkStats[i].timeCourantCritical).

See also
Legacy: stats_updateCriticalTimeCount()

◆ stat_time_full_both

std::vector<double> openswmm::LinkData::stat_time_full_both

Time flowing at or above full normal flow (seconds).

See also
Legacy: LinkStats[i].timeFullFlow

◆ stat_time_full_dnstream

std::vector<double> openswmm::LinkData::stat_time_full_dnstream

Time of downstream surcharge (seconds).

See also
Legacy: LinkStats[i].timeFullDnstream

◆ stat_time_full_upstream

std::vector<double> openswmm::LinkData::stat_time_full_upstream

Time of upstream surcharge (seconds).

See also
Legacy: LinkStats[i].timeFullUpstream

◆ stat_time_slot_above

std::vector<double> openswmm::LinkData::stat_time_slot_above

Time (s) the instantaneous slot share exceeded 1 %.

◆ stat_time_surcharged

std::vector<double> openswmm::LinkData::stat_time_surcharged

Total duration of surcharge (seconds).

See also
Legacy: LinkStats[i].timeSurcharged

◆ stat_total_load

std::vector<double> openswmm::LinkData::stat_total_load

Cumulative pollutant loads transported through each link.

Flat 2D: [link * n_pollutants + p]. Resized by resize_loads() after pollutant count is known.

See also
Legacy: Link[i].totalLoad[p]

◆ stat_vol_dt

std::vector<double> openswmm::LinkData::stat_vol_dt

∫ volume dt over the run (ft³·s) — the share denominator.

◆ stat_vol_flow

std::vector<double> openswmm::LinkData::stat_vol_flow

Total volume conveyed by this link (project volume units).

See also
Legacy: LinkStats[i].volFlow

◆ tags

std::vector<std::string> openswmm::LinkData::tags

Per-object tag from the INP [TAGS] section.

Free-form string label. Index-keyed so swmm_link_rename keeps the tag attached.

◆ target_setting

std::vector<double> openswmm::LinkData::target_setting

Target setting from control rules.

See also
Legacy: Link[j].targetSetting

◆ time_last_set

std::vector<double> openswmm::LinkData::time_last_set

Absolute date (decimal days) when target_setting last crossed an open<->closed boundary. Consulted by the control engine for LINK_TIMEOPEN / LINK_TIMECLOSED premises. Updated by the routing layer (SWMMEngine::stepRouting) only on open<->closed transitions, matching legacy routing.c:295-299.

See also
Legacy: Link[j].timeLastSet

◆ type

std::vector<LinkType> openswmm::LinkData::type

Link type.

◆ volume

std::vector<double> openswmm::LinkData::volume

Current full-flow volume (project volume units).

See also
Legacy: Link[i].newVolume

◆ xsect_a_bot

std::vector<double> openswmm::LinkData::xsect_a_bot

Bottom area for FILLED_CIRCULAR, RECT_TRIANG shapes.

See also
Legacy: Link[j].xsect.aBot

◆ xsect_a_full

std::vector<double> openswmm::LinkData::xsect_a_full

Full-flow area of cross-section (sq project length units).

◆ xsect_batch_shape

std::vector<int> openswmm::LinkData::xsect_batch_shape

Cached batch (XSectBatch) shape code, translated from XsectShape at init.

Avoids per-timestep translateShape() switch dispatch. Set once by Routing::init() or PostParseResolver.

◆ xsect_curve

std::vector<int> openswmm::LinkData::xsect_curve

Shape curve index (for IRREGULAR / CUSTOM shapes).

-1 for standard shapes.

◆ xsect_geom1

std::vector<double> openswmm::LinkData::xsect_geom1

Raw [XSECTIONS] geometry parameters as supplied (display units), retained purely for lossless serialization.

The computational fields above (xsect_y_full, xsect_w_max, xsect_a_full, xsect_y_bot, xsect_r_bot) are overwritten with derived geometry during initialization (e.g. for a trapezoid xsect_w_max becomes the TOP width, discarding the input bottom width and side slopes), so they cannot reproduce the original Geom1–Geom4. These mirror the four columns exactly so swmm_model_write and swmm_link_get_xsect can round-trip them. xsect_geom1 == 0 marks "not populated" (e.g. objects built by readers that do not set these), in which case writers fall back to the derived fields. Set by swmm_link_set_xsect and the [XSECTIONS] parser.

◆ xsect_geom2

std::vector<double> openswmm::LinkData::xsect_geom2

◆ xsect_geom3

std::vector<double> openswmm::LinkData::xsect_geom3

◆ xsect_geom4

std::vector<double> openswmm::LinkData::xsect_geom4

◆ xsect_r_bot

std::vector<double> openswmm::LinkData::xsect_r_bot

Multi-purpose shape param: wall length (RECT_TRIANG), wetted perimeter (FILLED_CIRCULAR).

See also
Legacy: Link[j].xsect.rBot

◆ xsect_r_full

std::vector<double> openswmm::LinkData::xsect_r_full

Full-pipe hydraulic radius.

See also
Legacy: Link[j].xsect.rFull

◆ xsect_s_bot

std::vector<double> openswmm::LinkData::xsect_s_bot

Multi-purpose shape param: side slope (RECT_TRIANG), C-factor (FORCE_MAIN), number of open sides (RECT_OPEN), etc.

See also
Legacy: Link[j].xsect.sBot

◆ xsect_s_full

std::vector<double> openswmm::LinkData::xsect_s_full

Full-pipe section factor.

See also
Legacy: Link[j].xsect.sFull

◆ xsect_s_max

std::vector<double> openswmm::LinkData::xsect_s_max

Maximum section factor (at depth of max conveyance).

See also
Legacy: Link[j].xsect.sMax

◆ xsect_shape

std::vector<XsectShape> openswmm::LinkData::xsect_shape

Cross-section shape.

◆ xsect_w_max

std::vector<double> openswmm::LinkData::xsect_w_max

Full hydraulic width of cross-section.

◆ xsect_y_bot

std::vector<double> openswmm::LinkData::xsect_y_bot

Bottom depth for FILLED_CIRCULAR, RECT_TRIANG, RECT_ROUND shapes.

See also
Legacy: Link[j].xsect.yBot

◆ xsect_y_full

std::vector<double> openswmm::LinkData::xsect_y_full

Full depth of cross-section (project length units).

◆ xsect_yw_max

std::vector<double> openswmm::LinkData::xsect_yw_max

Depth at maximum width.

See also
Legacy: Link[j].xsect.ywMax

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