From 42b0cd61e37d659cef39eb2303d406be5c86e245 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 14 Feb 2022 20:40:58 -0700 Subject: [PATCH] Improve an error message. --- include/deal.II/lac/petsc_vector_base.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); } -- 2.39.5