3 #ifndef DUNE_POLYHEDRALGRID_ENTITY_HH
4 #define DUNE_POLYHEDRALGRID_ENTITY_HH
7 #include <dune/common/typetraits.hh>
10 #include <dune/grid/common/entity.hh>
22 template<
int codim,
int dim,
class Gr
id >
26 typedef typename std::remove_const< Grid >::type::Traits Traits;
47 typedef typename Traits::ctype
ctype;
49 typedef typename Traits::Index Index;
52 typedef typename Grid::template Codim< codimension >::Entity
Entity;
55 typedef typename Grid::template Codim< codimension >::EntitySeed
EntitySeed;
57 typedef typename Traits::template Codim< codimension >::Geometry
Geometry;
58 typedef typename Traits::template Codim< codimension >::GeometryImpl GeometryImpl;
64 typedef typename Traits::ExtraData ExtraData;
100 return data()->geometryType(seed_);
112 return InteriorEntity;
118 return Geometry( GeometryImpl( data(), seed_ ) );
129 ExtraData data()
const {
return data_; }
131 Index index ()
const {
return seed_.index(); }
137 return seed_.equals(other.seed_);
150 template<
int codim,
int dim,
class Gr
id >
155 typedef typename std::remove_const< Grid >::type::Traits Traits;
159 typedef typename Traits::ExtraData ExtraData;
179 unsigned int subEntities(
const unsigned int cd )
const
184 return data()->subEntities( seed_, cd );
188 typename Grid::template Codim< cd >::EntityPointer
189 subEntity (
int i )
const
191 typedef typename Traits::template Codim< cd >::EntityPointerImpl EntityPointerImpl;
192 typedef typename Traits::template Codim< cd >::EntityImpl EntityImpl;
193 return EntityPointerImpl( EntityImpl( data(), data()->
template subEntitySeed< cd >( seed_, i ) ) );
205 template<
int dim,
class Gr
id >
212 typedef typename Base::Traits Traits;
215 typedef typename Base::ExtraData ExtraData;
223 typedef typename Traits :: LeafIntersectionIteratorImpl LeafIntersectionIteratorImpl;
224 typedef typename Traits::template Codim< codimension >::LocalGeometryImpl LocalGeometryImpl;
233 typedef typename Traits::template Codim< codimension >::LocalGeometry
LocalGeometry;
235 typedef typename Traits::template Codim< codimension >::Entity
Entity;
237 typedef typename Traits::template Codim< codimension >::EntityPointer
EntityPointer;
268 const This& dereference()
const
274 unsigned int subEntities(
const unsigned int codim )
const
279 return data()->subEntities( seed_, codim );
282 template<
int codim >
285 return subEntities( codim );
288 template<
int codim >
289 typename Grid::template Codim< codim >::EntityPointer
290 subEntity (
int i )
const
292 typedef typename Traits::template Codim< codim >::EntityPointerImpl EntityPointerImpl;
293 typedef typename Traits::template Codim< codim >::EntityImpl EntityImpl;
294 return EntityPointerImpl( EntityImpl( data(), data()->
template subEntitySeed< codim >( seed_, i ) ) );
297 bool hasBoundaryIntersections ()
const
299 return data()->hasBoundaryIntersections( this->
seed() );
302 LeafIntersectionIterator ibegin ()
const
304 return LeafIntersectionIterator( LeafIntersectionIteratorImpl( data(), seed_,
true ) );
307 LeafIntersectionIterator iend ()
const
309 return LeafIntersectionIterator( LeafIntersectionIteratorImpl( data(), seed_,
false ) );
312 LeafIntersectionIterator ileafbegin ()
const {
return ibegin(); }
313 LevelIntersectionIterator ilevelbegin ()
const {
return ibegin(); }
315 LeafIntersectionIterator ileafend ()
const {
return iend(); }
316 LevelIntersectionIterator ilevelend ()
const {
return iend(); }
323 EntityPointer father ()
const
325 DUNE_THROW(InvalidStateException,
"no father available");
326 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
327 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
328 return EntityPointer( EntityPointerImpl( EntityImpl( data() ) ) );
331 bool hasFather ()
const
336 LocalGeometry geometryInFather ()
const
338 DUNE_THROW(InvalidStateException,
"no father available");
339 return LocalGeometry( LocalGeometryImpl( data() ) );
342 HierarchicIterator hbegin (
int maxLevel )
const
344 return hend( maxLevel );
347 HierarchicIterator hend (
int )
const
349 typedef typename Traits :: HierarchicIteratorImpl HierarchicIteratorImpl ;
350 return HierarchicIterator( HierarchicIteratorImpl( data(),
false ) );
353 bool isRegular ()
const
363 bool mightVanish ()
const
static const int codimension
codimensioon of the entity
Definition: entity.hh:33
int level() const
obtain the level of this entity
Definition: entity.hh:104
PolyhedralGridEntityBasic()
construct a null entity
Definition: entity.hh:71
static const int mydimension
dimension of the entity
Definition: entity.hh:37
Traits::ctype ctype
coordinate type of the grid
Definition: entity.hh:47
static const int dimension
dimension of the grid
Definition: entity.hh:35
static const int dimensionworld
dimension of the world
Definition: entity.hh:39
PolyhedralGridEntityBasic(ExtraData data, const EntitySeed &seed)
construct an initialized entity
Definition: entity.hh:84
PartitionType partitionType() const
obtain the partition type of this entity
Definition: entity.hh:110
Geometry geometry() const
obtain the geometry of this entity
Definition: entity.hh:116
Traits::template Codim< codimension >::Geometry Geometry
type of corresponding geometry
Definition: entity.hh:57
Grid::template Codim< codimension >::Entity Entity
type of entity
Definition: entity.hh:52
PolyhedralGridEntityBasic(ExtraData data)
construct a null entity with data pointer
Definition: entity.hh:77
EntitySeed seed() const
return EntitySeed
Definition: entity.hh:122
GeometryType type() const
obtain the name of the corresponding reference element
Definition: entity.hh:98
Grid::template Codim< codimension >::EntitySeed EntitySeed
type of corresponding entity seed
Definition: entity.hh:55
construct a null entity
Definition: entity.hh:207
PolyhedralGridEntity(ExtraData data_param, const EntitySeed &seed)
construct an initialized entity
Definition: entity.hh:262
PolyhedralGridEntity(ExtraData data_param)
construct a null entity with data pointer
Definition: entity.hh:257
Traits::template Codim< codimension >::Entity Entity
type of corresponding entity
Definition: entity.hh:235
Traits::template Codim< codimension >::LocalGeometry LocalGeometry
type of corresponding local geometry
Definition: entity.hh:233
Traits::HierarchicIterator HierarchicIterator
type of hierarchic iterator
Definition: entity.hh:240
PolyhedralGridEntity()
construct a null entity
Definition: entity.hh:252
Traits::LeafIntersectionIterator LeafIntersectionIterator
type of leaf intersection iterator
Definition: entity.hh:242
Traits::template Codim< codimension >::EntityPointer EntityPointer
type of corresponding entity
Definition: entity.hh:237
Traits::LevelIntersectionIterator LevelIntersectionIterator
type of level intersection iterator
Definition: entity.hh:244
Definition: entity.hh:152
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10