OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
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)
 Accumulate a step into minimum, maximum, sum and count.
 
void record_step (double dt, bool steady, bool first_step)
 Record a step using legacy steady-state and first-step rules.
 
void update_iterations (int iters, bool converged)
 Accumulate routing iterations and non-convergence events.
 
void init_histogram (double route_step, double min_route_step)
 Set descending logarithmic time-step histogram edges.
 
void build_histogram ()
 Derive histogram edges from recorded extrema.
 
void record_step_bin (double dt)
 Count one duration in the current histogram.
 
double avg_step () const
 Compute the mean duration of counted routing steps.
 
double pct_non_converged () const
 Compute non-converged steps as a percentage of counted steps.
 
double computed_avg_iterations () const
 Compute mean routing iterations per counted step.
 

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.
 
double steady_time = 0.0
 Time skipped as steady state (sec)
 
long report_steps = 0
 Flow-stat steps after report start (legacy ReportStepCount)
 
double report_time = 0.0
 Their total time, sec (legacy RoutingTimeSpan)
 
double max_outfall_flow
 Peak of the summed outfall inflow, cfs (legacy MaxOutfallFlow)
 
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.
 
double slot_peak_share = 0.0
 
double slot_time_above_s = 0.0
 
long fv_nsteps = -1
 explicit substeps over the run
 
long fv_nflux = 0
 face flux evaluations
 
double fv_avg_h = 0.0
 mean substep (s)
 
double fv_last_h = 0.0
 last substep (s)
 
double fv_min_h = 0.0
 smallest substep taken (s)
 
double fv_active_min = -1.0
 min active-face fraction
 
double fv_active_mean = -1.0
 mean active-face fraction
 
double fv_active_max = -1.0
 max active-face fraction
 
long fv_tier_cells [8] = {0}
 rebuild-sampled cells per LTS tier
 
int fv_n_tiers = 0
 populated tier count
 
long fv_dt_argmin_pressurized = 0
 
long fv_dt_argmin_band = 0
 
long fv_dt_argmin_free = 0
 
long fv_dt_argmin_node = 0
 
long fv_macro_cycles = 0
 
long fv_macro_rejected = 0
 
int lstep_mode = 0
 

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

Compute the mean duration of counted routing steps.

Returns
sum_step/n_steps in seconds, or zero when n_steps<=0.

◆ build_histogram()

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

Derive histogram edges from recorded extrema.

Does nothing for zero steps or nonpositive maximum. An absent/nonpositive minimum falls back to the maximum. Changes edges only; existing counts are neither reset nor redistributed.

Here is the call graph for this function:

◆ computed_avg_iterations()

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

Compute mean routing iterations per counted step.

Caller must pair iteration accumulation with the counted-step population.

Returns
sum_iterations/n_steps, or zero when n_steps<=0.

◆ init_histogram()

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

Set descending logarithmic time-step histogram edges.

Sets N_TIME_BINS+1 edges with exact first/last endpoints. Preserves existing counts; typically called before recording steps.

Parameters
[in]route_stepUpper step in seconds; <=0 leaves edges unchanged. For active setup supply finite positive input.
[in]min_route_stepLower step in seconds; <=0 uses route_step. Caller ensures finite input and lower<=upper.
Here is the caller graph for this function:

◆ pct_non_converged()

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

Compute non-converged steps as a percentage of counted steps.

No clamping: caller must maintain counters from the same step population.

Returns
100*n_non_converged/n_steps, or zero when n_steps<=0.

◆ record_step()

void openswmm::SimulationContext::RoutingStepStats::record_step ( double dt,
bool steady,
bool first_step )
inline

Record a step using legacy steady-state and first-step rules.

For later nonsteady steps, increments the first bin whose lower edge is <=dt. Values below every lower edge enter no bin. Caller initializes descending histogram edges and separately records iterations.

Parameters
[in]dtFinite nonnegative step duration in seconds.
[in]steadyTrue adds only steady_time and returns without counting a routed step.
[in]first_stepTrue excludes this nonsteady step from the minimum and histogram, while still updating maximum/sum/count.

◆ record_step_bin()

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

Count one duration in the current histogram.

Uses the first lower edge <=dt, otherwise increments the final active bin. Unlike record_step(), below-minimum values still count. Does not change time/step totals or use the extra sentinel count slot.

Parameters
[in]dtStep duration in seconds; caller initializes finite descending edges first.

◆ update()

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

Accumulate a step into minimum, maximum, sum and count.

Does not update steady time, histogram bins or iteration statistics.

Parameters
[in]dtRouting duration in seconds; caller supplies a finite nonnegative value.

◆ update_iterations()

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

Accumulate routing iterations and non-convergence events.

Does not increment n_steps; caller keeps iteration and step populations consistent.

Parameters
[in]itersIteration count for one counted routing step; caller supplies a nonnegative count.
[in]convergedFalse increments n_non_converged.

Member Data Documentation

◆ fv_active_max

double openswmm::SimulationContext::RoutingStepStats::fv_active_max = -1.0

max active-face fraction

◆ fv_active_mean

double openswmm::SimulationContext::RoutingStepStats::fv_active_mean = -1.0

mean active-face fraction

◆ fv_active_min

double openswmm::SimulationContext::RoutingStepStats::fv_active_min = -1.0

min active-face fraction

◆ fv_avg_h

double openswmm::SimulationContext::RoutingStepStats::fv_avg_h = 0.0

mean substep (s)

◆ fv_dt_argmin_band

long openswmm::SimulationContext::RoutingStepStats::fv_dt_argmin_band = 0

◆ fv_dt_argmin_free

long openswmm::SimulationContext::RoutingStepStats::fv_dt_argmin_free = 0

◆ fv_dt_argmin_node

long openswmm::SimulationContext::RoutingStepStats::fv_dt_argmin_node = 0

◆ fv_dt_argmin_pressurized

long openswmm::SimulationContext::RoutingStepStats::fv_dt_argmin_pressurized = 0

◆ fv_last_h

double openswmm::SimulationContext::RoutingStepStats::fv_last_h = 0.0

last substep (s)

◆ fv_macro_cycles

long openswmm::SimulationContext::RoutingStepStats::fv_macro_cycles = 0

◆ fv_macro_rejected

long openswmm::SimulationContext::RoutingStepStats::fv_macro_rejected = 0

◆ fv_min_h

double openswmm::SimulationContext::RoutingStepStats::fv_min_h = 0.0

smallest substep taken (s)

◆ fv_n_tiers

int openswmm::SimulationContext::RoutingStepStats::fv_n_tiers = 0

populated tier count

◆ fv_nflux

long openswmm::SimulationContext::RoutingStepStats::fv_nflux = 0

face flux evaluations

◆ fv_nsteps

long openswmm::SimulationContext::RoutingStepStats::fv_nsteps = -1

explicit substeps over the run

◆ fv_tier_cells

long openswmm::SimulationContext::RoutingStepStats::fv_tier_cells[8] = {0}

rebuild-sampled cells per LTS tier

◆ lstep_mode

int openswmm::SimulationContext::RoutingStepStats::lstep_mode = 0

Source of the per-conduit time step summary ([REPORT] LINK_STEPS), set at init: 0 = not collected / unsupported routing method, 1 = DW (CFL-allowable step), 2 = FV (local step taken).

◆ max_courant

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

Maximum Courant number observed.

◆ max_outfall_flow

double openswmm::SimulationContext::RoutingStepStats::max_outfall_flow
Initial value:
=
0.0

Peak of the summed outfall inflow, cfs (legacy MaxOutfallFlow)

◆ 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

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

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

◆ report_steps

long openswmm::SimulationContext::RoutingStepStats::report_steps = 0

Flow-stat steps after report start (legacy ReportStepCount)

◆ report_time

double openswmm::SimulationContext::RoutingStepStats::report_time = 0.0

Their total time, sec (legacy RoutingTimeSpan)

◆ slot_peak_share

double openswmm::SimulationContext::RoutingStepStats::slot_peak_share = 0.0

◆ slot_time_above_s

double openswmm::SimulationContext::RoutingStepStats::slot_time_above_s = 0.0

◆ steady_pct

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

Percent of time in steady state.

◆ steady_time

double openswmm::SimulationContext::RoutingStepStats::steady_time = 0.0

Time skipped as steady state (sec)

◆ 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: