3#ifndef DUNE_FEM_GRIDPART_COMMON_ENTITY_HH
4#define DUNE_FEM_GRIDPART_COMMON_ENTITY_HH
6#include <dune/grid/common/entity.hh>
21 template<
int cd,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
26 using BaseType::BaseType;
35 template <
typename T,
typename dummy =
void>
36 struct checkHostEntity : std::false_type {};
39 struct checkHostEntity<T, typename ToVoid<typename T::HostEntityType>
::type > : std::true_type{};
42 template <
class Impl,
bool>
44 typedef Impl HostEntity;
49 struct HE< Impl, true >
53 typedef typename Impl::HostGridPartType::GridType::template
Codim<cd>::Entity __GEType;
55 typedef typename Impl::HostEntityType HostEntity;
57 std::conditional< std::is_same<HostEntity, __GEType>::value,
63 static constexpr bool hasHostEntity = checkHostEntity< ImplementationType >::value;
64 typedef typename HE< ImplementationType, hasHostEntity >::HostEntity HostEntityType;
68 operator const HostEntityType& ()
const
70 if constexpr ( hasHostEntity )
71 return this->
impl().hostEntity();
77 operator const GridEntityType& ()
const
79 if constexpr ( std::is_same< BaseType, GridEntityType > :: value )
83 return gridEntity(*
this);
Wrapper class for entities.
Definition: entity.hh:66
Implementation & impl()
access to the underlying implementation
Definition: entity.hh:80
EntityImp< cd, dim, GridImp > Implementation
type of underlying implementation
Definition: entity.hh:73
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: entity.hh:146
Wrapper class for wrapped entities added a cast operator to the host entity.
Definition: extendedentity.hh:23
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24