From: Peter Munch Date: Sat, 12 Jun 2021 18:20:41 +0000 (+0200) Subject: Fix DataOut for TrilinosWrappers::MPI::Vector X-Git-Tag: v9.4.0-rc1~1224^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12453%2Fhead;p=dealii.git Fix DataOut for TrilinosWrappers::MPI::Vector --- 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. */