From: Sebastian Kinnewig Date: Fri, 26 Jan 2024 09:44:37 +0000 (+0100) Subject: Fix Copy Constructor in TpetraWrappers::Vector. X-Git-Tag: relicensing~104^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16545%2Fhead;p=dealii.git Fix Copy Constructor in TpetraWrappers::Vector. --- diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index 6d93e62eeb..fbba68b36d 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -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( + V.vector->getMap())) + { + Tpetra::deep_copy(*vector, *V.vector); + if (!V.nonlocal_vector.is_null()) + { + nonlocal_vector = Utilities::Trilinos::internal::make_rcp( + V.nonlocal_vector->getMap()); + Tpetra::deep_copy(*nonlocal_vector, *V.nonlocal_vector); + } + }