]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix SymmetricTensor::deviator for VectorizedArray 14838/head
authorSebastian Proell <sebastian.proell@tum.de>
Thu, 2 Mar 2023 14:17:00 +0000 (15:17 +0100)
committerSebastian Proell <sebastian.proell@tum.de>
Fri, 3 Mar 2023 08:22:08 +0000 (09:22 +0100)
include/deal.II/base/symmetric_tensor.h

index 4a8397a6d0c1b8957a7d1b2d2bf7f84f9f6712a2..a9c7da529ba84a990a6fa5ac38477eb54c5f6301 100644 (file)
@@ -3311,7 +3311,7 @@ deviator(const SymmetricTensor<2, dim, Number> &t)
   SymmetricTensor<2, dim, Number> tmp = t;
 
   // subtract scaled trace from the diagonal
-  const Number tr = trace(t) / dim;
+  const Number tr = trace(t) * internal::NumberType<Number>::value(1.0 / dim);
   for (unsigned int i = 0; i < dim; ++i)
     tmp.data[i] -= tr;
 

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.