diff --git a/dune/fufem/symmetrictensor.hh b/dune/fufem/symmetrictensor.hh index bdc0bb0f33bcd94c2c51827879616b633482009b..d877545333e781f35141dc16d5fd5aa48ec727f7 100644 --- a/dune/fufem/symmetrictensor.hh +++ b/dune/fufem/symmetrictensor.hh @@ -54,7 +54,7 @@ public: { double r = 0.0; for (int i = 0; i < dim*(dim+1)/2; ++i) - r += (1+(i>=dim))*(*this)[i]*B[i]; // this weird looking coefficient is used to produce the 2 as coefficient before the off-diagonal entries which occur twice in the full (symmetric) matrix + r += (i>=dim ? 2 : 1)*(*this)[i]*B[i]; return r; }