From: Wolfgang Bangerth Date: Thu, 12 Mar 2015 01:36:58 +0000 (-0500) Subject: Improve what an exception says. X-Git-Tag: v8.3.0-rc1~378^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F658%2Fhead;p=dealii.git Improve what an exception says. This happens to be a case one of my students ran into today. Again for #610. --- 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]];