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> 63 template<
int cd,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
66 #if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS 72 GridImp::
dimension, GridImp::dimensionworld,
73 typename GridImp::ctype,
74 typename GridImp::GridFamily> ;
100 typedef typename GridImp::template Codim<cd>::Geometry
Geometry;
103 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
128 int level ()
const {
return realEntity.level(); }
145 Geometry
geometry ()
const {
return realEntity.geometry(); }
165 return realEntity.subEntities(codim);
171 EntitySeed
seed ()
const {
return realEntity.seed(); }
190 : realEntity(other.realEntity)
195 : realEntity(
std::move(other.realEntity))
208 realEntity = std::move(other.realEntity);
221 Entity(
const EntityImp<cd,dim,GridImp> & e) : realEntity(e) {}
224 Entity(EntityImp<cd,dim,GridImp> && e) : realEntity(
std::move(e)) {}
249 template<
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
252 #if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS 258 GridImp::
dimension, GridImp::dimensionworld,
259 typename GridImp::ctype,
260 typename GridImp::GridFamily> ;
286 typedef typename GridImp::template Codim<0>::Geometry
Geometry;
289 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
332 int level ()
const {
return realEntity.level(); }
338 Geometry
geometry ()
const {
return realEntity.geometry(); }
353 return realEntity.subEntities(codim);
364 EntitySeed
seed ()
const {
return realEntity.seed(); }
383 : realEntity(other.realEntity)
388 : realEntity(
std::move(other.realEntity))
401 realEntity = std::move(other.realEntity);
423 template<
int codim >
427 return realEntity.template subEntity< codim >( i );
442 return realEntity.father();
450 return realEntity.hasFather();
456 return realEntity.isLeaf();
462 bool isRegular()
const {
return realEntity.isRegular(); }
502 HierarchicIterator
hbegin (
int maxLevel)
const 504 return realEntity.hbegin(maxLevel);
514 HierarchicIterator
hend (
int maxLevel)
const 516 return realEntity.hend(maxLevel);
521 bool isNew ()
const {
return realEntity.isNew(); }
541 Entity(
const EntityImp<0,dim,GridImp> & e) : realEntity(e) {}
544 Entity(EntityImp<0,dim,GridImp> && e) : realEntity(
std::move(e)) {}
567 template<
int cd,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
581 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
596 typedef typename std::remove_const< GridImp >::type::ctype ctype;
597 return ReferenceElements< ctype, mydimension >::general( asImp().
type() ).size( codim -
codimension );
607 EntityImp<cd,dim,GridImp>& asImp ()
609 return static_cast<EntityImp<cd,dim,GridImp>&
>(*this);
611 const EntityImp<cd,dim,GridImp>& asImp ()
const 613 return static_cast<const EntityImp<cd,dim,GridImp>&
>(*this);
628 template<
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
642 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
662 typedef typename std::remove_const< GridImp >::type::ctype ctype;
663 return ReferenceElements< ctype, mydimension >::general( asImp().
type() ).size( codim -
codimension );
673 bool isNew ()
const {
return false; }
686 IntersectionIterator end = asImp().ilevelend();
687 for (IntersectionIterator it = asImp().ilevelbegin(); it != end; ++it)
696 EntityImp<0,dim,GridImp>& asImp () {
return static_cast<EntityImp<0,dim,GridImp>&
>(*this); }
697 const EntityImp<0,dim,GridImp>& asImp ()
const {
return static_cast<const EntityImp<0,dim,GridImp>&
>(*this); }
702 #endif // DUNE_GRID_ENTITY_HH HierarchicIterator hend(int maxLevel) const
Returns iterator to one past the last son element.
Definition: common/entity.hh:514
Entity(Entity &&other)
Move constructor from an existing entity.
Definition: common/entity.hh:194
bool operator!=(const Entity &other) const
Compares two entities for inequality.
Definition: common/entity.hh:180
GridImp::template Codim< cd >::Entity Entity
Definition: common/entity.hh:304
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:642
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:462
Wrapper and interface class for a static iterator (EntityPointer)
bool mightVanish() const
Returns true, if entity might disappear during the next call to adapt()
Definition: common/entity.hh:677
Entity(const Entity &other)
Copy constructor from an existing entity.
Definition: common/entity.hh:189
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
Geometry geometry() const
obtain geometric realization of the entity
Definition: common/entity.hh:338
bool hasFather() const
Return true if entity has a father entity which can be accessed using the father() method...
Definition: common/entity.hh:448
PartitionType partitionType() const
Partition type of this entity.
Definition: common/entity.hh:335
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:603
Geometry geometry() const
obtain geometric realization of the entity
Definition: common/entity.hh:145
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:669
bool isLeaf() const
Returns true if the entity is contained in the leaf grid.
Definition: common/entity.hh:454
Definition: common/geometry.hh:24
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:163
Entity()
Definition: common/entity.hh:185
bool operator!=(const Entity &other) const
Compares two entities for inequality.
Definition: common/entity.hh:373
const Implementation & impl() const
Return const reference to the real implementation.
Definition: common/entity.hh:86
Entity & operator=(Entity &&other)
Move assignment operator from an existing entity.
Definition: common/entity.hh:206
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:345
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:150
Entity(const Entity &other)
Copy constructor from an existing entity.
Definition: common/entity.hh:382
Entity & operator=(const Entity &other)
Copy assignment operator from an existing entity.
Definition: common/entity.hh:392
Codim< codim >::Entity subEntity(int i) const
Obtain a subentity.
Definition: common/entity.hh:425
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:289
LocalGeometry geometryInFather() const
Provides information how this element has been subdivided from its father element.
Definition: common/entity.hh:489
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:594
Dimensionality of the reference element of the entity.
Definition: common/entity.hh:115
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: common/entity.hh:359
bool hasBoundaryIntersections() const
Returns true, if entity has intersections with boundary.
Definition: common/entity.hh:531
Know the grid dimension.
Definition: common/entity.hh:111
Implementation & impl()
Return reference to the real implementation.
Definition: common/entity.hh:84
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:298
Know your own codimension.
Definition: common/entity.hh:107
const Implementation & impl() const
Return const reference to the real implementation.
Definition: common/entity.hh:272
bool isNew() const
Returns true, if the entity has been created during the last call to adapt()
Definition: common/entity.hh:521
Entity father() const
Inter-level access to father entity on the next-coarser grid. The given entity resulted directly from...
Definition: common/entity.hh:440
Entity(const EntityImp< 0, dim, GridImp > &e)
Copy constructor from EntityImp.
Definition: common/entity.hh:541
EntitySeed seed() const
Return the entity seed which contains sufficient information to generate the entity again and uses as...
Definition: common/entity.hh:171
bool hasBoundaryIntersections() const
Returns true, if entity has intersections with boundary, this implementation uses the Level- and Leaf...
Definition: common/entity.hh:683
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:647
Definition: defaultgridview.hh:16
Entity(EntityImp< 0, dim, GridImp > &&e)
Move constructor from EntityImp.
Definition: common/entity.hh:544
Default Implementations for EntityImp.
Definition: common/entity.hh:568
GridImp::HierarchicIterator HierarchicIterator
The HierarchicIterator type.
Definition: common/entity.hh:308
Entity(EntityImp< cd, dim, GridImp > &&e)
Move constructor from EntityImp.
Definition: common/entity.hh:224
Include standard header files.
Definition: agrid.hh:59
GridImp::template Codim< 0 >::Geometry Geometry
The geometry type of this entity.
Definition: common/entity.hh:286
GridImp::template Codim< cd >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:103
bool operator==(const Entity &other) const
Compares two entities for equality.
Definition: common/entity.hh:367
GridImp::template Codim< cd >::EntitySeed EntitySeed
The corresponding entity seed (for storage of entities)
Definition: common/entity.hh:581
Entity(const EntityImp< cd, dim, GridImp > &e)
Copy constructor from EntityImp.
Definition: common/entity.hh:221
int level() const
The level of this entity.
Definition: common/entity.hh:128
Wrapper class for entities.
Definition: common/entity.hh:64
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:351
Entity & operator=(const Entity &other)
Copy assignment operator from an existing entity.
Definition: common/entity.hh:199
Definition: defaultgridview.hh:19
bool operator==(const Entity &other) const
Compares two entities for equality.
Definition: common/entity.hh:174
Entity(Entity &&other)
Move constructor from an existing entity.
Definition: common/entity.hh:387
GridImp::template Codim< cd >::Geometry Geometry
The corresponding geometry type.
Definition: common/entity.hh:100
Implementation realEntity
Definition: common/entity.hh:89
Different resources needed by all grid implementations.
bool isNew() const
Returns true, if the entity has been created during the last call to adapt()
Definition: common/entity.hh:673
unsigned int subEntities(unsigned int codim) const
Number of subentities for a given codimension.
Definition: common/entity.hh:660
Implementation realEntity
Definition: common/entity.hh:275
int level() const
The level of this entity.
Definition: common/entity.hh:332
bool mightVanish() const
Returns true, if entity might disappear during the next call to adapt(). If the method returns false...
Definition: common/entity.hh:527
HierarchicIterator hbegin(int maxLevel) const
Inter-level access to elements that resulted from (recursive) subdivision of this element...
Definition: common/entity.hh:502
EntityImp< cd, dim, Grid > Implementation
Definition: common/entity.hh:81
Entity()
Definition: common/entity.hh:378
PartitionType partitionType() const
Partition type of this entity.
Definition: common/entity.hh:131
Entity & operator=(Entity &&other)
Move assignment operator from an existing entity.
Definition: common/entity.hh:399
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:114
EntitySeed seed() const
Return the entity seed which contains sufficient information to generate the entity again and uses as...
Definition: common/entity.hh:364