]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide better error messages. 3010/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 Aug 2016 16:27:36 +0000 (10:27 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 Aug 2016 16:27:36 +0000 (10:27 -0600)
include/deal.II/lac/chunk_sparsity_pattern.h
include/deal.II/lac/sparse_decomposition.templates.h
include/deal.II/lac/sparsity_pattern.h
include/deal.II/lac/sparsity_tools.h

index 36ac6d50393a982690f7faf20242bc905a94c112..5f8b4d99ab021523a1364f5651d827ae7458127e 100644 (file)
@@ -734,13 +734,19 @@ public:
                   << "(Maximum number of entries for this row: "
                   << arg2 << "; maybe the matrix is already compressed?)");
   /**
-   * Exception
+   * The operation is only allowed after the SparsityPattern has been set up
+   * and compress() was called.
    */
-  DeclException0 (ExcNotCompressed);
+  DeclExceptionMsg (ExcNotCompressed,
+                    "The operation you attempted is only allowed after the SparsityPattern "
+                    "has been set up and compress() was called.");
   /**
-   * Exception
+   * This operation changes the structure of the SparsityPattern and is not
+   * possible after compress() has been called.
    */
-  DeclException0 (ExcMatrixIsCompressed);
+  DeclExceptionMsg (ExcMatrixIsCompressed,
+                    "The operation you attempted changes the structure of the SparsityPattern "
+                    "and is not possible after compress() has been called.");
   /**
    * Exception
    */
index 665e9cb760b5be963e0a06e57bb07a88d1b7fe4f..3f871ad8e671d3ffb9afa7aa19f38777bd92273f 100644 (file)
@@ -118,7 +118,8 @@ void SparseLUDecomposition<number>::initialize (
 
   // now use this sparsity pattern
   Assert (sparsity_pattern_to_use->n_rows()==sparsity_pattern_to_use->n_cols(),
-          typename SparsityPattern::ExcDiagonalNotOptimized());
+          ExcMessage ("It is not possible to compute this matrix decomposition for "
+                      "matrices that are not square."));
   {
     std::vector<const size_type *> tmp;
     tmp.swap (prebuilt_lower_bound);
index a5645e05a23722738542a39a84426c5799290bd4..104d40cb56b97064bd4536da47b68e4a1c010911 100644 (file)
@@ -979,22 +979,20 @@ public:
    * The operation is only allowed after the SparsityPattern has been set up
    * and compress() was called.
    */
-  DeclException0 (ExcNotCompressed);
+  DeclExceptionMsg (ExcNotCompressed,
+                    "The operation you attempted is only allowed after the SparsityPattern "
+                    "has been set up and compress() was called.");
   /**
    * This operation changes the structure of the SparsityPattern and is not
    * possible after compress() has been called.
    */
-  DeclException0 (ExcMatrixIsCompressed);
+  DeclExceptionMsg (ExcMatrixIsCompressed,
+                    "The operation you attempted changes the structure of the SparsityPattern "
+                    "and is not possible after compress() has been called.");
   /**
    * Exception
    */
   DeclException0 (ExcInvalidConstructorCall);
-  /**
-   * This exception is thrown if the matrix does not follow the convention of
-   * storing diagonal elements first in row. Refer to
-   * SparityPattern::optimize_diagonal() for more information.
-   */
-  DeclException0 (ExcDiagonalNotOptimized);
   /**
    * Exception
    */
index e5a820499cde9ab739264544f06af26b8c33f302..4f1061c9c421152aec9f9dd2c803299a3572477a 100644 (file)
@@ -225,7 +225,10 @@ namespace SparsityTools
   /**
    * Exception
    */
-  DeclException0 (ExcMETISNotInstalled);
+  DeclExceptionMsg (ExcMETISNotInstalled,
+                    "The function you called requires METIS, but you did not "
+                    "configure deal.II with METIS.");
+
   /**
    * 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.