From: Martin Kronbichler Date: Sat, 3 Jun 2023 06:06:00 +0000 (+0200) Subject: Merge pull request #14595 from marcfehling/blockvector-reinit X-Git-Tag: v9.5.0-rc1~163 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc056b39668a854a48691f22234f56f74855dc44;p=dealii.git Merge pull request #14595 from marcfehling/blockvector-reinit Added reinit(partitioners) to LA::distributed::BlockVector. --- bc056b39668a854a48691f22234f56f74855dc44 diff --cc include/deal.II/lac/la_parallel_block_vector.h index 3bbf54bfe0,14bb9fc0c8..321ea64071 --- a/include/deal.II/lac/la_parallel_block_vector.h +++ b/include/deal.II/lac/la_parallel_block_vector.h @@@ -174,8 -174,24 +174,24 @@@ namespace LinearAlgebr * Same as above but the ghost indices are assumed to be empty. */ BlockVector(const std::vector &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> + & partitioners, + const MPI_Comm &comm_sm = MPI_COMM_SELF); + /** * Destructor. * @@@ -326,8 -342,27 +342,27 @@@ */ void reinit(const std::vector &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> + & 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