diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index 735afc905c29ddf7ea37efc65a710f8862cdb31a..ee5388cea7cfb101dcffa8e5e77e4fdcd590cd80 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -58,9 +58,8 @@ template <class ConvexProblem> class MyBlockProblem { MyBlockProblem(Dune::ParameterTree const &parset, ConvexProblem const &problem) - : parset(parset), problem(problem) { - bisection = Bisection(); - } + : parset(parset), problem(problem), localBisection() // NOTE: defaults + {} std::string getOutput(bool header = false) const { if (header) { @@ -106,8 +105,8 @@ template <class ConvexProblem> class MyBlockProblem { return 0; int bisectionsteps = 0; - Bisection bisection; - return bisection.minimize(psi, vnorm, 0.0, bisectionsteps) / vnorm; // TODO + Bisection const globalBisection; // NOTE: defaults + return globalBisection.minimize(psi, vnorm, 0.0, bisectionsteps) / vnorm; } void assembleTruncate(VectorType const &u, Linearization &linearization, @@ -186,7 +185,7 @@ template <class ConvexProblem> class MyBlockProblem { /** \brief Constructs and returns an iterate object */ IterateObject getIterateObject() { - return IterateObject(parset, bisection, problem); + return IterateObject(parset, localBisection, problem); } private: @@ -195,8 +194,7 @@ template <class ConvexProblem> class MyBlockProblem { // problem data ConvexProblem const &problem; - // commonly used minimization stuff - Bisection bisection; + Bisection const localBisection; mutable std::ostringstream outStream; }; @@ -214,7 +212,7 @@ class MyBlockProblem<ConvexProblem>::IterateObject { IterateObject(Dune::ParameterTree const &parset, Bisection const &bisection, ConvexProblem const &problem) : problem(problem), - bisection(bisection), + bisection_(bisection), localsteps(parset.get<size_t>("localsolver.steps")) {} public: @@ -254,7 +252,7 @@ class MyBlockProblem<ConvexProblem>::IterateObject { auto const phi = problem.phi.restriction(m); EllipticEnergy<block_size> localJ(*localA, localb, phi, ignore); - minimise(localJ, ui, localsteps, bisection); + minimise(localJ, ui, localsteps, bisection_); } } @@ -262,8 +260,7 @@ class MyBlockProblem<ConvexProblem>::IterateObject { // problem data ConvexProblem const &problem; - // commonly used minimization stuff - Bisection bisection; + Bisection const bisection_; // state data for smoothing procedure used by: // setIterate, updateIterate, solveLocalProblem