KASKADE 7 development version
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Kaskade::NewtonsMethod Class Referenceabstract

Base class for Newton's method. Defines the main algorithm, potentially using damping. More...

#include <newton_base.hh>

Detailed Description

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.

Inheritance diagram for Kaskade::NewtonsMethod:
Kaskade::Algorithm Kaskade::DampedCovariantNewtonMethod Kaskade::StateConstraintsNewtonMethod

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 ParametersgetParameters ()
 
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

AbstractFunctionalfunctional
 
AbstractNewtonDirectionlinearSolver
 
AbstractChartchart
 
AbstractNormnorm
 
Parametersp
 
std::unique_ptr< AbstractFunctionSpaceElementiterate
 
std::unique_ptr< AbstractFunctionSpaceElementtrialIterate
 
std::unique_ptr< AbstractFunctionSpaceElementcorrection
 
std::unique_ptr< AbstractLinearizationnewtonLinearization
 
std::unique_ptr< AbstractLinearizationsimplifiedLinearization
 
AbstractLinearizationnewtonPtr
 
int step
 
int report
 

Member Typedef Documentation

◆ Parameters

Definition at line 91 of file newton_base.hh.

Constructor & Destructor Documentation

◆ ~NewtonsMethod()

virtual Kaskade::NewtonsMethod::~NewtonsMethod ( )
inlinevirtual

Definition at line 93 of file newton_base.hh.

◆ NewtonsMethod()

Kaskade::NewtonsMethod::NewtonsMethod ( AbstractNewtonDirection l,
AbstractChart chart_,
AbstractNorm n,
Parameters p_ 
)
inline

Create Newton's Method, providing a solver, a norm and algorithmic parameters.

Definition at line 96 of file newton_base.hh.

Member Function Documentation

◆ algorithmWrapper()

int Kaskade::Algorithm::algorithmWrapper ( )
protectedinherited

Run algorithm, completely with initialization and finalization.

◆ changedGrid()

bool Kaskade::NewtonsMethod::changedGrid ( )
inline

Definition at line 125 of file newton_base.hh.

◆ computeTrialIterate()

virtual void Kaskade::NewtonsMethod::computeTrialIterate ( AbstractFunctionSpaceElement trialIterate,
AbstractFunctionSpaceElement const &  direction,
AbstractLinearization const &  lin 
)
inlinevirtual

Reimplemented in Kaskade::DampedCovariantNewtonMethod.

Definition at line 134 of file newton_base.hh.

◆ convergenceTest()

virtual Convergence Kaskade::NewtonsMethod::convergenceTest ( AbstractFunctionSpaceElement const &  correction,
AbstractFunctionSpaceElement const &  iterate 
)
protectedpure virtual

Return true, if convergence is detected, false otherwise.

Implemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.

◆ dampingFactor()

virtual double & Kaskade::NewtonsMethod::dampingFactor ( )
inlineprotectedvirtual

Return a damping factor.

Reimplemented in Kaskade::DampedCovariantNewtonMethod.

Definition at line 161 of file newton_base.hh.

◆ evaluateTrialIterate()

virtual AcceptanceTest Kaskade::NewtonsMethod::evaluateTrialIterate ( AbstractFunctionSpaceElement const &  trialIterate,
AbstractFunctionSpaceElement const &  correction,
AbstractLinearization const &  lin 
)
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.

◆ finalize()

virtual void Kaskade::NewtonsMethod::finalize ( int  )
protectedvirtual

Called after Iteration.

Reimplemented from Kaskade::Algorithm.

◆ getLastLinearization()

AbstractLinearization const & Kaskade::NewtonsMethod::getLastLinearization ( )
inline

Definition at line 139 of file newton_base.hh.

◆ getLastSimplifiedLinearization()

AbstractLinearization const & Kaskade::NewtonsMethod::getLastSimplifiedLinearization ( )
inline

Definition at line 141 of file newton_base.hh.

◆ getParameters()

virtual Parameters & Kaskade::NewtonsMethod::getParameters ( )
inlinevirtual

Reimplemented in Kaskade::DampedCovariantNewtonMethod.

Definition at line 115 of file newton_base.hh.

◆ getSearchDirection()

virtual void Kaskade::NewtonsMethod::getSearchDirection ( AbstractFunctionSpaceElement direction)
inlinevirtual

Definition at line 127 of file newton_base.hh.

◆ initialize()

virtual void Kaskade::NewtonsMethod::initialize ( )
protectedvirtual

Called before Iteration.

Reimplemented from Kaskade::Algorithm.

Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.

◆ initNewtonStep()

virtual void Kaskade::NewtonsMethod::initNewtonStep ( )
inlineprotectedvirtual

◆ logQuantities()

virtual void Kaskade::NewtonsMethod::logQuantities ( )
inlineprotectedvirtual

Performs logging of quantities.

Definition at line 150 of file newton_base.hh.

◆ maxSteps()

virtual double Kaskade::NewtonsMethod::maxSteps ( )
inlineprotectedvirtual

return the maximal number of steps

Definition at line 163 of file newton_base.hh.

◆ oneStep()

void Kaskade::NewtonsMethod::oneStep ( AbstractFunctional f,
AbstractLinearization l,
AbstractFunctionSpaceElement x 
)

Perform one Newton step (which may be several trial steps, if damping is applied)

◆ oneStepWrapper()

int Kaskade::Algorithm::oneStepWrapper ( )
protectedinherited

Run one step of algorithm.

◆ performTiming()

void Kaskade::Algorithm::performTiming ( bool  doit)
inlineinherited

Definition at line 181 of file algorithm_base.hh.

◆ predictNextDampingFactor()

virtual void Kaskade::NewtonsMethod::predictNextDampingFactor ( AbstractFunctionSpaceElement correction)
inlineprotectedvirtual

Should compute a damping factor.

Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.

Definition at line 158 of file newton_base.hh.

◆ regularityTest()

virtual RegularityTest Kaskade::NewtonsMethod::regularityTest ( double  scalingFactor)
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.

◆ reportOnIteration()

void Kaskade::Algorithm::reportOnIteration ( int  level)
inlineinherited

Definition at line 182 of file algorithm_base.hh.

◆ resetParameters()

void Kaskade::NewtonsMethod::resetParameters ( )
inline

Reset all algorithmic parameters to their default values.

Definition at line 121 of file newton_base.hh.

◆ resolve()

void Kaskade::NewtonsMethod::resolve ( AbstractFunctionSpaceElement x,
AbstractLinearization const &  l 
)
inline

Definition at line 105 of file newton_base.hh.

◆ setDesiredAccuracy()

void Kaskade::NewtonsMethod::setDesiredAccuracy ( double  da)
inline

set the desired accuracy

Definition at line 117 of file newton_base.hh.

◆ setDesiredRelativeAccuracy()

virtual void Kaskade::NewtonsMethod::setDesiredRelativeAccuracy ( double  ra)
inlinevirtual

set the desired accuracy

Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.

Definition at line 119 of file newton_base.hh.

◆ solve()

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.

◆ stepsPerformed()

int Kaskade::NewtonsMethod::stepsPerformed ( )
inline

◆ terminationMessage()

virtual void Kaskade::NewtonsMethod::terminationMessage ( int  flag)
protectedvirtual

Reimplemented from Kaskade::Algorithm.

◆ updateIterate()

virtual void Kaskade::NewtonsMethod::updateIterate ( AbstractFunctionSpaceElement iterate,
AbstractFunctionSpaceElement trialIterate,
AbstractLinearization const &  lin 
)
protectedvirtual

update an accepted iterate, default: iterate=trialIterate

Reimplemented in Kaskade::DampedCovariantNewtonMethod, and Kaskade::StateConstraintsNewtonMethod.

Member Data Documentation

◆ chart

AbstractChart& Kaskade::NewtonsMethod::chart
protected

Definition at line 232 of file newton_base.hh.

Referenced by computeTrialIterate().

◆ correction

std::unique_ptr<AbstractFunctionSpaceElement> Kaskade::NewtonsMethod::correction
protected

◆ functional

AbstractFunctional* Kaskade::NewtonsMethod::functional
protected

Definition at line 230 of file newton_base.hh.

◆ iterate

std::unique_ptr<AbstractFunctionSpaceElement> Kaskade::NewtonsMethod::iterate
protected

Definition at line 236 of file newton_base.hh.

◆ linearSolver

AbstractNewtonDirection& Kaskade::NewtonsMethod::linearSolver
protected

Definition at line 231 of file newton_base.hh.

Referenced by getSearchDirection(), and resolve().

◆ newtonLinearization

std::unique_ptr<AbstractLinearization> Kaskade::NewtonsMethod::newtonLinearization
protected

Definition at line 238 of file newton_base.hh.

Referenced by getLastLinearization(), and getSearchDirection().

◆ newtonPtr

AbstractLinearization* Kaskade::NewtonsMethod::newtonPtr
protected

Definition at line 240 of file newton_base.hh.

◆ norm

AbstractNorm& Kaskade::NewtonsMethod::norm
protected

◆ p

Parameters& Kaskade::NewtonsMethod::p
protected

◆ report

int Kaskade::Algorithm::report
protectedinherited

Definition at line 193 of file algorithm_base.hh.

Referenced by Kaskade::Algorithm::reportOnIteration().

◆ simplifiedLinearization

std::unique_ptr<AbstractLinearization> Kaskade::NewtonsMethod::simplifiedLinearization
protected

Definition at line 239 of file newton_base.hh.

Referenced by getLastSimplifiedLinearization().

◆ step

int Kaskade::NewtonsMethod::step
protected

Definition at line 242 of file newton_base.hh.

Referenced by stepsPerformed().

◆ trialIterate

std::unique_ptr<AbstractFunctionSpaceElement> Kaskade::NewtonsMethod::trialIterate
protected

Definition at line 236 of file newton_base.hh.

Referenced by computeTrialIterate().


The documentation for this class was generated from the following file: