Skip to content
Snippets Groups Projects
Commit 22e8057e authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

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.
parent 156dbcf0
Branches
No related tags found
1 merge request!57Change TargetSpace of GFE::LocalEnergy to be a variadic template and Change from Virtual Function to lambda function in cosserat-continuum
...@@ -8,19 +8,20 @@ namespace Dune { ...@@ -8,19 +8,20 @@ namespace Dune {
namespace GFE { namespace GFE {
/** \brief Base class for energies defined by integrating over one grid element */ /** \brief Base class for energies defined by integrating over one grid element */
template<class Basis, class TargetSpace> template<class Basis, class... TargetSpaces>
class LocalEnergy class LocalEnergy
{ {
public: public:
using RT = typename std::common_type<typename TargetSpaces::ctype...>::type;
/** \brief Compute the energy /** \brief Compute the energy
* *
* \param localView Local view specifying the current element and the FE space there * \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 * \param coefficients The coefficients of a FE function on the current element
*/ */
virtual typename TargetSpace::ctype virtual RT
energy (const typename Basis::LocalView& localView, energy (const typename Basis::LocalView& localView,
const std::vector<TargetSpace>& localSolution) const = 0; const std::vector<TargetSpaces>&... localSolution) const = 0;
/** Empty virtual default destructor /** Empty virtual default destructor
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment