Skip to content
Snippets Groups Projects
Unverified Commit 570dede6 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #2822 from wenqing/fixing_dt

Avoided the infinite time loop when a rejected step gives no change in the step size
parents 1ba951a5 bc5efb11
No related branches found
No related tags found
No related merge requests found
...@@ -399,6 +399,25 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t, ...@@ -399,6 +399,25 @@ double TimeLoop::computeTimeStepping(const double prev_dt, double& t,
dt = _end_time - 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; return dt;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment