]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add new function for trilinos blockvectors
authorTimo Heister <timo.heister@gmail.com>
Wed, 5 Jun 2013 20:55:55 +0000 (20:55 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 5 Jun 2013 20:55:55 +0000 (20:55 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29770 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h
deal.II/source/lac/trilinos_block_vector.cc

index 8c5408572d7328e00543654a3c56ef8240334946..1d2c4738511ae149622ec68ff632635608193507 100644 (file)
@@ -225,6 +225,14 @@ namespace TrilinosWrappers
       void reinit (const std::vector<IndexSet> &parallel_partitioning,
                    const MPI_Comm              &communicator = MPI_COMM_WORLD,
                    const bool                   fast = false);
+      /**
+       * like above, but with a second set of indices for
+       * ghost entries.
+       */
+      void reinit (const std::vector<IndexSet> &partitioning,
+                   const std::vector<IndexSet> &ghost_values,
+                   const MPI_Comm              &communicator = MPI_COMM_WORLD);
+
 
       /**
        * Change the dimension to that
index aaa3eb830cdbeb9b7221ab444d7d9c98960e58a8..010eeeebe37e35c5952a98c8c1cde3508653fb63 100644 (file)
@@ -136,6 +136,28 @@ namespace TrilinosWrappers
       collect_sizes();
     }
 
+    void
+    BlockVector::reinit (const std::vector<IndexSet> &parallel_partitioning,
+                         const std::vector<IndexSet> &ghost_values,
+                         const MPI_Comm              &communicator)
+    {
+      const size_type no_blocks = parallel_partitioning.size();
+      std::vector<size_type> block_sizes (no_blocks);
+
+      for (size_type i=0; i<no_blocks; ++i)
+        {
+          block_sizes[i] = parallel_partitioning[i].size();
+        }
+
+      this->block_indices.reinit (block_sizes);
+      if (components.size() != n_blocks())
+        components.resize(n_blocks());
+
+      for (size_type i=0; i<n_blocks(); ++i)
+        components[i].reinit(parallel_partitioning[i], ghost_values[i], communicator);
+
+      collect_sizes();
+    }
 
 
     void

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.