![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Abstract time integrator for the explicit FV 1D network. More...
#include <INetworkSolver.hpp>
Classes | |
| struct | Divergence |
| struct | RunStats |
Public Member Functions | |
| virtual | ~INetworkSolver ()=default |
| Destroy a concrete backend through the network-solver interface. | |
| virtual void | initialize (NetworkMeshData &mesh, NetworkStateData &state, const FvOptions &opts)=0 |
| Bind and initialize a concrete backend for one network model. | |
| virtual double | advance (double t_current, double t_target, const FvStepForcing &forcing)=0 |
| Advance bound network state across one requested routing window. | |
| virtual void | reinitialize (double t0)=0 |
| Refresh backend state after caller edits the bound hydraulic arrays. | |
| virtual void | finalize ()=0 |
| Release all backend resources. | |
| virtual long | last_num_steps () const noexcept=0 |
| Substep count used by the last advance() call. | |
| virtual double | last_step_size () const noexcept=0 |
| Last internal substep size (s). | |
| virtual double | suggested_step () const noexcept=0 |
| Read the next CFL step suggestion from the latest backend census. | |
| virtual RunStats | run_stats () const noexcept |
| Read cumulative statistics. Default: zeros (backend has no counters). | |
| virtual bool | divergence (Divergence &d) const noexcept |
| Report the last advance's worst physical-bound/nonfinite offender when supported. | |
| virtual bool | is_initialized () const noexcept=0 |
| True once initialize() has completed and the solver is ready. | |
Abstract time integrator for the explicit FV 1D network.
The lifecycle mirrors what Router drives: one-time setup, repeated advance over a routing step (internally substepped at the CFL limit), optional reinitialize after external state edits (hot start / runtime forcing), and teardown.
Implementations are non-copyable (they own backend resources) and owned by Router through a unique_ptr<INetworkSolver>; the virtual destructor makes that deletion correct.
|
virtualdefault |
|
pure virtual |
Advance bound network state across one requested routing window.
Concrete backend chooses CFL substeps and failure/partial-state behavior. Caller must check reached time before publishing full-window receipts; this interface offers no automatic rollback or exception barrier.
| [in] | t_current | Finite elapsed start seconds consistent with the backend's current state. |
| [in] | t_target | Finite target elapsed seconds>=t_current. |
| [in] | forcing | Borrowed forcing and referenced spans valid for all internal substeps; optional refresh callback may update its backing arrays synchronously. |
Implemented in openswmm::fv::ExplicitFvSolver.
|
inlinevirtualnoexcept |
Report the last advance's worst physical-bound/nonfinite offender when supported.
Returned what pointer is borrowed backend-defined text; caller must respect concrete implementation lifetime. Does not run another advance or repair state.
| [out] | d | Populated only when backend returns true; default implementation leaves destination unchanged. |
Reimplemented in openswmm::fv::ExplicitFvSolver.
|
pure virtual |
Release all backend resources.
Implemented in openswmm::fv::ExplicitFvSolver.
|
pure virtual |
Bind and initialize a concrete backend for one network model.
One-time setup in the abstract lifecycle; concrete backend defines validation/allocation failures and initial workspace. Caller serializes initialize/advance/reinitialize/finalize and does not resize bound stores during active use.
| [in,out] | mesh | Borrowed validated topology/geometry; must outlive solver use until finalize/destruction. |
| [in,out] | state | Borrowed aligned hydraulic state updated by subsequent advance calls; must outlive solver use. |
| [in] | opts | Borrowed solver options whose lifetime covers solver use. |
Implemented in openswmm::fv::ExplicitFvSolver.
|
pure virtualnoexcept |
True once initialize() has completed and the solver is ready.
Implemented in openswmm::fv::ExplicitFvSolver.
|
pure virtualnoexcept |
Substep count used by the last advance() call.
Implemented in openswmm::fv::ExplicitFvSolver.
|
pure virtualnoexcept |
Last internal substep size (s).
Implemented in openswmm::fv::ExplicitFvSolver.
|
pure virtual |
Refresh backend state after caller edits the bound hydraulic arrays.
Used for hotstart/runtime edits after initialization. Concrete backend determines workspace resets and validation failures; does not imply ownership transfer or rebuild of externally owned mesh.
| [in] | t0 | Finite elapsed restart seconds corresponding to externally supplied state. |
Implemented in openswmm::fv::ExplicitFvSolver.
|
inlinevirtualnoexcept |
Read cumulative statistics. Default: zeros (backend has no counters).
Reimplemented in openswmm::fv::ExplicitFvSolver.
|
pure virtualnoexcept |
Read the next CFL step suggestion from the latest backend census.
Implemented in openswmm::fv::ExplicitFvSolver.