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;
99 EntitySeed
seed ()
const {
return EntitySeed( AlbertaGridEntitySeed< codim, Grid >( elementInfo(),
subEntity() ) ); }
108 const ElementInfo &elementInfo ()
const {
return elementInfo_; }
111 bool equals (
const This &other )
const;
113 void clearElement ();
114 void setElement (
const ElementInfo &elementInfo,
int subEntity );
117 void setEntity (
const This &other );
134 return elementInfo().template twist< codimension >(
subEntity() );
142 ElementInfo elementInfo_;
160 template<
int dim,
class Gr
id >
169 friend class AlbertaGridLeafIntersection<
Grid >;
175 static const int dimension = dim;
176 static const int codimension = 0;
177 static const int mydimension = dimension - codimension;
179 template<
int codim >
182 typedef typename Grid::template Codim< codim >::EntityPointer
184 typedef typename Grid::template Codim< codim >::Entity
197 typedef Dune::AlbertaGridLeafIntersectionIterator< Grid > AlbertaGridLeafIntersectionIterator;
198 typedef AlbertaGridLeafIntersectionIterator AlbertaGridLevelIntersectionIterator;
200 typedef Alberta::ElementInfo< dimension > ElementInfo;
214 int boundaryId ()
const;
223 EntitySeed
seed ()
const {
return EntitySeed( AlbertaGridEntitySeed< 0, Grid >(elementInfo() )); }
231 template<
int codim >
234 return Alberta::NumSubEntities< dimension, codim >::value;
248 int k = dimension-codim+1;
252 for (
int i=n-k+1; i<=n; i++)
254 for (
long i=2; i<=k; i++)
270 template<
int codim >
278 AlbertaGridLeafIntersectionIterator ileafbegin ()
const;
281 AlbertaGridLeafIntersectionIterator ileafend ()
const;
283 AlbertaGridLevelIntersectionIterator ilevelbegin ()
const
285 if(
grid().maxLevel() == 0 )
294 AlbertaGridLevelIntersectionIterator ilevelend ()
const
300 bool isLeaf ()
const;
304 Entity father ()
const;
308 return (this->
level()>0);
319 LocalGeometry geometryInFather ()
const;
325 HierarchicIterator hbegin (
int maxlevel)
const;
328 HierarchicIterator hend (
int maxlevel)
const;
334 bool mightVanish ()
const;
338 bool hasBoundaryIntersections ()
const ;
344 bool equals (
const This &i )
const;
349 const ElementInfo &elementInfo ()
const
354 void clearElement ();
355 void setElement (
const ElementInfo &elementInfo,
int subEntity );
358 void setEntity (
const This &other );
375 return elementInfo().template twist< codimension >(
subEntity() );
379 template<
int codim >
382 return elementInfo().template twist< codim >(
grid().generic2alberta( codim, i ) );
393 ElementInfo elementInfo_;
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Definition: entity.hh:163
EntitySeed seed() const
obtain entity seed
Definition: entity.hh:223
unsigned int subEntities(unsigned int codim) const
Obtain the number of subentities of a given codimension.
Definition: entity.hh:245
int count() const
Definition: entity.hh:232
int twist() const
obtain twist
Definition: entity.hh:373
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:306
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:367
int twist(int i) const
obtain twist of a subentity
Definition: entity.hh:380
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:361
int twist() const
obtain twist
Definition: entity.hh:132
ALBERTA EL_INFO * getElInfo() const
needed for the LevelIterator and LeafIterator
Definition: entity.cc:60
int level() const
level of this element
Definition: entity.cc:92
EntitySeed seed() const
obtain entity seed
Definition: entity.hh:99
PartitionType partitionType() const
return partition type of this entity
Definition: entity.cc:38
Geometry geometry() const
geometry of this entity
Definition: entity.cc:101
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:120
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:126
GeometryType type() const
type of geometry of this entity
Definition: entity.cc:112
bool equals(const This &other) const
equality of entities
Definition: entity.cc:46
Definition: hierarchiciterator.hh:29
Definition: treeiterator.hh:182
[ provides Dune::Grid ]
Definition: agrid.hh:140
Default Implementations for EntityImp.
Definition: entity.hh:740
GridImp::template Codim< cd >::EntityPointer EntityPointer
The corresponding entity seed (for storage of entities)
Definition: entity.hh:755
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Grid abstract base class.
Definition: grid.hh:388
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
Definition: grid.hh:512
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:408
Default exception for dummy implementations.
Definition: exceptions.hh:288
provides a wrapper for ALBERTA's el_info structure
#define DUNE_THROW(E, m)
Definition: exceptions.hh:243
int binomial(int upper, int lower)
calculate
Definition: simplex.cc:292
Dune namespace.
Definition: alignment.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22