]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an assertion.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 24 Jul 2023 22:11:58 +0000 (16:11 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 8 Sep 2023 10:47:10 +0000 (04:47 -0600)
include/deal.II/lac/affine_constraints.templates.h

index 3ff0add6534e96aebf90ca6bd93e75a9297c637b..55e2d3e0a609c58af5b512a5fb467b63cc535b79 100644 (file)
@@ -2560,6 +2560,18 @@ AffineConstraints<number>::distribute(VectorType &vec) const
 
   if (dealii::is_serial_vector<VectorType>::value == false)
     {
+      // Check that the set of indices we will import is a superset of
+      // the locally-owned ones. This *should* be the case if, as one
+      // would expect, the AffineConstraint object was initialized
+      // with a locally-relevant index set that is indeed a superset
+      // of the locally-owned indices. But you never know what people
+      // pass as arguments...
+#ifdef DEBUG
+      for (const auto i : vec_owned_elements)
+        Assert(needed_elements_for_distribute.is_element(i),
+               ExcInternalError());
+#endif
+
       VectorType ghosted_vector;
       internal::import_vector_with_ghost_elements(
         vec,

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.