KASKADE 7 development version
|
Base class for Newton's method. Defines the main algorithm, potentially using damping. More...
#include <newton_base.hh>
Base class for Newton's method. Defines the main algorithm, potentially using damping.
This algorithm is defined in terms of abstract quantities. This is for the sake of reusability. It is design via virtual methods should provide flexibility to implement variants of this algorithm. As often with virtual functions: the base class specifies, when they are called, the derived class specifies what they do
Definition at line 88 of file newton_base.hh.
Classes | |
class | CycleDetection |
Public Types | |
typedef NewtonParameters | Parameters |
Public Member Functions | |
virtual | ~NewtonsMethod () |
NewtonsMethod (AbstractNewtonDirection &l, AbstractChart &chart_, AbstractNorm &n, Parameters &p_) | |
Create Newton's Method, providing a solver, a norm and algorithmic parameters. More... | |
void | solve (AbstractFunctional *f, AbstractFunctionSpaceElement &x) |
Solve the system f=0 with starting value x. On (successful) exit, the solution is x, otherwise it is left unmodified. More... | |
void | oneStep (AbstractFunctional *f, AbstractLinearization *l, AbstractFunctionSpaceElement &x) |
Perform one Newton step (which may be several trial steps, if damping is applied) More... | |
void | resolve (AbstractFunctionSpaceElement &x, AbstractLinearization const &l) |
virtual Parameters & | getParameters () |
void | setDesiredAccuracy (double da) |
set the desired accuracy More... | |
virtual void | setDesiredRelativeAccuracy (double ra) |
set the desired accuracy More... | |
void | resetParameters () |
Reset all algorithmic parameters to their default values. More... | |
int | stepsPerformed () |
bool | changedGrid () |
virtual void | getSearchDirection (AbstractFunctionSpaceElement &direction) |
virtual void | computeTrialIterate (AbstractFunctionSpaceElement &trialIterate, AbstractFunctionSpaceElement const &direction, AbstractLinearization const &lin) |
AbstractLinearization const & | getLastLinearization () |
AbstractLinearization const & | getLastSimplifiedLinearization () |
void | performTiming (bool doit) |
void | reportOnIteration (int level) |
Protected Member Functions | |
virtual void | initialize () |
Called before Iteration. More... | |
virtual void | finalize (int) |
Called after Iteration. More... | |
virtual void | logQuantities () |
Performs logging of quantities. More... | |
virtual void | initNewtonStep () |
virtual Convergence | convergenceTest (AbstractFunctionSpaceElement const &correction, AbstractFunctionSpaceElement const &iterate)=0 |
Return true, if convergence is detected, false otherwise. More... | |
virtual void | predictNextDampingFactor (AbstractFunctionSpaceElement &correction) |
Should compute a damping factor. More... | |
virtual double & | dampingFactor () |
Return a damping factor. More... | |
virtual double | maxSteps () |
return the maximal number of steps More... | |
virtual void | updateIterate (AbstractFunctionSpaceElement &iterate, AbstractFunctionSpaceElement &trialIterate, AbstractLinearization const &lin) |
update an accepted iterate, default: iterate=trialIterate More... | |
virtual RegularityTest | regularityTest (double scalingFactor) |
virtual AcceptanceTest | evaluateTrialIterate (AbstractFunctionSpaceElement const &trialIterate, AbstractFunctionSpaceElement const &correction, AbstractLinearization const &lin)=0 |
virtual void | terminationMessage (int flag) |
int | algorithmWrapper () |
Run algorithm, completely with initialization and finalization. More... | |
int | oneStepWrapper () |
Run one step of algorithm. More... | |
Protected Attributes | |
AbstractFunctional * | functional |
AbstractNewtonDirection & | linearSolver |
AbstractChart & | chart |
AbstractNorm & | norm |
Parameters & | p |
std::unique_ptr< AbstractFunctionSpaceElement > | iterate |
std::unique_ptr< AbstractFunctionSpaceElement > | trialIterate |
std::unique_ptr< AbstractFunctionSpaceElement > | correction |
std::unique_ptr< AbstractLinearization > | newtonLinearization |
std::unique_ptr< AbstractLinearization > | simplifiedLinearization |
AbstractLinearization * | newtonPtr |
int | step |
int | report |
Definition at line 91 of file newton_base.hh.
|
inlinevirtual |
Definition at line 93 of file newton_base.hh.
|
inline |
Create Newton's Method, providing a solver, a norm and algorithmic parameters.
Definition at line 96 of file newton_base.hh.
|
protectedinherited |
Run algorithm, completely with initialization and finalization.
|
inline |
Definition at line 125 of file newton_base.hh.
|
inlinevirtual |
Reimplemented in Kaskade::DampedCovariantNewtonMethod.
Definition at line 134 of file newton_base.hh.
|
protectedpure virtual |
Return true, if convergence is detected, false otherwise.
Implemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
|
inlineprotectedvirtual |
Return a damping factor.
Reimplemented in Kaskade::DampedCovariantNewtonMethod.
Definition at line 161 of file newton_base.hh.
|
protectedpure virtual |
function to evaluate the quality of the trial iterate. returns true if trial iterate is acceptable as new iterate i.e. if some damping factor is of appropriate size
Implemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
|
protectedvirtual |
Called after Iteration.
Reimplemented from Kaskade::Algorithm.
|
inline |
Definition at line 139 of file newton_base.hh.
|
inline |
Definition at line 141 of file newton_base.hh.
|
inlinevirtual |
Reimplemented in Kaskade::DampedCovariantNewtonMethod.
Definition at line 115 of file newton_base.hh.
|
inlinevirtual |
Definition at line 127 of file newton_base.hh.
|
protectedvirtual |
Called before Iteration.
Reimplemented from Kaskade::Algorithm.
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
|
inlineprotectedvirtual |
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
Definition at line 152 of file newton_base.hh.
|
inlineprotectedvirtual |
Performs logging of quantities.
Definition at line 150 of file newton_base.hh.
|
inlineprotectedvirtual |
return the maximal number of steps
Definition at line 163 of file newton_base.hh.
void Kaskade::NewtonsMethod::oneStep | ( | AbstractFunctional * | f, |
AbstractLinearization * | l, | ||
AbstractFunctionSpaceElement & | x | ||
) |
Perform one Newton step (which may be several trial steps, if damping is applied)
|
protectedinherited |
Run one step of algorithm.
|
inlineinherited |
Definition at line 181 of file algorithm_base.hh.
|
inlineprotectedvirtual |
Should compute a damping factor.
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
Definition at line 158 of file newton_base.hh.
|
inlineprotectedvirtual |
trial iterate = iterate + scalingFactor * correction if this was successful, return RegularityTest::Passed, otherwise (e.g. if scalingFactor is too small) RegularityTest::Failed false will lead to an unsuccessful exit of algorithm
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
Definition at line 175 of file newton_base.hh.
|
inlineinherited |
Definition at line 182 of file algorithm_base.hh.
|
inline |
Reset all algorithmic parameters to their default values.
Definition at line 121 of file newton_base.hh.
|
inline |
Definition at line 105 of file newton_base.hh.
|
inline |
set the desired accuracy
Definition at line 117 of file newton_base.hh.
|
inlinevirtual |
set the desired accuracy
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
Definition at line 119 of file newton_base.hh.
void Kaskade::NewtonsMethod::solve | ( | AbstractFunctional * | f, |
AbstractFunctionSpaceElement & | x | ||
) |
Solve the system f=0 with starting value x. On (successful) exit, the solution is x, otherwise it is left unmodified.
|
inline |
Definition at line 123 of file newton_base.hh.
Referenced by Kaskade::InteriorPointSqrtModel::finalizeCorrector(), and Kaskade::InteriorPointSlopeEstimate::finalizeCorrector().
|
protectedvirtual |
Reimplemented from Kaskade::Algorithm.
|
protectedvirtual |
update an accepted iterate, default: iterate=trialIterate
Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.
|
protected |
Definition at line 232 of file newton_base.hh.
Referenced by computeTrialIterate().
|
protected |
Definition at line 236 of file newton_base.hh.
Referenced by Kaskade::StateConstraintsNewtonMethod::predictNextDampingFactor().
|
protected |
Definition at line 230 of file newton_base.hh.
|
protected |
Definition at line 236 of file newton_base.hh.
|
protected |
Definition at line 231 of file newton_base.hh.
Referenced by getSearchDirection(), and resolve().
|
protected |
Definition at line 238 of file newton_base.hh.
Referenced by getLastLinearization(), and getSearchDirection().
|
protected |
Definition at line 240 of file newton_base.hh.
|
protected |
Definition at line 233 of file newton_base.hh.
Referenced by Kaskade::StateConstraintsNewtonMethod::predictNextDampingFactor().
|
protected |
Definition at line 234 of file newton_base.hh.
Referenced by getParameters(), logQuantities(), maxSteps(), resetParameters(), resolve(), and setDesiredAccuracy().
|
protectedinherited |
Definition at line 193 of file algorithm_base.hh.
Referenced by Kaskade::Algorithm::reportOnIteration().
|
protected |
Definition at line 239 of file newton_base.hh.
Referenced by getLastSimplifiedLinearization().
|
protected |
Definition at line 242 of file newton_base.hh.
Referenced by stepsPerformed().
|
protected |
Definition at line 236 of file newton_base.hh.
Referenced by computeTrialIterate().