Newton solver for solving non-linear problems.
More...
#include <dune/pdelab/solver/newton.hh>
template<typename GridOperator_, typename LinearSolver_>
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 high. You can change this through setMinLinearReduction()
- Template Parameters
-
GridOperator_ | Grid operator for evaluation of resdidual and Jacobian |
LinearSolver_ | Solver backend for solving linear system of equations |
- Examples
- recipe-operator-splitting.cc.
◆ Domain
template<typename GridOperator_ , typename LinearSolver_ >
Type of the domain (solution)
◆ GridOperator
template<typename GridOperator_ , typename LinearSolver_ >
Type of the grid operator.
◆ Jacobian
template<typename GridOperator_ , typename LinearSolver_ >
Type of the Jacobian matrix.
◆ LinearSolver
template<typename GridOperator_ , typename LinearSolver_ >
Type of the linear solver.
◆ Range
template<typename GridOperator_ , typename LinearSolver_ >
Type of the range (residual)
◆ Real
template<typename GridOperator_ , typename LinearSolver_ >
using Dune::PDELab::NewtonMethod< GridOperator_, LinearSolver_ >::Real = typename Dune::FieldTraits<typename Domain::ElementType>::real_type |
◆ Result
template<typename GridOperator_ , typename LinearSolver_ >
◆ NewtonMethod() [1/2]
template<typename GridOperator_ , typename LinearSolver_ >
Construct Newton using default parameters.
◆ NewtonMethod() [2/2]
template<typename GridOperator_ , typename LinearSolver_ >
Construct Newton passing a parameter tree.
◆ apply()
template<typename GridOperator_ , typename LinearSolver_ >
Solve the nonlinear problem using solution as initial guess and for storing the result.
◆ discardMatrix()
template<typename GridOperator_ , typename LinearSolver_ >
Discard the stored Jacobian matrix.
◆ getAbsoluteLimit()
template<typename GridOperator_ , typename LinearSolver_ >
◆ getReduction()
template<typename GridOperator_ , typename LinearSolver_ >
◆ getVerbosityLevel()
template<typename GridOperator_ , typename LinearSolver_ >
◆ keepMatrix()
template<typename GridOperator_ , typename LinearSolver_ >
Return whether the jacobian matrix is kept across calls to apply().
◆ linearSolve()
template<typename GridOperator_ , typename LinearSolver_ >
◆ prepareStep()
template<typename GridOperator_ , typename LinearSolver_ >
◆ result()
template<typename GridOperator_ , typename LinearSolver_ >
◆ setAbsoluteLimit()
template<typename GridOperator_ , typename LinearSolver_ >
Set absolute convergence limit.
◆ setFixedLinearReduction()
template<typename GridOperator_ , typename LinearSolver_ >
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.
◆ setHangingNodeModifications()
template<typename GridOperator_ , typename LinearSolver_ >
Does the problem have hanging nodes.
◆ setKeepMatrix()
template<typename GridOperator_ , typename LinearSolver_ >
Set whether the jacobian matrix should be kept across calls to apply().
◆ setLineSearch()
template<typename GridOperator_ , typename LinearSolver_ >
Set the line search.
See getLineSearch() for already implemented line searches
◆ setMinLinearReduction()
template<typename GridOperator_ , typename LinearSolver_ >
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()
template<typename GridOperator_ , typename LinearSolver_ >
Interpret a parameter tree as a set of options for the newton solver.
Possible parameters:
example configuration:
[newton_parameters]
reassemble_threshold = 0.1
absolute_limit = 1e-6
reduction = 1e-4
min_linear_reduction = 1e-3
[newton_parameters.terminate]
max_iterations = 15
[newton_parameters.line_search]
line_search_damping_factor = 0.7
and invocation in the code:
newton.setParameters(param.sub("NewtonParameters"));
This can also be used to set single parameters like this
Dune::ParameterTree ptree;
ptree["verbosity"] = "4";
newton.setParameters(ptree);
◆ setReassembleThreshold()
template<typename GridOperator_ , typename LinearSolver_ >
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.
◆ setReduction()
template<typename GridOperator_ , typename LinearSolver_ >
Set reduction Newton needs to achieve.
◆ setTerminate()
template<typename GridOperator_ , typename LinearSolver_ >
Set the termination criterion.
◆ setUseMaxNorm()
template<typename GridOperator_ , typename LinearSolver_ >
Set whether to use the maximum norm for stopping criteria.
◆ setVerbosityLevel()
template<typename GridOperator_ , typename LinearSolver_ >
Set how much output you get.
◆ updateDefect()
template<typename GridOperator_ , typename LinearSolver_ >
Update _residual and defect in _result.
The documentation for this class was generated from the following file: