Reference documentation for deal.II version 8.5.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ReductionControl Class Reference

#include <deal.II/lac/solver_control.h>

Inheritance diagram for ReductionControl:

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)
 ReductionControl (const SolverControl &c)
ReductionControloperator= (const SolverControl &c)
virtual ~ReductionControl ()
void parse_parameters (ParameterHandler &param)
virtual State check (const unsigned int step, const double check_value)
double reduction () const
double set_reduction (const double)
- Public Member Functions inherited from SolverControl
 SolverControl (const unsigned int n=100, const double tol=1.e-10, const bool log_history=false, const bool log_result=true)
virtual ~SolverControl ()
void parse_parameters (ParameterHandler &param)
State last_check () const
double initial_value () const
double last_value () const
unsigned int last_step () const
unsigned int max_steps () const
unsigned int set_max_steps (const unsigned int)
void set_failure_criterion (const double rel_failure_residual)
void clear_failure_criterion ()
double tolerance () const
double set_tolerance (const double)
void enable_history_data ()
double average_reduction () const
double final_reduction () const
double step_reduction (unsigned int step) const
void log_history (const bool)
bool log_history () const
unsigned int log_frequency (unsigned int)
void log_result (const bool)
bool log_result () const
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 Subscriptor (const Subscriptor &)
 Subscriptor (Subscriptor &&)
virtual ~Subscriptor ()
Subscriptoroperator= (const Subscriptor &)
Subscriptoroperator= (Subscriptor &&)
void subscribe (const char *identifier=0) const
void unsubscribe (const char *identifier=0) const
unsigned int n_subscriptions () const
void list_subscribers () const
template<class Archive >
void serialize (Archive &ar, const unsigned int version)

Static Public Member Functions

static void declare_parameters (ParameterHandler &param)
- Static Public Member Functions inherited from SolverControl
static void declare_parameters (ParameterHandler &param)
static::ExceptionBase & ExcHistoryDataRequired ()
- Static Public Member Functions inherited from Subscriptor
static::ExceptionBase & ExcInUse (int arg1, char *arg2, std::string &arg3)
static::ExceptionBase & ExcNoSubscriber (char *arg1, char *arg2)

Protected Attributes

double reduce
double reduced_tol
- Protected Attributes inherited from SolverControl
unsigned int maxsteps
double tol
State lcheck
double initial_val
double lvalue
unsigned int lstep
bool check_failure
double relative_failure_residual
double failure_residual
bool m_log_history
unsigned int m_log_frequency
bool m_log_result
bool history_data_enabled
std::vector< double > history_data

Additional Inherited Members

- Public Types inherited from SolverControl
enum  State { iterate = 0, success, failure }

Detailed Description

Specialization of 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% and the tolerance is 0.1%. The initial residual is 2.5. The process will break if 20 iteration are completed or the new residual is less then 2.5*1% or if it is less then 0.1%.

Guido Kanschat

Definition at line 401 of file solver_control.h.

Constructor & Destructor Documentation

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 in addition to arguments that have the same meaning as those of the constructor of the SolverControl constructor.

Definition at line 219 of file

ReductionControl::ReductionControl ( const SolverControl c)

Initialize with a SolverControl object. The result will emulate SolverControl by setting reduce to zero.

Definition at line 231 of file

ReductionControl::~ReductionControl ( )

Virtual destructor is needed as there are virtual functions in this class.

Definition at line 250 of file

Member Function Documentation

ReductionControl & ReductionControl::operator= ( const SolverControl c)

Assign a SolverControl object to ReductionControl. The result of the assignment will emulate SolverControl by setting reduce to zero.

Definition at line 242 of file

void ReductionControl::declare_parameters ( ParameterHandler param)

Interface to parameter file.

Definition at line 289 of file

void ReductionControl::parse_parameters ( ParameterHandler param)

Read parameters from file.

Definition at line 297 of file

SolverControl::State ReductionControl::check ( const unsigned int  step,
const double  check_value 

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.

Definition at line 255 of file

double ReductionControl::reduction ( ) const

Reduction factor.

double ReductionControl::set_reduction ( const double  )

Change reduction factor.

Member Data Documentation

double ReductionControl::reduce

Desired reduction factor.

Definition at line 465 of file solver_control.h.

double ReductionControl::reduced_tol

Reduced tolerance. Stop iterations if either this value is achieved or if the base class indicates success.

Definition at line 471 of file solver_control.h.

The documentation for this class was generated from the following files: