]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix another PETSc reinit() call
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Aug 2013 20:57:35 +0000 (20:57 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Aug 2013 20:57:35 +0000 (20:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@30225 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/petsc_parallel_vector.cc

index 3b06dbb0c889818fc8659cd4037cddc5c26b480d..c61872ebbe7acae61f80d76fc3d6211ed0d34924 100644 (file)
@@ -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);
     }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.