]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve what an exception says. 658/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 12 Mar 2015 01:36:58 +0000 (20:36 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 12 Mar 2015 01:36:58 +0000 (20:36 -0500)
This happens to be a case one of my students ran into today. Again for #610.

include/deal.II/lac/sparse_ilu.h
include/deal.II/lac/sparse_ilu.templates.h

index d2e86ed571c69049eb2faf8dfad18198a1000914..aca55bf088d5beec9c88b7391e42ba4ca8ed3ad7 100644 (file)
@@ -142,6 +142,17 @@ public:
                   double,
                   << "The strengthening parameter " << arg1
                   << " is not greater or equal than zero!");
+  /**
+   * Exception
+   */
+  DeclException1 (ExcZeroPivot,
+                  size_type,
+                  << "While computing the ILU decomposition, the algorithm "
+                  "found a zero pivot on the diagonal of row "
+                  << arg1
+                  << ". This must stop the ILU algorithm because it means "
+                  "that the matrix for which you try to compute a "
+                  "decomposition is singular.");
   //@}
 };
 
index bb6e47871b62b21ce109432dba151a8e7a8e3ee3..97113152e8858b9a4539e987f295fc05da4cdcaf 100644 (file)
@@ -126,7 +126,7 @@ label_200:
       // now we have to deal with the diagonal element. in the book it is
       // located at position 'j', but here we use the convention of storing
       // the diagonal element first, so instead of j we use uptr[k]=ia[k]
-      Assert (luval[ia[k]] != 0, ExcInternalError());
+      Assert (luval[ia[k]] != 0, ExcZeroPivot(k));
 
       luval[ia[k]] = 1./luval[ia[k]];
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.