36#ifndef OPENSWMM_ROUTING_HPP
37#define OPENSWMM_ROUTING_HPP
100 double evap_rate = 0.0,
112 double fixed_step,
double courant);
123 dw_solver_.setNumThreads(n, warnings);
152 const std::string&
fvBackend()
const {
return fv_backend_; }
156 const std::vector<std::string>&
fvWarnings()
const {
return fv_warnings_; }
157 const std::vector<std::string>&
fvErrors()
const {
return fv_errors_; }
169 std::vector<char> steady_storage_updated_;
172 std::vector<double> steady_y_;
181 std::unique_ptr<fv::INetworkSolver> fv_solver_;
182 std::string fv_backend_;
183 std::vector<std::string> fv_warnings_, fv_errors_;
186 std::vector<double> fv_lateral_, fv_fixed_head_, fv_struct_flow_, fv_cond_loss_;
192 std::vector<double> fv_link_q_cap_;
199 std::vector<double> fv_struct_int_;
200 double fv_struct_t_prev_ = 0.0;
209 std::vector<int> steady_sorted_links_;
210 bool cycle_detected_ =
false;
223 const std::function<
void()>& eval_structures);
Flow divider node logic — cutoff, overflow, tabular, weir.
Dynamic wave routing solver — batch-oriented St. Venant equations.
Option struct for the explicit finite-volume 1D network solver.
Backend-neutral interface for the explicit FV 1D network integrator.
Kinematic wave routing solver — batch-oriented design.
SoA storage for the 1D finite-volume network mesh and its state.
Cross-section geometry — unified batch + per-element API.
Top-level routing orchestrator.
Definition Routing.hpp:78
double getAdaptiveStep(SimulationContext &ctx, double fixed_step, double courant)
Compute adaptive timestep (DW only).
Definition Routing.cpp:431
const fv::INetworkSolver * fvSolver() const
Definition Routing.hpp:146
void setStructureSolver(hydstruct::StructureSolver *s)
Definition Routing.hpp:133
void setDWNumThreads(int n, std::vector< std::string > *warnings=nullptr)
Set the DWSolver OpenMP thread count (delegates to DWSolver::setNumThreads).
Definition Routing.hpp:122
dynwave::DWSolver & dwSolver()
Access the DW solver (for non-conduit node state scatter).
Definition Routing.hpp:127
const XSectGroups & xsectGroups() const
Access the shape-grouped xsect manager.
Definition Routing.hpp:115
const std::vector< std::string > & fvErrors() const
Definition Routing.hpp:157
void init(SimulationContext &ctx, RouteModel model)
Initialise the router for the given model.
Definition Routing.cpp:75
const fv::NetworkMeshData & fvMesh() const
The FV mesh built at init (empty unless FLOW_ROUTING FV).
Definition Routing.hpp:149
bool hasCycle() const
Definition Routing.hpp:119
bool lastStepConverged() const
Definition Routing.hpp:140
int step(SimulationContext &ctx, double dt, double evap_rate=0.0, dynwave::DWSolver::NonConduitFlowFunc non_conduit_fn=nullptr)
Execute one routing timestep.
Definition Routing.cpp:345
const std::string & fvBackend() const
Backend label chosen by the FV factory ("cpu (...)", "omp (...)", ...).
Definition Routing.hpp:152
const std::vector< std::string > & fvWarnings() const
Definition Routing.hpp:156
Shape-grouped cross-section manager for batch computation.
Definition XSectBatch.hpp:243
Dynamic wave solver — operates on entire link/node system.
Definition DynamicWave.hpp:193
std::function< void(SimulationContext &, double, int)> NonConduitFlowFunc
Definition DynamicWave.hpp:216
Abstract time integrator for the explicit FV 1D network.
Definition INetworkSolver.hpp:121
Definition HydStructures.hpp:170
Kinematic wave solver state.
Definition KinematicWave.hpp:165
Definition NodeCoupling.cpp:16
@ FV
Explicit conservative finite volume (Godunov, HLL/HLLC)
Definition SimulationOptions.hpp:79
@ KINWAVE
Kinematic wave approximation.
Definition SimulationOptions.hpp:77
@ STEADY
Steady-state (no routing)
Definition SimulationOptions.hpp:76
@ DYNWAVE
Dynamic wave (full Saint-Venant, implicit Picard)
Definition SimulationOptions.hpp:78
RouteModel
Definition Routing.hpp:60
@ DYNWAVE
Dynamic wave (St. Venant, implicit Picard)
Definition Routing.hpp:63
Central, reentrant simulation context.
Definition SimulationContext.hpp:353
Knobs for FLOW_ROUTING FV.
Definition FvOptions.hpp:123
SoA mesh geometry and topology for the FV network solver.
Definition NetworkMeshData.hpp:176
Mutable solver state — the conserved variables and the node volumes.
Definition NetworkMeshData.hpp:489