From 86b0755c12e85882439ac80bed90f756d0e111ce Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Thu, 5 Jan 2012 18:13:43 +0000
Subject: [PATCH] hopefully last grr on time step size of retries

This issue seems to be jinxed.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7313 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/boxmodels/common/boxproblem.hh | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/dumux/boxmodels/common/boxproblem.hh b/dumux/boxmodels/common/boxproblem.hh
index 718aa63ee5..75c362e311 100644
--- a/dumux/boxmodels/common/boxproblem.hh
+++ b/dumux/boxmodels/common/boxproblem.hh
@@ -465,20 +465,17 @@ public:
     void timeIntegration()
     {
         const int maxFails = 10;
-        Scalar dt = timeManager().timeStepSize();
         for (int i = 0; i < maxFails; ++i) {
-            Scalar nextDt = dt / 2;
-
-            // update failed
-            if (i > 0 && gridView().comm().rank() == 0)
-                std::cout << "Newton solver did not converge with dt="<<dt<<" seconds. Retrying with time step of "
-                          << nextDt << " seconds\n";
-
             if (model_.update(newtonMethod_, newtonCtl_))
                 return;
 
+            Scalar dt = timeManager().timeStepSize();
+            Scalar nextDt = dt / 2;
             timeManager().setTimeStepSize(nextDt);
-            dt = nextDt;
+
+            // update failed
+            std::cout << "Newton solver did not converge with dt="<<dt<<" seconds. Retrying with time step of "
+                      << nextDt << " seconds\n";
         }
 
         DUNE_THROW(Dune::MathError,
-- 
GitLab