]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use constructor instead of operator= in SymmetricTensor operations 9457/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 1 Feb 2020 19:06:18 +0000 (20:06 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 2 Feb 2020 20:28:03 +0000 (21:28 +0100)
include/deal.II/base/symmetric_tensor.h

index 9371c3dd023a3696a2e9c355a74a524eaff6f6d7..c9c9f9424df590a87da27ee1b90df005e8ade1af 100644 (file)
@@ -3587,7 +3587,7 @@ operator/(const SymmetricTensor<rank_, dim, Number> &t,
           const OtherNumber &                        factor)
 {
   using product_type = typename ProductType<Number, OtherNumber>::type;
-  SymmetricTensor<rank_, dim, product_type> tt = t;
+  SymmetricTensor<rank_, dim, product_type> tt(t);
   tt /= internal::NumberType<product_type>::value(factor);
   return tt;
 }
@@ -3604,7 +3604,7 @@ template <int rank_, int dim>
 DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
                                                operator*(const SymmetricTensor<rank_, dim> &t, const double factor)
 {
-  SymmetricTensor<rank_, dim> tt = t;
+  SymmetricTensor<rank_, dim> tt(t);
   tt *= factor;
   return tt;
 }
@@ -3621,7 +3621,7 @@ template <int rank_, int dim>
 DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
                                                operator*(const double factor, const SymmetricTensor<rank_, dim> &t)
 {
-  SymmetricTensor<rank_, dim> tt = t;
+  SymmetricTensor<rank_, dim> tt(t);
   tt *= factor;
   return tt;
 }
@@ -3637,7 +3637,7 @@ template <int rank_, int dim>
 DEAL_II_CONSTEXPR inline SymmetricTensor<rank_, dim>
 operator/(const SymmetricTensor<rank_, dim> &t, const double factor)
 {
-  SymmetricTensor<rank_, dim> tt = t;
+  SymmetricTensor<rank_, dim> tt(t);
   tt /= factor;
   return tt;
 }

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.