3 #ifndef DUNE_GRID_ENTITY_HH 4 #define DUNE_GRID_ENTITY_HH 8 #include <dune/common/iteratorrange.hh> 9 #include <dune/common/typetraits.hh> 11 #include <dune/geometry/dimension.hh> 12 #include <dune/geometry/referenceelements.hh> 62 template<
int cd,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
98 typedef typename GridImp::template Codim<cd>::Geometry
Geometry;
101 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
126 int level ()
const {
return realEntity.level(); }
143 Geometry
geometry ()
const {
return realEntity.geometry(); }
163 return realEntity.subEntities(codim);
169 EntitySeed
seed ()
const {
return realEntity.seed(); }
188 : realEntity(other.realEntity)
193 : realEntity(
std::move(other.realEntity))
206 realEntity = std::move(other.realEntity);
219 Entity(
const EntityImp<cd,dim,GridImp> & e) : realEntity(e) {}
222 Entity(EntityImp<cd,dim,GridImp> && e) : realEntity(
std::move(e)) {}
241 template<
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
270 typedef typename GridImp::template Codim<0>::Geometry
Geometry;
273 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
316 int level ()
const {
return realEntity.level(); }
322 Geometry
geometry ()
const {
return realEntity.geometry(); }
337 return realEntity.subEntities(codim);
348 EntitySeed
seed ()
const {
return realEntity.seed(); }
367 : realEntity(other.realEntity)
372 : realEntity(
std::move(other.realEntity))
385 realEntity = std::move(other.realEntity);
407 template<
int codim >
411 return realEntity.template subEntity< codim >( i );
426 return realEntity.father();
434 return realEntity.hasFather();
440 return realEntity.isLeaf();
446 bool isRegular()
const {
return realEntity.isRegular(); }
486 HierarchicIterator
hbegin (
int maxLevel)
const 488 return realEntity.hbegin(maxLevel);
498 HierarchicIterator
hend (
int maxLevel)
const 500 return realEntity.hend(maxLevel);
505 bool isNew ()
const {
return realEntity.isNew(); }
525 Entity(
const EntityImp<0,dim,GridImp> & e) : realEntity(e) {}
528 Entity(EntityImp<0,dim,GridImp> && e) : realEntity(
std::move(e)) {}
546 template<
int cd,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
560 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
575 typedef typename std::remove_const< GridImp >::type::ctype ctype;
576 return ReferenceElements< ctype, mydimension >::general( asImp().
type() ).size( codim -
codimension );
586 EntityImp<cd,dim,GridImp>& asImp ()
588 return static_cast<EntityImp<cd,dim,GridImp>&
>(*this);
590 const EntityImp<cd,dim,GridImp>& asImp ()
const 592 return static_cast<const EntityImp<cd,dim,GridImp>&
>(*this);
607 template<
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
621 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
641 typedef typename std::remove_const< GridImp >::type::ctype ctype;
642 return ReferenceElements< ctype, mydimension >::general( asImp().
type() ).size( codim -
codimension );
652 bool isNew ()
const {
return false; }
665 IntersectionIterator end = asImp().ilevelend();
666 for (IntersectionIterator it = asImp().ilevelbegin(); it != end; ++it)
675 EntityImp<0,dim,GridImp>& asImp () {
return static_cast<EntityImp<0,dim,GridImp>&
>(*this); }
676 const EntityImp<0,dim,GridImp>& asImp ()
const {
return static_cast<const EntityImp<0,dim,GridImp>&
>(*this); }
681 #endif // DUNE_GRID_ENTITY_HH GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:582
bool hasBoundaryIntersections() const
Returns true, if entity has intersections with boundary.
Definition: common/entity.hh:515
GridImp::template Codim< cd >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:101
GridImp::HierarchicIterator HierarchicIterator
The HierarchicIterator type.
Definition: common/entity.hh:292
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:161
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
The geometry type of this entity when the geometry is expressed embedded in the father element...
Definition: common/entity.hh:282
Codim< codim >::Entity subEntity(int i) const
Obtain a subentity.
Definition: common/entity.hh:409
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:343
Default Implementations for EntityImp.
Definition: common/entity.hh:547
const Implementation & impl() const
access to the underlying implementation
Definition: common/entity.hh:84
Entity father() const
Inter-level access to father entity on the next-coarser grid. The given entity resulted directly from...
Definition: common/entity.hh:424
Entity(const EntityImp< 0, dim, GridImp > &e)
Copy constructor from EntityImp.
Definition: common/entity.hh:525
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:573
PartitionType partitionType() const
Partition type of this entity.
Definition: common/entity.hh:129
Entity(EntityImp< 0, dim, GridImp > &&e)
Move constructor from EntityImp.
Definition: common/entity.hh:528
GridImp::template Codim< cd >::Geometry Geometry
The corresponding geometry type.
Definition: common/entity.hh:98
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:345
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:639
Entity()
Definition: common/entity.hh:183
Implementation realEntity
Definition: common/entity.hh:259
Wrapper class for entities.
Definition: common/entity.hh:63
Entity(Entity &&other)
Move constructor from an existing entity.
Definition: common/entity.hh:192
bool isRegular() const
Returns true if element is of regular type in red/green type refinement. In bisection or hanging node...
Definition: common/entity.hh:626
bool operator!=(const Entity &other) const
Compares two entities for inequality.
Definition: common/entity.hh:178
GridImp::template Codim< 0 >::Geometry Geometry
The geometry type of this entity.
Definition: common/entity.hh:270
Entity & operator=(Entity &&other)
Move assignment operator from an existing entity.
Definition: common/entity.hh:383
Entity(Entity &&other)
Move constructor from an existing entity.
Definition: common/entity.hh:371
EntitySeed seed() const
Return the entity seed which contains sufficient information to generate the entity again and uses as...
Definition: common/entity.hh:348
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:335
bool operator==(const Entity &other) const
Compares two entities for equality.
Definition: common/entity.hh:351
Entity & operator=(Entity &&other)
Move assignment operator from an existing entity.
Definition: common/entity.hh:204
Implementation & impl()
access to the underlying implementation
Definition: common/entity.hh:78
GridImp::template Codim< cd >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:560
int level() const
The level of this entity.
Definition: common/entity.hh:316
HierarchicIterator hbegin(int maxLevel) const
Inter-level access to elements that resulted from (recursive) subdivision of this element...
Definition: common/entity.hh:486
int level() const
The level of this entity.
Definition: common/entity.hh:126
EntityImp< 0, dim, GridImp > Implementation
Type of underlying implementation.
Definition: common/entity.hh:251
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:621
Know the grid dimension.
Definition: common/entity.hh:109
Dimensionality of the reference element of the entity.
Definition: common/entity.hh:113
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Entity()
Definition: common/entity.hh:362
bool mightVanish() const
Returns true, if entity might disappear during the next call to adapt()
Definition: common/entity.hh:656
bool operator==(const Entity &other) const
Compares two entities for equality.
Definition: common/entity.hh:172
EntitySeed seed() const
Return the entity seed which contains sufficient information to generate the entity again and uses as...
Definition: common/entity.hh:169
Know your own codimension.
Definition: common/entity.hh:105
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:648
bool isNew() const
Returns true, if the entity has been created during the last call to adapt()
Definition: common/entity.hh:652
bool hasFather() const
Return true if entity has a father entity which can be accessed using the father() method...
Definition: common/entity.hh:432
bool isRegular() const
Returns true if element is of regular type in red/green type refinement. In bisection or hanging node...
Definition: common/entity.hh:446
bool mightVanish() const
Returns true, if entity might disappear during the next call to adapt(). If the method returns false...
Definition: common/entity.hh:511
EntityImp< cd, dim, GridImp > Implementation
type of underlying implementation
Definition: common/entity.hh:71
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:148
bool operator!=(const Entity &other) const
Compares two entities for inequality.
Definition: common/entity.hh:357
HierarchicIterator hend(int maxLevel) const
Returns iterator to one past the last son element.
Definition: common/entity.hh:498
Implementation & impl()
Return reference to the real implementation.
Definition: common/entity.hh:254
Entity(const Entity &other)
Copy constructor from an existing entity.
Definition: common/entity.hh:366
GridImp::template Codim< cd >::Entity Entity
Definition: common/entity.hh:288
PartitionType partitionType() const
Partition type of this entity.
Definition: common/entity.hh:319
Entity(EntityImp< cd, dim, GridImp > &&e)
Move constructor from EntityImp.
Definition: common/entity.hh:222
Different resources needed by all grid implementations.
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:273
Entity(const Entity &other)
Copy constructor from an existing entity.
Definition: common/entity.hh:187
LocalGeometry geometryInFather() const
Provides information how this element has been subdivided from its father element.
Definition: common/entity.hh:473
Entity & operator=(const Entity &other)
Copy assignment operator from an existing entity.
Definition: common/entity.hh:197
Geometry geometry() const
obtain geometric realization of the entity
Definition: common/entity.hh:322
Entity(const EntityImp< cd, dim, GridImp > &e)
Copy constructor from EntityImp.
Definition: common/entity.hh:219
Geometry geometry() const
obtain geometric realization of the entity
Definition: common/entity.hh:143
bool hasBoundaryIntersections() const
Returns true, if entity has intersections with boundary, this implementation uses the Level- and Leaf...
Definition: common/entity.hh:662
Implementation realEntity
Definition: common/entity.hh:87
bool isLeaf() const
Returns true if the entity is contained in the leaf grid.
Definition: common/entity.hh:438
Entity & operator=(const Entity &other)
Copy assignment operator from an existing entity.
Definition: common/entity.hh:376
const Implementation & impl() const
Return const reference to the real implementation.
Definition: common/entity.hh:256
Include standard header files.
Definition: agrid.hh:58
bool isNew() const
Returns true, if the entity has been created during the last call to adapt()
Definition: common/entity.hh:505