3#ifndef DUNE_ALBERTA_ENTITY_HH
4#define DUNE_ALBERTA_ENTITY_HH
6#include <dune/grid/common/entity.hh>
9#include <dune/grid/albertagrid/entityseed.hh>
10#include <dune/grid/albertagrid/geometry.hh>
20 template<
int codim,
class Gr
id >
21 class AlbertaGridEntityPointer;
23 template<
int codim,
class Gr
id,
bool leafIterator >
24 class AlbertaGridTreeIterator;
26 template<
class Gr
id >
27 class AlbertaGridHierarchicIterator;
29 template<
class Gr
id >
30 class AlbertaGridLeafIntersection;
32 template<
class Gr
id >
33 class AlbertaGridLeafIntersectionIterator;
44 template<
int codim,
int dim,
class Gr
id >
58 static const int dimension = dim;
59 static const int codimension = codim;
60 static const int mydimension = dimension - codimension;
65 typedef typename Grid::template Codim< cd >::EntityPointer
EntityPointer;
68 typedef typename Grid::template Codim< codim >::Entity Entity;
69 typedef typename Grid::template Codim< codim >::EntitySeed EntitySeed;
70 typedef typename Grid::template Codim< codim >::Geometry Geometry;
72 typedef Alberta::ElementInfo< dimension > ElementInfo;
75 typedef typename Grid::Traits::template Codim< codim >::GeometryImpl GeometryImpl;
97 EntitySeed
seed ()
const {
return EntitySeed( AlbertaGridEntitySeed< codim, Grid >( elementInfo(),
subEntity() ) ); }
106 const ElementInfo &elementInfo ()
const {
return elementInfo_; }
109 bool equals (
const This &other )
const;
111 void clearElement ();
112 void setElement (
const ElementInfo &elementInfo,
int subEntity );
115 void setEntity (
const This &other );
132 return elementInfo().template twist< codimension >(
subEntity() );
140 ElementInfo elementInfo_;
158 template<
int dim,
class Gr
id >
167 friend class AlbertaGridLeafIntersection<
Grid >;
173 static const int dimension = dim;
174 static const int codimension = 0;
175 static const int mydimension = dimension - codimension;
177 template<
int codim >
180 typedef typename Grid::template Codim< codim >::EntityPointer
184 typedef typename Grid::template Codim< 0 >::Entity Entity;
185 typedef typename Grid::template Codim< 0 >::EntitySeed EntitySeed;
186 typedef typename Grid::template Codim< 0 >::Geometry Geometry;
187 typedef typename Grid::template Codim< 0 >::LocalGeometry LocalGeometry;
188 typedef typename Grid::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
191 typedef typename Grid::template Codim< 0 >::EntityPointer
EntityPointer;
193 typedef Dune::AlbertaGridLeafIntersectionIterator< Grid > AlbertaGridLeafIntersectionIterator;
194 typedef AlbertaGridLeafIntersectionIterator AlbertaGridLevelIntersectionIterator;
196 typedef Alberta::ElementInfo< dimension > ElementInfo;
208 int boundaryId ()
const;
217 EntitySeed
seed ()
const {
return EntitySeed( AlbertaGridEntitySeed< 0, Grid >(elementInfo() )); }
225 template<
int codim >
228 return Alberta::NumSubEntities< dimension, codim >::value;
241 template<
int codim >
242 typename Codim< codim >::EntityPointer
subEntity (
int i )
const;
249 AlbertaGridLeafIntersectionIterator ileafbegin ()
const;
252 AlbertaGridLeafIntersectionIterator ileafend ()
const;
254 AlbertaGridLevelIntersectionIterator ilevelbegin ()
const
256 if(
grid().maxLevel() == 0 )
265 AlbertaGridLevelIntersectionIterator ilevelend ()
const
271 bool isLeaf ()
const;
279 return (this->
level()>0);
290 LocalGeometry geometryInFather ()
const;
305 bool mightVanish ()
const;
309 bool hasBoundaryIntersections ()
const ;
315 bool equals (
const This &i )
const;
320 const ElementInfo &elementInfo ()
const
325 void clearElement ();
326 void setElement (
const ElementInfo &elementInfo,
int subEntity );
329 void setEntity (
const This &other );
346 return elementInfo().template twist< codimension >(
subEntity() );
350 template<
int codim >
353 return elementInfo().template twist< codim >(
grid().generic2alberta( codim, i ) );
364 ElementInfo elementInfo_;
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Definition: entity.hh:161
EntitySeed seed() const
obtain entity seed
Definition: entity.hh:217
int count() const
Definition: entity.hh:226
int twist() const
obtain twist
Definition: entity.hh:344
Codim< codim >::EntityPointer subEntity(int i) const
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:277
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:338
int twist(int i) const
obtain twist of a subentity
Definition: entity.hh:351
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:332
int twist() const
obtain twist
Definition: entity.hh:130
ALBERTA EL_INFO * getElInfo() const
needed for the LevelIterator and LeafIterator
Definition: entity.cc:52
int level() const
level of this element
Definition: entity.cc:84
EntitySeed seed() const
obtain entity seed
Definition: entity.hh:97
PartitionType partitionType() const
return partition type of this entity
Definition: entity.cc:30
AlbertaGridEntity(const Grid &grid)
constructor
Definition: entity.cc:22
Geometry geometry() const
geometry of this entity
Definition: entity.cc:93
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:118
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:124
GeometryType type() const
type of geometry of this entity
Definition: entity.cc:104
bool equals(const This &other) const
equality of entities
Definition: entity.cc:38
Definition: hierarchiciterator.hh:29
Definition: treeiterator.hh:182
[ provides Dune::Grid ]
Definition: agrid.hh:140
Default Implementations for EntityImp.
Definition: entity.hh:553
GridImp::template Codim< cd >::EntityPointer EntityPointer
The corresponding entity seed (for storage of entities)
Definition: entity.hh:574
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Grid abstract base class.
Definition: grid.hh:386
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
Definition: grid.hh:510
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:406
Enables iteration over all codim zero entities in a subtree See also the documentation of Dune::Entit...
Definition: hierarchiciterator.hh:33
Default exception for dummy implementations.
Definition: exceptions.hh:289
provides a wrapper for ALBERTA's el_info structure
#define DUNE_THROW(E, m)
Definition: exceptions.hh:244
Dune namespace.
Definition: alignment.hh:14
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:24