]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve an error message.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 11 Oct 2015 22:28:31 +0000 (17:28 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 11 Oct 2015 22:28:31 +0000 (17:28 -0500)
include/deal.II/lac/chunk_sparse_matrix.h
include/deal.II/lac/sparse_matrix.h

index 73dc8e6894447a3b02ec54d9448885aa28f7ce9a..039741a9560a390e69b93d7d8eaaeb612390b22f 100644 (file)
@@ -1284,8 +1284,22 @@ public:
    */
   DeclException2 (ExcInvalidIndex,
                   int, int,
-                  << "The entry with index <" << arg1 << ',' << arg2
-                  << "> does not exist.");
+                  << "You are trying to access the matrix entry with index <"
+                  << arg1 << ',' << arg2
+                  << ">, but this entry does not exist in the sparsity pattern"
+                  "of this matrix."
+                  "\n\n"
+                  "The most common cause for this problem is that you used "
+                  "a method to build the sparsity pattern that did not "
+                  "(completely) take into account all of the entries you "
+                  "will later try to write into. An example would be "
+                  "building a sparsity pattern that does not include "
+                  "the entries you will write into due to constraint "
+                  "on degrees of freedom such as handing nodes or periodic "
+                  "boundary conditions. In such cases, building the "
+                  "sparsity pattern will succeed, but you will get errors "
+                  "such as the current one at one point or other when "
+                  "trying to write into the entries of the matrix.");
   /**
    * Exception
    */
index 86988585a4989e9a8ac4b520682d6e111d1a973b..e6ac726f5c99f1de8cbac4e32eff904b9c173b3f 100644 (file)
@@ -1508,8 +1508,22 @@ public:
    */
   DeclException2 (ExcInvalidIndex,
                   int, int,
-                  << "The entry with index <" << arg1 << ',' << arg2
-                  << "> does not exist.");
+                  << "You are trying to access the matrix entry with index <"
+                  << arg1 << ',' << arg2
+                  << ">, but this entry does not exist in the sparsity pattern"
+                  "of this matrix."
+                  "\n\n"
+                  "The most common cause for this problem is that you used "
+                  "a method to build the sparsity pattern that did not "
+                  "(completely) take into account all of the entries you "
+                  "will later try to write into. An example would be "
+                  "building a sparsity pattern that does not include "
+                  "the entries you will write into due to constraint "
+                  "on degrees of freedom such as handing nodes or periodic "
+                  "boundary conditions. In such cases, building the "
+                  "sparsity pattern will succeed, but you will get errors "
+                  "such as the current one at one point or other when "
+                  "trying to write into the entries of the matrix.");
   /**
    * Exception
    */

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.