diff --git a/dune/tectonic/minimisation.hh b/dune/tectonic/minimisation.hh index 7cf815b70f6b8d85e24902aee9c8a43fa3b4dc9d..ef818bdbf1f8e7d5310652d07bb54503c6b43c19 100644 --- a/dune/tectonic/minimisation.hh +++ b/dune/tectonic/minimisation.hh @@ -5,6 +5,7 @@ #include <dune/common/fvector.hh> #include <dune/common/stdstreams.hh> +#include <dune/fufem/arithmetic.hh> #include <dune/fufem/interval.hh> #include <dune/solvers/computeenergy.hh> #include <dune/tnnmg/problem-classes/bisection.hh> @@ -28,9 +29,9 @@ void descentMinimisation(Functional const &J, since A is symmetric. */ - SmallVector tmp = J.b; // b - J.A.mmv(x, tmp); // b-Au - double const JRestb = tmp * v; // <b-Au,v> + SmallVector tmp = J.b; + Arithmetic::addProduct(tmp, -1.0, J.A, x); + double const JRestb = tmp * v; MyDirectionalConvexFunction<LocalNonlinearityType> const JRest( 2.0 * computeEnergy(J.A, v), JRestb, *J.phi, x, v);