From ed90c83bc159d2cd4917e3d0f926f75f69a2fd27 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 18 Feb 2019 18:28:50 +0100 Subject: [PATCH] Clarify TODO for operator+= --- source/lac/trilinos_tpetra_vector.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/source/lac/trilinos_tpetra_vector.cc b/source/lac/trilinos_tpetra_vector.cc index 7df8249fd6..ea218f8309 100644 --- a/source/lac/trilinos_tpetra_vector.cc +++ b/source/lac/trilinos_tpetra_vector.cc @@ -257,7 +257,7 @@ namespace LinearAlgebra // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast &>(V); - // If the maps are the same we can Update right away. + // If the maps are the same we can update right away. if (vector->getMap()->isSameAs(*(down_V.trilinos_vector().getMap()))) { vector->update(1., down_V.trilinos_vector(), 1.); @@ -267,21 +267,16 @@ namespace LinearAlgebra Assert(this->size() == down_V.size(), ExcDimensionMismatch(this->size(), down_V.size())); - // TODO: The code doesn't work as expected so we use a workaround. - /*Tpetra::Export - data_exchange(vector->getMap(), down_V.trilinos_vector().getMap()); - vector->doExport(down_V.trilinos_vector(), - data_exchange, - Tpetra::ADD);*/ - + // TODO: Tpetra doesn't have a combine mode that also updates local + // elements, maybe there is a better workaround. Tpetra::Vector dummy( vector->getMap(), false); Tpetra::Import data_exchange( - dummy.getMap(), down_V.trilinos_vector().getMap()); + down_V.trilinos_vector().getMap(), dummy.getMap()); - dummy.doExport(down_V.trilinos_vector(), + dummy.doImport(down_V.trilinos_vector(), data_exchange, - Tpetra::REPLACE); + Tpetra::INSERT); vector->update(1.0, dummy, 1.0); } -- 2.39.5