36 template <
typename NLO>
38 const NLO& nonLinearOperator) {}
75 template <
typename NLO>
77 const NLO& nonLinearOperator) {
80 if (targetIterations_ == 0)
81 DUNE_THROW(Dune::InvalidStateException,
82 "TargetIterations should not be equal to 0. Try calling "
83 "setTargetIterations(int) first.");
84 const auto previousIterations = solverInfo.
iterations;
85 if (previousIterations > targetIterations_)
87 sqrt(
static_cast<double>(targetIterations_) / previousIterations) * subsidiaryArgs.
stepSize;
102 DUNE_THROW(Dune::InvalidStateException,
"TargetIterations should not be equal to 0.");
107 int targetIterations_{0};
Defines structures and methods related to subsidiary functions for control routines.
Implementation of the Newton-Raphson method for solving nonlinear equations.
Definition: adaptivestepsizing.hh:17
The NoOp strategy for adaptive step sizing.
Definition: adaptivestepsizing.hh:25
void operator()(const NonLinearSolverInformation &solverInfo, SubsidiaryArgs &subsidiaryArgs, const NLO &nonLinearOperator)
Call operator for the NoOp strategy.
Definition: adaptivestepsizing.hh:37
void setTargetIterations(int targetIterations)
Set the target iterations.
Definition: adaptivestepsizing.hh:50
int targetIterations() const
Get the target iterations.
Definition: adaptivestepsizing.hh:44
The IterationBased strategy for adaptive step sizing.
Definition: adaptivestepsizing.hh:64
void setTargetIterations(int targetIterations)
Set the target iterations.
Definition: adaptivestepsizing.hh:100
void operator()(const NonLinearSolverInformation &solverInfo, SubsidiaryArgs &subsidiaryArgs, const NLO &nonLinearOperator)
Call operator of the IterationBased strategy.
Definition: adaptivestepsizing.hh:76
int targetIterations() const
Get the target iterations.
Definition: adaptivestepsizing.hh:94
Structure containing arguments for subsidiary functions.
Definition: pathfollowingfunctions.hh:39
int currentStep
The current step index in the control routine.
Definition: pathfollowingfunctions.hh:46
double stepSize
The step size in the control routine.
Definition: pathfollowingfunctions.hh:40
Information about the result of a non-linear solver.
Definition: solverinfos.hh:19
int iterations
Definition: solverinfos.hh:29