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 >::Entity Entity;
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() ) ); }
111 int n = mydimension+1;
112 int k = dimension-cd+1;
116 for (
int i=n-k+1; i<=n; i++)
118 for (
long i=2; i<=k; i++)
131 const ElementInfo &elementInfo ()
const {
return elementInfo_; }
134 bool equals (
const This &other )
const;
136 void clearElement ();
137 void setElement (
const ElementInfo &elementInfo,
int subEntity );
140 void setEntity (
const This &other );
157 return elementInfo().template twist< codimension >(
subEntity() );
165 ElementInfo elementInfo_;
183 template<
int dim,
class Gr
id >
192 friend class AlbertaGridLeafIntersection<
Grid >;
198 static const int dimension = dim;
199 static const int codimension = 0;
200 static const int mydimension = dimension - codimension;
202 template<
int codim >
205 typedef typename Grid::template Codim< codim >::Entity
217 typedef Dune::AlbertaGridLeafIntersectionIterator< Grid > AlbertaGridLeafIntersectionIterator;
218 typedef AlbertaGridLeafIntersectionIterator AlbertaGridLevelIntersectionIterator;
220 typedef Alberta::ElementInfo< dimension > ElementInfo;
234 int boundaryId ()
const;
243 EntitySeed
seed ()
const {
return EntitySeed( AlbertaGridEntitySeed< 0, Grid >(elementInfo() )); }
251 template<
int codim >
254 return Alberta::NumSubEntities< dimension, codim >::value;
267 int n = mydimension+1;
268 int k = dimension-cd+1;
272 for (
int i=n-k+1; i<=n; i++)
274 for (
long i=2; i<=k; i++)
290 template<
int codim >
298 AlbertaGridLeafIntersectionIterator ileafbegin ()
const;
301 AlbertaGridLeafIntersectionIterator ileafend ()
const;
303 AlbertaGridLevelIntersectionIterator ilevelbegin ()
const
305 if(
grid().maxLevel() == 0 )
314 AlbertaGridLevelIntersectionIterator ilevelend ()
const
320 bool isLeaf ()
const;
324 Entity father ()
const;
328 return (this->
level()>0);
339 LocalGeometry geometryInFather ()
const;
345 HierarchicIterator hbegin (
int maxlevel)
const;
348 HierarchicIterator hend (
int maxlevel)
const;
354 bool mightVanish ()
const;
358 bool hasBoundaryIntersections ()
const ;
364 bool equals (
const This &i )
const;
369 const ElementInfo &elementInfo ()
const
374 void clearElement ();
375 void setElement (
const ElementInfo &elementInfo,
int subEntity );
378 void setEntity (
const This &other );
395 return elementInfo().template twist< codimension >(
subEntity() );
399 template<
int codim >
402 return elementInfo().template twist< codim >(
grid().generic2alberta( codim, i ) );
413 ElementInfo elementInfo_;
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
Definition: entity.hh:186
EntitySeed seed() const
obtain entity seed
Definition: entity.hh:243
int count() const
Definition: entity.hh:252
int twist() const
obtain twist
Definition: entity.hh:393
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:326
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:387
int twist(int i) const
obtain twist of a subentity
Definition: entity.hh:400
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:381
unsigned int subEntities(unsigned int cd) const
Obtain the number of subentities of a given codimension.
Definition: entity.hh:265
int twist() const
obtain twist
Definition: entity.hh:155
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
unsigned int subEntities(unsigned int cd) const
Obtain the number of subentities of a given codimension.
Definition: entity.hh:109
const Grid & grid() const
obtain a reference to the grid
Definition: entity.hh:143
int subEntity() const
obtain number of the subentity within the element (in ALBERTA numbering)
Definition: entity.hh:149
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:569
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:268
Grid abstract base class.
Definition: grid.hh:373
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:393
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
Definition: grid.hh:486
Default exception for dummy implementations.
Definition: exceptions.hh:261
provides a wrapper for ALBERTA's el_info structure
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
int binomial(int upper, int lower)
calculate
Definition: simplex.cc:294
Dune namespace.
Definition: alignment.hh:11
Static tag representing a codimension.
Definition: dimension.hh:22