#include <RuntimeCoupling.hpp>
|
| RuntimeForcing * | find (int channel, int cell) |
| | Find an exact channel/cell forcing row, including disabled retained rows.
|
| |
| const RuntimeForcing * | get (int channel, int cell) const noexcept |
| | Resolve enabled cell-specific forcing with uniform fallback.
|
| |
| double | rate (int channel, int cell, double native) const noexcept |
| | Resolve a forced scalar rate from a native value.
|
| |
| void | replace (RuntimeForcing row) |
| | Upsert one forcing prescription while retaining its accumulated receipt.
|
| |
| void | rebuild (int count) |
| | Rebuild channel/cell and uniform forcing gather indices.
|
| |
| bool | active () const noexcept |
| | Test whether any retained runtime prescription is enabled.
|
| |
| double | nextTime (double now) const noexcept |
| | Find the next enabled prescription expiry strictly after now.
|
| |
| void | expire (double now) noexcept |
| | Disable all enabled prescriptions whose expiry has been reached.
|
| |
|
| std::vector< RuntimeForcing > | rows |
| |
| std::vector< std::array< int, 4 > > | cells |
| |
| std::array< int, 4 > | uniform {{-1, -1, -1, -1}} |
| |
| std::unordered_map< int, std::unordered_map< int, std::size_t > > | index |
| |
◆ active()
| bool openswmm::twoD::RuntimeForcings::active |
( |
| ) |
const |
|
inlinenoexcept |
Test whether any retained runtime prescription is enabled.
- Returns
- True if at least one row.enabled is true, otherwise false. Expiry time is not inspected; expire() must run first for time-based status.
- Note
- Read-only, allocation-free; serialize with registry mutations.
◆ expire()
| void openswmm::twoD::RuntimeForcings::expire |
( |
double | now | ) |
|
|
inlinenoexcept |
Disable all enabled prescriptions whose expiry has been reached.
- Parameters
-
| [in] | now | Finite elapsed simulation time, seconds; until <= now expires. |
- Postcondition
- Keeps row identity and cumulative receipts; cached indices remain and get() checks enabled flags, falling back to uniform forcing.
- Note
- Requires exclusive registry access. No allocation or exceptions.
◆ find()
| RuntimeForcing * openswmm::twoD::RuntimeForcings::find |
( |
int | channel, |
|
|
int | cell ) |
|
inline |
Find an exact channel/cell forcing row, including disabled retained rows.
- Parameters
-
| [in] | channel | Runtime forcing channel key (normally 1..4). |
| [in] | cell | Zero-based cell key, or negative uniform key as authored. |
- Returns
- Borrowed mutable row pointer or NULL for no key. Invalidated by rows growth/replacement/destruction; never free it.
- Precondition
- index and rows are coherent. No allocation/mutation; serialize with edits.
◆ get()
| const RuntimeForcing * openswmm::twoD::RuntimeForcings::get |
( |
int | channel, |
|
|
int | cell ) const |
|
inlinenoexcept |
Resolve enabled cell-specific forcing with uniform fallback.
- Parameters
-
| [in] | channel | Channel in [1,4]; unchecked and used as channel-1 array offset. |
| [in] | cell | Zero-based target cell; out-of-range/negative uses the uniform fallback directly. |
- Returns
- Borrowed enabled row pointer, first the cell override then uniform, or NULL if neither is enabled. Expiry time is not checked here.
- Precondition
- Cached indices are rebuilt and coherent. Read-only, no allocation/exceptions; serialize with edits.
◆ nextTime()
| double openswmm::twoD::RuntimeForcings::nextTime |
( |
double | now | ) |
const |
|
inlinenoexcept |
Find the next enabled prescription expiry strictly after now.
- Parameters
-
| [in] | now | Finite elapsed simulation time, seconds. |
- Returns
- Earliest enabled until > now in elapsed seconds, or positive infinity if none exists.
- Note
- Read-only; expired/equal-time rows are skipped without disabling them. No allocation; serialize with edits.
◆ rate()
| double openswmm::twoD::RuntimeForcings::rate |
( |
int | channel, |
|
|
int | cell, |
|
|
double | native ) const |
|
inlinenoexcept |
Resolve a forced scalar rate from a native value.
- Parameters
-
| [in] | channel | Valid runtime channel [1,4]. |
| [in] | cell | Cell whose specific/uniform forcing is selected by get(). |
| [in] | native | Native rate in the channel's units, normally m/s. |
- Returns
- native when no row, native + row.rate for mode 2, otherwise row.rate.
- Note
- No validation, clamping, expiry or receipt update. Read-only and allocation-free; channel units must be consistent.
◆ rebuild()
| void openswmm::twoD::RuntimeForcings::rebuild |
( |
int | count | ) |
|
|
inline |
Rebuild channel/cell and uniform forcing gather indices.
- Parameters
-
| [in] | count | Nonnegative number of mesh cells. |
- Precondition
- Every enabled channel is [1,4]; every nonnegative enabled cell is < count.
- Postcondition
- Replaces cells and uniform; later rows overwrite earlier duplicate placement. Does not rebuild the channel/cell identity map or alter receipts.
- Exceptions
-
| std::out_of_range | For a nonnegative cell outside count. Invalid channels are unchecked. |
- Note
- May allocate and leave partial indices on failure; requires exclusive access.
◆ replace()
Upsert one forcing prescription while retaining its accumulated receipt.
- Parameters
-
| [in] | row | Owned draft with a validated channel/cell key and consistent units; moved into the registry. |
- Postcondition
- Existing keys retain receipts; new rows keep their supplied receipt. Cached cell/uniform indices are not rebuilt automatically.
- Note
- Requires exclusive access. Allocation may throw after index changes; use a private staged registry for transactional publication. Input storage is not retained and row pointers may be invalidated.
◆ cells
| std::vector<std::array<int, 4> > openswmm::twoD::RuntimeForcings::cells |
◆ index
| std::unordered_map<int, std::unordered_map<int, std::size_t> > openswmm::twoD::RuntimeForcings::index |
◆ rows
◆ uniform
| std::array<int, 4> openswmm::twoD::RuntimeForcings::uniform {{-1, -1, -1, -1}} |
The documentation for this struct was generated from the following file: