30 const double tolerance,
31 const bool m_log_history,
32 const bool m_log_result)
36 , initial_val(
numbers::signaling_nan<double>())
37 , lvalue(
numbers::signaling_nan<double>())
38 , lstep(
numbers::invalid_unsigned_int)
39 , check_failure(false)
40 , relative_failure_residual(0)
42 , m_log_history(m_log_history)
44 , m_log_result(m_log_result)
45 , history_data_enabled(false)
65 deallog <<
"Check " << step <<
"\t" << check_value << std::endl;
76 deallog <<
"Starting value " << check_value << std::endl;
82 if (check_value <=
tol)
85 deallog <<
"Convergence step " << step <<
" value " << check_value
95 deallog <<
"Failure step " << step <<
" value " << check_value
154const std::vector<double> &
161 "The SolverControl object was asked for the solver history "
162 "data, but there is no data. Possibly you requested the data before the "
232 const bool m_log_history,
233 const bool m_log_result)
236 , reduced_tol(
numbers::signaling_nan<double>())
242 , reduce(
numbers::signaling_nan<double>())
243 , reduced_tol(
numbers::signaling_nan<double>())
281 deallog <<
"Convergence step " << step <<
" value " << check_value
318 const double tolerance,
319 const bool m_log_history,
320 const bool m_log_result)
334 deallog <<
"Convergence step " << step <<
" value " << check_value
350 const unsigned int n,
351 const double tolerance,
352 const unsigned int n_consecutive_iterations,
353 const bool m_log_history,
354 const bool m_log_result)
356 , n_consecutive_iterations(n_consecutive_iterations)
357 , n_converged_iterations(0)
360 ExcMessage(
"n_consecutive_iterations should be positive"));
367 , n_consecutive_iterations(1)
368 , n_converged_iterations(0)
396 ExcMessage(
"steps should be ascending integers."));
ConsecutiveControl & operator=(const SolverControl &c)
ConsecutiveControl(const unsigned int maxiter=100, const double tolerance=1.e-10, const unsigned int n_consecutive_iterations=2, const bool log_history=false, const bool log_result=false)
unsigned int n_consecutive_iterations
unsigned int n_converged_iterations
virtual State check(const unsigned int step, const double check_value) override
virtual State check(const unsigned int step, const double check_value) override
IterationNumberControl(const unsigned int maxiter=100, const double tolerance=1e-12, const bool log_history=false, const bool log_result=true)
long int get_integer(const std::string &entry_string) const
bool get_bool(const std::string &entry_name) const
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation="", const bool has_to_be_set=false)
double get_double(const std::string &entry_name) const
double set_reduction(const double)
void parse_parameters(ParameterHandler ¶m)
virtual State check(const unsigned int step, const double check_value) override
static void declare_parameters(ParameterHandler ¶m)
ReductionControl & operator=(const SolverControl &c)
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)
static void declare_parameters(ParameterHandler ¶m)
double average_reduction() const
const std::vector< double > & get_history_data() const
unsigned int last_step() const
double last_value() const
unsigned int m_log_frequency
unsigned int log_frequency(unsigned int)
virtual State check(const unsigned int step, const double check_value)
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)
SolverControl(const unsigned int n=100, const double tol=1.e-10, const bool log_history=false, const bool log_result=true)
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
Subscriptor & operator=(const Subscriptor &)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcHistoryDataRequired()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
bool is_nan(const double x)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)