diff --git a/dune/tectonic/localfriction.hh b/dune/tectonic/localfriction.hh index f30f625e9e31b4cad0e209e09a9802dc87933d8f..8439c60335b4fe32c39e2c7e3ceaf3787b2db4bc 100644 --- a/dune/tectonic/localfriction.hh +++ b/dune/tectonic/localfriction.hh @@ -69,17 +69,17 @@ template <int dimension> class LocalFriction { \f} */ void addHessian(VectorType const &x, MatrixType &A) const { - double const normX2 = x.two_norm2(); - double const normX = std::sqrt(normX2); - double const normX3 = normX * normX2; + double const xnorm2 = x.two_norm2(); + double const xnorm = std::sqrt(xnorm2); + double const xnorm3 = xnorm * xnorm2; - double const H1 = func->rightDifferential(normX); - double const H2 = func->second_deriv(normX); + double const H1 = func->rightDifferential(xnorm); + double const H2 = func->second_deriv(xnorm); - // TODO: potential optimisation: factor out (H1 / normX), get rid of normX3 - double const weight1 = H2 / normX2; - double const weight2 = -H1 / normX3; - double const weight3 = H1 / normX; + // TODO: potential optimisation: factor out (H1 / xnorm), get rid of xnorm3 + double const weight1 = H2 / xnorm2; + double const weight2 = -H1 / xnorm3; + double const weight3 = H1 / xnorm; // {{{ In what follows, we handle the case 0 * (1/x) = 0 with x // close to 0.