From 82ebd9291b7bceaeadbb972d16b57ba5e34f0e23 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Thu, 4 Feb 2010 17:51:06 +0000
Subject: [PATCH] throw an exception if direction is not a descent direction

[[Imported from SVN: r5480]]
---
 rodobstacle.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/rodobstacle.cc b/rodobstacle.cc
index 694f91d2..693b402b 100644
--- a/rodobstacle.cc
+++ b/rodobstacle.cc
@@ -292,12 +292,8 @@ int main (int argc, char *argv[]) try
              double oldEnergy = rodAssembler.computeEnergy(x); 
              double energy    = rodAssembler.computeEnergy(newIterate); 
 
-             if (energy >= oldEnergy) {
-                 printf("Richtung ist keine Abstiegsrichtung!\n");
-//                  std::cout << "corr[0]\n" << corr[0] << std::endl;
-
-                 exit(0);
-             }
+             if (energy >= oldEnergy) 
+                 DUNE_THROW(SolverError, "Richtung ist keine Abstiegsrichtung!");
                  
              //  Add correction to the current solution
              x += corr;
-- 
GitLab