Per-(unit, layer, species) state for every LID unit in the model.
More...
#include <LidLayerSpeciesData.hpp>
|
| bool | active () const noexcept |
| | Test whether both LID-unit and species counts are positive.
|
| |
| std::size_t | layer_index (int unit, LidLayer layer, int species) const noexcept |
| | Calculate the flat unit/layer/species value index.
|
| |
| void | resize (int units, int species, const std::vector< int > &offsets) |
| | Replace LID layer state with a zeroed shape and copied group offsets.
|
| |
| void | ensureSized (int units, int species, const std::vector< int > &offsets) |
| | Resize LID state only when its main shape differs.
|
| |
| void | clear () |
| | Release all LID layer species state and reset counts.
|
| |
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.
◆ active()
| bool openswmm::LidLayerSpeciesState::active |
( |
| ) |
const |
|
inlinenoexcept |
Test whether both LID-unit and species counts are positive.
- Returns
- n_units>0 && n_species>0; does not validate allocated arrays or offsets.
◆ clear()
| void openswmm::LidLayerSpeciesState::clear |
( |
| ) |
|
|
inline |
Release all LID layer species state and reset counts.
Restores empty offsets/value/history/workspace arrays; invalidates borrowed elements and leaves the LID manager definitions unchanged.
◆ ensureSized()
| void openswmm::LidLayerSpeciesState::ensureSized |
( |
int | units, |
|
|
int | species, |
|
|
const std::vector< int > & | offsets ) |
|
inline |
Resize LID state only when its main shape differs.
Returns immediately when counts and value length match, preserving values and existing offsets. Does not verify offsets, vol_prev/drain/inflow lengths or refresh changed group topology in that case. Otherwise delegates to resize() and zeroes all state before species-specific seeding.
- Parameters
-
| [in] | units | Nonnegative total LID-unit count. |
| [in] | species | Nonnegative species stride; all size_t products must fit. |
| [in] | offsets | Borrowed group-prefix offsets copied into owned storage when resizing. Caller provides monotone group-count+1 entries ending at units; not checked. |
◆ layer_index()
| std::size_t openswmm::LidLayerSpeciesState::layer_index |
( |
int | unit, |
|
|
LidLayer | layer, |
|
|
int | species ) const |
|
inlinenoexcept |
Calculate the flat unit/layer/species value index.
- Parameters
-
| [in] | unit | Existing unit index in [0,n_units); unchecked. |
| [in] | layer | Existing layer enum excluding COUNT_; unchecked. |
| [in] | species | Existing species index in [0,n_species); unchecked. |
- Returns
- (unit*kLayerCount+layer)*n_species+species; caller ensures size arithmetic and array bounds.
◆ resize()
| void openswmm::LidLayerSpeciesState::resize |
( |
int | units, |
|
|
int | species, |
|
|
const std::vector< int > & | offsets ) |
|
inline |
Replace LID layer state with a zeroed shape and copied group offsets.
Zero values mean seconds for AGE and degC for TEMPERATURE; caller then seeds each enabled species appropriately. Replaces prior values, volume history (ft water depth), drain and inflow arrays. Independent assignments can leave partial state on allocation failure; both explicit counts are required to avoid silently dropping a species dimension.
- Parameters
-
| [in] | units | Nonnegative total LID-unit count. |
| [in] | species | Nonnegative species stride; all size_t products must fit. |
| [in] | offsets | Borrowed group-prefix offsets copied into owned storage when resizing. Caller provides monotone group-count+1 entries ending at units; not checked. |
◆ 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: