Public Member Functions | |
ReductionControl (const unsigned int maxiter=100, const double tolerance=1.e-10, const double reduce=1.e-2, const bool log_history=false, const bool log_result=true) | |
virtual | ~ReductionControl () |
void | parse_parameters (ParameterHandler ¶m) |
virtual State | check (const unsigned int step, const double check_value) |
double | reduction () const |
double | set_reduction (const double) |
Static Public Member Functions | |
static void | declare_parameters (ParameterHandler ¶m) |
Protected Attributes | |
double | reduce |
double | reduced_tol |
SolverControl
which returns success
if either the specified tolerance is achieved or if the initial residual (or whatever criterion was chosen by the solver class) is reduced by a given factor. This is useful in cases where you don't want to solve exactly, but rather want to gain two digits or if the maximal number of iterations is achieved. For example: The maximal number of iterations is 20, the reduction factor is 1% und the tolerance is 0.1%. The initial residual is 2.5. The process will break if 20 iteration are comleted or the new residual is less then 2.5*1% or if it is less then 0.1%. ReductionControl::ReductionControl | ( | const unsigned int | maxiter = 100 , |
|
const double | tolerance = 1.e-10 , |
|||
const double | reduce = 1.e-2 , |
|||
const bool | log_history = false , |
|||
const bool | log_result = true | |||
) |
Constructor. Provide the reduction factor additional to the arguments of the Control constructor.
virtual ReductionControl::~ReductionControl | ( | ) | [virtual] |
Virtual destructor is needed as there are virtual functions in this class.
static void ReductionControl::declare_parameters | ( | ParameterHandler & | param | ) | [static] |
Interface to parameter file.
Reimplemented from SolverControl.
void ReductionControl::parse_parameters | ( | ParameterHandler & | param | ) |
Read parameters from file.
Reimplemented from SolverControl.
virtual State ReductionControl::check | ( | const unsigned int | step, | |
const double | check_value | |||
) | [virtual] |
Decide about success or failure of an iteration. This function calls the one in the base class, but sets the tolerance to reduction * initial value
upon the first iteration.
Reimplemented from SolverControl.
double ReductionControl::reduction | ( | ) | const |
Reduction factor.
double ReductionControl::set_reduction | ( | const | double | ) |
Change reduction factor.
double ReductionControl::reduce [protected] |
Desired reduction factor.
double ReductionControl::reduced_tol [protected] |
Reduced tolerance. Stop iterations if either this value is achieved or if the base class indicates success.