]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
clean up more compress() calls
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Feb 2013 15:35:47 +0000 (15:35 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Feb 2013 15:35:47 +0000 (15:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@28381 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/constraint_matrix.templates.h
deal.II/source/lac/petsc_matrix_free.cc
deal.II/source/lac/petsc_vector_base.cc

index 56154db94943aabda16a2ea335e1382e502d0539..4e72bd279589763345fc7bca682349d9aacf0a9d 100644 (file)
@@ -167,13 +167,15 @@ ConstraintMatrix::condense (VectorType &vec) const
               constraint_line->entries[q].second);
     }
 
-  vec.compress();
+  vec.compress(VectorOperation::add);
 
   for (std::vector<ConstraintLine>::const_iterator
        constraint_line = lines.begin();
        constraint_line!=lines.end(); ++constraint_line)
     if (vec.in_local_range(constraint_line->line) == true)
       vec(constraint_line->line) = 0.;
+
+  vec.compress(VectorOperation::insert);
 }
 
 
@@ -777,6 +779,7 @@ namespace internal
       void set_zero_all(const dealii::ConstraintMatrix &cm, VEC &vec)
       {
         set_zero_in_parallel<VEC>(cm, vec, internal::bool2type<IsBlockVector<VEC>::value>());
+        vec.compress(VectorOperation::insert);
       }
 
 
index f688cf5517a8636fac56373149ae2185bfbf1ade..bf3528031547d5382ef4ea5f5fad5ce7641d69e8 100755 (executable)
@@ -229,7 +229,6 @@ namespace PETScWrappers
     // be reimplemented in derived classes
     vmult (*y, *x);
 
-    y->compress();
     // copy the result back to dst
     ierr = VecCopy (&(*(*y)), dst);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
index c228ccdd3d66604c2fc154330f9f789f86da0f5c..b6560781b0806a34d474eee0668c86817651320e 100644 (file)
@@ -211,11 +211,7 @@ namespace PETScWrappers
 
     Assert (numbers::is_finite(s), ExcNumberNotFinite());
 
-    // flush previously cached elements. this
-    // seems to be necessary since petsc
-    // 2.2.1, at least for parallel vectors
-    // (see test bits/petsc_65)
-    compress ();
+    //TODO[TH]: assert(is_compressed())
 
     const int ierr = VecSet (vector, s);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
@@ -986,8 +982,7 @@ namespace PETScWrappers
   void
   VectorBase::write_ascii (const PetscViewerFormat format)
   {
-    // First flush PETSc caches
-    compress();
+    //TODO[TH]:assert(is_compressed())
 
     // Set options
     PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,

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.