]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
detect when assigning PETSc vectors to each other when they are not compress()ed
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Feb 2014 22:32:22 +0000 (22:32 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Feb 2014 22:32:22 +0000 (22:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@32464 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_parallel_vector.h

index eaf007917a969a4d6141e04c1b293f3659c021c6..540bf0b23ef45fdf75cd8756e2d4f810d8c8cb11 100644 (file)
@@ -596,6 +596,15 @@ namespace PETScWrappers
     Vector &
     Vector::operator = (const Vector &v)
     {
+      // make sure left- and right-hand side of the assignment are compress()'ed:
+      Assert(v.last_action == VectorOperation::unknown,
+            internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
+                                                   v.last_action));
+      Assert(last_action == VectorOperation::unknown,
+            internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
+                                                   last_action));
+
+
       if (v.size()==0)
         {
           // this happens if v has not been initialized to something useful:

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.