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 |
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 |
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::Newton< VectorType_ >::VectorType = VectorType_ |
|
inline |
|
inline |
|
inlineprivate |
Check if the iteration should go on.
|
inlineprivate |
Calculate the current error estimate.
|
inline |
Get the latest error.
|
inline |
|
inline |
|
inline |
Get the number of jacobians created in the latest iteration.
|
inline |
|
inline |
Get the number of steps taken in the latest iteration.
|
inline |
|
inline |
Perform a newton iteration on the input vector.
iterate | the input vector which contains the initial guess and later the solution. |
|
inline |
Should it be necessary, one can force a recalculation of the jacobian hereby.
|
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.
x |
|
inline |
Set the jacobian recalculation threshold, i.e. below which reduction we force a jacobian update.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
std::function<void(VectorType &, const VectorType &)> DiFfRG::Newton< VectorType_ >::lin_solve |
|
private |
|
private |
|
private |
std::function<void(VectorType &, const VectorType &)> DiFfRG::Newton< VectorType_ >::residual |
|
private |
|
private |
|
private |
|
private |
std::function<void(const VectorType &)> DiFfRG::Newton< VectorType_ >::update_jacobian |