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

#include <SigmaPorewaterMap.hpp>

Collaboration diagram for openswmm::twoD::SigmaPorewaterMap:

Classes

struct  Overlap
 

Public Member Functions

bool active () const noexcept
 Test whether a stretching-layer overlap map is configured.
 
std::string configure (int layer_count, int species_count, std::vector< Overlap >, const std::vector< double > &partition, const std::vector< double > &canonical, const std::vector< double > &saturated_reserved)
 Construct a derived physical/SIGMA overlap view and seed it from canonical inventories.
 
std::string rebase (const std::vector< double > &canonical, const std::vector< double > &saturated_reserved)
 Redistribute canonical reactor mass and saturated claims over existing overlap capacities.
 
bool apply (int row, int physical, double increment) noexcept
 Distribute a physical-layer contact receipt into overlap views and pending reactor receipts.
 
std::string publish (SubsurfaceTransportState &, int cell)
 Publish pending overlap receipts into canonical hydraulic reactors and refresh this view.
 

Public Attributes

int layers = 0
 
int species = 0
 
std::vector< Overlap > overlaps
 
std::vector< double > capacity
 
std::vector< double > mass
 
std::vector< double > reserved
 
std::vector< double > pending
 

Member Function Documentation

◆ active()

bool openswmm::twoD::SigmaPorewaterMap::active ( ) const
inlinenoexcept

Test whether a stretching-layer overlap map is configured.

Returns
layers > 0; does not validate species, overlap geometry or inventory extents.

◆ apply()

bool openswmm::twoD::SigmaPorewaterMap::apply ( int row,
int physical,
double increment )
noexcept

Distribute a physical-layer contact receipt into overlap views and pending reactor receipts.

Parameters
[in]rowSpecies index in [0,species).
[in]physicalPhysical layer index matched against overlap geometry. For a nonzero receipt at least one matching overlap must have positive capacity/available inventory.
[in]incrementFinite signed native inventory amount, positive into the physical layer.
Returns
True after publication, or for a zero increment after checking matching overlap weights. False leaves state unchanged for invalid indices/weights, lack of capacity, overdraw, overflow, or any caught exception including allocation failure.
Note
Positive receipts partition by capacity, negative receipts by mass-reserved; the largest weight gets the remainder. Canonical owner inventories are unchanged until publish(). Existing overlap indices/array extents must be consistent. Requires exclusive access despite noexcept.

◆ configure()

std::string openswmm::twoD::SigmaPorewaterMap::configure ( int m,
int ns,
std::vector< Overlap > entries,
const std::vector< double > & partition,
const std::vector< double > & canonical,
const std::vector< double > & held )

Construct a derived physical/SIGMA overlap view and seed it from canonical inventories.

Parameters
[in]mPositive unsaturated reactor count; reactor m is the saturated zone.
[in]nsPositive species count.
[in]entriesOwned overlap geometry, moved into the candidate. Each entry has a nonnegative physical index, reactor in [0,m], finite nonnegative water m3 and finite positive bulk volume m3. Physical upper bounds are the caller's responsibility because this map has no physical-grid size.
[in]partitionns finite nonnegative retained-capacity factors: water-equivalent volume per bulk volume. Overlap capacity is water + partition*bulk in m3.
[in]canonicalSpecies-major native inventories with ns*(m+1) entries, unsaturated reactors first and saturated last, all finite and nonnegative.
[in]heldns finite nonnegative saturated outgoing reservations, no greater than their canonical inventory, in native species units.
Returns
Empty after replacing this map and zeroing pending receipts; diagnostic on invalid layout, geometry, capacity or rebase refusal with this map unchanged. Allocation exceptions propagate.
Note
Empty entries are allowed; zero-capacity canonical dry mass remains solely with its owner. Reservations require positive aqueous overlap capacity. Inputs must remain stable during copying.
Here is the call graph for this function:

◆ publish()

std::string openswmm::twoD::SigmaPorewaterMap::publish ( SubsurfaceTransportState & tr,
int cell )

Publish pending overlap receipts into canonical hydraulic reactors and refresh this view.

Parameters
[in,out]trCanonical owner with matching layers/species and valid per-cell saturated and layer inventories. Temperature rows are excluded; other row inventories receive pending amounts.
[in]cellValid owner cell index; this method does not perform a cell-bounds check.
Returns
Empty on success after canonical publication, unsaturated-view refresh, overlap rebase and clearing pending receipts. Diagnostic on owner layout or candidate rebase refusal before canonical writes; allocation exceptions also occur before publication.
Note
Rebase preserves current summed overlap reservations as saturated claims. Prepared indices, extents and owner invariants are required. Both objects need exclusive access for the call.
Here is the call graph for this function:

◆ rebase()

std::string openswmm::twoD::SigmaPorewaterMap::rebase ( const std::vector< double > & canonical,
const std::vector< double > & held )

Redistribute canonical reactor mass and saturated claims over existing overlap capacities.

Parameters
[in]canonicalSpecies-major native inventory, species*(layers+1) entries. Each amount must be finite and nonnegative; the last reactor of each species is saturated.
[in]heldOne finite nonnegative saturated reservation per species, no greater than the corresponding saturated mass; unsaturated reservation targets are zero.
Returns
Empty after replacing derived mass/reserved arrays; diagnostic on shape, invalid inventory or unpartitionable reservation with those arrays unchanged. Allocation exceptions propagate.
Note
Existing geometry/capacity and storage sizes must be consistent. Largest positive capacity receives the subtraction remainder. A zero-capacity reactor retains canonical mass outside this view and gets zero overlap mass unless it has a reservation, which is refused. Pending receipts are retained; callers must choose whether rebasing includes or excludes those receipts.
Here is the caller graph for this function:

Member Data Documentation

◆ capacity

std::vector<double> openswmm::twoD::SigmaPorewaterMap::capacity

◆ layers

int openswmm::twoD::SigmaPorewaterMap::layers = 0

◆ mass

std::vector<double> openswmm::twoD::SigmaPorewaterMap::mass

◆ overlaps

std::vector<Overlap> openswmm::twoD::SigmaPorewaterMap::overlaps

◆ pending

std::vector<double> openswmm::twoD::SigmaPorewaterMap::pending

◆ reserved

std::vector<double> openswmm::twoD::SigmaPorewaterMap::reserved

◆ species

int openswmm::twoD::SigmaPorewaterMap::species = 0

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