diff --git a/dune/tectonic/globallaursennonlinearity.hh b/dune/tectonic/globallaursennonlinearity.hh index 539abedb2a50fb50c1563204ab665dde5fb6ee92..b1d845441e0b08af713fb46e8a92fb7d19a0b7b3 100644 --- a/dune/tectonic/globallaursennonlinearity.hh +++ b/dune/tectonic/globallaursennonlinearity.hh @@ -34,11 +34,11 @@ class GlobalLaursenNonlinearity sigma_n [id + mu id] = sigma_n (1 + mu) id */ - virtual void restriction(int i, OuterFunctionType &f) const { + OuterFunctionType restriction(int i) const { double coefficient = nodalIntegrals[i][0]; coefficient *= normalStress[i]; coefficient *= 1 + coefficientOfFriction[i]; - f = OuterFunctionType(coefficient); + return OuterFunctionType(coefficient); } private: diff --git a/dune/tectonic/globalnonlinearity.hh b/dune/tectonic/globalnonlinearity.hh index a72c2bb29aa3d85ddd8a5d63dc2ae34ea907a78d..8ed3bb38d2a34854d0dbb79c7838a2de0a8fbe22 100644 --- a/dune/tectonic/globalnonlinearity.hh +++ b/dune/tectonic/globalnonlinearity.hh @@ -11,7 +11,7 @@ template <int dim, class OuterFunctionType> class GlobalNonlinearity { /* Return a restriction of the outer function to the i'th node. If */ - virtual void restriction(int i, OuterFunctionType &f) const = 0; + virtual OuterFunctionType restriction(int i) const = 0; }; } #endif diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index 243fdd8e8afaa94599dcdd3163e29519d1069470..cb285c015d5027b43a4bcface66e0d672e1b3c7b 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -114,8 +114,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { } assert(localA != NULL); - FunctionType f; - problem.phi.restriction(m, f); + auto const f = problem.phi.restriction(m); Dune::LocalNonlinearity<block_size> const phi(f); Dune::SampleFunctional<block_size> localJ(*localA, localb, phi, ignore_component);