From fe52da7d8785d3ce6ef95d6d619e54ef844930dc Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 13 Feb 2013 15:35:47 +0000 Subject: [PATCH] clean up more compress() calls git-svn-id: https://svn.dealii.org/trunk@28381 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/constraint_matrix.templates.h | 5 ++++- deal.II/source/lac/petsc_matrix_free.cc | 1 - deal.II/source/lac/petsc_vector_base.cc | 9 ++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index 56154db949..4e72bd2795 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -167,13 +167,15 @@ ConstraintMatrix::condense (VectorType &vec) const constraint_line->entries[q].second); } - vec.compress(); + vec.compress(VectorOperation::add); for (std::vector::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(cm, vec, internal::bool2type::value>()); + vec.compress(VectorOperation::insert); } diff --git a/deal.II/source/lac/petsc_matrix_free.cc b/deal.II/source/lac/petsc_matrix_free.cc index f688cf5517..bf35280315 100755 --- a/deal.II/source/lac/petsc_matrix_free.cc +++ b/deal.II/source/lac/petsc_matrix_free.cc @@ -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)); diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc index c228ccdd3d..b6560781b0 100644 --- a/deal.II/source/lac/petsc_vector_base.cc +++ b/deal.II/source/lac/petsc_vector_base.cc @@ -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, -- 2.39.5