![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Abstract time integrator for the 2D surface-routing ODE system. More...
#include <ISurfaceSolver.hpp>
Classes | |
| struct | RunStats |
Public Member Functions | |
| virtual | ~ISurfaceSolver ()=default |
| Destroy a backend solver through its polymorphic interface. | |
| virtual void | initialize (MeshData &mesh, SurfaceStateData &state, SolverOptions2D &opts)=0 |
One-time setup. mesh and state must outlive the solver. | |
| virtual double | advance (double t_current, double t_target)=0 |
Advance the solution from t_current to t_target (s). | |
| virtual double | completedSourceTime () const noexcept |
| Horizon through which ALL cell sources have actually landed, including lazy inactive cells and LTS accumulators. Unsupported backends return -1; an outer routing endpoint alone is not source-completion evidence. | |
| virtual void | reinitialize (double t0)=0 |
Reinitialize the integrator at t0 after external state edits. | |
| virtual void | resyncFromVolumes (double t0) |
Re-time the integrator at t0 keeping the SIGNED cell volumes from state.volume. Used by the failed-window freeze path: reinitialize() reseeds from the reconstructed head, which clamps at the dry anchor and silently zeroes negative-volume debt (creating water); this variant preserves it. Default falls back to reinitialize() for backends that have not implemented volume-exact resync. | |
| virtual void | finalize ()=0 |
| Release all backend resources. | |
| virtual long | last_num_steps () const noexcept=0 |
| Number of internal integrator steps in the last advance() call. | |
| virtual double | last_step_size () const noexcept=0 |
| Last internal step size used by the integrator. | |
| virtual const std::vector< double > & | last_coupling_exchange () const noexcept |
| Per-point ∫Q dt (m³) from the live node-coupling macro-step path. Default returns empty for backends that do not implement live coupling (so the caller falls back to the held-flux booking). See ExplicitInertialSolver. | |
| virtual RunStats | run_stats () const noexcept |
| Read cumulative statistics. Default: zeros (backend has no counters). | |
| virtual bool | is_initialized () const noexcept=0 |
| True once initialize() has completed and the solver is ready. | |
Abstract time integrator for the 2D surface-routing ODE system.
The method set mirrors the lifecycle SurfaceRouter2D drives: one-time setup, repeated advance, optional reinitialize after external state edits (hot start), and teardown. The status accessors expose the most recent integrator step count and step size for runtime reporting.
Implementations are non-copyable (they own backend resources) and owned by SurfaceRouter2D through a unique_ptr<ISurfaceSolver>; the virtual destructor makes that deletion correct.
|
virtualdefault |
Destroy a backend solver through its polymorphic interface.
|
pure virtual |
Advance the solution from t_current to t_target (s).
| [in] | t_current | Finite elapsed simulation start time, seconds, matching initialized solver time. |
| [in] | t_target | Finite desired elapsed endpoint, seconds, at least t_current. |
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
inlinevirtualnoexcept |
Horizon through which ALL cell sources have actually landed, including lazy inactive cells and LTS accumulators. Unsupported backends return -1; an outer routing endpoint alone is not source-completion evidence.
Reimplemented in openswmm::twoD::ExplicitInertialSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtual |
Release all backend resources.
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtual |
One-time setup. mesh and state must outlive the solver.
| [in,out] | mesh | Built mesh geometry/topology in SI units, retained by implementations; must outlive the initialized solver. |
| [in,out] | state | Preallocated hydrodynamic/transport state, mutated during setup and stepping; must outlive the solver. |
| [in,out] | opts | Validated solver configuration, retained by implementations; keep alive and edit only through supported between-step paths. |
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtualnoexcept |
True once initialize() has completed and the solver is ready.
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
inlinevirtualnoexcept |
Per-point ∫Q dt (m³) from the live node-coupling macro-step path. Default returns empty for backends that do not implement live coupling (so the caller falls back to the held-flux booking). See ExplicitInertialSolver.
Reimplemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtualnoexcept |
Number of internal integrator steps in the last advance() call.
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtualnoexcept |
Last internal step size used by the integrator.
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
pure virtual |
Reinitialize the integrator at t0 after external state edits.
| [in] | t0 | Finite elapsed time in seconds for reseeding after a hotstart/external state edit. |
Implemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
inlinevirtual |
Re-time the integrator at t0 keeping the SIGNED cell volumes from state.volume. Used by the failed-window freeze path: reinitialize() reseeds from the reconstructed head, which clamps at the dry anchor and silently zeroes negative-volume debt (creating water); this variant preserves it. Default falls back to reinitialize() for backends that have not implemented volume-exact resync.
| [in] | t0 | Finite elapsed simulation time, seconds. |
Reimplemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.
|
inlinevirtualnoexcept |
Read cumulative statistics. Default: zeros (backend has no counters).
Reimplemented in openswmm::twoD::ExplicitInertialSolver, openswmm::twoD::gpu::ExplicitKokkosSurfaceSolver, and openswmm::twoD::PluginSurfaceSolver.