From: Daniel Arndt Date: Wed, 12 Mar 2014 13:29:25 +0000 (+0000) Subject: Fixed some problems regarding Trilinos vectors with different maps X-Git-Tag: v8.2.0-rc1~706 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd82625e710cf42186bfec39515165db793cf614;p=dealii.git Fixed some problems regarding Trilinos vectors with different maps git-svn-id: https://svn.dealii.org/trunk@32642 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/trilinos_vector_base.h b/deal.II/include/deal.II/lac/trilinos_vector_base.h index 84845480eb..9d5a7e3cfc 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector_base.h +++ b/deal.II/include/deal.II/lac/trilinos_vector_base.h @@ -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 {