]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clarify TODO for operator+=
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 18 Feb 2019 17:28:50 +0000 (18:28 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 20 Feb 2019 12:46:19 +0000 (13:46 +0100)
source/lac/trilinos_tpetra_vector.cc

index 7df8249fd6c018435d5356c26e24c2956021f635..ea218f8309f876be3df65c8f0f40cb394d9c4c77 100644 (file)
@@ -257,7 +257,7 @@ namespace LinearAlgebra
 
       // Downcast V. If fails, throws an exception.
       const Vector<Number> &down_V = dynamic_cast<const Vector<Number> &>(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<int, types::global_dof_index>
-          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<Number, int, types::global_dof_index> dummy(
             vector->getMap(), false);
           Tpetra::Import<int, types::global_dof_index> 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);
         }

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.