diff --git a/dune/solvers/computeenergy.hh b/dune/solvers/computeenergy.hh index 1356ea92b328fbce5c18475accfe39e9e18b5f58..e6933f046fac7dd787a9d8249700f7529287344e 100644 --- a/dune/solvers/computeenergy.hh +++ b/dune/solvers/computeenergy.hh @@ -1,20 +1,19 @@ // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- // vi: set et ts=8 sw=4 sts=4: -#ifndef CONTACT_COMPUTE_ENERGY_HH -#define CONTACT_COMPUTE_ENERGY_HH +#ifndef DUNE_SOLVERS_COMPUTEENERGY_HH +#define DUNE_SOLVERS_COMPUTEENERGY_HH #include "common/arithmetic.hh" template <class M, class V> -double computeEnergy(const M& mat, const V& x, const V& rhs) +double computeEnergy(const M& mat, const V& x) { - return 0.5*Arithmetic::Axy(mat,x,x) - rhs*x; + return 0.5*Arithmetic::Axy(mat,x,x); } template <class M, class V> -double computeEnergy(const M& mat, const V& x) +double computeEnergy(const M& mat, const V& x, const V& rhs) { - return 0.5*Arithmetic::Axy(mat,x,x); + return computeEnergy(mat,x) - rhs*x; } - #endif