From: Wolfgang Bangerth Date: Tue, 11 Aug 2015 23:03:35 +0000 (-0500) Subject: Improve error messages about ghosted vectors. X-Git-Tag: v8.4.0-rc2~627^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ae80af3ad43d5f8a104dd5b7a29aab47ed73f21;p=dealii.git Improve error messages about ghosted vectors. 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. --- diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index d3d74836c6..63486332f9 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -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."); diff --git a/include/deal.II/lac/constraint_matrix.templates.h b/include/deal.II/lac/constraint_matrix.templates.h index 4a39e5c87e..e7bb325d19 100644 --- a/include/deal.II/lac/constraint_matrix.templates.h +++ b/include/deal.II/lac/constraint_matrix.templates.h @@ -703,7 +703,7 @@ namespace internal const internal::bool2type /*is_block_vector*/) { Assert(!vec.has_ghost_elements(), - TrilinosWrappers::VectorBase::ExcGhostsPresent()); + ExcGhostsPresent()); #ifdef DEAL_II_WITH_MPI const Epetra_MpiComm *mpi_comm = dynamic_cast(&vec.trilinos_vector().Comm()); diff --git a/include/deal.II/lac/trilinos_vector_base.h b/include/deal.II/lac/trilinos_vector_base.h index e21094fc1e..d31c1b4c3e 100644 --- a/include/deal.II/lac/trilinos_vector_base.h +++ b/include/deal.II/lac/trilinos_vector_base.h @@ -868,11 +868,6 @@ namespace TrilinosWrappers const MPI_Comm &get_mpi_communicator () const; //@} - /** - * Exception - */ - DeclException0 (ExcGhostsPresent); - /** * Exception */