From: Daniel Arndt Date: Mon, 18 Feb 2019 17:28:50 +0000 (+0100) Subject: Clarify TODO for operator+= X-Git-Tag: v9.1.0-rc1~309^2~10 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed90c83bc159d2cd4917e3d0f926f75f69a2fd27;p=dealii.git Clarify TODO for operator+= --- 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); }