]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make TrilinosWrappers::MPI::Vector::reinit accept Utilities::MPI::Partitioner. 14427/head
authorMarc Fehling <mafehling.git@gmail.com>
Tue, 15 Nov 2022 20:13:33 +0000 (13:13 -0700)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 15 Nov 2022 20:13:33 +0000 (13:13 -0700)
include/deal.II/lac/trilinos_vector.h
source/lac/trilinos_vector.cc

index 14daaaf7577379981cde71000f53ec76ba3745a2..fb0232102b44ec227dded147753484b544ffe5dc 100644 (file)
@@ -22,6 +22,7 @@
 #ifdef DEAL_II_WITH_TRILINOS
 #  include <deal.II/base/index_set.h>
 #  include <deal.II/base/mpi_stub.h>
+#  include <deal.II/base/partitioner.h>
 #  include <deal.II/base/subscriptor.h>
 
 #  include <deal.II/lac/exceptions.h>
@@ -600,6 +601,15 @@ namespace TrilinosWrappers
              const MPI_Comm &communicator    = MPI_COMM_WORLD,
              const bool      vector_writable = false);
 
+      /**
+       * Initialize the vector given to the parallel partitioning described in
+       * @p partitioner using the function above.
+       */
+      void
+      reinit(
+        const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner,
+        const bool vector_writable = false);
+
       /**
        * Create vector by merging components from a block vector.
        */
index d8bba2362a448353cbfa2d844226cd2e737d476b..58063a4a150db5708bb27289bc40e76fba30b6cb 100644 (file)
@@ -407,6 +407,19 @@ namespace TrilinosWrappers
 
 
 
+    void
+    Vector::reinit(
+      const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner,
+      const bool                                                vector_writable)
+    {
+      this->reinit(partitioner->locally_owned_range(),
+                   partitioner->ghost_indices(),
+                   partitioner->get_mpi_communicator(),
+                   vector_writable);
+    }
+
+
+
     Vector &
     Vector::operator=(const Vector &v)
     {

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.