![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <SourceWaterDeliveryBridge.hpp>
Public Member Functions | |
| std::string | initialize (const SourceWaterDriver &source) |
| Attach whole-source ownership before any source/receiving advancement. | |
| bool | ownsSubcatch (int source) const |
| Test whether a model subcatchment belongs to a captured source component. | |
| const std::vector< int > & | sourceGroups () const |
| Borrow the original-subcatchment-to-source-group mapping. | |
| std::string | validateReceiver (const SimulationContext &context) const |
| Check receiver node count and exact ordered node-name identity. | |
| std::string | capture (const SourceWaterDriver &source, double accepted_end) |
| Queue newly completed source outlet records at an accepted receiver boundary. | |
| std::string | stage (double start, double end) |
| Offer every pending receipt once over the next contiguous receiving interval. | |
| std::string | commit () |
| Accept the staged receiving interval and consume its pending source water. | |
| void | cancel () |
| Drop a receiving trial without consuming any accepted pending receipt. Leaves accepted clocks/totals/last receipts unchanged; safe without a trial. Invalidates receipts() borrows. Caller owns rollback of any private hydraulic trial. | |
| const std::vector< SourceNodeDelivery > & | receipts () const |
| Borrow staged per-node water offers in receiver index order. | |
| const std::vector< QueuedSourceDelivery > & | pending () const |
| Borrow the ordered captured-but-unconsumed delivery suffix. | |
| const std::vector< SourceNodeDelivery > & | received () const |
| Borrow cumulative captured volumes per receiver node. | |
| const std::vector< SourceNodeDelivery > & | delivered () const |
| Borrow cumulative volumes consumed by accepted receiving intervals. | |
| const std::vector< SourceNodeDelivery > & | lastReceipts () const |
| Borrow exact receipts of the preceding accepted receiving interval. | |
| double | lastStart () const |
| Read the previous accepted receiving interval's opening time. | |
| double | receiverEnd () const |
| Read the accepted receiving frontier. | |
| uint64_t | capturedCount () const |
| Read the length of the source delivery prefix captured by this bridge. | |
| void | checkpoint (detail::CompletedSourceArchive &archive, bool model, const SourceWaterDriver &source) |
| Stream private same-platform identity or accepted delivery restart state. | |
Internal water-only qualification boundary between completed spatial source graphs and hydraulic routing. Ownership covers whole weakly connected graphs. Capture publishes completed outlet volumes after an accepted receiving step; stage offers them once to the next step, at volume / receiving duration. Commit must follow hydraulic acceptance; cancel leaves every receipt pending. The explicit internal engine attachment suppresses duplicate ordinary runoff/LID kernels and pairs the bridge with engine/surface/source restart. This whole-copy bridge does not qualify production scheduling/performance.
|
inline |
Drop a receiving trial without consuming any accepted pending receipt. Leaves accepted clocks/totals/last receipts unchanged; safe without a trial. Invalidates receipts() borrows. Caller owns rollback of any private hydraulic trial.
| std::string openswmm::runoff::SourceWaterDeliveryBridge::capture | ( | const SourceWaterDriver & | source, |
| double | accepted_end ) |
Queue newly completed source outlet records at an accepted receiver boundary.
| source | Compatible original driver with immutable previously captured prefix, no pending group trials and completed source horizons no later than accepted_end except relative 1e-12 roundoff. All records must carry positive finite ft3 water, valid owned source/node/interval and no pollutant mass. |
| accepted_end | Finite elapsed seconds exactly equal receiverEnd(); a receiving trial must not be staged. Capture publishes availability for the next interval, not consumption in the already accepted step. |
|
inline |
Read the length of the source delivery prefix captured by this bridge.
| void openswmm::runoff::SourceWaterDeliveryBridge::checkpoint | ( | detail::CompletedSourceArchive & | archive, |
| bool | model, | ||
| const SourceWaterDriver & | source ) |
Stream private same-platform identity or accepted delivery restart state.
| [in,out] | archive | Matching native CompletedSourceArchive reader/writer; byte order/schema are not portable interchange. Caller finishes archive validation before publishing restored engine/surface/source/bridge ownership together. |
| model | True writes version-two model identity/mapping only; reading model identity is refused. False streams version-two accepted state into a temporary. | |
| source | Already prepared matching source with every completed outlet captured and every source group clock published at the bridge boundary. |
| std::runtime_error | Uninitialized/staged bridge, wrong version/model/prefix, clock/order/shape/water closure or archive error. A failed read retains accepted bridge state; the archive cursor/output bytes can be partially consumed/written. Restore on a private bridge copy, validate the containing archive then publish all paired owners together. No receiving/source water is booked by this method. |
| std::string openswmm::runoff::SourceWaterDeliveryBridge::commit | ( | ) |
Accept the staged receiving interval and consume its pending source water.
|
inline |
Borrow cumulative volumes consumed by accepted receiving intervals.
| std::string openswmm::runoff::SourceWaterDeliveryBridge::initialize | ( | const SourceWaterDriver & | source | ) |
Attach whole-source ownership before any source/receiving advancement.
| source | Compatible initialized source driver with zero completed group clocks, no pending source trial or delivery history, named hydraulic nodes and resolved outlets for selected components. This bridge rejects pollutant-bearing sources; other source qualification remains the driver's responsibility. |
|
inline |
Borrow exact receipts of the preceding accepted receiving interval.
|
inline |
Read the previous accepted receiving interval's opening time.
| bool openswmm::runoff::SourceWaterDeliveryBridge::ownsSubcatch | ( | int | source | ) | const |
Test whether a model subcatchment belongs to a captured source component.
| source | Zero-based original subcatchment index. |
|
inline |
Borrow the ordered captured-but-unconsumed delivery suffix.
| const std::vector< SourceNodeDelivery > & openswmm::runoff::SourceWaterDeliveryBridge::receipts | ( | ) | const |
Borrow staged per-node water offers in receiver index order.
| std::logic_error | No active receiving trial. Does not consume/commit water. |
|
inline |
Borrow cumulative captured volumes per receiver node.
|
inline |
Read the accepted receiving frontier.
|
inline |
Borrow the original-subcatchment-to-source-group mapping.
| std::string openswmm::runoff::SourceWaterDeliveryBridge::stage | ( | double | start, |
| double | end ) |
Offer every pending receipt once over the next contiguous receiving interval.
| start | Finite elapsed seconds exactly equal accepted receiverEnd(). |
| end | Finite later elapsed seconds with representable finite difference. |
| std::string openswmm::runoff::SourceWaterDeliveryBridge::validateReceiver | ( | const SimulationContext & | context | ) | const |
Check receiver node count and exact ordered node-name identity.
| context | Borrowed initialized receiving context; node-name table matches count. |