From 3fadd1e569c7edc77a6caf703db8d0da3d01d66f Mon Sep 17 00:00:00 2001
From: Markus Wolff <markus.wolff@twt-gmbh.de>
Date: Tue, 8 May 2012 09:24:52 +0000
Subject: [PATCH] SuperLU backend now checks the solution vector for
 nan's/inf's which can appear if the solver has not found a solution

   - if there are nan's or inf's in the solution vector, converged (the return of the solve() function) is set
     to false
   - reviewed by Klaus



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8251 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/linear/seqsolverbackend.hh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dumux/linear/seqsolverbackend.hh b/dumux/linear/seqsolverbackend.hh
index 944bb26bf9..eb6598c6b6 100644
--- a/dumux/linear/seqsolverbackend.hh
+++ b/dumux/linear/seqsolverbackend.hh
@@ -543,6 +543,19 @@ public:
 
     solver.apply(x, bTmp, result_);
 
+    int size = x.size();
+    for (int i = 0; i < size; i++)
+    {
+        for (int j = 0; j < blockSize; j++)
+        {
+            if (isnan(x[i][j]) || isinf(x[i][j]))
+            {
+                result_.converged = false;
+                break;
+            }
+        }
+    }
+
     return result_.converged;
   }
 
-- 
GitLab