![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Top-level orchestrator for the 2D surface routing module. More...
#include <SurfaceRouter2D.hpp>
Classes | |
| struct | PendingBoundaryRow |
Per-row buffer for [2D_BOUNDARY_CONDITIONS] parse output. More... | |
Public Member Functions | |
| SurfaceRouter2D ()=default | |
| ~SurfaceRouter2D ()=default | |
| SurfaceRouter2D (const SurfaceRouter2D &)=delete | |
| SurfaceRouter2D & | operator= (const SurfaceRouter2D &)=delete |
| SurfaceRouter2D (SurfaceRouter2D &&)=default | |
| SurfaceRouter2D & | operator= (SurfaceRouter2D &&)=default |
| void | initialize (SimulationContext &ctx) |
| Initialize the 2D module after input parsing is complete. | |
| void | step (SimulationContext &ctx, double dt, double t) |
| Advance the 2D surface routing by one SWMM routing step. | |
| void | updateOutfallsPreRouting (SimulationContext &ctx) |
| Pre-routing hook: update outfall boundaries from 2D surface heads. | |
| void | advancePostRouting (SimulationContext &ctx, double dt, double t) |
| Post-routing hook: compute coupling exchange and advance 2D solver. | |
| void | finalize () |
| Finalize the 2D module at simulation end. | |
| double | computeCflHint (const SimulationContext &ctx) const |
| Compute a CFL-like stability hint for the 2D domain. | |
| bool | isActive () const noexcept |
| Check if the 2D module is active. | |
| const MeshData & | mesh () const noexcept |
| Access mesh data (read-only). | |
| MeshData & | mesh () noexcept |
| Access mesh data (mutable, for input parsing). | |
| const SurfaceStateData & | state () const noexcept |
| Access surface state (read-only). | |
| SurfaceStateData & | state () noexcept |
| Access surface state (mutable, for forcing). | |
| const SolverOptions2D & | options () const noexcept |
| Access solver options (read-only). | |
| SolverOptions2D & | options () noexcept |
| Access solver options (mutable). | |
| const BoundaryData & | boundary () const noexcept |
| Access per-edge boundary-condition data (read-only). | |
| BoundaryData & | boundary () noexcept |
| Access per-edge boundary-condition data (mutable, for forcing/parsing). | |
| std::vector< PendingBoundaryRow > & | pendingBCRows () noexcept |
| const std::vector< PendingBoundaryRow > & | pendingBCRows () const noexcept |
| double | totalVolume () const |
| Get total 2D surface volume (sum of depth * area). | |
| double | totalExchangeFlow () const |
| Get total exchange flow (sum of coupling flows, m³/s). | |
| long | lastCvodeSteps () const |
| double | lastCvodeStepSize () const |
Top-level orchestrator for the 2D surface routing module.
|
default |
|
default |
|
delete |
|
default |
| void openswmm::twoD::SurfaceRouter2D::advancePostRouting | ( | SimulationContext & | ctx, |
| double | dt, | ||
| double | t | ||
| ) |
Post-routing hook: compute coupling exchange and advance 2D solver.
Must be called AFTER the 1D routing step.
| ctx | Simulation context. |
| dt | SWMM routing timestep (seconds). |
| t | Current simulation time (seconds from start). |
|
inlinenoexcept |
Access per-edge boundary-condition data (read-only).
|
inlinenoexcept |
Access per-edge boundary-condition data (mutable, for forcing/parsing).
| double openswmm::twoD::SurfaceRouter2D::computeCflHint | ( | const SimulationContext & | ctx | ) | const |
Compute a CFL-like stability hint for the 2D domain.
Returns an advisory maximum dt based on mesh resolution and wave speeds. CVODE handles its own sub-stepping, but this prevents the coupling interval from being too large.
| ctx | Simulation context. |
| void openswmm::twoD::SurfaceRouter2D::finalize | ( | ) |
Finalize the 2D module at simulation end.
| void openswmm::twoD::SurfaceRouter2D::initialize | ( | SimulationContext & | ctx | ) |
Initialize the 2D module after input parsing is complete.
Builds mesh topology, vertex stencils, resolves coupling names, and initializes the CVODE solver.
| ctx | Simulation context (must have mesh_2d populated from parsing). |
|
inlinenoexcept |
Check if the 2D module is active.
|
inline |
|
inline |
|
inlinenoexcept |
Access mesh data (read-only).
|
inlinenoexcept |
Access mesh data (mutable, for input parsing).
|
delete |
|
default |
|
inlinenoexcept |
Access solver options (read-only).
|
inlinenoexcept |
Access solver options (mutable).
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Access surface state (read-only).
|
inlinenoexcept |
Access surface state (mutable, for forcing).
| void openswmm::twoD::SurfaceRouter2D::step | ( | SimulationContext & | ctx, |
| double | dt, | ||
| double | t | ||
| ) |
Advance the 2D surface routing by one SWMM routing step.
Sequence:
| ctx | Simulation context. |
| dt | SWMM routing timestep (seconds). |
| t | Current simulation time (seconds from start). |
| double openswmm::twoD::SurfaceRouter2D::totalExchangeFlow | ( | ) | const |
Get total exchange flow (sum of coupling flows, m³/s).
| double openswmm::twoD::SurfaceRouter2D::totalVolume | ( | ) | const |
Get total 2D surface volume (sum of depth * area).
| void openswmm::twoD::SurfaceRouter2D::updateOutfallsPreRouting | ( | SimulationContext & | ctx | ) |
Pre-routing hook: update outfall boundaries from 2D surface heads.
Must be called BEFORE the 1D routing step, after setOutfallDepths().
| ctx | Simulation context. |