38#ifndef OPENSWMM_ENGINE_DATA_LIDLAYERSPECIESDATA_HPP
39#define OPENSWMM_ENGINE_DATA_LIDLAYERSPECIESDATA_HPP
118 return (
static_cast<std::size_t
>(unit) *
kLayerCount +
static_cast<std::size_t
>(layer)) *
120 static_cast<std::size_t
>(species);
136 void resize(
int units,
int species,
const std::vector<int>& offsets) {
140 const auto n_layers =
141 static_cast<std::size_t
>(units) *
static_cast<std::size_t
>(
kLayerCount);
142 value.assign(n_layers *
static_cast<std::size_t
>(species), 0.0);
144 drain_value.assign(
static_cast<std::size_t
>(units) *
static_cast<std::size_t
>(species),
146 inflow_value.assign(
static_cast<std::size_t
>(units) *
static_cast<std::size_t
>(species),
162 void ensureSized(
int units,
int species,
const std::vector<int>& offsets) {
163 const auto want =
static_cast<std::size_t
>(units) *
static_cast<std::size_t
>(
kLayerCount) *
164 static_cast<std::size_t
>(species);
167 resize(units, species, offsets);
Definition ExchangeLaw.hpp:60
LidLayer
Definition LidLayerSpeciesData.hpp:52
@ PAVEMENT
Definition LidLayerSpeciesData.hpp:52
@ SURFACE
Definition LidLayerSpeciesData.hpp:52
@ SOIL
Definition LidLayerSpeciesData.hpp:52
@ COUNT_
Definition LidLayerSpeciesData.hpp:52
@ STORAGE
Definition LidLayerSpeciesData.hpp:52
LidSpecies
Species rows carried on the LID layers.
Definition LidLayerSpeciesData.hpp:55
@ AGE
Definition LidLayerSpeciesData.hpp:56
@ TEMPERATURE
Definition LidLayerSpeciesData.hpp:59
@ COUNT_
Definition HeatData.hpp:80
Per-(unit, layer, species) state for every LID unit in the model.
Definition LidLayerSpeciesData.hpp:71
void resize(int units, int species, const std::vector< int > &offsets)
Replace LID layer state with a zeroed shape and copied group offsets.
Definition LidLayerSpeciesData.hpp:136
static constexpr int kLayerCount
Definition LidLayerSpeciesData.hpp:100
std::vector< int > group_offset
Definition LidLayerSpeciesData.hpp:77
int n_units
Definition LidLayerSpeciesData.hpp:72
std::vector< double > vol_prev
Definition LidLayerSpeciesData.hpp:87
int n_species
Definition LidLayerSpeciesData.hpp:73
bool active() const noexcept
Test whether both LID-unit and species counts are positive.
Definition LidLayerSpeciesData.hpp:106
std::vector< double > drain_value
Definition LidLayerSpeciesData.hpp:92
std::vector< double > value
[(unit * kLayerCount + layer) * n_species + species]
Definition LidLayerSpeciesData.hpp:80
void ensureSized(int units, int species, const std::vector< int > &offsets)
Resize LID state only when its main shape differs.
Definition LidLayerSpeciesData.hpp:162
std::vector< double > inflow_value
Definition LidLayerSpeciesData.hpp:98
std::size_t layer_index(int unit, LidLayer layer, int species) const noexcept
Calculate the flat unit/layer/species value index.
Definition LidLayerSpeciesData.hpp:117
void clear()
Release all LID layer species state and reset counts.
Definition LidLayerSpeciesData.hpp:176