]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow v=0.0 for ghosted PETSc and Trilinos vectors 198/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 14 Oct 2014 21:07:29 +0000 (17:07 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 14 Oct 2014 21:07:29 +0000 (17:07 -0400)
source/lac/petsc_vector_base.cc

index 007453082d1ddbd9d11ce2b097386b7b3f2a38fa..041648c52e74ed490f1a669cd78532c2b851c3f9 100644 (file)
@@ -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;
   }
 

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.