From: Wolfgang Bangerth Date: Tue, 15 Feb 2022 03:40:58 +0000 (-0700) Subject: Improve an error message. X-Git-Tag: v9.4.0-rc1~494^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42b0cd61e37d659cef39eb2303d406be5c86e245;p=dealii.git Improve an error message. --- diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index cdc19ab169..b253095eb3 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -1254,7 +1254,14 @@ namespace PETScWrappers Assert(index >= static_cast(begin) && index < static_cast(end), - ExcInternalError()); + ExcMessage("You are accessing elements of a vector without " + "ghost elements that are not actually owned by " + "this vector. A typical case where this may " + "happen is if you are passing a non-ghosted " + "(completely distributed) vector to a function " + "that expects a vector that stores ghost " + "elements for all locally relevant or locally " + "active vector entries.")); *(values_begin + i) = *(ptr + index - begin); }