From: heister Date: Mon, 5 Aug 2013 20:57:35 +0000 (+0000) Subject: fix another PETSc reinit() call X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92e440701bfc01c01a40a97028abc7c92c69764c;p=dealii-svn.git fix another PETSc reinit() call git-svn-id: https://svn.dealii.org/trunk@30225 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/lac/petsc_parallel_vector.cc b/deal.II/source/lac/petsc_parallel_vector.cc index 3b06dbb0c8..c61872ebbe 100644 --- a/deal.II/source/lac/petsc_parallel_vector.cc +++ b/deal.II/source/lac/petsc_parallel_vector.cc @@ -166,9 +166,17 @@ namespace PETScWrappers Vector::reinit (const Vector &v, const bool fast) { - communicator = v.communicator; - - reinit (communicator, v.size(), v.local_size(), fast); + if (v.has_ghost_elements()) + { + reinit (v.locally_owned_elements(), v.ghost_indices, v.communicator); + if (!fast) + { + int ierr = VecSet(vector, 0.0); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + } + } + else + reinit (communicator, v.size(), v.local_size(), fast); }