3 #ifndef DUNE_ALU2DGRIDENTITY_HH
4 #define DUNE_ALU2DGRIDENTITY_HH
19 template<
int cd,
int dim,
class Gr
idImp>
21 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
23 template<
int codim,
class Gr
idImp >
25 template<
int mydim,
int coorddim,
class Gr
idImp>
27 template<
class Gr
idImp>
29 template<
class Gr
idImp>
31 template<
class Gr
idImp>
33 template<
class Gr
idImp>
35 template<
int codim, PartitionIteratorType,
class Gr
idImp>
37 template<
int dim,
int dimworld, ALU2DSPACE ElementType eltype >
52 template<
int cd,
int dim,
class Gr
idImp>
56 static const int dimworld = GridImp::dimensionworld;
57 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
80 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
83 typedef typename GridImp :: GridObjectFactoryType
FactoryType;
89 typedef typename GridImp::template Codim<cd>::Entity
Entity;
91 typedef typename GridImp::template Codim<cd>::Geometry
Geometry;
94 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
97 typedef typename GridImp::template Codim<0>::EntityPointer
EntityPointer;
152 const GridImp&
grid()
const {
return factory_.grid(); }
184 mutable GeometryImpl geoObj_;
209 template<
int dim,
class Gr
idImp>
213 static const int dimworld = GridImp::dimensionworld;
237 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
238 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
244 typedef typename GridImp::template Codim<0>::Geometry
Geometry;
249 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
257 typedef typename GridImp::template Codim<0>::Entity
Entity;
290 return (cc==0) ? 1 : item_->numvertices();
299 return (codim==0) ? 1 : item_->numvertices();
319 DUNE_DEPRECATED_MSG("Use ileafbegin() instead.")
326 DUNE_DEPRECATED_MSG("Use ileafend() instead.")
349 bool isLeaf ()
const;
358 return (this->
level()>0);
379 typename Codim<cc>::EntityPointer entity (
int i)
const;
383 template<
int codim >
391 if( item_->numvertices() == 3 )
394 switch (i) {
case 0 : j=2;
break;
399 else if ( codim == 2 )
401 if( item_->numvertices() == 4 )
403 switch (i) {
case 0 : j=0;
break;
409 return entity< codim >( j );
415 #if ALU2DGRID_PARALLEL
416 return grid().rankManager().partitionType( item_->getIndex() );
429 int subBoundaryId (
int i )
const;
442 LocalGeometry geometryInFather ()
const;
447 return ((item_->is(
ALU2DSPACE Refco::crs))==1);
452 return ((item_->wasRefined())==1);
463 bool mark(
int refCount)
const;
471 void setElement(
const HElementType &element,
int face=-1,
int level = -1)
const;
479 void reset (
int l );
501 const GridImp&
grid()
const {
return factory_.grid(); }
519 template<
int cc>
int getSubIndex (
int i)
const;
521 int subIndex (
int i,
unsigned int codim)
const;
527 mutable HElementType *item_;
530 mutable GeometryImpl geoObj_;
533 mutable bool isLeaf_;
547 template<
int codim,
class Gr
idImp >
548 class ALU2dGridEntityPointer
551 typedef ALU2dGridEntityPointer< codim, GridImp > ThisType;
553 static const int dim = GridImp::dimension;
554 static const int dimworld = GridImp::dimensionworld;
555 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
565 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
568 typedef typename GridImp::template Codim<codimension>::EntitySeed
EntitySeed;
577 const ElementType &item,
635 #include "entity_imp.cc"
EntitySeed seed() const
return seed of entity
Definition: alugrid/2d/entity.hh:495
int boundaryId() const
Id of the boundary which is associated with the entity, returns 0 for inner entities, arbitrary int otherwise.
const FactoryType & factory() const
return reference to factory
Definition: alugrid/2d/entity.hh:155
#define ALU2DSPACE
Definition: alu2dinclude.hh:34
Dune::ALU2dImplTraits< dimworld, eltype >::template Codim< 2 >::InterfaceType VertexType
Definition: alugrid/2d/entity.hh:86
Definition: alugrid/2d/entity.hh:22
int getFace() const
Definition: alugrid/2d/entity.hh:507
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: alugrid/2d/entity.hh:265
PartitionType partitionType() const
Definition: alugrid/2d/entity.hh:134
ThisType & operator=(const ThisType &org)
assigment operator
EntityObj * entity_
entity that this EntityPointer points to
Definition: alugrid/2d/entity.hh:630
void updateEntityPointer(ElementType *item, int face=-1, int level=-1)
update underlying item pointer and set entity
ALU2dGridIntersectionIteratorType iend() const
Definition: alugrid/2d/entity.hh:325
hierarchic index set of ALU2dGrid
Definition: alugrid/2d/grid.hh:66
void done()
has to be called when iterator is finished
int level() const
level of this element
void setElement(const ALU2dGridEntity &org) const
Definition: alugrid/2d/entity.hh:124
Definition: alugrid/2d/entity.hh:36
ALU2dGridEntityPointer< codimension, GridImp > EntityPointerImp
Definition: alugrid/2d/entity.hh:573
HmeshType::helement_t HElementType
Definition: alu2dinclude.hh:108
ALU2dGridLevelIntersectionIteratorType ilevelbegin() const
Definition: alugrid/2d/entity.hh:331
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/2d/entity.hh:94
Definition: alugrid/2d/entity.hh:34
ALU2dGridHierarchicIterator< GridImp > hbegin(int maxLevel) const
Definition: alugrid/2d/entity.hh:365
ElementType & getItem() const
return reference to current item
Definition: alugrid/2d/entity.hh:158
Definition: alugrid/2d/entity.hh:20
GridImp::template Codim< 0 >::Entity Entity
type of entity interface
Definition: alugrid/2d/entity.hh:257
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
type of corresponding interface local geometry
Definition: alugrid/2d/entity.hh:246
HElementType & getItem() const
Definition: alugrid/2d/entity.hh:488
Definition: alugrid/2d/entity.hh:30
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:112
GridImp::template Codim< codimension >::EntitySeed EntitySeed
type of the seed
Definition: alugrid/2d/entity.hh:568
GridImp::template Codim< 0 >::EntityPointer EntityPointer
tpye of EntityPointer
Definition: alugrid/2d/entity.hh:97
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:241
EntitySeed seed_
the essential information
Definition: alugrid/2d/entity.hh:627
void removeElement()
set item pointer to NULL
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
all interior entities
Definition: gridenums.hh:29
ALU2dGridEntity(const FactoryType &factory, int level)
Constructor.
const GridImp & grid() const
return reference to grid
Definition: alugrid/2d/entity.hh:501
Definition: alugrid/2d/entity.hh:32
Default Implementations for EntityImp.
Definition: common/entity.hh:739
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
ALU2dGridEntityPointer(const FactoryType &factory, const ElementType &item, int face=-1, int level=-1)
Constructor for EntityPointer that points to an element.
Entity & dereference() const
dereferencing
all entities
Definition: gridenums.hh:139
GeometryType type() const
return type of geometry
Codim< codim >::EntityPointer subEntity(int i) const
Definition: alugrid/2d/entity.hh:384
EntitySeed seed() const
return seed of entity
Definition: alugrid/2d/entity.hh:165
bool mightVanish() const
The former state() method has been replaced by:
Definition: alugrid/2d/entity.hh:445
const GridImp & grid() const
return reference to grid
Definition: alugrid/2d/entity.hh:152
Definition: alugrid/2d/entity.hh:26
ALU2dGridLevelIntersectionIteratorType ilevelend() const
Definition: alugrid/2d/entity.hh:335
ALU2dGridEntityPointer< 0, GridImp > EntityPointer
tpye of entitypointer interface
Definition: alugrid/2d/entity.hh:260
ALU2dGridEntity< codimension, dim, GridImp > EntityImp
tpye of stored entity (implementation)
Definition: alugrid/2d/entity.hh:570
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:560
bool isNew() const
Definition: alugrid/2d/entity.hh:450
bool hasFather() const
returns true if father entity exists
Definition: alugrid/2d/entity.hh:356
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/2d/entity.hh:249
int getFace() const
Definition: alugrid/2d/entity.hh:171
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:83
~ALU2dGridEntityPointer()
Destructor.
ALU2dGridLeafIntersectionIteratorType ileafend() const
Definition: alugrid/2d/entity.hh:343
Definition: alugrid/2d/entity.hh:24
int boundaryId() const
Id of the boundary which is associated with the entity, returns 0 for inner entities, arbitrary int otherwise.
Definition: alugrid/2d/entity.hh:306
LeafIntersectionIteratorWrapper< GridImp > ALU2dGridLeafIntersectionIteratorType
tpye of intersection iterator
Definition: alugrid/2d/entity.hh:252
const FactoryType & factory() const
return reference to factory
Definition: alugrid/2d/entity.hh:504
Definition: alugrid/2d/entity.hh:562
bool equals(const ALU2dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements
GridImp::template Codim< codimension >::Entity Entity
type of stored entity (interface)
Definition: alugrid/2d/entity.hh:565
int getIndex() const
index is unique within the grid hierachie and per codim
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: alugrid/2d/entity.hh:413
Hierarchic Iterator of ALU2dGrid.
Definition: alugrid/2d/entity.hh:28
GridImp::template Codim< cd >::Geometry Geometry
type of corresponding interface geometry
Definition: alugrid/2d/entity.hh:91
Definition: alu2dinclude.hh:97
void setElement(const ALU2dGridEntity &org) const
Definition: alugrid/2d/entity.hh:474
Geometry geometry() const
geometry of this entity
const GridImp & grid() const
return reference top grid
Definition: alugrid/2d/entity.hh:611
FieldVector< alu2d_ctype, dim > & positionInOwnersFather() const
my position in local coordinates of the owners father
int count() const
Definition: alugrid/2d/entity.hh:287
void setElement(const ElementType &element, int face=-1, int level=-1) const
set element as normal entity
EntityPointer ownersFather() const
MakeableInterfaceObject< Entity > EntityObj
Definition: alugrid/2d/entity.hh:571
const FactoryType & factory_
reference to entity factory
Definition: alugrid/2d/entity.hh:624
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
Definition: alugrid/2d/entity.hh:210
ALU2dGridHierarchicIterator< GridImp > hend(int maxLevel) const
Returns iterator to one past the last son.
Definition: alugrid/2d/entity.hh:371
ALU2dGridLeafIntersectionIteratorType ileafbegin() const
Definition: alugrid/2d/entity.hh:339
ALU2dGridLeafIntersectionIteratorType ALU2dGridIntersectionIteratorType
Definition: alugrid/2d/entity.hh:254
Dune::ALU2dImplTraits< dimworld, eltype >::template Codim< cd >::InterfaceType ElementType
Definition: alugrid/2d/entity.hh:85
Definition: alugrid/2d/grid.hh:60
[ provides Dune::Grid ]
Definition: alugrid/2d/entity.hh:38
GridImp::template Codim< 0 >::Geometry Geometry
type of our Geometry interface
Definition: alugrid/2d/entity.hh:244
LevelIntersectionIteratorWrapper< GridImp > ALU2dGridLevelIntersectionIteratorType
Definition: alugrid/2d/entity.hh:253
bool equals(const ThisType &i) const
equality
GridImp::template Codim< cd >::Entity Entity
type of our interface entity
Definition: alugrid/2d/entity.hh:89
int level() const
ask for level of entities
unsigned int subEntities(unsigned int codim) const
Definition: alugrid/2d/entity.hh:296
ALU2dGridIntersectionIteratorType ibegin() const
Definition: alugrid/2d/entity.hh:318