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)
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}
74 "You can't advance time further."
75 "Either dt == 0 or you are at the end of the simulation time."));