![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <ExplicitFvSolver.hpp>
Public Types | |
| using | ConduitStepSink = void (*)(void* user, int conduit, double dt, double dur) |
Public Member Functions | |
| ExplicitFvSolver ()=default | |
| Construct an unbound solver with no borrowed mesh/state. | |
| ~ExplicitFvSolver () override=default | |
| Destroy owned solver scratch without deleting borrowed mesh/state. | |
| ExplicitFvSolver (const ExplicitFvSolver &)=delete | |
| Disallow copying a solver and its borrowed state/scratch ownership. | |
| ExplicitFvSolver & | operator= (const ExplicitFvSolver &)=delete |
| Disallow copy assignment of a live solver. | |
| void | enablePressureStorageCandidate (const NonlinearPressureStorage::Controls &controls={}) |
| Enable the restricted native nonlinear pressure-storage experiment. | |
| const NonlinearPressureStorage::Result & | pressureCandidateResult () const noexcept |
| Borrow the most recently attempted nonlinear pressure candidate diagnostics. | |
| long | pressureCandidateRejections () const noexcept |
| Read the current restricted-candidate routing-window rejection count. | |
| void | initialize (NetworkMeshData &mesh, NetworkStateData &state, const FvOptions &opts) override |
| Bind a mesh/state and initialize native solver scratch and static eligibility. | |
| double | advance (double t_current, double t_target, const FvStepForcing &forcing) override |
| Advance the borrowed native state over one requested routing window. | |
| void | reinitialize (double t0) override |
| Invalidate stepping caches and refresh derived state after external restoration. | |
| void | finalize () override |
| Detach the borrowed mesh and state. | |
| long | last_num_steps () const noexcept override |
| Substep count used by the last advance() call. | |
| double | last_step_size () const noexcept override |
| Last internal substep size (s). | |
| double | suggested_step () const noexcept override |
| Read the next CFL step suggestion from the latest backend census. | |
| RunStats | run_stats () const noexcept override |
| Read cumulative statistics. Default: zeros (backend has no counters). | |
| bool | is_initialized () const noexcept override |
| True once initialize() has completed and the solver is ready. | |
| bool | divergence (Divergence &d) const noexcept override |
| Report the last advance's worst physical-bound/nonfinite offender when supported. | |
| void | setConduitStepSink (ConduitStepSink fn, void *user) noexcept |
| Set an optional synchronous per-conduit accepted-step reporting observer. | |
| const std::vector< double > & | node_exchange () const noexcept |
| Borrow the last-window signed node exchange receipt. | |
| void | trackAcceptedWater (bool enabled) |
| const AcceptedWaterVolumes & | acceptedWater () const noexcept |
| void | requireConservativeNodeBalance (bool enabled) noexcept |
| std::vector< double > & | withdrawalRates () noexcept |
| const std::vector< double > & | withdrawalRates () const noexcept |
| const std::vector< double > & | unmetWithdrawalVolumes () const noexcept |
| const std::vector< double > & | node_continuity_carry () const noexcept |
| Borrow the signed numerical node-continuity carry. | |
| const std::vector< std::uint8_t > & | pressure_folded_nodes () const noexcept |
| Borrow the most recent pressure-classification folded-node mask. | |
| const std::vector< double > & | node_inflow_volume () const noexcept |
| Borrow accumulated arriving conduit-face volume magnitudes. | |
| const std::vector< double > & | node_outflow_volume () const noexcept |
| Borrow accumulated departing conduit-face/diverted-lateral volume magnitudes. | |
| void | bookDivertedLateral (std::size_t un, double dt, const FvStepForcing &forcing) noexcept |
| Book positive node lateral volume that entered cells without crossing node faces. | |
| const std::vector< uint8_t > & | inlet_control () const noexcept |
| Borrow culvert inlet-control occurrence flags for the last window. | |
| const std::vector< double > & | node_flood_volume () const noexcept |
| Per-node flooding VOLUME (ft³) over the last advance(). | |
| const std::vector< double > & | dummy_volume () const noexcept |
| Borrow per-structure-entry DUMMY pass-through receipts. | |
| const std::vector< std::uint8_t > & | node_passthrough () const noexcept |
| Borrow the current direct-face algebraic-node bypass mask. | |
| const std::vector< std::uint8_t > & | node_publish_stage () const noexcept |
| Borrow eligibility for reconstructing reported node stage from adjacent wet cells. | |
| const std::vector< double > & | cell_flow_integral () const noexcept |
| Borrow the last-window time integral of mean face through-flow per cell. | |
| double | nodeVolumeFromDepth (int node, double depth) const |
| Evaluate native node storage volume from depth. | |
| int | lts_tiers () const noexcept |
| Read the most recent local-time-stepping tier count. | |
| const std::array< long, kMaxLtsTiers > & | tier_occupancy () const noexcept |
| Borrow the run tier-occupancy histogram. | |
Public Member Functions inherited from openswmm::fv::INetworkSolver | |
| virtual | ~INetworkSolver ()=default |
| Destroy a concrete backend through the network-solver interface. | |
| using openswmm::fv::ExplicitFvSolver::ConduitStepSink = void (*)(void* user, int conduit, double dt, double dur) |
Per-conduit local-step sink for the "Conduit Time Step Summary" ([REPORT] LINK_STEPS). When set, every accepted global substep and LTS macro cycle calls fn(user, conduit_row, dt, duration) once per conduit row, with dt the conduit's governing (finest-cell) step. Reporting only: never read by the integrator. Null (default) = off.
|
default |
Construct an unbound solver with no borrowed mesh/state.
Call initialize before using geometry/state helpers or advancing physical time.
|
overridedefault |
Destroy owned solver scratch without deleting borrowed mesh/state.
All returned member references and raw views become invalid; no final advance, report publication or external callback is performed.
|
delete |
Disallow copying a solver and its borrowed state/scratch ownership.
|
inlinenoexcept |
|
overridevirtual |
Advance the borrowed native state over one requested routing window.
Resets per-window receipts, reseeds nonalgebraic node volume from heads, subcycles globally or by eligible LTS tiers and publishes current state/telemetry. Ordinary retry exhaustion or minimum substep accepts the last state; inspect divergence() and reached time. General allocation/callback failures can leave partial advance. The enabled restricted pressure candidate instead validates supported water-only Euler options and restores its routing-window physical state/accepted receipts on exceptions, then rethrows; work diagnostics remain attempted-work telemetry. Callbacks must be synchronous and non-reentrant. External edits to cell A/Q require reinitialize to invalidate derived-state caching.
| [in] | t_current | Finite current simulation time in seconds. |
| [in] | t_target | Finite target seconds, normally >=t_current; an unbound solver or nonforward interval returns t_target without advancing. |
| [in] | forcing | Borrowed step arrays/callback context, dimension-aligned and live for the entire call; values may be synchronously refreshed by the documented callback. |
Implements openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Book positive node lateral volume that entered cells without crossing node faces.
If node_lat_div is set and lateral is positive, adds lateral*dt to node_out. Does not inject water again, change forcing or handle negative lateral withdrawals. Caller invokes exactly once per node update on either stepping path.
| [in] | un | Valid initialized global node index, unchecked when the diversion mask is present. |
| [in] | dt | Nonnegative accepted substep duration in seconds. |
| [in] | forcing | Borrowed aligned node_lateral ft3/s array or a null lateral pointer. |
|
inlinenoexcept |
Borrow the last-window time integral of mean face through-flow per cell.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlineoverridevirtualnoexcept |
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 from openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Borrow per-structure-entry DUMMY pass-through receipts.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inline |
Enable the restricted native nonlinear pressure-storage experiment.
Sets a persistent enable flag and copies controls; no immediate feature validation or solve occurs. advance rejects unsupported options/forcing. There is no disable method on this instance; initialize does not clear this flag. Serialize configuration with solver execution.
| [in] | controls | Copied nonlinear stopping/work controls; no referenced caller storage is retained. |
|
overridevirtual |
Detach the borrowed mesh and state.
Sets only mesh_/state_ to null. Does not delete external storage, clear owned capacities/statistics/receipts, invoke callbacks or advance time. Reinitialize via initialize before accessing state-dependent helpers.
Implements openswmm::fv::INetworkSolver.
|
overridevirtual |
Bind a mesh/state and initialize native solver scratch and static eligibility.
Mesh/state must remain alive at stable addresses and retain coherent dimensions/topology until finalize or rebinding. Initializes owned face/cell/node/LTS/transport arrays, resets major run statistics and builds algebraic/pass-through/rim caches. Does not validate every required array/index; callers provide a constructed mesh and sized state. Allocation can throw after binding and partial mutation, so is_initialized alone cannot certify successful completion. Concurrent use of one solver or its borrowed state is unsupported.
| [in,out] | mesh | Borrowed validated mesh/topology and geometry; fills short optional node surcharge/ponding and face gate/culvert arrays, and derives missing face geometry. |
| [in,out] | state | Borrowed dimension-aligned conserved/node/species state in native ft units. Refreshes derived depths/velocities/areas, floors negative cell area and clears dry Q; initializes/clears TPA regime flags. |
| [in] | opts | Copied FV options; development environment switches are read synchronously and may override selected options. |
Implements openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Borrow culvert inlet-control occurrence flags for the last window.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlineoverridevirtualnoexcept |
True once initialize() has completed and the solver is ready.
Implements openswmm::fv::INetworkSolver.
|
inlineoverridevirtualnoexcept |
Substep count used by the last advance() call.
Implements openswmm::fv::INetworkSolver.
|
inlineoverridevirtualnoexcept |
Last internal substep size (s).
Implements openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Read the most recent local-time-stepping tier count.
|
inlinenoexcept |
Borrow the signed numerical node-continuity carry.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Borrow the last-window signed node exchange receipt.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Per-node flooding VOLUME (ft³) over the last advance().
|
inlinenoexcept |
Borrow accumulated arriving conduit-face volume magnitudes.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Borrow accumulated departing conduit-face/diverted-lateral volume magnitudes.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Borrow the current direct-face algebraic-node bypass mask.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Borrow eligibility for reconstructing reported node stage from adjacent wet cells.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
| double openswmm::fv::ExplicitFvSolver::nodeVolumeFromDepth | ( | int | node, |
| double | depth ) const |
Evaluate native node storage volume from depth.
Pondable depth above a positive full_depth uses its rim volume plus ponded_area*(depth-full_depth). A non-storage-table node uses its current node_surf_area*depth; a table node interpolates 129 uniform samples and extends above table top using node_vol_atop. Requires positive table spacing and valid nondegenerate geometry. No allocation, state mutation or independent validation.
| [in] | node | Valid initialized global node index with coherent storage arrays. |
| [in] | depth | Finite depth in ft; <=0 returns zero. |
|
delete |
Disallow copy assignment of a live solver.
|
inlinenoexcept |
Borrow the most recent pressure-classification folded-node mask.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inlinenoexcept |
Read the current restricted-candidate routing-window rejection count.
|
inlinenoexcept |
Borrow the most recently attempted nonlinear pressure candidate diagnostics.
|
overridevirtual |
Invalidate stepping caches and refresh derived state after external restoration.
No-op when unbound. Invalidates LTS/active-list/CFL caches, refreshes depths/velocity/closure and node areas. Does not clear run statistics, numerical carry, borrowed topology, existing TPA history or all report receipts; use initialize for a new run. Does not rebuild static topology/eligibility caches.
| [in] | t0 | Compatibility time in seconds; ignored by this implementation. |
Implements openswmm::fv::INetworkSolver.
|
inlinenoexcept |
|
overridevirtualnoexcept |
Read cumulative statistics. Default: zeros (backend has no counters).
Reimplemented from openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Set an optional synchronous per-conduit accepted-step reporting observer.
Every accepted global step/LTS macro cycle invokes once per conduit. The sink is reporting-only, must not throw, retain transient arguments, reenter the solver or mutate its mesh/state. Restricted nonlinear candidate validation disallows the sink. Replacing a sink does not release user storage.
| [in] | fn | Callback(user,conduit_row,governing_dt,duration), or nullptr to disable; dt/duration are seconds and conduit row is mesh ConduitData indexing. |
| [in] | user | Opaque borrowed callback context retained alongside fn; caller keeps it live until replaced or solver destruction. |
|
inlineoverridevirtualnoexcept |
Read the next CFL step suggestion from the latest backend census.
Implements openswmm::fv::INetworkSolver.
|
inlinenoexcept |
Borrow the run tier-occupancy histogram.
Const references remain valid only while this solver lives; their underlying element pointers/contents can change on initialization or later stepping. Serialize reads with mutation.
|
inline |
Enable optional water-transfer observations after initialize(). Disabled runs allocate/record nothing. Changing this invalidates borrowed rows.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |