From 79d3774c86f0957e2720d8d95ed60659727d9463 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Thu, 12 Oct 2017 09:11:10 -0600
Subject: [PATCH] Provide ExcSourceEqualsDestination with a message.

---
 include/deal.II/lac/chunk_sparse_matrix.h       | 5 ++++-
 include/deal.II/lac/full_matrix.h               | 5 ++++-
 include/deal.II/lac/petsc_matrix_base.h         | 5 ++++-
 include/deal.II/lac/sparse_matrix.h             | 5 ++++-
 include/deal.II/lac/trilinos_sparse_matrix.h    | 5 ++++-
 include/deal.II/lac/trilinos_sparsity_pattern.h | 5 ++++-
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/include/deal.II/lac/chunk_sparse_matrix.h b/include/deal.II/lac/chunk_sparse_matrix.h
index 9bfdd775a8..0f9b773f3c 100644
--- a/include/deal.II/lac/chunk_sparse_matrix.h
+++ b/include/deal.II/lac/chunk_sparse_matrix.h
@@ -1317,7 +1317,10 @@ public:
   /**
    * Exception
    */
-  DeclException0 (ExcSourceEqualsDestination);
+  DeclExceptionMsg (ExcSourceEqualsDestination,
+                    "You are attempting an operation on two matrices that "
+                    "are the same object, but the operation requires that the "
+                    "two objects are in fact different.");
   //@}
 private:
   /**
diff --git a/include/deal.II/lac/full_matrix.h b/include/deal.II/lac/full_matrix.h
index ccc0914fae..351e2dd6c1 100644
--- a/include/deal.II/lac/full_matrix.h
+++ b/include/deal.II/lac/full_matrix.h
@@ -1124,7 +1124,10 @@ public:
   /**
    * Exception
    */
-  DeclException0 (ExcSourceEqualsDestination);
+  DeclExceptionMsg (ExcSourceEqualsDestination,
+                    "You are attempting an operation on two matrices that "
+                    "are the same object, but the operation requires that the "
+                    "two objects are in fact different.");
   /**
    * Exception
    */
diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h
index 1a515ac24d..5defe0901c 100644
--- a/include/deal.II/lac/petsc_matrix_base.h
+++ b/include/deal.II/lac/petsc_matrix_base.h
@@ -871,7 +871,10 @@ namespace PETScWrappers
     /**
      * Exception
      */
-    DeclException0 (ExcSourceEqualsDestination);
+    DeclExceptionMsg (ExcSourceEqualsDestination,
+                      "You are attempting an operation on two matrices that "
+                      "are the same object, but the operation requires that the "
+                      "two objects are in fact different.");
 
     /**
      * Exception.
diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h
index 313a1444e2..69980e16f7 100644
--- a/include/deal.II/lac/sparse_matrix.h
+++ b/include/deal.II/lac/sparse_matrix.h
@@ -1565,7 +1565,10 @@ public:
   /**
    * Exception
    */
-  DeclException0 (ExcSourceEqualsDestination);
+  DeclExceptionMsg (ExcSourceEqualsDestination,
+                    "You are attempting an operation on two matrices that "
+                    "are the same object, but the operation requires that the "
+                    "two objects are in fact different.");
   //@}
 
 protected:
diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h
index 263d3feab2..fb31590069 100644
--- a/include/deal.II/lac/trilinos_sparse_matrix.h
+++ b/include/deal.II/lac/trilinos_sparse_matrix.h
@@ -1920,7 +1920,10 @@ namespace TrilinosWrappers
     /**
      * Exception
      */
-    DeclException0 (ExcSourceEqualsDestination);
+    DeclExceptionMsg (ExcSourceEqualsDestination,
+                      "You are attempting an operation on two matrices that "
+                      "are the same object, but the operation requires that the "
+                      "two objects are in fact different.");
 
     /**
      * Exception
diff --git a/include/deal.II/lac/trilinos_sparsity_pattern.h b/include/deal.II/lac/trilinos_sparsity_pattern.h
index dc42c69243..be6fb960df 100644
--- a/include/deal.II/lac/trilinos_sparsity_pattern.h
+++ b/include/deal.II/lac/trilinos_sparsity_pattern.h
@@ -1113,7 +1113,10 @@ namespace TrilinosWrappers
     /**
      * Exception
      */
-    DeclException0 (ExcSourceEqualsDestination);
+    DeclExceptionMsg (ExcSourceEqualsDestination,
+                      "You are attempting an operation on two sparsity patterns that "
+                      "are the same object, but the operation requires that the "
+                      "two objects are in fact different.");
 
     /**
      * Exception
-- 
2.39.5