OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::fv::INetworkSolver Class Referenceabstract

Abstract time integrator for the explicit FV 1D network. More...

#include <INetworkSolver.hpp>

Inheritance diagram for openswmm::fv::INetworkSolver:
Collaboration diagram for openswmm::fv::INetworkSolver:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~INetworkSolver()

virtual openswmm::fv::INetworkSolver::~INetworkSolver ( )
virtualdefault

Destroy a concrete backend through the network-solver interface.

Router owns the implementation via unique_ptr. Backend destructor handles its owned resources; referenced mesh/state/options remain externally owned.

Member Function Documentation

◆ advance()

virtual double openswmm::fv::INetworkSolver::advance ( double t_current,
double t_target,
const FvStepForcing & forcing )
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.

Parameters
[in]t_currentFinite elapsed start seconds consistent with the backend's current state.
[in]t_targetFinite target elapsed seconds>=t_current.
[in]forcingBorrowed forcing and referenced spans valid for all internal substeps; optional refresh callback may update its backing arrays synchronously.
Returns
Elapsed time actually reached; successful full-window advance returns t_target.

Implemented in openswmm::fv::ExplicitFvSolver.

Here is the caller graph for this function:

◆ divergence()

virtual bool openswmm::fv::INetworkSolver::divergence ( Divergence & d) const
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.

Parameters
[out]dPopulated only when backend returns true; default implementation leaves destination unchanged.
Returns
True for a reported offender; default false for backends without this check.

Reimplemented in openswmm::fv::ExplicitFvSolver.

◆ finalize()

virtual void openswmm::fv::INetworkSolver::finalize ( )
pure virtual

Release all backend resources.

Implemented in openswmm::fv::ExplicitFvSolver.

◆ initialize()

virtual void openswmm::fv::INetworkSolver::initialize ( NetworkMeshData & mesh,
NetworkStateData & state,
const FvOptions & opts )
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.

Parameters
[in,out]meshBorrowed validated topology/geometry; must outlive solver use until finalize/destruction.
[in,out]stateBorrowed aligned hydraulic state updated by subsequent advance calls; must outlive solver use.
[in]optsBorrowed solver options whose lifetime covers solver use.

Implemented in openswmm::fv::ExplicitFvSolver.

◆ is_initialized()

virtual bool openswmm::fv::INetworkSolver::is_initialized ( ) const
pure virtualnoexcept

True once initialize() has completed and the solver is ready.

Implemented in openswmm::fv::ExplicitFvSolver.

◆ last_num_steps()

virtual long openswmm::fv::INetworkSolver::last_num_steps ( ) const
pure virtualnoexcept

Substep count used by the last advance() call.

Implemented in openswmm::fv::ExplicitFvSolver.

◆ last_step_size()

virtual double openswmm::fv::INetworkSolver::last_step_size ( ) const
pure virtualnoexcept

Last internal substep size (s).

Implemented in openswmm::fv::ExplicitFvSolver.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reinitialize()

virtual void openswmm::fv::INetworkSolver::reinitialize ( double t0)
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.

Parameters
[in]t0Finite elapsed restart seconds corresponding to externally supplied state.

Implemented in openswmm::fv::ExplicitFvSolver.

◆ run_stats()

virtual RunStats openswmm::fv::INetworkSolver::run_stats ( ) const
inlinevirtualnoexcept

Read cumulative statistics. Default: zeros (backend has no counters).

Reimplemented in openswmm::fv::ExplicitFvSolver.

◆ suggested_step()

virtual double openswmm::fv::INetworkSolver::suggested_step ( ) const
pure virtualnoexcept

Read the next CFL step suggestion from the latest backend census.

Returns
Suggested seconds interpreted by Router adaptive routing; concrete backend defines values before initialization or after finalize.

Implemented in openswmm::fv::ExplicitFvSolver.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: