28 calculate_next_time(
const double current_time,
29 const double step_size,
30 const double end_time)
34 double next_time = current_time + step_size;
35 constexpr double relative_tolerance = 0.05;
36 const double time_tolerance = relative_tolerance * step_size;
37 if (next_time > end_time - time_tolerance)
46 const double end_time,
47 const double desired_start_step_size)
48 : start_time{start_time}
50 , current_time{start_time}
51 , next_time{calculate_next_time(start_time,
52 desired_start_step_size,
54 , previous_time{start_time}
55 , start_step_size{next_time - start_time}
73 ExcMessage(
"Only positive time step size is allowed."));
78 "Time step size is too large. The next time cannot exceed the end time."));
88 "Either dt==0 or you are at the "
89 "end of the simulation time."));
double get_next_step_size() const
void set_desired_next_step_size(const double time_step_size)
void set_next_step_size(const double time_step_size)
DiscreteTime(const double start_time, const double end_time, const double desired_start_step_size=0.)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)