]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix Copy Constructor in TpetraWrappers::Vector. 16545/head
authorSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Fri, 26 Jan 2024 09:44:37 +0000 (10:44 +0100)
committerSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Fri, 26 Jan 2024 10:09:40 +0000 (11:09 +0100)
include/deal.II/lac/trilinos_tpetra_vector.templates.h

index 6d93e62eeb8f72d45407dcb43f2f1aa9bd4738e5..fbba68b36d2ddfb8f2d4cdf949084ff6b3373368 100644 (file)
@@ -63,9 +63,17 @@ namespace LinearAlgebra
       : Subscriptor()
       , compressed(V.compressed)
       , has_ghost(V.has_ghost)
-      , vector(V.vector)
-      , nonlocal_vector(V.nonlocal_vector)
-    {}
+      , vector(Utilities::Trilinos::internal::make_rcp<VectorType>(
+          V.vector->getMap()))
+    {
+      Tpetra::deep_copy(*vector, *V.vector);
+      if (!V.nonlocal_vector.is_null())
+        {
+          nonlocal_vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+            V.nonlocal_vector->getMap());
+          Tpetra::deep_copy(*nonlocal_vector, *V.nonlocal_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.