17 #include <deal.II/algorithms/timestep_control.h> 19 #include <deal.II/base/parameter_handler.h> 21 DEAL_II_NAMESPACE_OPEN
33 , tolerance_val(tolerance)
34 , strategy_val(uniform)
35 , start_step_val(start_step)
36 , max_step_val(max_step)
38 , current_step_val(start_step)
39 , step_val(start_step)
40 , print_step(print_step)
41 , next_print_val(print_step > 0. ? start_val + print_step : start_val - 1.)
44 strcpy(format,
"T.%06.3f");
78 if (
strategy == std::string(
"uniform"))
80 else if (
strategy == std::string(
"doubling"))
94 if (now_val !=
start())
96 if (strategy_val ==
doubling && 2 * s <= tolerance_val)
103 double h = now_val + s;
104 changed = s != step_val;
116 if (h > final_val - s1)
131 if (print_step == 0.)
136 bool result = (now_val >= next_print_val);
140 next_print_val += print_step;
141 if (next_print_val > final_val)
142 next_print_val = final_val;
147 DEAL_II_NAMESPACE_CLOSE
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation="")
std::string get(const std::string &entry_string) const
TimestepControl(double start=0., double final=1., double tolerance=1.e-2, double start_step=1.e-2, double print_step=-1., double max_step=1.)
void start_step(const double step)
double get_double(const std::string &entry_name) const
static void declare_parameters(ParameterHandler ¶m)
void parse_parameters(ParameterHandler ¶m)