From: wolf Date: Thu, 7 Oct 2004 19:48:52 +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=50fddcf2a197f3f0535be0cc25bb734f6aedb6b8;p=dealii-svn.git Two patches that are necessary for the upgrade to petsc 2.2.1 git-svn-id: https://svn.dealii.org/branches/Branch-5-0@9698 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 de15e68d7c..d297e80527 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 1ddfb78601..bf2c92031a 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));