diff --git a/ProcessLib/TimeLoop.cpp b/ProcessLib/TimeLoop.cpp index 1fca367abd46440eb6938ce8222e171164378853..e14acebcb78a0bce09e4c6886e856f5862ff1ede 100644 --- a/ProcessLib/TimeLoop.cpp +++ b/ProcessLib/TimeLoop.cpp @@ -399,6 +399,25 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, dt = _end_time - t; } + // Check whether the time stepping is stabilized + if (std::fabs(dt - prev_dt) < std::numeric_limits<double>::epsilon()) + { + if (_last_step_rejected) + { + OGS_FATAL( + "The new step size of %g is the same as that of the previous " + "rejected time step. \nPlease re-run ogs with a proper " + "adjustment in the numerical settings, \ne.g those for " + "time stepper, local or global non-linear solver.", + dt); + } + else + { + DBUG("The time stepping is stabilized with the step size of %g.", + dt); + } + } + return dt; }