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)
42 strcpy(format,
"T.%06.3f");
73 const std::string strat = param.
get(
"Strategy");
74 if (strat == std::string(
"uniform"))
76 else if (strat == std::string(
"doubling"))
91 if (now_val !=
start())
93 if (strategy_val ==
doubling && 2*s <= tolerance_val)
100 double h = now_val + s;
101 changed = s != step_val;
113 if (h > final_val-s1)
127 if (print_step == 0.)
132 bool result = (now_val >= next_print_val);
136 next_print_val += print_step;
137 if (next_print_val > final_val)
138 next_print_val = final_val;
143 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())