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

Per-(unit, layer, species) state for every LID unit in the model. More...

#include <LidLayerSpeciesData.hpp>

Collaboration diagram for openswmm::LidLayerSpeciesState:

Public Member Functions

bool active () const noexcept
 
std::size_t layer_index (int unit, LidLayer layer, int species) const noexcept
 
void resize (int units, int species, const std::vector< int > &offsets)
 
void ensureSized (int units, int species, const std::vector< int > &offsets)
 Size the block if it is not already the requested shape.
 
void clear ()
 

Public Attributes

int n_units = 0
 
int n_species = 0
 
std::vector< int > group_offset
 
std::vector< double > value
 [(unit * kLayerCount + layer) * n_species + species]
 
std::vector< double > vol_prev
 
std::vector< double > drain_value
 
std::vector< double > inflow_value
 

Static Public Attributes

static constexpr int kLayerCount = static_cast<int>(LidLayer::COUNT_)
 

Detailed Description

Per-(unit, layer, species) state for every LID unit in the model.

Values are whatever the species means — seconds for AGE. The update is complete-mix per layer: what is held ages, what arrives mixes in by volume, and what leaves does so at the layer's own value, which is why only the INFLOW is needed.

Member Function Documentation

◆ active()

bool openswmm::LidLayerSpeciesState::active ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ clear()

void openswmm::LidLayerSpeciesState::clear ( )
inline

◆ ensureSized()

void openswmm::LidLayerSpeciesState::ensureSized ( int units,
int species,
const std::vector< int > & offsets )
inline

Size the block if it is not already the requested shape.

H5b: the block is now shared by TWO capabilities that are independently switchable. A4's initLidLayerAge both sized and seeded, under a water_age guard — so a HEAT-only deck would never have sized it, and an AGE-only deck would have left the temperature row at 0 °C, which D-H5c exists to say is a real temperature and not a sentinel.

Both initialisers now call this first and seed only their own row, so neither depends on the other having run. That is the lesson-20 configuration trap, whose eighth instance this would otherwise have been.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ layer_index()

std::size_t openswmm::LidLayerSpeciesState::layer_index ( int unit,
LidLayer layer,
int species ) const
inlinenoexcept

◆ resize()

void openswmm::LidLayerSpeciesState::resize ( int units,
int species,
const std::vector< int > & offsets )
inline
Note
No defaulted arguments, deliberately. A3's round removed a default from WaterAgeState::resize because a short call compiled and emptied the new arrays at runtime, where nothing could observe it — every call site was guarded by a size mismatch that repaired itself on the next step. Requiring both counts keeps that failure at the compiler.
Here is the caller graph for this function:

Member Data Documentation

◆ drain_value

std::vector<double> openswmm::LidLayerSpeciesState::drain_value

[unit * n_species + species] — what leaves through the underdrain. Decision (2026-08-18): the drain draws from the STORAGE layer, so this is the storage row for every type that has one.

◆ group_offset

std::vector<int> openswmm::LidLayerSpeciesState::group_offset

[type] flat index of that group's first unit; size = numGroups() + 1, so group_offset.back() == n_units.

◆ inflow_value

std::vector<double> openswmm::LidLayerSpeciesState::inflow_value

[unit * n_species + species] — the value of the water arriving at the unit from its subcatchment (rainfall, captured subarea runoff, and run-on where the LID occupies the whole subcatchment), flow-weighted at the point those terms are assembled.

◆ kLayerCount

int openswmm::LidLayerSpeciesState::kLayerCount = static_cast<int>(LidLayer::COUNT_)
staticconstexpr

◆ n_species

int openswmm::LidLayerSpeciesState::n_species = 0

◆ n_units

int openswmm::LidLayerSpeciesState::n_units = 0

◆ value

std::vector<double> openswmm::LidLayerSpeciesState::value

[(unit * kLayerCount + layer) * n_species + species]

◆ vol_prev

std::vector<double> openswmm::LidLayerSpeciesState::vol_prev

[unit * kLayerCount + layer] — the layer's stored water at the END of the previous step, as a depth per unit area (ft), void-weighted the way LIDSolver::storedVolume() weights it. Kept because the solver overwrites its depths in place, so the old volume is otherwise gone by the time the age update runs.


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