diff --git a/ProcessLib/UncoupledProcessesTimeLoop.cpp b/ProcessLib/UncoupledProcessesTimeLoop.cpp index 60a7afc6c0ec3775c31f8b17bb725d46cc40625a..07ebb624feff270e5ef4a2d56417a14204498f07 100644 --- a/ProcessLib/UncoupledProcessesTimeLoop.cpp +++ b/ProcessLib/UncoupledProcessesTimeLoop.cpp @@ -642,13 +642,28 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( if (!is_initial_step) { if (all_process_steps_accepted) + { accepted_steps++; + _last_step_rejected = false; + } else { + if (std::abs(dt -prev_dt) < std::numeric_limits<double>::min() + && _last_step_rejected) + { + OGS_FATAL("\tThis time step is rejected and the new computed" + " step size is the same as\n" + "\tthat was just used.\n" + "\tSuggest to adjust the parameters of the time" + " stepper or try other time stepper.\n" + "\tThe program stops"); + } + if (t < _end_time) { t -= prev_dt; rejected_steps++; + _last_step_rejected = true; } } } diff --git a/ProcessLib/UncoupledProcessesTimeLoop.h b/ProcessLib/UncoupledProcessesTimeLoop.h index df0c9e058b3fc1ba66587f458fbe733ee990053c..61e0f796782e476d3d6b0fd8a364b2e5484d1349 100644 --- a/ProcessLib/UncoupledProcessesTimeLoop.h +++ b/ProcessLib/UncoupledProcessesTimeLoop.h @@ -66,6 +66,7 @@ private: std::unique_ptr<Output> _output; std::vector<std::unique_ptr<SingleProcessData>> _per_process_data; + bool _last_step_rejected = false; const double _start_time; const double _end_time;