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 |
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 |
A newton solver, using local error estimates for each vector component.
VectorType_ | Vector type used by the simulation (i.e. any dealii vector type) |
using DiFfRG::KINSOL< VectorType_ >::VectorType = VectorType_ |
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 ) |
double DiFfRG::KINSOL< VectorType_ >::average_time_newton | ( | ) | const |
|
private |
Check if the iteration should go on.
|
private |
Calculate the current error estimate.
double DiFfRG::KINSOL< VectorType_ >::get_error | ( | ) |
Get the latest error.
const VectorType & DiFfRG::KINSOL< VectorType_ >::get_initial | ( | ) | const |
const VectorType & DiFfRG::KINSOL< VectorType_ >::get_iterate | ( | ) | const |
unsigned int DiFfRG::KINSOL< VectorType_ >::get_jacobians | ( | ) |
Get the number of jacobians created in the latest iteration.
const VectorType & DiFfRG::KINSOL< VectorType_ >::get_residual | ( | ) | const |
unsigned int DiFfRG::KINSOL< VectorType_ >::get_step | ( | ) |
Get the number of steps taken in the latest iteration.
unsigned int DiFfRG::KINSOL< VectorType_ >::num_newton_calls | ( | ) | const |
void DiFfRG::KINSOL< VectorType_ >::operator() | ( | VectorType & | iterate | ) |
Perform a newton iteration on the input vector.
iterate | the input vector which contains the initial guess and later the solution. |
void DiFfRG::KINSOL< VectorType_ >::reinit | ( | const VectorType & | u | ) |
Should it be necessary, one can force a recalculation of the jacobian hereby.
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.
x |
double DiFfRG::KINSOL< VectorType_ >::threshold | ( | const double | thr | ) |
Set the jacobian recalculation threshold, i.e. below which reduction we force a jacobian update.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
std::function<void(VectorType &, const VectorType &)> DiFfRG::KINSOL< VectorType_ >::lin_solve |
|
private |
|
private |
|
private |
std::function<void(VectorType &, const VectorType &)> DiFfRG::KINSOL< VectorType_ >::residual |
|
private |
|
private |
|
private |
|
private |
std::function<void(const VectorType &)> DiFfRG::KINSOL< VectorType_ >::update_jacobian |