Go to the documentation of this file.
39 safeScale_(
dict.lookupOrDefault<scalar>(
"safeScale", 0.9)),
40 alphaInc_(
dict.lookupOrDefault<scalar>(
"alphaIncrease", 0.2)),
41 alphaDec_(
dict.lookupOrDefault<scalar>(
"alphaDecrease", 0.25)),
42 minScale_(
dict.lookupOrDefault<scalar>(
"minScale", 0.2)),
43 maxScale_(
dict.lookupOrDefault<scalar>(
"maxScale", 10)),
78 err =
solve(
x,
y, dydx0_, dx, yTemp_);
83 scalar scale =
max(safeScale_*
pow(err, -alphaDec_), minScale_);
89 <<
"stepsize underflow"
100 if (err >
pow(maxScale_/safeScale_, -1.0/alphaInc_))
103 min(
max(safeScale_*
pow(err, -alphaInc_), minScale_), maxScale_)*dx;
107 dxTry = safeScale_*maxScale_*dx;
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
virtual scalar solve(const scalar x0, const scalarField &y0, const scalarField &dydx0, const scalar dx, scalarField &y) const =0
Solve a single step dx and return the error.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
SolverPerformance< Type > solve(faMatrix< Type > &, Istream &)
Solve returning the solution statistics given convergence tolerance.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An ODE solver for chemistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static void resizeField(UList< Type > &f, const label n)
Macros for easy insertion into run-time selection tables.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void derivatives(const scalar x, const scalarField &y, scalarField &dydx) const =0
Calculate the derivatives in dydx.
Abstract base class for the systems of ordinary differential equations.
bool resize(const label n)
Resize the ODE solver.
adaptiveSolver(const ODESystem &ode, const dictionary &dict)
Construct from ODESystem.