#include <SimulationContext.hpp>
|
| 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.
|
| |
|
| static constexpr int | N_TIME_BINS = 5 |
| | Number of time step histogram bins (matching legacy TIMELEVELS=5).
|
| |
◆ 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.
◆ 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_step | Upper step in seconds; <=0 leaves edges unchanged. For active setup supply finite positive input. |
| [in] | min_route_step | Lower step in seconds; <=0 uses route_step. Caller ensures finite input and lower<=upper. |
◆ 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] | dt | Finite nonnegative step duration in seconds. |
| [in] | steady | True adds only steady_time and returns without counting a routed step. |
| [in] | first_step | True 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] | dt | Step 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] | dt | Routing 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] | iters | Iteration count for one counted routing step; caller supplies a nonnegative count. |
| [in] | converged | False increments n_non_converged. |
◆ fv_active_max
| double openswmm::SimulationContext::RoutingStepStats::fv_active_max = -1.0 |
◆ 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 |
◆ fv_avg_h
| double openswmm::SimulationContext::RoutingStepStats::fv_avg_h = 0.0 |
◆ 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 |
◆ 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 |
◆ fv_nflux
| long openswmm::SimulationContext::RoutingStepStats::fv_nflux = 0 |
◆ 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:
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] = {} |
◆ step_intervals
| double openswmm::SimulationContext::RoutingStepStats::step_intervals[N_TIME_BINS+1] = {} |
◆ 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: