Commit d2f715a7 authored by Andreas Dedner's avatar Andreas Dedner

[!315] added an sfinae check for template argument `Function` for hp space ctors.

Merge branch 'feature/sfinae4hpspaces' into 'master'

ref:dune-fem/dune-fem Make sure function(entity) is well forme. This avoids
the compiler excepting the `int order` argument used in the local fe spaces

See merge request [!315]

  [!315]: gitlab.dune-project.org/dune-fem/dune-fem/merge_requests/315
parents ecac9750 707ffcde
Pipeline #18340 passed with stage
in 23 minutes and 36 seconds
......@@ -90,6 +90,7 @@ namespace Dune
public:
using GridPartType = typename BaseType::GridPartType;
using EntityType = typename BaseType::EntityType;
using BasisFunctionSetsType = typename BaseType::BasisFunctionSetsType;
explicit AnisotropicDiscontinuousGalerkinSpace ( GridPartType &gridPart,
......@@ -98,7 +99,10 @@ namespace Dune
: BaseType( gridPart, BasisFunctionSetsType(), defaultKey(), interface, direction )
{}
template< class Function >
template <class Function,
std::enable_if_t<
std::is_arithmetic<
decltype(Function(std::declval<const EntityType>()))>::value,int> i=0>
AnisotropicDiscontinuousGalerkinSpace ( GridPartType &gridPart, Function function,
const Dune::InterfaceType interface = Dune::InteriorBorder_All_Interface,
const Dune::CommunicationDirection direction = Dune::ForwardCommunication )
......
......@@ -129,6 +129,7 @@ namespace Dune
public:
using GridPartType = typename BaseType::GridPartType;
using EntityType = typename BaseType::EntityType;
using BasisFunctionSetsType = typename BaseType::BasisFunctionSetsType;
explicit HierarchicLegendreDiscontinuousGalerkinSpace ( GridPartType &gridPart,
......@@ -137,7 +138,10 @@ namespace Dune
: BaseType( gridPart, BasisFunctionSetsType{}, order, interface, direction )
{}
template< class Function >
template <class Function,
std::enable_if_t<
std::is_arithmetic<
decltype(Function(std::declval<const EntityType>()))>::value,int> i=0>
HierarchicLegendreDiscontinuousGalerkinSpace ( GridPartType &gridPart, Function function,
const Dune::InterfaceType interface = Dune::InteriorBorder_All_Interface,
const Dune::CommunicationDirection direction = Dune::ForwardCommunication )
......
......@@ -93,6 +93,7 @@ namespace Dune
static const int polynomialOrder = order ;
using GridPartType = typename BaseType::GridPartType;
using EntityType = typename BaseType::EntityType;
using BasisFunctionSetsType = typename BaseType::BasisFunctionSetsType;
explicit OrthogonalDiscontinuousGalerkinSpace ( GridPartType &gridPart,
......@@ -101,7 +102,10 @@ namespace Dune
: BaseType( gridPart, BasisFunctionSetsType{}, order, interface, direction )
{}
template< class Function >
template <class Function,
std::enable_if_t<
std::is_arithmetic<
decltype(Function(std::declval<const EntityType>()))>::value,int> i=0>
OrthogonalDiscontinuousGalerkinSpace ( GridPartType &gridPart, Function function,
const Dune::InterfaceType interface = Dune::InteriorBorder_All_Interface,
const Dune::CommunicationDirection direction = Dune::ForwardCommunication )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment