From 92e440701bfc01c01a40a97028abc7c92c69764c Mon Sep 17 00:00:00 2001 From: heister Date: Mon, 5 Aug 2013 20:57:35 +0000 Subject: [PATCH] fix another PETSc reinit() call git-svn-id: https://svn.dealii.org/trunk@30225 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/petsc_parallel_vector.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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); } -- 2.39.5