From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Tue, 1 Apr 2025 15:03:07 +0000 (-0600)
Subject: Improve an error message.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c6c055ef811d5263da62ecec281c2d5b9c870b3;p=dealii.git

Improve an error message.
---

diff --git a/include/deal.II/lac/sparse_ilu.h b/include/deal.II/lac/sparse_ilu.h
index 6a771ca599..afed1df578 100644
--- a/include/deal.II/lac/sparse_ilu.h
+++ b/include/deal.II/lac/sparse_ilu.h
@@ -147,11 +147,30 @@ public:
   DeclException1(ExcZeroPivot,
                  size_type,
                  << "While computing the ILU decomposition, the algorithm "
-                    "found a zero pivot on the diagonal of row "
+                    "found a zero entry 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.");
+                 << ". The algorithm can not recover from this because it "
+                    "wants to divide by this diagonal entry."
+                    "\n\n"
+                    "There are several reasons why this could be happening. "
+                    "First, the matrix for which you try to compute a "
+                    "decomposition might be singular. Second, the order in "
+                    "which the algorithm considers might lead it to find "
+                    "a zero diagonal entry even though different pivoting "
+                    "strategies might not; the current implementation does "
+                    "not do any pivoting (i.e., it works on rows/columns "
+                    "in their natural order), and so you will trigger "
+                    "this error if, for example, you have a zero in the "
+                    "(0,0) entry of the matrix, even though this does "
+                    "not imply that the matrix is singular."
+                    "\n\n"
+                    "It is possible that you can avoid the error if "
+                    "you re-order degrees of freedom (using "
+                    "the functions in namespace DoFRenumbering). You may "
+                    "also want to consider \"strengthening the diagonal\", "
+                    "using the AdditionalData::strengthen_diagonal parameter "
+                    "you can set in the optional constructor argument of "
+                    "this class.");
   /** @} */
 };