]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix vector being a ghosted vectors by accident
authorTimo Heister <timo.heister@gmail.com>
Sun, 17 Feb 2013 14:16:47 +0000 (14:16 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sun, 17 Feb 2013 14:16:47 +0000 (14:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@28439 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_parallel_vector.h
deal.II/source/lac/petsc_parallel_vector.cc

index 52a1399c5a76864a7b3825d03a111af479177fa9..ffbdd2598660b71783088dc8f764dac992d47ddd 100644 (file)
@@ -391,8 +391,15 @@ namespace PETScWrappers
        */
       void reinit (const MPI_Comm     &communicator,
                    const IndexSet   &local,
-                   const IndexSet &ghost = IndexSet(0));
+                   const IndexSet &ghost);
 
+      /**
+       * Reinit as a vector without ghost elements. See
+       * constructor with same signature
+       * for more detais.
+       */
+      void reinit (const MPI_Comm     &communicator,
+                   const IndexSet   &local);
 
       /**
        * Return a reference to the MPI
index fdadfa6ae4957b4291c26505e51d28a3b08fde69..d790c406135abc7261c489d546e05c4864e47d15 100644 (file)
@@ -76,12 +76,6 @@ namespace PETScWrappers
       IndexSet ghost_set = ghost;
       ghost_set.subtract_set(local);
 
-      //possible optmization: figure out if
-      //there are ghost indices (collective
-      //operation!) and then create a
-      //non-ghosted vector.
-//      Vector::create_vector (local.size(), local.n_elements());
-
       Vector::create_vector(local.size(), local.n_elements(), ghost_set);
     }
 
@@ -166,6 +160,15 @@ namespace PETScWrappers
       create_vector(local.size(), local.n_elements(), ghost_set);
     }
 
+    void
+    Vector::reinit (const MPI_Comm     &comm,
+                 const IndexSet   &local)
+    {
+      communicator = comm;
+
+      Assert(local.is_contiguous(), ExcNotImplemented());
+      create_vector(local.size(), local.n_elements());
+    }
 
 
     Vector &
@@ -215,6 +218,7 @@ namespace PETScWrappers
                            const unsigned int  local_size)
     {
       Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
+      ghosted = false;
 
       const int ierr
         = VecCreateMPI (communicator, local_size, PETSC_DETERMINE,

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.