From 218cf2ff24d326822642ffc69fd8e2b87877558e Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 7 Oct 2004 19:46:57 +0000 Subject: [PATCH] Two patches that are necessary for the upgrade to petsc 2.2.1 git-svn-id: https://svn.dealii.org/trunk@9697 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/petsc_matrix_base.cc | 6 ++++++ deal.II/lac/source/petsc_vector_base.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/deal.II/lac/source/petsc_matrix_base.cc b/deal.II/lac/source/petsc_matrix_base.cc index e99ebf9ecf..29fefb2181 100644 --- a/deal.II/lac/source/petsc_matrix_base.cc +++ b/deal.II/lac/source/petsc_matrix_base.cc @@ -102,6 +102,12 @@ namespace PETScWrappers MatrixBase::operator = (const double d) { Assert (d==0, ExcScalarAssignmentOnlyForZeroValue()); + + // flush previously cached elements. this + // seems to be necessary since petsc + // 2.2.1, at least for parallel vectors + // (see test bits/petsc_64) + compress (); const int ierr = MatZeroEntries (matrix); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --git a/deal.II/lac/source/petsc_vector_base.cc b/deal.II/lac/source/petsc_vector_base.cc index 83a2ea5765..efc9e3e99d 100644 --- a/deal.II/lac/source/petsc_vector_base.cc +++ b/deal.II/lac/source/petsc_vector_base.cc @@ -121,6 +121,12 @@ namespace PETScWrappers VectorBase & VectorBase::operator = (const PetscScalar s) { + // 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 (); + const int ierr = VecSet (&s, vector); AssertThrow (ierr == 0, ExcPETScError(ierr)); -- 2.39.5