From 6a7601619a29382b80b7be6b08082b1ee0645bfa Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 12 Jun 2021 20:20:41 +0200 Subject: [PATCH] Fix DataOut for TrilinosWrappers::MPI::Vector --- .../numerics/data_out_dof_data.templates.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index d2f5d89b49..96b350dcdd 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -791,6 +791,21 @@ namespace internal dst.import(temp2, VectorOperation::insert); } +#ifdef DEAL_II_WITH_TRILINOS + template + void + copy_locally_owned_data_from( + const TrilinosWrappers::MPI::Vector & src, + LinearAlgebra::distributed::Vector &dst) + { + // ReadWriteVector does not work for ghosted + // TrilinosWrappers::MPI::Vector objects. Fall back to copy the + // entries manually. + for (const auto i : dst.locally_owned_elements()) + dst[i] = src[i]; + } +#endif + /** * Create a ghosted-copy of a block dof vector. */ -- 2.39.5