From 22e8057e208edf818d4bfb9a680353bec4ee6220 Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel <lisa_julia.nebel@tu-dresden.de> Date: Mon, 5 Oct 2020 08:24:19 +0200 Subject: [PATCH] Change TargetSpace of GFE::LocalEnergy to be a variadic template With this it will be possible to for the SumCosseratEnergy and the SurfaceCosseratEnergy to extend GFE::LocalEnergy, as they need multiple types of TargetSpaces. --- dune/gfe/localenergy.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dune/gfe/localenergy.hh b/dune/gfe/localenergy.hh index ba6f8da4..d80c0f0f 100644 --- a/dune/gfe/localenergy.hh +++ b/dune/gfe/localenergy.hh @@ -8,19 +8,20 @@ namespace Dune { namespace GFE { /** \brief Base class for energies defined by integrating over one grid element */ -template<class Basis, class TargetSpace> +template<class Basis, class... TargetSpaces> class LocalEnergy { public: + using RT = typename std::common_type<typename TargetSpaces::ctype...>::type; /** \brief Compute the energy * * \param localView Local view specifying the current element and the FE space there * \param coefficients The coefficients of a FE function on the current element */ - virtual typename TargetSpace::ctype + virtual RT energy (const typename Basis::LocalView& localView, - const std::vector<TargetSpace>& localSolution) const = 0; + const std::vector<TargetSpaces>&... localSolution) const = 0; /** Empty virtual default destructor * -- GitLab