From: wolf Date: Thu, 7 Oct 2004 19:46:57 +0000 (+0000) Subject: Two patches that are necessary for the upgrade to petsc 2.2.1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=218cf2ff24d326822642ffc69fd8e2b87877558e;p=dealii-svn.git 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 --- 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));