]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change the temporary type for a scalar_product function.
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 17 Nov 2017 08:08:45 +0000 (09:08 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 17 Nov 2017 08:08:45 +0000 (09:08 +0100)
include/deal.II/base/symmetric_tensor.h

index d39ee90e3b164dd273cf20e5592554b6a50485d3..df62374d06faf07c3129f8235d5c41a7213ea973 100644 (file)
@@ -3673,7 +3673,7 @@ typename ProductType<Number, OtherNumber>::type
 scalar_product (const SymmetricTensor<2,dim,Number> &t1,
                 const Tensor<2,dim,OtherNumber>     &t2)
 {
-  Number s = 0;
+  typename ProductType<Number, OtherNumber>::type s = internal::NumberType<typename ProductType<Number, OtherNumber>::type>::value(0.0);
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       s += t1[i][j] * t2[i][j];

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.