From 896bb21f8e06918dbbea0b59b98b3ffc9e4cc79f Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Tue, 28 Aug 2007 09:52:21 +0000
Subject: [PATCH] suspect rounding problems also the the model decrease is less
 than 1e-10

[[Imported from SVN: r1612]]
---
 src/rodsolver.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/rodsolver.cc b/src/rodsolver.cc
index 76b0c868..c445a65e 100644
--- a/src/rodsolver.cc
+++ b/src/rodsolver.cc
@@ -370,8 +370,10 @@ void RodSolver<GridType>::solve()
 //             exit(0);
         }
 
-        if (std::abs(oldEnergy-energy) < 1e-12)
+        if (std::abs(oldEnergy-energy) < 1e-12 || modelDecrease < 1e-10) {
             std::cout << "Suspecting rounding problems" << std::endl;
+            break;
+        }
 
         // //////////////////////////////////////////////
         //   Check for acceptance of the step
-- 
GitLab