![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <SourceClockGroups.hpp>
Public Member Functions | |
| std::string | initialize (const SimulationContext &ctx, const std::vector< int > &seeds, bool hydraulic_returns=false) |
| Build selected connected source groups and snapshot their forcing inputs. | |
| std::string | stage (int group, double end, double completed_through) |
| Resolve and stage contiguous forcing from a group's accepted boundary. | |
| std::string | commit (int group) |
| Advance a group's accepted clock to the last staged forcing endpoint. | |
| void | cancel (int group) |
| Drop staged forcing without changing the accepted clock or water stores. | |
| const std::vector< SourceClockGroup > & | groups () const |
| Borrow the group membership, accepted clocks and pending forcing. | |
| int | groupForSubcatch (int source) const |
| Look up selected component membership without scanning the graph. | |
| void | checkpoint (detail::CompletedSourceArchive &archive, bool model) |
| Stream model forcing/membership or accepted source-clock restart state. | |
Internal completed-interval clock/forcing adapter. Seeds select whole weakly connected runoff/LID-drain graphs. Copied source records, not the global gage/climate cursor, supply group rates through SourceWaterDriver. Stage changes no source water. The driver must trial every enabled store, settle intake, install accepted source states, then commit the group marker. Cancellation restores no water: uncommitted source trials must stay private.
| void openswmm::runoff::SourceClockGroups::cancel | ( | int | group | ) |
Drop staged forcing without changing the accepted clock or water stores.
| group | Zero-based group index; an invalid index is a no-op. Invalidates references to that group's pending elements. Source trials and any water rollback remain the driver's responsibility. |
| void openswmm::runoff::SourceClockGroups::checkpoint | ( | detail::CompletedSourceArchive & | archive, |
| bool | model ) |
Stream model forcing/membership or accepted source-clock restart state.
| [in,out] | archive | Matching CompletedSourceArchive in read or write mode; serialization order/schema and companion model are supplied by the caller. |
| model | True streams forcing snapshot and group membership; false streams only completed_end for each group and requires no pending intervals. |
| std::runtime_error | Pending restart state, invalid restored/written clock, or archive shape/bounds/IO errors. Clocks must be finite, nonnegative and within the stored duration tolerance. Read can partially mutate before a later refusal; use an isolated candidate when transactional restoration is required. Model-mode loading alone is not comprehensive validation of all stored forcing values. |
| std::string openswmm::runoff::SourceClockGroups::commit | ( | int | group | ) |
Advance a group's accepted clock to the last staged forcing endpoint.
| group | Valid zero-based group with a nonempty pending list. |
| int openswmm::runoff::SourceClockGroups::groupForSubcatch | ( | int | source | ) | const |
Look up selected component membership without scanning the graph.
| source | Zero-based model subcatchment index. |
|
inline |
Borrow the group membership, accepted clocks and pending forcing.
| std::string openswmm::runoff::SourceClockGroups::initialize | ( | const SimulationContext & | ctx, |
| const std::vector< int > & | seeds, | ||
| bool | hydraulic_returns = false ) |
Build selected connected source groups and snapshot their forcing inputs.
| ctx | Compatible initialized model with aligned subcatchment/gage/LID arrays, resolved names, valid flow units, calendar dates and forcing persistence arrays. Reads graph, rainfall/PET tables and monthly factors without advancing cursors. |
| seeds | Zero-based subcatchment indices. Every whole weakly connected component touched by a seed is selected; duplicates are harmless, empty selects none. Runoff, LID drains and enabled snow plowing all connect components. |
| hydraulic_returns | True permits qualified hydraulic outfall returns and validates their indices; false rejects returns into selected components. |
| std::string openswmm::runoff::SourceClockGroups::stage | ( | int | group, |
| double | end, | ||
| double | completed_through ) |
Resolve and stage contiguous forcing from a group's accepted boundary.
| group | Zero-based initialized group index with no existing pending interval. |
| end | Finite requested end in elapsed seconds, strictly after completed_end and within simulation duration (relative tolerance 1e-12). |
| completed_through | Finite elapsed-second frontier at least end; supplied by the driver as proof the forcing interval is completed, not future prediction. |