From: Sebastian Kinnewig Date: Mon, 29 Jan 2024 11:40:11 +0000 (+0100) Subject: Make a deep-copy of the Tpetra::Vector in the assignment operator. X-Git-Tag: relicensing~99^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f22c82db6b859e013edac205c892caeb418d77f0;p=dealii.git Make a deep-copy of the Tpetra::Vector in the assignment operator. --- diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index cf52c7be02..d9d9519cb2 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -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( - V.vector->getMap()); - Tpetra::deep_copy(*vector, *V.vector); + vector = + Utilities::Trilinos::internal::make_rcp(*V.vector, + Teuchos::Copy); compressed = V.compressed; has_ghost = V.has_ghost;