]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix DataOut for TrilinosWrappers::MPI::Vector 12453/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 12 Jun 2021 18:20:41 +0000 (20:20 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 12 Jun 2021 18:30:46 +0000 (20:30 +0200)
include/deal.II/numerics/data_out_dof_data.templates.h

index d2f5d89b49481bd4ac8fd41baa70bd47b816588c..96b350dcddf67caf2c0ff78a94b1dca692150e51 100644 (file)
@@ -791,6 +791,21 @@ namespace internal
         dst.import(temp2, VectorOperation::insert);
       }
 
+#ifdef DEAL_II_WITH_TRILINOS
+      template <typename Number>
+      void
+      copy_locally_owned_data_from(
+        const TrilinosWrappers::MPI::Vector &       src,
+        LinearAlgebra::distributed::Vector<Number> &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.
        */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.