From: Timo Heister Date: Tue, 14 Oct 2014 21:07:29 +0000 (-0400) Subject: Allow v=0.0 for ghosted PETSc and Trilinos vectors X-Git-Tag: v8.2.0-rc1~106^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F198%2Fhead;p=dealii.git Allow v=0.0 for ghosted PETSc and Trilinos vectors --- diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 007453082d..041648c52e 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -221,18 +221,18 @@ namespace PETScWrappers AssertThrow (ierr == 0, ExcPETScError(ierr)); if (has_ghost_elements()) - { - Vec ghost = PETSC_NULL; - ierr = VecGhostGetLocalForm(vector, &ghost); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + { + Vec ghost = PETSC_NULL; + ierr = VecGhostGetLocalForm(vector, &ghost); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = VecSet (ghost, s); + AssertThrow (ierr == 0, ExcPETScError(ierr)); - ierr = VecSet (ghost, s); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + ierr = VecGhostRestoreLocalForm(vector, &ghost); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + } - ierr = VecGhostRestoreLocalForm(vector, &ghost); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - } - return *this; }