28 const bool is_previous_step_accepted = timestep_current.
isAccepted();
30 const double e_n = solution_error;
31 const double zero_threshold = std::numeric_limits<double>::epsilon();
37 double h_new = (e_n > zero_threshold)
38 ? timestep_current.
dt() *
_tol / e_n
39 : 0.5 * timestep_current.
dt();
42 limitStepSize(h_new, is_previous_step_accepted, timestep_current);
45 "This step is rejected due to the relative change from the"
46 " solution of the previous\n"
47 "\t time step to the current solution exceeds the given tolerance"
49 "\t This time step will be repeated with a new time step size of"
51 "\t or the simulation will be halted.",
66 const double h_n = timestep_current.
dt();
69 if (e_n > zero_threshold)
85 std::pow(
_tol / e_n,
_kI) * h_n;
90 h_new = std::pow(
_tol / e_n,
_kI) * h_n;
94 h_new =
limitStepSize(h_new, is_previous_step_accepted, timestep_current);
103 const double h_new,
const bool previous_step_accepted,
106 const double h_n = timestep_current.
dt();
109 const double h_in_range = std::max(
_h_min, std::min(h_new,
_h_max));
114 if (!previous_step_accepted)
119 if (std::abs(limited_h - timestep_current.
dt()) <
120 std::numeric_limits<double>::min())
122 limited_h = std::max(
_h_min, 0.5 * limited_h);
131 if (limited_h > timestep_current.
dt())
133 limited_h = std::max(
_h_min, 0.5 * timestep_current.
dt());
144 auto fixed_output_time_it = std::find_if(
146 [×tep_current](
auto const fixed_output_time)
147 {
return timestep_current.
current() <
Time{fixed_output_time}; });
153 if (
Time{*fixed_output_time_it} <
154 timestep_current.
current() + limited_h)
157 if (std::abs(*fixed_output_time_it - timestep_current.
current()()) >
158 std::numeric_limits<double>::epsilon() *
161 return *fixed_output_time_it - timestep_current.
current()();