dune-pdelab  2.4.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Dune::PDELab::Newton< GOS, S, TrlV, TstV > Class Template Referenceabstract

#include <dune/pdelab/newton/newton.hh>

Inheritance diagram for Dune::PDELab::Newton< GOS, S, TrlV, TstV >:
Inheritance graph

Public Types

typedef NewtonResult< RFType > Result
 
enum  Strategy { noLineSearch, hackbuschReusken, hackbuschReuskenAcceptBest }
 

Public Member Functions

 Newton (const GridOperator &go, TrialVector &u_, Solver &solver_)
 
 Newton (const GridOperator &go, Solver &solver_)
 
void setParameters (Dune::ParameterTree &param)
 interpret a parameter tree as a set of options for the newton solver More...
 
void apply ()
 
void apply (TrialVector &u_)
 
const Resultresult () const
 
void setVerbosityLevel (unsigned int verbosity_level)
 
void setKeepMatrix (bool b)
 Set whether the jacobian matrix should be kept across calls to apply(). More...
 
bool keepMatrix () const
 Return whether the jacobian matrix is kept across calls to apply(). More...
 
void discardMatrix ()
 Discard the stored Jacobian matrix. More...
 
void setReduction (RFType reduction)
 
void setMaxIterations (unsigned int maxit)
 
void setForceIteration (bool force_iteration)
 
void setAbsoluteLimit (RFType abs_limit_)
 
virtual bool terminate ()
 
void setLineSearchStrategy (Strategy strategy)
 
void setLineSearchStrategy (std::string strategy)
 
void setLineSearchMaxIterations (unsigned int maxit)
 
void setLineSearchDampingFactor (RFType damping_factor)
 
virtual void line_search (TrialVector &z, TestVector &r)
 
void setMinLinearReduction (RFType min_linear_reduction)
 set the minimal reduction in the linear solver More...
 
void setFixedLinearReduction (bool fixed_linear_reduction)
 set a fixed reduction in the linear solver (overwrites setMinLinearReduction) More...
 
void setReassembleThreshold (RFType reassemble_threshold)
 set a threshold, when the linear operator is reassembled More...
 
virtual void prepare_step (Matrix &A, TstV &)
 

Protected Member Functions

virtual void defect (TestVector &r)
 
virtual bool terminate ()=0
 
virtual void prepare_step (Matrix &A, TestVector &r)=0
 
virtual void line_search (TrialVector &z, TestVector &r)=0
 
Strategy strategyFromName (const std::string &s)
 

Protected Attributes

const GridOperator & gridoperator_
 
TrialVector * u_
 
std::shared_ptr< TrialVector > z_
 
std::shared_ptr< TestVector > r_
 
std::shared_ptr< Matrix > A_
 
Result res_
 
unsigned int verbosity_level_
 
RFType prev_defect_
 
RFType linear_reduction_
 
bool reassembled_
 
RFType reduction_
 
RFType abs_limit_
 
bool keep_matrix_
 

Member Typedef Documentation

template<class GOS , class S , class TrlV , class TstV >
typedef NewtonResult<RFType> Dune::PDELab::NewtonSolver< GOS, S, TrlV, TstV >::Result
inherited

Member Enumeration Documentation

template<class GOS , class TrlV , class TstV >
enum Dune::PDELab::NewtonLineSearch::Strategy
inherited
Enumerator
noLineSearch 

don't do any linesearch or damping

hackbuschReusken 

perform a linear search for the optimal damping parameter with multiples of damping

the strategy was described in [Hackbusch and Reusken, 1989]

hackbuschReuskenAcceptBest 

same as hackbuschReusken, but doesn't fail if the best update is still not good enough

Constructor & Destructor Documentation

template<class GOS , class S , class TrlV , class TstV = TrlV>
Dune::PDELab::Newton< GOS, S, TrlV, TstV >::Newton ( const GridOperator &  go,
TrialVector &  u_,
Solver &  solver_ 
)
inline
template<class GOS , class S , class TrlV , class TstV = TrlV>
Dune::PDELab::Newton< GOS, S, TrlV, TstV >::Newton ( const GridOperator &  go,
Solver &  solver_ 
)
inline

Member Function Documentation

template<class GOS , class S , class TrlV , class TstV >
void Dune::PDELab::NewtonSolver< GOS, S, TrlV, TstV >::apply ( )
inherited
template<class GOS , class S , class TrlV , class TstV >
void Dune::PDELab::NewtonSolver< GOS, S, TrlV, TstV >::apply ( TrialVector &  u_)
inherited
template<class GOS , class S , class TrlV , class TstV >
virtual void Dune::PDELab::NewtonSolver< GOS, S, TrlV, TstV >::defect ( TestVector &  r)
inlineprotectedvirtualinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::discardMatrix ( )
inlineinherited

Discard the stored Jacobian matrix.

template<class GOS , class TrlV , class TstV >
bool Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::keepMatrix ( ) const
inlineinherited

Return whether the jacobian matrix is kept across calls to apply().

template<class GOS , class TrlV , class TstV >
virtual void Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::line_search ( TrialVector &  z,
TestVector &  r 
)
protectedpure virtualinherited
template<class GOS , class TrlV , class TstV >
virtual void Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::line_search ( TrialVector &  z,
TestVector &  r 
)
inlinevirtualinherited
template<class GOS , class TrlV , class TstV >
virtual void Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::prepare_step ( Matrix &  A,
TestVector &  r 
)
protectedpure virtualinherited
template<class GOS , class TrlV , class TstV >
virtual void Dune::PDELab::NewtonPrepareStep< GOS, TrlV, TstV >::prepare_step ( Matrix &  A,
TstV &   
)
inlinevirtualinherited
template<class GOS , class S , class TrlV , class TstV >
const Result& Dune::PDELab::NewtonSolver< GOS, S, TrlV, TstV >::result ( ) const
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonTerminate< GOS, TrlV, TstV >::setAbsoluteLimit ( RFType  abs_limit_)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonPrepareStep< GOS, TrlV, TstV >::setFixedLinearReduction ( bool  fixed_linear_reduction)
inlineinherited

set a fixed reduction in the linear solver (overwrites setMinLinearReduction)

Note
with fixed_linear_reduction > 0, the linear reduction rate will always be fixed to min_linear_reduction.
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonTerminate< GOS, TrlV, TstV >::setForceIteration ( bool  force_iteration)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::setKeepMatrix ( bool  b)
inlineinherited

Set whether the jacobian matrix should be kept across calls to apply().

template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::setLineSearchDampingFactor ( RFType  damping_factor)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::setLineSearchMaxIterations ( unsigned int  maxit)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::setLineSearchStrategy ( Strategy  strategy)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::setLineSearchStrategy ( std::string  strategy)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonTerminate< GOS, TrlV, TstV >::setMaxIterations ( unsigned int  maxit)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonPrepareStep< GOS, TrlV, TstV >::setMinLinearReduction ( RFType  min_linear_reduction)
inlineinherited

set the minimal reduction in the linear solver

Note
with min_linear_reduction > 0, the linear reduction will be determined as mininum of the min_linear_reduction and the linear_reduction needed to achieve second order Newton convergence.
template<class GOS , class S , class TrlV , class TstV = TrlV>
void Dune::PDELab::Newton< GOS, S, TrlV, TstV >::setParameters ( Dune::ParameterTree &  param)
inline

interpret a parameter tree as a set of options for the newton solver

example configuration:

[NewtonParameters]
ReassembleThreshold = 0.1
LineSearchMaxIterations = 10
MaxIterations = 7
AbsoluteLimit = 1e-6
Reduction = 1e-4
LinearReduction = 1e-3
LineSearchDamping = 0.9

and invocation in the code:

newton.setParameters(param.sub("NewtonParameters"));
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonPrepareStep< GOS, TrlV, TstV >::setReassembleThreshold ( RFType  reassemble_threshold)
inlineinherited

set a threshold, when the linear operator is reassembled

We allow to keep the linear operator over several newton iterations. If the reduction in the newton drops below a given threshold the linear operator is reassembled to ensure convergence.

template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonTerminate< GOS, TrlV, TstV >::setReduction ( RFType  reduction)
inlineinherited
template<class GOS , class TrlV , class TstV >
void Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::setVerbosityLevel ( unsigned int  verbosity_level)
inlineinherited
template<class GOS , class TrlV , class TstV >
Strategy Dune::PDELab::NewtonLineSearch< GOS, TrlV, TstV >::strategyFromName ( const std::string &  s)
inlineprotectedinherited

helper function to get the different strategies from their name

template<class GOS , class TrlV , class TstV >
virtual bool Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::terminate ( )
protectedpure virtualinherited
template<class GOS , class TrlV , class TstV >
virtual bool Dune::PDELab::NewtonTerminate< GOS, TrlV, TstV >::terminate ( )
inlinevirtualinherited

Member Data Documentation

template<class GOS , class TrlV , class TstV >
std::shared_ptr<Matrix> Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::A_
protectedinherited
template<class GOS , class TrlV , class TstV >
RFType Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::abs_limit_
protectedinherited
template<class GOS , class TrlV , class TstV >
const GridOperator& Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::gridoperator_
protectedinherited
template<class GOS , class TrlV , class TstV >
bool Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::keep_matrix_
protectedinherited
template<class GOS , class TrlV , class TstV >
RFType Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::linear_reduction_
protectedinherited
template<class GOS , class TrlV , class TstV >
RFType Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::prev_defect_
protectedinherited
template<class GOS , class TrlV , class TstV >
std::shared_ptr<TestVector> Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::r_
protectedinherited
template<class GOS , class TrlV , class TstV >
bool Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::reassembled_
protectedinherited
template<class GOS , class TrlV , class TstV >
RFType Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::reduction_
protectedinherited
template<class GOS , class TrlV , class TstV >
Result Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::res_
protectedinherited
template<class GOS , class TrlV , class TstV >
TrialVector* Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::u_
protectedinherited
template<class GOS , class TrlV , class TstV >
unsigned int Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::verbosity_level_
protectedinherited
template<class GOS , class TrlV , class TstV >
std::shared_ptr<TrialVector> Dune::PDELab::NewtonBase< GOS, TrlV, TstV >::z_
protectedinherited

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