KINSOL< VectorType_ > Class Template Reference#
|
DiFfRG
|
A newton solver, using local error estimates for each vector component. More...
#include <kinsol.hh>
Public Types | |
| using | VectorType = VectorType_ |
Public Member Functions | |
| KINSOL (double abstol_=1e-10, double reltol_=1e-6, double assemble_threshold_=0., unsigned int max_steps_=21, unsigned int 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 |
| unsigned int | 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. | |
| unsigned int | get_step () |
| Get the number of steps taken in the latest iteration. | |
| unsigned int | 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 | eest_tmp |
| double | abstol |
| double | reltol |
| double | assemble_threshold |
| unsigned int | max_steps |
| unsigned int | n_stepsize_iterations |
| bool | converged |
| bool | ignore_nonconv |
| double | resnorm |
| unsigned int | step |
| unsigned int | jacobians |
| std::vector< double > | timings_newton |
| std::shared_ptr< SUNDIALS::KINSOL< VectorType > > | kinsol |
Detailed Description
class DiFfRG::KINSOL< 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::KINSOL< VectorType_ >::VectorType = VectorType_ |
Constructor & Destructor Documentation
◆ KINSOL()
| DiFfRG::KINSOL< VectorType_ >::KINSOL | ( | double | abstol_ = 1e-10, |
| double | reltol_ = 1e-6, | ||
| double | assemble_threshold_ = 0., | ||
| unsigned int | max_steps_ = 21, | ||
| unsigned int | n_stepsize_iterations_ = 21 ) |
Member Function Documentation
◆ average_time_newton()
| double DiFfRG::KINSOL< VectorType_ >::average_time_newton | ( | ) | const |
◆ check()
|
private |
Check if the iteration should go on.
- Returns
- true
- false
◆ get_EEst()
|
private |
Calculate the current error estimate.
- Returns
- double
◆ get_error()
| double DiFfRG::KINSOL< VectorType_ >::get_error | ( | ) |
Get the latest error.
◆ get_initial()
| const VectorType & DiFfRG::KINSOL< VectorType_ >::get_initial | ( | ) | const |
◆ get_iterate()
| const VectorType & DiFfRG::KINSOL< VectorType_ >::get_iterate | ( | ) | const |
◆ get_jacobians()
| unsigned int DiFfRG::KINSOL< VectorType_ >::get_jacobians | ( | ) |
Get the number of jacobians created in the latest iteration.
◆ get_residual()
| const VectorType & DiFfRG::KINSOL< VectorType_ >::get_residual | ( | ) | const |
◆ get_step()
| unsigned int DiFfRG::KINSOL< VectorType_ >::get_step | ( | ) |
Get the number of steps taken in the latest iteration.
◆ num_newton_calls()
| unsigned int DiFfRG::KINSOL< VectorType_ >::num_newton_calls | ( | ) | const |
◆ operator()()
| void DiFfRG::KINSOL< VectorType_ >::operator() | ( | VectorType & | iterate | ) |
Perform a newton iteration on the input vector.
- Parameters
-
iterate the input vector which contains the initial guess and later the solution.
◆ reinit()
| void DiFfRG::KINSOL< VectorType_ >::reinit | ( | const VectorType & | u | ) |
Should it be necessary, one can force a recalculation of the jacobian hereby.
◆ set_ignore_nonconv()
| void DiFfRG::KINSOL< VectorType_ >::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.
- Parameters
-
x
◆ threshold()
| double DiFfRG::KINSOL< VectorType_ >::threshold | ( | const double | thr | ) |
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 |
◆ eest_tmp
|
private |
◆ ignore_nonconv
|
private |
◆ initial_vector
|
private |
◆ iterate_vector
|
private |
◆ jacobians
|
private |
◆ kinsol
|
private |
◆ lin_solve
| std::function<void(VectorType &, const VectorType &)> DiFfRG::KINSOL< VectorType_ >::lin_solve |
◆ max_steps
|
private |
◆ n_stepsize_iterations
|
private |
◆ reltol
|
private |
◆ residual
| std::function<void(VectorType &, const VectorType &)> DiFfRG::KINSOL< VectorType_ >::residual |
◆ residual_vector
|
private |
◆ resnorm
|
private |
◆ step
|
private |
◆ timings_newton
|
private |
◆ update_jacobian
| std::function<void(const VectorType &)> DiFfRG::KINSOL< 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/kinsol.hh
Generated by