]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve error messages about ghosted vectors. 1330/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 11 Aug 2015 23:03:35 +0000 (18:03 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 11 Aug 2015 23:03:35 +0000 (18:03 -0500)
The TrilinosWrappers::VectorBase class declared its own version of
ExcGhostsPresent that hid the class we already declare globally in
exceptions.h, and thereby led to a situation where we output less
information than is available. This also led to some confusion as
evidenced by a recent mail on the mailing list.

Fix this by removing the extraneous class. Also augment the error
message of the existing class.

include/deal.II/base/exceptions.h
include/deal.II/lac/constraint_matrix.templates.h
include/deal.II/lac/trilinos_vector_base.h

index d3d74836c6773e162840e0af1cc2a34609a36911..63486332f9350d683f5cfcc57b9cf3e25999affc 100644 (file)
@@ -1000,6 +1000,10 @@ namespace StandardExceptions
                     "You are trying an operation on a vector that is only "
                     "allowed if the vector has no ghost elements, but the "
                     "vector you are operating on does have ghost elements. "
+                    "Specifically, vectors with ghost elements are read-only "
+                    "and cannot appear in operations that write into these "
+                    "vectors."
+                    "\n\n"
                     "See the glossary entry on 'Ghosted vectors' for more "
                     "information.");
 
index 4a39e5c87eded053a77da8b09301126f01dcb85e..e7bb325d19ef683a55a0c179955b99d97d37de7d 100644 (file)
@@ -703,7 +703,7 @@ namespace internal
                                        const internal::bool2type<false>     /*is_block_vector*/)
     {
       Assert(!vec.has_ghost_elements(),
-             TrilinosWrappers::VectorBase::ExcGhostsPresent());
+             ExcGhostsPresent());
 #ifdef DEAL_II_WITH_MPI
       const Epetra_MpiComm *mpi_comm
         = dynamic_cast<const Epetra_MpiComm *>(&vec.trilinos_vector().Comm());
index e21094fc1e7b5c1cfb07d7a496f2ee60f65c03c3..d31c1b4c3e5e1def298175cd5158ee722bb20570 100644 (file)
@@ -868,11 +868,6 @@ namespace TrilinosWrappers
     const MPI_Comm &get_mpi_communicator () const;
     //@}
 
-    /**
-     * Exception
-     */
-    DeclException0 (ExcGhostsPresent);
-
     /**
      * 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.