17 #include <deal.II/algorithms/timestep_control.h> 18 #include <deal.II/base/parameter_handler.h> 20 DEAL_II_NAMESPACE_OPEN
32 tolerance_val(tolerance),
33 strategy_val(uniform),
34 start_step_val(start_step),
35 max_step_val(max_step),
37 current_step_val(start_step),
39 print_step(print_step),
40 next_print_val(print_step > 0. ? start_val + print_step : start_val - 1.)
43 strcpy(format,
"T.%06.3f");
74 const std::string strat = param.
get(
"Strategy");
75 if (strat == std::string(
"uniform"))
77 else if (strat == std::string(
"doubling"))
92 if (now_val !=
start())
94 if (strategy_val ==
doubling && 2*s <= tolerance_val)
101 double h = now_val + s;
102 changed = s != step_val;
114 if (h > final_val-s1)
128 if (print_step == 0.)
133 bool result = (now_val >= next_print_val);
137 next_print_val += print_step;
138 if (next_print_val > final_val)
139 next_print_val = final_val;
144 DEAL_II_NAMESPACE_CLOSE
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)
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())