![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Dynamic wave solver — operates on entire link/node system. More...
#include <DynamicWave.hpp>
Public Member Functions | |
| void | init (int n_nodes, int n_links, const XSectGroups &groups) |
| void | setNumThreads (int n) |
| Set the number of OpenMP threads for parallel loops. | |
| int | execute (SimulationContext &ctx, double dt) |
| Execute one DW routing timestep. | |
| double | getRoutingStep (const SimulationContext &ctx, double fixed_step, double courant_factor) const |
| Compute CFL-based variable timestep. | |
Public Attributes | |
| double | head_tol = DEFAULT_HEADTOL |
| int | max_trials = DEFAULT_MAXTRIALS |
| double | omega = OMEGA |
| SurchargeMethod | surcharge_method = SurchargeMethod::EXTRAN |
Dynamic wave solver — operates on entire link/node system.
Working arrays are allocated once at init and reused each timestep. The solver pre-computes all cross-section geometry via XSectGroups batch API before entering the momentum arithmetic loop, ensuring the inner loop is branch-free and vectorisable.
| int openswmm::dynwave::DWSolver::execute | ( | SimulationContext & | ctx, |
| double | dt | ||
| ) |
Execute one DW routing timestep.
| ctx | Simulation context. |
| dt | Timestep (seconds). |
| double openswmm::dynwave::DWSolver::getRoutingStep | ( | const SimulationContext & | ctx, |
| double | fixed_step, | ||
| double | courant_factor | ||
| ) | const |
Compute CFL-based variable timestep.
| void openswmm::dynwave::DWSolver::init | ( | int | n_nodes, |
| int | n_links, | ||
| const XSectGroups & | groups | ||
| ) |
| void openswmm::dynwave::DWSolver::setNumThreads | ( | int | n | ) |
Set the number of OpenMP threads for parallel loops.
Called after init() when the thread count is finalized. A threshold is applied: if n_links < 4 * n, threading is disabled (matching legacy dynwave.c behaviour).
| n | Requested thread count (0 = use omp_get_max_threads()). |
| double openswmm::dynwave::DWSolver::head_tol = DEFAULT_HEADTOL |
| int openswmm::dynwave::DWSolver::max_trials = DEFAULT_MAXTRIALS |
| double openswmm::dynwave::DWSolver::omega = OMEGA |
| SurchargeMethod openswmm::dynwave::DWSolver::surcharge_method = SurchargeMethod::EXTRAN |