]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an exception to check that an element exists. 12464/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 14 Jun 2021 22:56:26 +0000 (16:56 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 14 Jun 2021 22:56:26 +0000 (16:56 -0600)
source/lac/petsc_vector_base.cc

index de27a60c3b19069d19e41079c20b02407d51ba62..d4aae2a97a1cfee83027b516126268dc5132fdc8 100644 (file)
@@ -73,6 +73,11 @@ namespace PETScWrappers
           else
             {
               // ghost entry
+              Assert(vector.ghost_indices.is_element(index),
+                     ExcMessage(
+                       "You are trying to access an element of a vector "
+                       "that is neither a locally owned element nor a "
+                       "ghost element of the vector."));
               const size_type ghostidx =
                 vector.ghost_indices.index_within_set(index);
 

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.