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

The segment store's species-row layout, computed in ONE place. More...

#include <LagrangianSolver.hpp>

Collaboration diagram for openswmm::lard::SpeciesRowLayout:

Public Attributes

int np = 0
 pollutant rows occupy [0, np)
 
int age_row = -1
 water-age row index, or -1 when absent
 
int temp_row = -1
 temperature row index, or -1 (H7b)
 
int msx_first = -1
 
int ns = 0
 total rows the store carries
 

Detailed Description

The segment store's species-row layout, computed in ONE place.

H7a. Three call sites (step, substep, init) each used to recompute np + (age ? 1 : 0) independently, and the age row was identified by the predicate s >= np. That predicate is only correct while age is the one and only reserved row: the moment a second one exists (temperature, H7b) s >= np captures both, and temperature would be silently aged, sourced from node_age_vol_in and published to water_age_state — a defect that produces plausible numbers rather than a crash.

So the row identity becomes an explicit INDEX rather than a threshold, mirroring what the ARD engine already does (ArdEngine.cpp age_row_ / temp_row_). LARD is the engine that kept the threshold because it only ever had one.

This struct is deliberately introduced while temp_row is always -1, so the change is provably inert: with one reserved row, s == age_row and s >= np select exactly the same row. The corpus and the existing water-age gates are the proof. H7b then adds the temperature row on top of a layout that is already trusted, rather than changing the indexing and the physics in one step where a bit-identity check can no longer separate them.

Member Data Documentation

◆ age_row

int openswmm::lard::SpeciesRowLayout::age_row = -1

water-age row index, or -1 when absent

◆ msx_first

int openswmm::lard::SpeciesRowLayout::msx_first = -1

first MSX species row, or -1 (L3); species s rides row msx_first + s

◆ np

int openswmm::lard::SpeciesRowLayout::np = 0

pollutant rows occupy [0, np)

◆ ns

int openswmm::lard::SpeciesRowLayout::ns = 0

total rows the store carries

◆ temp_row

int openswmm::lard::SpeciesRowLayout::temp_row = -1

temperature row index, or -1 (H7b)


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