From: Wolfgang Bangerth Date: Sun, 11 Oct 2015 22:28:31 +0000 (-0500) Subject: Improve an error message. X-Git-Tag: v8.4.0-rc2~325^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a506ab51f9818f88e5d182d275264a0679066578;p=dealii.git Improve an error message. --- diff --git a/include/deal.II/lac/chunk_sparse_matrix.h b/include/deal.II/lac/chunk_sparse_matrix.h index 73dc8e6894..039741a956 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.h +++ b/include/deal.II/lac/chunk_sparse_matrix.h @@ -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 */ diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 86988585a4..e6ac726f5c 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -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 */