]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed some problems regarding Trilinos vectors with different maps
authordaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Mar 2014 13:29:25 +0000 (13:29 +0000)
committerdaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Mar 2014 13:29:25 +0000 (13:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@32642 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_vector_base.h

index 84845480eb4f69d9ea508664a7357ab61c18a7e8..9d5a7e3cfc5f28a3a3a1f2f7f09bc085de596e0a 100644 (file)
@@ -1781,12 +1781,16 @@ namespace TrilinosWrappers
     else
     {
       (*this)*=s;
-      VectorBase tmp = v;
-      tmp *= a;
-      this->add(tmp, true);
-      tmp = w;
-      tmp *= b;
-      this->add(tmp, true);
+      {
+        VectorBase tmp = v;
+        tmp *= a;
+        this->add(tmp, true);
+      }
+      {
+        VectorBase tmp = w;
+        tmp *= b;
+        this->add(tmp, true);
+      }
     }
   }
 
@@ -1833,15 +1837,21 @@ namespace TrilinosWrappers
     else
     {
       (*this)*=s;
-      VectorBase tmp = v;
-      tmp *= a;
-      this->add(tmp, true);
-      tmp = w;
-      tmp *= b;
-      this->add(tmp, true);
-      tmp = x;
-      tmp *= c;
-      this->add(tmp, true);
+      {
+        VectorBase tmp = v;
+        tmp *= a;
+        this->add(tmp, true);
+      }
+      {
+        VectorBase tmp = w;
+        tmp *= b;
+        this->add(tmp, true);
+      }
+      {
+        VectorBase tmp = x;
+        tmp *= c;
+        this->add(tmp, true);
+      }
     }
   }
 
@@ -1876,8 +1886,7 @@ namespace TrilinosWrappers
     // If we don't have the same map, copy.
     if (vector->Map().SameAs(v.vector->Map())==false)
       {
-        *vector = *v.vector;
-        *this *= a;
+        this->sadd(0., a, v);
       }
     else
       {
@@ -1911,8 +1920,7 @@ namespace TrilinosWrappers
     // If we don't have the same map, copy.
     if (vector->Map().SameAs(v.vector->Map())==false)
       {
-        *vector = *v.vector;
-        sadd(a, b, w);
+        sadd(0., a, v, b, w);
       }
     else
       {

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.