1#ifndef DUNE_FEM_GRIDPART_IDGRIDPART_ENTITY_HH
2#define DUNE_FEM_GRIDPART_IDGRIDPART_ENTITY_HH
8#include <dune/grid/common/entity.hh>
9#include <dune/grid/common/gridenums.hh>
12#include <dune/fem/gridpart/common/defaultgridpartentity.hh>
13#include <dune/fem/gridpart/idgridpart/geometry.hh>
22 template<
int codim,
int dim,
class Gr
idFamily >
24 :
public DefaultGridPartEntity < codim, dim, GridFamily >
27 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
34 static const int codimension = codim;
36 static const int dimension = std::remove_const< GridFamily >::type::dimension;
38 static const int mydimension = dimension - codimension;
40 static const int dimensionworld = std::remove_const< GridFamily >::type::dimensionworld;
48 typedef typename std::remove_const< GridFamily >::type::ctype ctype;
51 typedef typename GridFamily::template Codim< codimension >::EntitySeed EntitySeedType;
53 typedef typename Traits::template Codim< codimension >::Geometry Geometry;
58 typedef typename Traits::HostGridPartType HostGridPartType;
62 typedef typename Traits::ExtraData ExtraData;
69 typedef typename HostGridPartType::template Codim< codimension >::EntityType HostEntityType;
77 IdEntityBasic () =
default;
83 IdEntityBasic ( ExtraData data, HostEntityType hostEntity )
84 : data_(
std::move( data ) ),
85 hostEntity_(
std::move( hostEntity ) )
99 return hostEntity().type();
105 return hostEntity().level();
111 return hostEntity().partitionType();
115 Geometry geometry ()
const
117 return Geometry( hostEntity().geometry() );
121 EntitySeedType seed ()
const {
return hostEntity().seed(); }
124 bool equals (
const IdEntityBasic &rhs )
const
126 return hostEntity() == rhs.hostEntity();
135 const HostEntityType &hostEntity ()
const
140 const ExtraData &data ()
const {
return data_; }
146 HostEntityType hostEntity_;
154 template<
int codim,
int dim,
class Gr
idFamily >
155 class IdEntity :
public IdEntityBasic< codim, dim, GridFamily >
157 typedef IdEntityBasic< codim, dim, GridFamily > BaseType ;
159 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
163 typedef typename Traits::HostGridPartType HostGridPartType;
166 typedef typename Traits::ExtraData ExtraData;
169 using BaseType :: codimension ;
175 typedef typename HostGridPartType::template Codim< codimension >::EntityType HostEntityType;
180 IdEntity () =
default;
182 IdEntity ( ExtraData data, HostEntityType hostEntity )
183 : BaseType( data, hostEntity )
195 template<
int dim,
class Gr
idFamily >
196 class IdEntity< 0, dim, GridFamily > :
public IdEntityBasic< 0, dim, GridFamily >
198 typedef IdEntityBasic< 0, dim, GridFamily > BaseType ;
200 typedef typename BaseType::Traits Traits;
203 typedef typename BaseType::ExtraData ExtraData;
206 typedef typename BaseType::HostGridPartType HostGridPartType;
208 using BaseType::codimension ;
209 using BaseType::data ;
210 using BaseType::hostEntity ;
240 IdEntity ( ExtraData data, HostEntityType hostEntity )
241 : BaseType( data, hostEntity )
246 unsigned int subEntities(
const unsigned int codim )
const
248 return hostEntity().subEntities( codim );
251 template<
int codim >
254 return hostEntity().template count< codim >();
257 template<
int codim >
258 typename Traits::template Codim< codim >::Entity
259 subEntity (
int i )
const
261 typedef typename Traits::template Codim< codim >::Entity::Implementation EntityImpl;
262 return EntityImpl( data(), hostEntity().
template subEntity< codim >( i ) );
265 bool hasBoundaryIntersections ()
const
267 return hostEntity().hasBoundaryIntersections();
Traits::template Codim< codimension >::LocalGeometry LocalGeometry
type of corresponding local geometry
Definition: entity.hh:223
HostGridPartType::template Codim< codimension >::EntityType HostEntityType
type of corresponding host entity
Definition: entity.hh:215
IdEntity()=default
construct a null entity
IdEntity(ExtraData data, HostEntityType hostEntity)
construct an initialized entity
Definition: entity.hh:240
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:587
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24