OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::ode::detail Namespace Reference

Classes

struct  OdeWorkspace
 

Functions

OdeWorkspace & workspace (int n)
 Grow this thread's reusable solver arrays for n equations.
 
template<typename F>
void rkck (OdeWorkspace &ws_, double x, int n, double h, F &&derivs)
 Evaluate one Cash-Karp trial step in the thread-local workspace.
 
template<typename F>
int rkqs (OdeWorkspace &ws_, double *x, int n, double htry, double eps, double *hdid, double *hnext, F &&derivs)
 Reject and shrink trial RK45 steps until local error is acceptable.
 
template<typename F>
int integrate (double *ystart, int n, double x1, double x2, double eps, double h1, F &&derivs)
 

Function Documentation

◆ integrate()

template<typename F>
int openswmm::ode::detail::integrate ( double * ystart,
int n,
double x1,
double x2,
double eps,
double h1,
F && derivs )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rkck()

template<typename F>
void openswmm::ode::detail::rkck ( OdeWorkspace & ws_,
double x,
int n,
double h,
F && derivs )

Evaluate one Cash-Karp trial step in the thread-local workspace.

Template Parameters
FCallable with the DerivFunc argument convention.
Parameters
[in]xIndependent variable at the current state.
[in]nPositive equation count, no larger than allocated workspace.
[in]hTrial step in x units; may be negative.
[in]derivsBorrowed synchronous derivative evaluator, not retained.
Precondition
ws_.y and ws_.dydx hold the current state and its derivative.
Postcondition
ws_.ytemp contains the fifth-order trial state and ws_.yerr its embedded error estimate. Current accepted ws_.y is unchanged.
Here is the caller graph for this function:

◆ rkqs()

template<typename F>
int openswmm::ode::detail::rkqs ( OdeWorkspace & ws_,
double * x,
int n,
double htry,
double eps,
double * hdid,
double * hnext,
F && derivs )

Reject and shrink trial RK45 steps until local error is acceptable.

Template Parameters
FCallable with the DerivFunc argument convention.
Parameters
[in,out]xNon-null current coordinate; advanced only on acceptance.
[in]nPositive equation count covered by thread-local workspace.
[in]htryInitial attempted step, in x units.
[in]epsPositive dimensionless scaled-error tolerance.
[out]hdidNon-null slot for the accepted step; unchanged on underflow.
[out]hnextNon-null slot for the next proposed step; unchanged on underflow.
[in]derivsBorrowed synchronous derivative evaluator, not retained.
Returns
ODE_OK after committing ws_.y, or ODE_UNDERFLOW when a rejected step becomes too small to change x. Callback exceptions propagate.
Precondition
ws_.y, ws_.dydx and ws_.yscal are initialized for x.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ workspace()

OdeWorkspace & openswmm::ode::detail::workspace ( int n)

Grow this thread's reusable solver arrays for n equations.

Parameters
[in]nPositive requested capacity; n * 5 must fit in int.

A request within current capacity does nothing. Growing releases all old arrays and allocates zero-initialized replacements, including five stage arrays. Allocation failures are not checked by this legacy helper.

Here is the caller graph for this function: