37 safeScale_(
dict.lookupOrDefault<scalar>(
"safeScale", 0.9)),
38 alphaInc_(
dict.lookupOrDefault<scalar>(
"alphaIncrease", 0.2)),
39 alphaDec_(
dict.lookupOrDefault<scalar>(
"alphaDecrease", 0.25)),
40 minScale_(
dict.lookupOrDefault<scalar>(
"minScale", 0.2)),
41 maxScale_(
dict.lookupOrDefault<scalar>(
"maxScale", 10)),
77 err =
solve(
x,
y, li, dydx0_, dx, yTemp_);
82 scalar scale =
max(safeScale_*
pow(err, -alphaDec_), minScale_);
88 <<
"stepsize underflow"
99 if (err >
pow(maxScale_/safeScale_, -1.0/alphaInc_))
102 min(
max(safeScale_*
pow(err, -alphaInc_), minScale_), maxScale_)*dx;
106 dxTry = safeScale_*maxScale_*dx;
Macros for easy insertion into run-time selection tables.
static void resizeField(UList< Type > &f, const label n)
Abstract base class for the systems of ordinary differential equations.
virtual void derivatives(const scalar x, const scalarField &y, const label li, scalarField &dydx) const =0
Calculate the derivatives in dydx.
adaptiveSolver(const ODESystem &ode, const dictionary &dict)
Construct from ODESystem.
virtual scalar solve(const scalar x0, const scalarField &y0, const label li, const scalarField &dydx0, const scalar dx, scalarField &y) const =0
Solve a single step dx and return the error.
bool resize(const label n)
Resize the ODE solver.
A list of keyword definitions, which are a keyword followed by any number of values (e....
An ODE solver for chemistry.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
SolverPerformance< Type > solve(fvMatrix< Type > &, const word &)
Solve returning the solution statistics given convergence tolerance.