]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make a deep-copy of the Tpetra::Vector in the assignment operator.
authorSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Mon, 29 Jan 2024 11:40:11 +0000 (12:40 +0100)
committerSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Mon, 29 Jan 2024 12:26:12 +0000 (13:26 +0100)
include/deal.II/lac/trilinos_tpetra_vector.templates.h

index cf52c7be025f258b0509edf862eea31f364c433d..d9d9519cb201de80669c6fdff349a1c36a1a2e6a 100644 (file)
@@ -289,7 +289,7 @@ namespace LinearAlgebra
       //  - Third case: the vectors have different size.
       if (vector->getMap()->isSameAs(*V.vector->getMap()))
         {
-          *vector = *V.vector;
+          *vector = Tpetra::createCopy(*V.vector);
         }
       else if (size() == V.size())
         {
@@ -317,9 +317,9 @@ namespace LinearAlgebra
       else
         {
           vector.reset();
-          vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
-            V.vector->getMap());
-          Tpetra::deep_copy(*vector, *V.vector);
+          vector =
+            Utilities::Trilinos::internal::make_rcp<VectorType>(*V.vector,
+                                                                Teuchos::Copy);
 
           compressed             = V.compressed;
           has_ghost              = V.has_ghost;

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.