DUNE PDELab (git)
Newton solver for solving non-linear problems. More...
#include <dune/pdelab/solver/newton.hh>
Public Types | |
using | GridOperator = GridOperator_ |
Type of the grid operator. | |
using | LinearSolver = LinearSolver_ |
Type of the linear solver. | |
using | Domain = typename GridOperator::Traits::Domain |
Type of the domain (solution) | |
using | Range = typename GridOperator::Traits::Range |
Type of the range (residual) | |
using | Jacobian = typename GridOperator::Traits::Jacobian |
Type of the Jacobian matrix. | |
using | Real = typename Dune::FieldTraits< typename Domain::ElementType >::real_type |
Number type. | |
using | Result = PDESolverResult< Real > |
Type of results. | |
using | LineSearch = LineSearchInterface< Domain > |
Type of line search interface. | |
Public Member Functions | |
Result & | result () |
Return results. | |
virtual void | apply (Domain &solution) |
Solve the nonlinear problem using solution as initial guess and for storing the result. | |
virtual void | updateDefect (Domain &solution) |
Update _residual and defect in _result. | |
void | setVerbosityLevel (unsigned int verbosity) |
Set how much output you get. | |
unsigned int | getVerbosityLevel () const |
Get verbosity level. | |
void | setReduction (Real reduction) |
Set reduction Newton needs to achieve. | |
Real | getReduction () const |
Get reduction. | |
void | setAbsoluteLimit (Real absoluteLimit) |
Set absolute convergence limit. | |
void | setKeepMatrix (bool b) |
Set whether the jacobian matrix should be kept across calls to apply(). | |
void | setUseMaxNorm (bool b) |
Set whether to use the maximum norm for stopping criteria. | |
void | setHangingNodeModifications (bool b) |
Does the problem have hanging nodes. | |
bool | keepMatrix () const |
Return whether the jacobian matrix is kept across calls to apply(). | |
void | discardMatrix () |
Discard the stored Jacobian matrix. | |
void | setMinLinearReduction (Real minLinearReduction) |
Set the minimal reduction in the linear solver. More... | |
void | setFixedLinearReduction (bool fixedLinearReduction) |
Set wether to use a fixed reduction in the linear solver. More... | |
void | setReassembleThreshold (Real reassembleThreshold) |
Set a threshold, when the linear operator is reassembled. More... | |
void | setParameters (const ParameterTree ¶meterTree) |
Interpret a parameter tree as a set of options for the newton solver. More... | |
void | setTerminate (std::shared_ptr< TerminateInterface > terminate) |
Set the termination criterion. | |
std::shared_ptr< TerminateInterface > | getTerminate () const |
Return a pointer to the stored termination criterion. | |
void | setLineSearch (std::shared_ptr< LineSearch > lineSearch) |
Set the line search. More... | |
std::shared_ptr< LineSearch > | getLineSearch () const |
Return a pointer to the stored line search. | |
void | printParameters (const std::string &_name="NewtonMethod") const |
Output NewtonMethod parameters. More... | |
NewtonMethod (const GridOperator &gridOperator, LinearSolver &linearSolver) | |
Construct Newton using default parameters with default parameters. More... | |
NewtonMethod (const GridOperator &gridOperator, LinearSolver &linearSolver, const ParameterTree ¶meterTree) | |
Construct Newton passing a parameter tree. | |
Detailed Description
class Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >
Newton solver for solving non-linear problems.
- The line search and the termination criterion can be changed at runtime by the setTerminate() and the setLineSearch() methods.
- If Newton is created using the default parameters it is an inexact Newton since the default reduction for the linear systems is quite low. You can change this through setMinLinearReduction()
- Template Parameters
-
GridOperator_ Grid operator for evaluation of residual and Jacobian LinearSolver_ Solver backend for solving linear system of equations
- Examples
- recipe-operator-splitting.cc.
Constructor & Destructor Documentation
◆ NewtonMethod()
|
inline |
Construct Newton using default parameters with default parameters.
in p
Member Function Documentation
◆ printParameters()
|
inline |
Output NewtonMethod parameters.
Setting parameters using ParameterTree is quite error prone. Checking parameters without setting up the debugger can be useful.
◆ setFixedLinearReduction()
|
inline |
Set wether to use a fixed reduction in the linear solver.
- Note
- If fixedLinearReduction is true, the linear reduction rate will always be fixed to minLinearReduction.
◆ setLineSearch()
|
inline |
Set the line search.
See getLineSearch() for already implemented line searches
◆ setMinLinearReduction()
|
inline |
Set the minimal reduction in the linear solver.
- Note
- with minLinearReduction > 0, the linear reduction will be determined as mininum of the minLinearReduction and the linear reduction needed to achieve second order Newton convergence. (As long as you are not using a fixed linear reduction)
◆ setParameters()
|
inline |
Interpret a parameter tree as a set of options for the newton solver.
Possible parameters:
example configuration:
and invocation in the code:
This can also be used to set single parameters like this
References Dune::ParameterTree::get(), Dune::ParameterTree::hasSub(), and Dune::ParameterTree::sub().
Referenced by Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::NewtonMethod().
◆ setReassembleThreshold()
|
inline |
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.
The documentation for this class was generated from the following file:
- dune/pdelab/solver/newton.hh