]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #14595 from marcfehling/blockvector-reinit
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Sat, 3 Jun 2023 06:06:00 +0000 (08:06 +0200)
committerGitHub <noreply@github.com>
Sat, 3 Jun 2023 06:06:00 +0000 (08:06 +0200)
Added reinit(partitioners) to LA::distributed::BlockVector.

1  2 
include/deal.II/lac/la_parallel_block_vector.h
include/deal.II/lac/la_parallel_block_vector.templates.h
include/deal.II/lac/la_parallel_vector.h

index 3bbf54bfe01ba0146d1bee8852fa5fb97fe9db53,14bb9fc0c8310bc6d544c971da0e46abea3d555b..321ea64071bb70fa9061da6aada4255e6a0bac60
@@@ -174,8 -174,24 +174,24 @@@ namespace LinearAlgebr
         * Same as above but the ghost indices are assumed to be empty.
         */
        BlockVector(const std::vector<IndexSet> &local_ranges,
 -                  const MPI_Comm &             communicator);
 +                  const MPI_Comm               communicator);
  
+       /**
+        * Construct a block vector with a Utilities::MPI::Partitioner for each
+        * block.
+        *
+        * The optional argument @p comm_sm, which consists of processes on
+        * the same shared-memory domain, allows users have read-only access to
+        * both locally-owned and ghost values of processes combined in the
+        * shared-memory communicator. See the general documentation of the
+        * LinearAlgebra::distributed::Vector class for more information about
+        * this argument.
+        */
+       BlockVector(
+         const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
+           &             partitioners,
+         const MPI_Comm &comm_sm = MPI_COMM_SELF);
        /**
         * Destructor.
         *
         */
        void
        reinit(const std::vector<IndexSet> &local_ranges,
 -             const MPI_Comm &             communicator);
 +             const MPI_Comm               communicator);
  
+       /**
+        * Initialize each block with the corresponding parallel partitioning
+        * in @p partitioners. The input arguments are shared pointers, which
+        * store the partitioner data only once and can be shared between several
+        * vectors with the same layout.
+        *
+        * The optional argument @p comm_sm, which consists of processes on
+        * the same shared-memory domain, allows users have read-only access to
+        * both locally-owned and ghost values of processes combined in the
+        * shared-memory communicator. See the general documentation of the
+        * LinearAlgebra::distributed::Vector class for more information about
+        * this argument.
+        */
+       void
+       reinit(
+         const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
+           &             partitioners,
+         const MPI_Comm &comm_sm = MPI_COMM_SELF);
        /**
         * This function copies the data that has accumulated in the data buffer
         * for ghost indices to the owning processor. For the meaning of the

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.