3 #ifndef DUNE_ALU3DGRIDENTITY_HH
4 #define DUNE_ALU3DGRIDENTITY_HH
21 template<
int cd,
int dim,
class Gr
idImp>
23 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
25 template<
int cd,
class Gr
idImp >
27 template<
int mydim,
int coorddim,
class Gr
idImp>
29 template<
class Gr
idImp>
31 template<
class Gr
idImp>
33 template<
int codim, PartitionIteratorType,
class Gr
idImp>
35 template< ALU3dGr
idElementType,
class >
44 template<
int cd,
int dim,
class Gr
idImp>
49 template <
class Gr
idType,
int cdim>
52 template <
class ItemType>
53 static int getLevel(
const GridType &
grid,
const ItemType & item )
62 template <
class Gr
idType>
63 struct GetLevel<GridType,3>
65 template <
class ItemType>
66 static int getLevel(
const GridType &
grid,
const ItemType & item)
68 return (item.isLeafEntity()) ? grid.getLevelOfLeafVertex(item) : item.level();
72 enum { dimworld = GridImp::dimensionworld };
74 typedef typename GridImp::MPICommunicatorType Comm;
76 friend class ALU3dGrid< GridImp::elementType, Comm >;
84 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
91 typedef typename ImplTraits::template Codim<cd>::ImplementationType
ItemType;
123 void
setElement(const HItemType & item, const int level, int twist=0, int face = -1);
129 void
setGhost(const HBndSegType &ghost);
135 void
reset ( int l );
138 bool
equals ( const ALU3dGridEntity<cd,dim,GridImp> & org ) const;
141 void
setEntity ( const ALU3dGridEntity<cd,dim,GridImp> & org );
147 const GridImp&
grid()
const {
return factory_.grid(); }
160 int getIndex ()
const;
166 mutable GeometryImpl geo_;
201 template<
int dim,
class Gr
idImp>
205 static const int dimworld = remove_const< GridImp >::type::dimensionworld;
208 typedef typename GridImp::MPICommunicatorType Comm;
213 typedef typename ImplTraits::GEOElementType GEOElementType;
214 typedef typename ImplTraits::BNDFaceType BNDFaceType;
215 typedef typename ImplTraits::IMPLElementType IMPLElementType;
216 typedef typename ImplTraits::HBndSegType
HBndSegType;
218 enum { refine_element_t = ImplTraits::refine_element_t };
219 enum { bisect_element_t = ImplTraits::bisect_element_t };
220 enum { coarse_element_t = ImplTraits::coarse_element_t };
221 enum { nosplit_element_t = ImplTraits::nosplit_element_t };
223 typedef typename ImplTraits::MarkRuleType MarkRuleType;
244 typedef typename GridImp :: ReferenceElementType ReferenceElementType;
246 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
247 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
252 typedef typename GridImp::template Codim< 0 >::Geometry
Geometry;
260 typedef typename GridImp::template Codim<0>::Entity
Entity;
270 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
293 template<
int cc>
int count ()
const ;
298 unsigned int subEntities (
unsigned int codim)
const ;
302 template<
int codim >
326 bool isLeaf ()
const;
334 return (this->
level()>0);
346 LocalGeometry geometryInFather ()
const;
365 bool mightVanish ()
const;
368 bool hasBoundaryIntersections ()
const;
374 bool mark(
int refCount )
const;
391 void reset (
int l );
404 template<
int cc>
int getSubIndex (
int i)
const;
409 int subIndex(
int i,
unsigned int codim)
const;
412 const IMPLElementType&
getItem ()
const {
return *item_; }
422 const GridImp&
grid()
const {
return factory_.grid(); }
428 bool isGhost ()
const {
return ImplTraits::isGhost( ghost_ ); }
441 int getIndex ()
const;
444 mutable GeometryImpl geo_;
450 mutable IMPLElementType* item_;
453 mutable BNDFaceType* ghost_;
467 template<
int codim,
class Gr
idImp >
471 enum { dim = GridImp::dimension };
472 enum { dimworld = GridImp::dimensionworld };
474 typedef typename GridImp::MPICommunicatorType Comm;
481 typedef typename ImplTraits::template Codim<codim>
::InterfaceType HElementType;
483 typedef typename ImplTraits::HBndSegType HBndSegType;
484 typedef typename ImplTraits::BNDFaceType BNDFaceType;
491 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
507 const HElementType & item);
511 const HElementType & item,
519 const HBndSegType & ghostFace );
580 return GridImp :: getRealImplementation(*
entity_);
587 template<
class Gr
idImp>
596 enum {
dim = GridImp::dimension };
599 typedef typename GridImp::MPICommunicatorType
Comm;
631 const HElementType & item)
681 template<
int cd,
class Gr
idImp>
682 class ALU3dGridEntityPointer :
683 public ALU3dGridEntityPointerBase<cd,GridImp>
688 enum {
dim = GridImp::dimension };
691 typedef typename GridImp::MPICommunicatorType
Comm;
729 const HElementType & item,
730 const int twist = defaultValue,
731 const int duneFace = defaultValue
774 #if COMPILE_ALUGRID_INLINE
775 #include "entity_imp.cc"
ALU3dGridEntityPointerBase(const FactoryType &factory, const HElementType &item)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:299
ALU3dGridEntityPointer< codimension, GridImp > EntityPointerImp
make type of entity pointer implementation available in derived classes
Definition: alugrid/3d/entity.hh:500
EntityObject * entity_
Definition: alugrid/3d/entity.hh:575
int level() const
ask for level of entities
Definition: entity_inline.hh:481
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:422
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:500
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:390
const BNDFaceType & getGhost() const
Definition: alugrid/3d/entity.hh:415
ALU3dGridEntity(const FactoryType &factory, int level)
Constructor.
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
EntityObject::ImplementationType EntityImp
Definition: alugrid/3d/entity.hh:494
GeometryType type() const
type of geometry of this entity
Definition: entity_inline.hh:56
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:717
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: entity_inline.hh:49
Definition: alugrid/3d/entity.hh:32
ALU3dGridEntityPointer< cd, GridImp > ALU3dGridEntityPointerType
typedef of my type
Definition: alugrid/3d/entity.hh:720
ALU3dGridIntersectionIterator< GridImp > IntersectionIteratorImp
Definition: alugrid/3d/entity.hh:254
void updateEntityPointer(HElementType *item, int level)
Definition: entity_inline.hh:587
[ provides Dune::Grid ]
Definition: alugrid/3d/entity.hh:36
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:701
Wrapper class for entities.
Definition: common/entity.hh:61
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:741
Provides proxy classes for IntersectionsIterators.
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:491
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:687
LevelIntersectionIteratorWrapper< GridImp > ALU3dGridLevelIntersectionIteratorType
Definition: alugrid/3d/entity.hh:258
static const int defaultValue
Definition: alugrid/3d/entity.hh:723
ImplTraits::VertexType VertexType
Definition: alugrid/3d/entity.hh:92
int level() const
ask for level of entities
Definition: entity_inline.hh:580
Definition: alugrid/3d/entity.hh:26
Geometry geometry() const
geometry of this entity
GridImp::template Codim< 0 >::Entity Entity
Definition: alugrid/3d/entity.hh:260
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:608
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridLeafIntersectionIteratorType
Definition: alugrid/3d/entity.hh:257
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:618
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:698
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:606
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:438
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:557
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
MakeableInterfaceObject< Entity > EntityObject
underlying EntityImplementation
Definition: alugrid/3d/entity.hh:493
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:544
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
ALU3dGridEntityPointerBase< cd, GridImp > BaseType
Definition: alugrid/3d/entity.hh:686
int level() const
level of this element
Definition: entity_inline.hh:42
ALU3dGridElementType
Definition: topology.hh:13
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:98
const ItemType & getItem() const
Definition: alugrid/3d/entity.hh:144
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:261
void reset(int l)
reset item pointer to NULL
Definition: entity_inline.hh:12
bool isGhost() const
returns true if entity is ghost
Definition: alugrid/3d/entity.hh:428
bool isGhost() const
methods for ghosts
Definition: alugrid/3d/entityseed.hh:175
const IMPLElementType & getItem() const
Definition: alugrid/3d/entity.hh:412
EntitySeed seed() const
return seed of entity
Definition: alugrid/3d/entity.hh:153
Default Implementations for EntityImp.
Definition: common/entity.hh:739
Definition: alu3dinclude.hh:201
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
ALU3dGridEntityPointerBase< 0, GridImp > BaseType
Definition: alugrid/3d/entity.hh:592
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:486
ImplTraits::template Codim< cd >::InterfaceType HItemType
Definition: alugrid/3d/entity.hh:90
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
BNDFaceType * ghost() const
Definition: alugrid/3d/entityseed.hh:176
all entities
Definition: gridenums.hh:139
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:147
Definition: alugrid/3d/entity.hh:30
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:711
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: alugrid/3d/entity.hh:89
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:676
Definition: alugrid/3d/entity.hh:202
ALU3dGridEntityPointer(const ALU3dGridEntityPointerType &org)
copy constructor
Definition: alugrid/3d/entity.hh:669
EntityImp & entityImp() const
Definition: alugrid/3d/entity.hh:578
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:640
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:250
ThisType ALU3dGridEntityPointerType
typedef of my type
Definition: alugrid/3d/entity.hh:497
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridIntersectionIteratorType
Definition: alugrid/3d/entity.hh:256
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/3d/entity.hh:101
ALU3dGridEntityPointer(const FactoryType &factory, const int level, const HElementType &item, const int twist=defaultValue, const int duneFace=defaultValue)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:517
void setElement(const HItemType &item)
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition: entity_inline.hh:30
Leaf iterator.
Definition: alugrid/3d/entity.hh:34
Ghost ghost
PartitionSet for the ghost partition.
Definition: partitionset.hh:238
Entity::Implementation ImplementationType
Definition: common/grid.hh:1468
Definition: alugrid/3d/grid.hh:84
ALU3dGridEntityPointer(const ALU3dGridEntityType &entity)
Constructor for EntityPointer that points to an entity (interior or ghost)
Definition: alugrid/3d/entity.hh:654
ImplTraits::template Codim< cd >::ImplementationType ItemType
Definition: alugrid/3d/entity.hh:91
const FactoryType & factory() const
return reference to factory
Definition: alugrid/3d/entity.hh:425
void setEntity(const ALU3dGridEntity< cd, dim, GridImp > &org)
set item from other entity, mainly for copy constructor of entity pointer
Definition: alugrid/3d/entity.hh:24
GridImp::template Codim< 0 >::Geometry Geometry
Definition: alugrid/3d/entity.hh:252
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:609
hierarchic index set of ALU3dGrid
Definition: alugrid/3d/grid.hh:80
GridImp::template Codim< cd >::Entity Entity
Definition: alugrid/3d/entity.hh:95
Definition: alugrid/3d/entity.hh:468
Definition: alugrid/3d/entity.hh:28
ALU3dGridEntitySeedType seed_
Definition: alugrid/3d/entity.hh:572
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:534
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:691
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:93
const FactoryType & factory() const
return reference to factory
Definition: alugrid/3d/entity.hh:150
Definition: alugrid/3d/entity.hh:688
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:489
const FactoryType & factory_
Definition: alugrid/3d/entity.hh:569
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition: alugrid/3d/entity.hh:503
ALU3dGridEntityPointer(const FactoryType &factory, const HBndSegType &ghostFace)
Constructor for EntityPointer that points to an ghost.
Definition: alugrid/3d/entity.hh:635
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:467
bool hasFather() const
returns true if father entity exists
Definition: alugrid/3d/entity.hh:332
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:599
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition: alugrid/3d/entity.hh:253
~ALU3dGridEntityPointerBase()
Destructor.
Definition: entity_inline.hh:432
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:381
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:566
Definition: alugrid/3d/entity.hh:22
EntitySeed seed() const
return key for this entity
Definition: alugrid/3d/entity.hh:431
void getEntity(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:366
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
void freeEntity()
put entity to entity stack
Definition: entity_inline.hh:446
Definition: alugrid/3d/entity.hh:689
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:595
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:87
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/3d/entity.hh:270
bool equals(const ALU3dGridEntityPointerType &i) const
equality
Definition: entity_inline.hh:459
Definition: alugrid/3d/entity.hh:488
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:624
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:700
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:765
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:266
GridImp::template Codim< cd >::Geometry Geometry
Definition: alugrid/3d/entity.hh:96
void removeElement()
reset item pointer to NULL
Definition: entity_inline.hh:22