#include <LagrangianSolver.hpp>
◆ applySpeciesIncrements()
Apply caller concentration deltas to represented nonthermal channel rows then republish.
- Parameters
-
| [in,out] | ctx | Matching initialized row policy/public quality stores; publish(ctx,0) refreshes link means and copies node/link pollutant current values into old histories. |
| [in] | updates | Owning stable region0 deltas, one total-row tuple per valid link; temperature delta must be exactly0. Positive existing mean scales each segment proportionally, otherwise sets target mean. |
- Returns
- Empty on success, descriptive validation message for unavailable state, region/row mismatch, nonzero thermal delta or nonfinite/negative candidate; validation precedes mutation of all entries.
- Note
- Repeated updates to same link validate independently against pre-update state, then apply sequentially to changed state, so caller must qualify duplicate/aggregate deltas. Allocation/publish can throw after earlier writes. No external mass ledger or physical/clock booking; exclusive coupling phase.
◆ applyThermalIncrements()
Add caller channel temperature increments uniformly to represented segments then republish.
- Parameters
-
| [in,out] | ctx | Matching initialized thermal/public quality state; publish(ctx,0) also refreshes pollutant old histories, not just temperature. |
| [in] | updates | Stable valid link/region0 records whose celsius field is a signed degC increment. |
- Returns
- Empty on success; message for unavailable owner, invalid identity or nonfinite candidate. All entries are prevalidated independently before writes; repeated-link aggregate overflow is not revalidated after each increment. Allocation/publish may throw after writes; no rollback, ledger, water or clock mutation. Caller owns exclusive completed coupling phase and qualified absolute temperatures.
◆ checkpointState()
| std::string openswmm::lard::LagrangianSolver::checkpointState |
( |
| ) |
const |
|
inline |
Export a validated completed-source snapshot of solver-owned segment/particle/topology state.
- Returns
- Owning archive bytes, including initialized flag; excludes SimulationContext inventories, clock, options and scratch. Retain matching completed context and configuration separately.
- Note
- Copies this owner, then archives/validates copy; allocation/archive/validation exceptions propagate without original solver mutation. Caller establishes a stable exclusive checkpoint barrier.
◆ initialized()
| bool openswmm::lard::LagrangianSolver::initialized |
( |
| ) |
const |
|
inlinenoexcept |
Read whether this segment owner completed initialization.
- Returns
- Initialized flag only; does not validate current context/layout or prepare state. No allocation/mutation.
◆ publish()
| void openswmm::lard::LagrangianSolver::publish |
( |
SimulationContext & | ctx, |
|
|
double | dt_routing ) |
|
inline |
Per-routing-step publication: link means + the conc_old convention. dt_routing ages the held state of empty slabs (once per step).
Publish represented conduit means and copy pollutant current values into old histories.
- Parameters
-
| [in,out] | ctx | Matching row policy and covered link/node public pollutant/age/heat/MSX arrays. |
| [in] | dt_routing | Elapsed accepted interval s added only to age of empty conduit rings;0 for coupling republish avoids additional aging. No independent time validation. |
- Note
- Requires initialized store and scratch covering row count. Pollutants publish zero means for empty rings; heat/MSX preserve old public values when empty. Nonconduit outputs remain from node routing. Copies all link/node pollutant current arrays to old, can allocate/throw after partial publication. No hydraulic/clock/global-ledger advance; exclusive completed quality phase.
◆ restoreCheckpointState()
| void openswmm::lard::LagrangianSolver::restoreCheckpointState |
( |
const std::string & | bytes, |
|
|
SimulationContext & | ctx ) |
|
inline |
Restore solver-owned completed-source state against a matching prepared context.
- Parameters
-
| [in] | bytes | Complete archive from checkpointState with compatible dimensions/options/layout. |
| [in,out] | ctx | Matching completed SimulationContext; ready snapshot calls init(ctx), which may seed scalar/native context state before archive fields are read. |
- Exceptions
-
| std::runtime_error | Archive/trailing-byte, topology, segment or particle validation failure; allocation/dependency exceptions propagate. Partial owner/context changes are retained on failure. |
- Note
- Archives do not contain context inventories/configuration. Exclusive lifecycle, not transactional; false-ready snapshot skips init and checkpointFields uses this owner's current initialized flag, so caller must restore into the intended matching initialization phase.
◆ speciesRegions()
Export mean carried-species tuples for each wet represented channel link.
- Parameters
-
| [in] | ctx | Stable matching row layout/names and native completed hydraulic geometry. |
- Returns
- Owning region0 records, volume m3 and row-order mean values: pollutant/native declared units, age seconds, temperature degC. Empty when uninitialized OR temperature row absent, even with species.
- Note
- Requires configured names/extents for all rows. No state mutation, ledger or clock advance; allocation can throw. Returned copied records are phase snapshots, not live borrowed views.
◆ step()
| void openswmm::lard::LagrangianSolver::step |
( |
SimulationContext & | ctx, |
|
|
double | dt_routing ) |
|
inline |
One routing step of LTD transport. Lazily initializes on the first call (needs router-set volumes, the ARD precedent).
Advance segment advection/mixing/kinetics with optional RWPT and final heat/bed exchange.
- Parameters
-
| [in,out] | ctx | Prepared completed hydraulics and freshly assembled external quality/scalar rates; updates node/link family concentrations, histories, HRT, reaction/negative-source and heat/bed state. |
| [in] | dt_routing | Positive finite accepted hydraulic interval s, not validated here. |
- Note
- No carried rows returns. Lazily initializes; reverses conduit segment order on meaningful flow-sign flips, recomputes directed topology, subdivides by positive quality_step, then applies heat/bed once and publishes. Caller keeps owner dimensions/layout/options stable after init and assembles source rates once for whole interval. Internal routines allocate/mutate progressively, exceptions retain partial work. No hydraulic water/engine clock advance or concurrent owner use.
◆ substep()
| void openswmm::lard::LagrangianSolver::substep |
( |
SimulationContext & | ctx, |
|
|
double | dt, |
|
|
double | frac ) |
|
inline |
One LTD substep: AGE → DRAIN → MIX(+passthrough) → RELEASE → DECAY.
- Parameters
-
| frac | fraction of the per-routing-step external volume (qual_vol_in) this substep consumes. |
Route and react one LARD quality subinterval against held hydraulic state.
- Parameters
-
| [in,out] | ctx | Prepared node/link quality, age/heat/native arrays and external-rate assembly; receives node/segment mixing, pollutant decay, treatment/HRT/native kinetics and diagnostics. |
| [in] | dt | Positive finite subinterval s.
- Additional argument frac: Positive hydraulic interval fraction used on already integrated qual_vol_in; external mass/scalar rates use dt independently, so fractions across routing step must sum1.
|
- Note
- Requires init, matching row policy, fresh topology and receipts. Ages all segments/nodes, drains conduit downstream/front excess, mixes nodes in order, forwards nonconduit loads, refills conduits, optionally disperses particles then decays/reacts. Pending cyclic graph receipts remain for next traversal. Not a standalone source assembler or publisher; no water/clock advance. Shared scratch, allocation, warning and integration can leave partial stores/ledgers on exception; exclusive once-per-subinterval chronology and stable hydraulic/source owner required.
◆ thermalRegions()
Export one mean-temperature channel region per wet represented link.
- Parameters
-
| [in] | ctx | Stable matching initialized row policy, native geometry and heat/contact configuration. |
- Returns
- Owning regions with link identity, region0/full-link interval, volume m3 and mean degC plus resolved thermal geometry. Empty when uninitialized or temperature row absent; zero-volume links skip.
- Note
- Read-only owner; context remains stable through geometry queries. Allocations may throw; returned records own values and need no owner lifetime, but later state/configuration changes make them stale.
The documentation for this class was generated from the following file: