From: Marc Fehling Date: Tue, 15 Nov 2022 20:13:33 +0000 (-0700) Subject: Make TrilinosWrappers::MPI::Vector::reinit accept Utilities::MPI::Partitioner. X-Git-Tag: v9.5.0-rc1~846^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3c9fec1cf03e9208c2f1146d1e2bb9cd81ddad7;p=dealii.git Make TrilinosWrappers::MPI::Vector::reinit accept Utilities::MPI::Partitioner. --- diff --git a/include/deal.II/lac/trilinos_vector.h b/include/deal.II/lac/trilinos_vector.h index 14daaaf757..fb0232102b 100644 --- a/include/deal.II/lac/trilinos_vector.h +++ b/include/deal.II/lac/trilinos_vector.h @@ -22,6 +22,7 @@ #ifdef DEAL_II_WITH_TRILINOS # include # include +# include # include # include @@ -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 &partitioner, + const bool vector_writable = false); + /** * Create vector by merging components from a block vector. */ diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index d8bba2362a..58063a4a15 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -407,6 +407,19 @@ namespace TrilinosWrappers + void + Vector::reinit( + const std::shared_ptr &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) {