OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::dynwave::DWSolver Class Reference

Dynamic wave solver — operates on entire link/node system. More...

#include <DynamicWave.hpp>

Collaboration diagram for openswmm::dynwave::DWSolver:

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
 

Detailed Description

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.

Member Function Documentation

◆ execute()

int openswmm::dynwave::DWSolver::execute ( SimulationContext ctx,
double  dt 
)

Execute one DW routing timestep.

Parameters
ctxSimulation context.
dtTimestep (seconds).
Returns
Number of Picard iterations used.
Here is the caller graph for this function:

◆ getRoutingStep()

double openswmm::dynwave::DWSolver::getRoutingStep ( const SimulationContext ctx,
double  fixed_step,
double  courant_factor 
) const

Compute CFL-based variable timestep.

Here is the caller graph for this function:

◆ init()

void openswmm::dynwave::DWSolver::init ( int  n_nodes,
int  n_links,
const XSectGroups groups 
)
Here is the caller graph for this function:

◆ setNumThreads()

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).

Parameters
nRequested thread count (0 = use omp_get_max_threads()).
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ head_tol

double openswmm::dynwave::DWSolver::head_tol = DEFAULT_HEADTOL

◆ max_trials

int openswmm::dynwave::DWSolver::max_trials = DEFAULT_MAXTRIALS

◆ omega

double openswmm::dynwave::DWSolver::omega = OMEGA

◆ surcharge_method

SurchargeMethod openswmm::dynwave::DWSolver::surcharge_method = SurchargeMethod::EXTRAN

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