Newton< VectorType_ > Class Template Reference#
|
DiFfRG
|
A newton solver, using local error estimates for each vector component. More...
#include <newton.hh>
Public Types | |
| using | VectorType = VectorType_ |
Public Member Functions | |
| Newton (double abstol_=1e-10, double reltol_=1e-6, double assemble_threshold_=0., uint max_steps_=21, uint n_stepsize_iterations_=21) | |
| void | reinit (const VectorType &u) |
| Should it be necessary, one can force a recalculation of the jacobian hereby. | |
| void | operator() (VectorType &iterate) |
| Perform a newton iteration on the input vector. | |
| double | threshold (const double thr) |
| Set the jacobian recalculation threshold, i.e. below which reduction we force a jacobian update. | |
| const VectorType & | get_residual () const |
| const VectorType & | get_initial () const |
| const VectorType & | get_iterate () const |
| double | average_time_newton () const |
| uint | num_newton_calls () const |
| void | set_ignore_nonconv (bool x) |
| Make the newton algorithm return a success even if the evolution did not fulfill the convergence criterion. The iteration always fails if the solution contains NaNs or infinities. | |
| double | get_error () |
| Get the latest error. | |
| uint | get_step () |
| Get the number of steps taken in the latest iteration. | |
| uint | get_jacobians () |
| Get the number of jacobians created in the latest iteration. | |
Public Attributes | |
| std::function< void(VectorType &, const VectorType &)> | residual |
| std::function< void(VectorType &, const VectorType &)> | lin_solve |
| std::function< void(const VectorType &)> | update_jacobian |
Private Member Functions | |
| double | get_EEst () |
| Calculate the current error estimate. | |
| bool | check () |
| Check if the iteration should go on. | |
Private Attributes | |
| VectorType | residual_vector |
| VectorType | initial_vector |
| VectorType | iterate_vector |
| VectorType | Du |
| VectorType | eest_tmp |
| double | abstol |
| double | reltol |
| double | assemble_threshold |
| uint | max_steps |
| uint | n_stepsize_iterations |
| bool | converged |
| bool | ignore_nonconv |
| double | resnorm |
| uint | step |
| uint | jacobians |
| std::vector< double > | timings_newton |
Detailed Description
class DiFfRG::Newton< VectorType_ >
A newton solver, using local error estimates for each vector component.
- Template Parameters
-
VectorType_ Vector type used by the simulation (i.e. any dealii vector type)
Member Typedef Documentation
◆ VectorType
| using DiFfRG::Newton< VectorType_ >::VectorType = VectorType_ |
Constructor & Destructor Documentation
◆ Newton()
|
inline |
Member Function Documentation
◆ average_time_newton()
|
inline |
◆ check()
|
inlineprivate |
Check if the iteration should go on.
- Returns
- true
- false
◆ get_EEst()
|
inlineprivate |
Calculate the current error estimate.
- Returns
- double
◆ get_error()
|
inline |
Get the latest error.
◆ get_initial()
|
inline |
◆ get_iterate()
|
inline |
◆ get_jacobians()
|
inline |
Get the number of jacobians created in the latest iteration.
◆ get_residual()
|
inline |
◆ get_step()
|
inline |
Get the number of steps taken in the latest iteration.
◆ num_newton_calls()
|
inline |
◆ operator()()
|
inline |
Perform a newton iteration on the input vector.
- Parameters
-
iterate the input vector which contains the initial guess and later the solution.
◆ reinit()
|
inline |
Should it be necessary, one can force a recalculation of the jacobian hereby.
◆ set_ignore_nonconv()
|
inline |
Make the newton algorithm return a success even if the evolution did not fulfill the convergence criterion. The iteration always fails if the solution contains NaNs or infinities.
- Parameters
-
x
◆ threshold()
|
inline |
Set the jacobian recalculation threshold, i.e. below which reduction we force a jacobian update.
- Returns
- double the old threshold
Member Data Documentation
◆ abstol
|
private |
◆ assemble_threshold
|
private |
◆ converged
|
private |
◆ Du
|
private |
◆ eest_tmp
|
private |
◆ ignore_nonconv
|
private |
◆ initial_vector
|
private |
◆ iterate_vector
|
private |
◆ jacobians
|
private |
◆ lin_solve
| std::function<void(VectorType &, const VectorType &)> DiFfRG::Newton< VectorType_ >::lin_solve |
◆ max_steps
|
private |
◆ n_stepsize_iterations
|
private |
◆ reltol
|
private |
◆ residual
| std::function<void(VectorType &, const VectorType &)> DiFfRG::Newton< VectorType_ >::residual |
◆ residual_vector
|
private |
◆ resnorm
|
private |
◆ step
|
private |
◆ timings_newton
|
private |
◆ update_jacobian
| std::function<void(const VectorType &)> DiFfRG::Newton< VectorType_ >::update_jacobian |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/timestepping/solver/newton.hh
Generated by