Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | List of all members
IterationNumberControl Class Reference

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

Inheritance diagram for IterationNumberControl:
[legend]

Public Member Functions

 IterationNumberControl (const unsigned int maxiter=100, const double tolerance=1e-12, const bool log_history=false, const bool log_result=true)
 
 IterationNumberControl (const SolverControl &c)
 
IterationNumberControloperator= (const SolverControl &c)
 
virtual ~IterationNumberControl () override=default
 
virtual State check (const unsigned int step, const double check_value) override
 
- 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 () override=default
 
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 ()
 
const std::vector< double > & get_history_data () const
 
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 &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Additional Inherited Members

- Public Types inherited from SolverControl
enum  State { iterate = 0, success, failure }
 
- Static Public Member Functions inherited from SolverControl
static void declare_parameters (ParameterHandler &param)
 
static ::ExceptionBaseExcHistoryDataRequired ()
 
- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- 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< doublehistory_data
 

Detailed Description

Specialization of SolverControl which returns success if a given number of iteration was performed, irrespective of the actual residual. This is useful in cases where you don't want to solve exactly, but rather want to perform a fixed number of iterations, e.g. in an inner solver. The arguments given to this class are exactly the same as for the SolverControl class and the solver terminates similarly when one of the given tolerance or the maximum iteration count were reached. The only difference to SolverControl is that the solver returns success in the latter case.

Author
Martin Kronbichler

Definition at line 517 of file solver_control.h.

Constructor & Destructor Documentation

◆ IterationNumberControl() [1/2]

IterationNumberControl::IterationNumberControl ( const unsigned int  maxiter = 100,
const double  tolerance = 1e-12,
const bool  log_history = false,
const bool  log_result = true 
)

Constructor. Provide exactly the same arguments as the constructor of the SolverControl class.

Definition at line 312 of file solver_control.cc.

◆ IterationNumberControl() [2/2]

IterationNumberControl::IterationNumberControl ( const SolverControl c)

Initialize with a SolverControl object. The result will emulate SolverControl by setting the reduction target to zero.

◆ ~IterationNumberControl()

virtual IterationNumberControl::~IterationNumberControl ( )
overridevirtualdefault

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

Member Function Documentation

◆ operator=()

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

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

◆ check()

SolverControl::State IterationNumberControl::check ( const unsigned int  step,
const double  check_value 
)
overridevirtual

Decide about success or failure of an iteration. This function bases success solely on the fact if a given number of iterations was reached or the check value reached exactly zero.

Reimplemented from SolverControl.

Definition at line 322 of file solver_control.cc.


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