Skip to content
Snippets Groups Projects
Commit 5b7ce1cc authored by Elias Pipping's avatar Elias Pipping
Browse files

Fix include guard, avoid duplication

parent 0ef389a0
No related branches found
No related tags found
No related merge requests found
Pipeline #
// -*- 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment