From aecc7be38cba05425d652aeab49f6c7de80fb01b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 11 Mar 2015 20:36:58 -0500 Subject: [PATCH] Improve what an exception says. This happens to be a case one of my students ran into today. Again for #610. --- include/deal.II/lac/sparse_ilu.h | 11 +++++++++++ include/deal.II/lac/sparse_ilu.templates.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/deal.II/lac/sparse_ilu.h b/include/deal.II/lac/sparse_ilu.h index d2e86ed571..aca55bf088 100644 --- a/include/deal.II/lac/sparse_ilu.h +++ b/include/deal.II/lac/sparse_ilu.h @@ -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."); //@} }; diff --git a/include/deal.II/lac/sparse_ilu.templates.h b/include/deal.II/lac/sparse_ilu.templates.h index bb6e47871b..97113152e8 100644 --- a/include/deal.II/lac/sparse_ilu.templates.h +++ b/include/deal.II/lac/sparse_ilu.templates.h @@ -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]]; -- 2.39.5