diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh index 0f182ef21476a20dee4e2a3a380690562a30271d..195dbe7d00c3347a7859bd98ea1266db99d2332f 100644 --- a/dune/tectonic/localnonlinearity.hh +++ b/dune/tectonic/localnonlinearity.hh @@ -18,11 +18,11 @@ template <int dimension> class LocalNonlinearity { typedef FieldVector<double, dimension> VectorType; typedef FieldMatrix<double, dimension, dimension> MatrixType; - LocalNonlinearity(NiceFunction const &func) : func_(func) {} + LocalNonlinearity(NiceFunction const *func) : func_(func) {} double operator()(VectorType const x) const { double ret; - func_.evaluate(x.two_norm(), ret); + func_->evaluate(x.two_norm(), ret); return ret; } @@ -31,29 +31,29 @@ template <int dimension> class LocalNonlinearity { 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(); + D[0] = D[1] = func_->rightDifferential(0) * v.two_norm(); return; } double const un = u.two_norm(); double const ndotp = (u * v) / un; // Our coordinate system is now such that v is a unit vector! if (ndotp > 0) { - D[1] = ndotp * func_.rightDifferential(un); - D[0] = ndotp * func_.leftDifferential(un); + D[1] = ndotp * func_->rightDifferential(un); + D[0] = ndotp * func_->leftDifferential(un); } else { - D[1] = ndotp * func_.leftDifferential(un); - D[0] = ndotp * func_.rightDifferential(un); + D[1] = ndotp * func_->leftDifferential(un); + D[0] = ndotp * func_->rightDifferential(un); } } void upperGradient(VectorType const x, VectorType &ret) const { ret = x; - ret *= func_.rightDifferential(x.two_norm()) / x.two_norm(); + ret *= func_->rightDifferential(x.two_norm()) / x.two_norm(); } void lowerGradient(VectorType const x, VectorType &ret) const { ret = x; - ret *= func_.leftDifferential(x.two_norm()) / x.two_norm(); + ret *= func_->leftDifferential(x.two_norm()) / x.two_norm(); } void directionalDomain(VectorType const &, VectorType const &, @@ -63,7 +63,7 @@ template <int dimension> class LocalNonlinearity { } private: - NiceFunction const &func_; + NiceFunction const *func_; }; } #endif diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index e4ff4a5da298a50b121c94dc333f9a6659cb9b6d..842bd73b3f69c9947588a6d2d247c6370ba55221 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -114,7 +114,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { assert(localA != NULL); auto const f = problem.phi.restriction(m); - Dune::LocalNonlinearity<block_size> const phi(*f); + Dune::LocalNonlinearity<block_size> const phi(f); Dune::SampleFunctional<block_size> localJ(*localA, localb, phi, ignore_component);