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

#include <SimulationContext.hpp>

Collaboration diagram for openswmm::SimulationContext::RoutingStepStats:

Public Member Functions

void update (double dt)
 
void update_iterations (int iters, bool converged)
 Record iteration count for a routing step.
 
void init_histogram (double route_step, double min_route_step)
 
void build_histogram ()
 
void record_step_bin (double dt)
 Add a step to the histogram (call during simulation or post-process)
 
double avg_step () const
 
double pct_non_converged () const
 
double computed_avg_iterations () const
 

Public Attributes

double min_step = 1.0e30
 Minimum routing time step used (sec)
 
double max_step = 0.0
 Maximum routing time step used (sec)
 
double sum_step = 0.0
 Sum of all routing time steps (sec)
 
long n_steps = 0
 Total number of routing steps.
 
double steady_pct = 0.0
 Percent of time in steady state.
 
long step_counts [N_TIME_BINS+1] = {}
 Histogram bin counts.
 
double step_intervals [N_TIME_BINS+1] = {}
 Histogram bin edges.
 
long n_non_converged = 0
 Non-convergence and iteration tracking.
 
double sum_iterations = 0.0
 Sum of iterations for averaging.
 
double max_courant = 0.0
 Maximum Courant number observed.
 

Static Public Attributes

static constexpr int N_TIME_BINS = 5
 Number of time step histogram bins (matching legacy TIMELEVELS=5).
 

Member Function Documentation

◆ avg_step()

double openswmm::SimulationContext::RoutingStepStats::avg_step ( ) const
inline

◆ build_histogram()

void openswmm::SimulationContext::RoutingStepStats::build_histogram ( )
inline

Build histogram bin edges post-hoc from observed min/max (fallback if init_histogram was not called).

Here is the call graph for this function:

◆ computed_avg_iterations()

double openswmm::SimulationContext::RoutingStepStats::computed_avg_iterations ( ) const
inline

◆ init_histogram()

void openswmm::SimulationContext::RoutingStepStats::init_histogram ( double  route_step,
double  min_route_step 
)
inline

Initialize histogram bin edges using log-scale between max and min routing steps. Call once at simulation start (matching legacy stats.c stats_open: intervals from RouteStep down to MinRouteStep).

Here is the caller graph for this function:

◆ pct_non_converged()

double openswmm::SimulationContext::RoutingStepStats::pct_non_converged ( ) const
inline

◆ record_step_bin()

void openswmm::SimulationContext::RoutingStepStats::record_step_bin ( double  dt)
inline

Add a step to the histogram (call during simulation or post-process)

◆ update()

void openswmm::SimulationContext::RoutingStepStats::update ( double  dt)
inline

◆ update_iterations()

void openswmm::SimulationContext::RoutingStepStats::update_iterations ( int  iters,
bool  converged 
)
inline

Record iteration count for a routing step.

Member Data Documentation

◆ max_courant

double openswmm::SimulationContext::RoutingStepStats::max_courant = 0.0

Maximum Courant number observed.

◆ max_step

double openswmm::SimulationContext::RoutingStepStats::max_step = 0.0

Maximum routing time step used (sec)

◆ min_step

double openswmm::SimulationContext::RoutingStepStats::min_step = 1.0e30

Minimum routing time step used (sec)

◆ n_non_converged

long openswmm::SimulationContext::RoutingStepStats::n_non_converged = 0

Non-convergence and iteration tracking.

Steps that didn't converge

◆ n_steps

long openswmm::SimulationContext::RoutingStepStats::n_steps = 0

Total number of routing steps.

◆ N_TIME_BINS

constexpr int openswmm::SimulationContext::RoutingStepStats::N_TIME_BINS = 5
staticconstexpr

Number of time step histogram bins (matching legacy TIMELEVELS=5).

◆ steady_pct

double openswmm::SimulationContext::RoutingStepStats::steady_pct = 0.0

Percent of time in steady state.

◆ step_counts

long openswmm::SimulationContext::RoutingStepStats::step_counts[N_TIME_BINS+1] = {}

Histogram bin counts.

◆ step_intervals

double openswmm::SimulationContext::RoutingStepStats::step_intervals[N_TIME_BINS+1] = {}

Histogram bin edges.

◆ sum_iterations

double openswmm::SimulationContext::RoutingStepStats::sum_iterations = 0.0

Sum of iterations for averaging.

◆ sum_step

double openswmm::SimulationContext::RoutingStepStats::sum_step = 0.0

Sum of all routing time steps (sec)


The documentation for this struct was generated from the following file: