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;
46 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;
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 const int faces = subEntities( 1 );
300 for(
int i=0; i<faces; ++i )
302 #if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
303 if( !this->
template subEntity< 1 >( i ).
seed().isValid() )
305 if( !this->
template subEntity< 1 >( i )->
seed().isValid() )
312 #if ! DUNE_VERSION_NEWER(DUNE_GRID,2,4)
313 LeafIntersectionIterator ibegin ()
const
315 return LeafIntersectionIterator( LeafIntersectionIteratorImpl( data(), seed_,
true ) );
318 LeafIntersectionIterator iend ()
const
320 return LeafIntersectionIterator( LeafIntersectionIteratorImpl( data(), seed_,
false ) );
323 LeafIntersectionIterator ileafbegin ()
const {
return ibegin(); }
324 LevelIntersectionIterator ilevelbegin ()
const {
return ibegin(); }
326 LeafIntersectionIterator ileafend ()
const {
return iend(); }
327 LevelIntersectionIterator ilevelend ()
const {
return iend(); }
335 EntityPointer father ()
const
337 DUNE_THROW(InvalidStateException,
"no father available");
338 typedef typename Traits::template Codim< 0 >::EntityImpl EntityImpl;
339 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
340 return EntityPointer( EntityPointerImpl( EntityImpl( data() ) ) );
343 bool hasFather ()
const
348 LocalGeometry geometryInFather ()
const
350 DUNE_THROW(InvalidStateException,
"no father available");
351 return LocalGeometry( LocalGeometryImpl( data() ) );
354 HierarchicIterator hbegin (
int maxLevel )
const
356 return hend( maxLevel );
359 HierarchicIterator hend (
int )
const
361 typedef typename Traits :: HierarchicIteratorImpl HierarchicIteratorImpl ;
362 return HierarchicIterator( HierarchicIteratorImpl( data(),
false ) );
365 bool isRegular ()
const
375 bool mightVanish ()
const
387 #endif // #ifndef DUNE_POLYHEDRALGRID_ENTITY_HH
static const int codimension
codimensioon of the entity
Definition: entity.hh:33
EntitySeed seed() const
return EntitySeed
Definition: entity.hh:122
PolyhedralGridEntityBasic(ExtraData data)
construct a null entity with data pointer
Definition: entity.hh:77
Traits::template Codim< codimension >::EntityPointer EntityPointer
type of corresponding entity
Definition: entity.hh:237
Traits::LeafIntersectionIterator LeafIntersectionIterator
type of leaf intersection iterator
Definition: entity.hh:242
Traits::LevelIntersectionIterator LevelIntersectionIterator
type of level intersection iterator
Definition: entity.hh:244
Traits::HierarchicIterator HierarchicIterator
type of hierarchic iterator
Definition: entity.hh:240
static const int dimensionworld
dimension of the world
Definition: entity.hh:39
PolyhedralGridEntity()
construct a null entity
Definition: entity.hh:252
Traits::template Codim< codimension >::Geometry Geometry
type of corresponding geometry
Definition: entity.hh:57
PolyhedralGridEntity(ExtraData data, const EntitySeed &seed)
construct an initialized entity
Definition: entity.hh:262
PolyhedralGridEntityBasic()
construct a null entity
Definition: entity.hh:71
PartitionType partitionType() const
obtain the partition type of this entity
Definition: entity.hh:110
Traits::template Codim< codimension >::Entity Entity
type of corresponding entity
Definition: entity.hh:235
static const int mydimension
dimension of the entity
Definition: entity.hh:37
static const int dimension
dimension of the grid
Definition: entity.hh:35
PolyhedralGridEntityBasic(ExtraData data, const EntitySeed &seed)
construct an initialized entity
Definition: entity.hh:84
Traits::ctype ctype
coordinate type of the grid
Definition: entity.hh:47
Geometry geometry() const
obtain the geometry of this entity
Definition: entity.hh:116
Grid::template Codim< codimension >::EntitySeed EntitySeed
type of corresponding entity seed
Definition: entity.hh:55
Traits::template Codim< codimension >::LocalGeometry LocalGeometry
type of corresponding local geometry
Definition: entity.hh:233
PolyhedralGridEntity(ExtraData data)
construct a null entity with data pointer
Definition: entity.hh:257
construct a null entity
Definition: entity.hh:206
GeometryType type() const
obtain the name of the corresponding reference element
Definition: entity.hh:98
Definition: entity.hh:151
Grid::template Codim< codimension >::Entity Entity
type of entity
Definition: entity.hh:52
int level() const
obtain the level of this entity
Definition: entity.hh:104