16#ifndef dealii_solver_control_h
17#define dealii_solver_control_h
109 <<
"Iterative method reported convergence failure in step " <<
last_step
110 <<
". The residual in the last step was " <<
last_residual <<
".\n\n"
111 <<
"This error message can indicate that you have simply not allowed "
112 <<
"a sufficiently large number of iterations for your iterative solver "
113 <<
"to converge. This often happens when you increase the size of your "
114 <<
"problem. In such cases, the last residual will likely still be very "
115 <<
"small, and you can make the error go away by increasing the allowed "
116 <<
"number of iterations when setting up the SolverControl object that "
117 <<
"determines the maximal number of iterations you allow."
119 <<
"The other situation where this error may occur is when your matrix "
120 <<
"is not invertible (e.g., your matrix has a null-space), or if you "
121 <<
"try to apply the wrong solver to a matrix (e.g., using CG for a "
122 <<
"matrix that is not symmetric or not positive definite). In these "
123 <<
"cases, the residual in the last iteration is likely going to be large."
152 const double tol = 1.e-10,
192 check(
const unsigned int step,
const double check_value);
267 const std::vector<double> &
434 const double reduce = 1.e-2,
475 check(
const unsigned int step,
const double check_value)
override;
550 check(
const unsigned int step,
const double check_value)
override;
605 check(
const unsigned int step,
const double check_value)
override;
ConsecutiveControl & operator=(const SolverControl &c)
virtual ~ConsecutiveControl() override=default
unsigned int n_consecutive_iterations
unsigned int n_converged_iterations
virtual State check(const unsigned int step, const double check_value) override
IterationNumberControl & operator=(const SolverControl &c)
virtual State check(const unsigned int step, const double check_value) override
IterationNumberControl(const SolverControl &c)
virtual ~IterationNumberControl() override=default
double set_reduction(const double)
void parse_parameters(ParameterHandler ¶m)
virtual ~ReductionControl() override=default
virtual State check(const unsigned int step, const double check_value) override
static void declare_parameters(ParameterHandler ¶m)
ReductionControl & operator=(const SolverControl &c)
const unsigned int last_step
NoConvergence(const unsigned int last_step, const double last_residual)
const double last_residual
virtual void print_info(std::ostream &out) const override
virtual ~NoConvergence() noexcept override=default
void log_history(const bool)
static void declare_parameters(ParameterHandler ¶m)
double average_reduction() const
virtual ~SolverControl() override=default
const std::vector< double > & get_history_data() const
void clear_failure_criterion()
unsigned int last_step() const
double last_value() const
void log_result(const bool)
unsigned int m_log_frequency
unsigned int log_frequency(unsigned int)
virtual State check(const unsigned int step, const double check_value)
void set_failure_criterion(const double rel_failure_residual)
void enable_history_data()
double step_reduction(unsigned int step) const
std::vector< double > history_data
double relative_failure_residual
unsigned int set_max_steps(const unsigned int)
double set_tolerance(const double)
unsigned int max_steps() const
double initial_value() const
void parse_parameters(ParameterHandler ¶m)
double final_reduction() const
@ iterate
Continue iteration.
@ success
Stop iteration, goal reached.
@ failure
Stop iteration, goal not reached.
bool history_data_enabled
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcHistoryDataRequired()