From 735f2f44e28eec12dd4e3632d4b5096aa91ecc40 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 21 Jan 2019 11:32:40 +0100
Subject: [PATCH] [PL] TS: Change handling when reaching end time.

First removal force the convergence checks to be executed.
Last two changes handle the t being (almost) equal to the
end time.
---
 ProcessLib/UncoupledProcessesTimeLoop.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/ProcessLib/UncoupledProcessesTimeLoop.cpp b/ProcessLib/UncoupledProcessesTimeLoop.cpp
index 938da3740f2..adee1fbaa5e 100644
--- a/ProcessLib/UncoupledProcessesTimeLoop.cpp
+++ b/ProcessLib/UncoupledProcessesTimeLoop.cpp
@@ -328,12 +328,6 @@ double UncoupledProcessesTimeLoop::computeTimeStepping(
     {
         auto& ppd = *_per_process_data[i];
         const auto& timestepper = ppd.timestepper;
-        if (t > timestepper->end())
-        {
-            // skip the process that already reaches the ending time.
-            ppd.skip_time_stepping = true;
-            continue;
-        }
 
         auto& time_disc = ppd.time_disc;
         auto const& x = *_process_solutions[i];
@@ -431,7 +425,8 @@ double UncoupledProcessesTimeLoop::computeTimeStepping(
         }
         else
         {
-            if (t < _end_time)
+            if (t < _end_time || std::abs(t - _end_time) <
+                                     std::numeric_limits<double>::epsilon())
             {
                 WARN(
                     "Time step %d was rejected %d times "
@@ -451,7 +446,8 @@ double UncoupledProcessesTimeLoop::computeTimeStepping(
         }
         else
         {
-            if (t < _end_time)
+            if (t < _end_time || std::abs(t - _end_time) <
+                                     std::numeric_limits<double>::epsilon())
             {
                 t -= prev_dt;
                 rejected_steps++;
-- 
GitLab