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

Top-level routing orchestrator. More...

#include <Routing.hpp>

Collaboration diagram for openswmm::Router:

Public Member Functions

void init (SimulationContext &ctx, RouteModel model)
 Initialise the router for the given model.
 
int step (SimulationContext &ctx, double dt, double evap_rate=0.0, dynwave::DWSolver::NonConduitFlowFunc non_conduit_fn=nullptr)
 Execute one routing timestep.
 
double getAdaptiveStep (SimulationContext &ctx, double fixed_step, double courant)
 Compute adaptive timestep (DW only).
 
const XSectGroupsxsectGroups () const
 Access the shape-grouped xsect manager.
 
bool hasCycle () const
 
void setDWNumThreads (int n)
 Set the DWSolver OpenMP thread count (delegates to DWSolver::setNumThreads).
 
dynwave::DWSolverdwSolver ()
 Access the DW solver (for non-conduit node state scatter).
 

Detailed Description

Top-level routing orchestrator.

Owns the XSectGroups (shape-grouped batch xsect), KWSolver, and DWSolver. Initialised once after the model is built; then step() is called each routing timestep.

Member Function Documentation

◆ dwSolver()

dynwave::DWSolver & openswmm::Router::dwSolver ( )
inline

Access the DW solver (for non-conduit node state scatter).

◆ getAdaptiveStep()

double openswmm::Router::getAdaptiveStep ( SimulationContext ctx,
double  fixed_step,
double  courant 
)

Compute adaptive timestep (DW only).

Parameters
ctxSimulation context.
fixed_stepUser-specified routing step.
courantCourant factor target (0 = use fixed).
Returns
Adaptive timestep (seconds).
Here is the call graph for this function:

◆ hasCycle()

bool openswmm::Router::hasCycle ( ) const
inline

Gap #44: true if a routing cycle was detected during the last init(). For KW/STEADY routing only (DW does not toposort).

◆ init()

void openswmm::Router::init ( SimulationContext ctx,
RouteModel  model 
)

Initialise the router for the given model.

Builds XSectGroups from the link cross-sections, initialises the KW and/or DW solver working arrays.

Parameters
ctxSimulation context (must have links/nodes populated).
modelRouting model selection.
Here is the call graph for this function:

◆ setDWNumThreads()

void openswmm::Router::setDWNumThreads ( int  n)
inline

Set the DWSolver OpenMP thread count (delegates to DWSolver::setNumThreads).

Here is the call graph for this function:

◆ step()

int openswmm::Router::step ( SimulationContext ctx,
double  dt,
double  evap_rate = 0.0,
dynwave::DWSolver::NonConduitFlowFunc  non_conduit_fn = nullptr 
)

Execute one routing timestep.

Parameters
ctxSimulation context (modified in place).
dtRouting timestep (seconds).
evap_rateCurrent evaporation rate (ft/sec), from climate module.
Returns
Number of solver iterations used.
Here is the call graph for this function:

◆ xsectGroups()

const XSectGroups & openswmm::Router::xsectGroups ( ) const
inline

Access the shape-grouped xsect manager.


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