From c3c9fec1cf03e9208c2f1146d1e2bb9cd81ddad7 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Tue, 15 Nov 2022 13:13:33 -0700 Subject: [PATCH] Make TrilinosWrappers::MPI::Vector::reinit accept Utilities::MPI::Partitioner. --- include/deal.II/lac/trilinos_vector.h | 10 ++++++++++ source/lac/trilinos_vector.cc | 13 +++++++++++++ 2 files changed, 23 insertions(+) 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) { -- 2.39.5