diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh index a8bc770d5d9295efbe492be5e78183a200200d85..bd7e69965a34e399425f7f18e6f744fbb8b9a702 100644 --- a/dune/tectonic/localnonlinearity.hh +++ b/dune/tectonic/localnonlinearity.hh @@ -21,7 +21,7 @@ template <int dimension> class LocalNonlinearity { LocalNonlinearity(shared_ptr<NiceFunction const> func) : func_(func) {} - double operator()(VectorType const x) const { + double operator()(VectorType const &x) const { double ret; func_->evaluate(x.two_norm(), ret); return ret; @@ -29,7 +29,7 @@ template <int dimension> class LocalNonlinearity { // directional subdifferential: at u on the line u + t*v // u and v are assumed to be non-zero - void directionalSubDiff(VectorType const u, VectorType const v, + void directionalSubDiff(VectorType const &u, VectorType const &v, Interval<double> &D) const { if (u.two_norm() == 0) { D[0] = D[1] = func_->rightDifferential(0) * v.two_norm(); @@ -47,12 +47,12 @@ template <int dimension> class LocalNonlinearity { } } - void upperGradient(VectorType const x, VectorType &ret) const { + void upperGradient(VectorType const &x, VectorType &ret) const { ret = x; ret *= func_->rightDifferential(x.two_norm()) / x.two_norm(); } - void lowerGradient(VectorType const x, VectorType &ret) const { + void lowerGradient(VectorType const &x, VectorType &ret) const { ret = x; ret *= func_->leftDifferential(x.two_norm()) / x.two_norm(); }