dune-pdelab 2.7-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 | |
const Result & | result () const |
Return results. | |
virtual void | prepareStep (Domain &solution) |
virtual void | linearSolve () |
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. | |
Real | getAbsoluteLimit () const |
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. | |
void | setFixedLinearReduction (bool fixedLinearReduction) |
Set wether to use a fixed reduction in the linear solver. | |
void | setReassembleThreshold (Real reassembleThreshold) |
Set a threshold, when the linear operator is reassembled. | |
void | setParameters (const ParameterTree ¶meterTree) |
Interpret a parameter tree as a set of options for the newton solver. | |
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. | |
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. | |
NewtonMethod (const GridOperator &gridOperator, LinearSolver &linearSolver) | |
Construct Newton using default parameters with default parameters. | |
NewtonMethod (const GridOperator &gridOperator, LinearSolver &linearSolver, const ParameterTree ¶meterTree) | |
Construct Newton passing a parameter tree. | |
virtual | ~NewtonMethod () |
Newton solver for solving non-linear problems.
GridOperator_ | Grid operator for evaluation of residual and Jacobian |
LinearSolver_ | Solver backend for solving linear system of equations |
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Domain = typename GridOperator::Traits::Domain |
Type of the domain (solution)
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::GridOperator = GridOperator_ |
Type of the grid operator.
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Jacobian = typename GridOperator::Traits::Jacobian |
Type of the Jacobian matrix.
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::LinearSolver = LinearSolver_ |
Type of the linear solver.
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::LineSearch = LineSearchInterface<Domain> |
Type of line search interface.
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Range = typename GridOperator::Traits::Range |
Type of the range (residual)
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Real = typename Dune::FieldTraits<typename Domain::ElementType>::real_type |
Number type.
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Result = PDESolverResult<Real> |
Type of results.
|
inline |
Construct Newton using default parameters with default parameters.
in p
|
inline |
Construct Newton passing a parameter tree.
|
inlinevirtual |
|
inlinevirtual |
Solve the nonlinear problem using solution as initial guess and for storing the result.
|
inline |
Discard the stored Jacobian matrix.
|
inline |
|
inline |
Return a pointer to the stored line search.
|
inline |
Get reduction.
|
inline |
Return a pointer to the stored termination criterion.
|
inline |
Get verbosity level.
|
inline |
Return whether the jacobian matrix is kept across calls to apply().
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Output NewtonMethod parameters.
Setting parameters using ParameterTree is quite error prone. Checking parameters without setting up the debugger can be useful.
|
inline |
Return results.
|
inline |
Set absolute convergence limit.
|
inline |
Set wether to use a fixed reduction in the linear solver.
|
inline |
Does the problem have hanging nodes.
|
inline |
Set whether the jacobian matrix should be kept across calls to apply().
|
inline |
Set the line search.
See getLineSearch() for already implemented line searches
|
inline |
Set the minimal reduction in the linear solver.
|
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
|
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.
|
inline |
Set reduction Newton needs to achieve.
|
inline |
Set the termination criterion.
|
inline |
Set whether to use the maximum norm for stopping criteria.
|
inline |
Set how much output you get.
|
inlinevirtual |
Update _residual and defect in _result.