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 >
310 ALU3dGridLeafIntersectionIteratorType ileafbegin ()
const;
313 ALU3dGridLeafIntersectionIteratorType ileafend ()
const;
320 ALU3dGridLevelIntersectionIteratorType ilevelbegin ()
const;
323 ALU3dGridLevelIntersectionIteratorType ilevelend ()
const;
326 bool isLeaf ()
const;
330 EntityPointer father ()
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(); }
425 const FactoryType&
factory()
const {
return factory_; }
428 bool isGhost ()
const {
return ImplTraits::isGhost( ghost_ ); }
441 int getIndex ()
const;
444 mutable GeometryImpl geo_;
447 const FactoryType& factory_;
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 );
523 const ALU3dGridEntitySeedType& seed );
532 bool equals (
const ALU3dGridEntityPointerType& i)
const;
545 void clone (
const ALU3dGridEntityPointerType & org);
548 void getEntity (
const ALU3dGridEntityPointerType & org);
580 return GridImp :: getRealImplementation(*entity_);
587 template<
class Gr
idImp>
596 enum {
dim = GridImp::dimension };
599 typedef typename GridImp::MPICommunicatorType
Comm;
613 using BaseType ::
seed_;
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;
704 using BaseType ::
seed_;
729 const HElementType & item,
730 const int twist = defaultValue,
731 const int duneFace = defaultValue
774 #if COMPILE_ALUGRID_INLINE
775 #include "entity_imp.cc"
ALU3dGridEntityPointer(const FactoryType &factory, const HBndSegType &ghostFace)
Constructor for EntityPointer that points to an ghost.
Definition: alugrid/3d/entity.hh:635
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:624
Definition: alugrid/3d/entity.hh:24
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:599
GridImp::template Codim< cd >::Geometry Geometry
Definition: alugrid/3d/entity.hh:96
void setElement(const HItemType &item)
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:486
int level() const
ask for level of entities
Definition: entity_inline.hh:580
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:147
Definition: alugrid/3d/entity.hh:22
Definition: alugrid/3d/entity.hh:28
int level() const
ask for level of entities
Definition: entity_inline.hh:481
const BNDFaceType & getGhost() const
Definition: alugrid/3d/entity.hh:415
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:618
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
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
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:691
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:595
EntityObject * entity_
Definition: alugrid/3d/entity.hh:575
ALU3dGridEntityPointerBase< cd, GridImp > BaseType
Definition: alugrid/3d/entity.hh:686
void setEntity(const ALU3dGridEntity< cd, dim, GridImp > &org)
set item from other entity, mainly for copy constructor of entity pointer
GeometryType type() const
type of geometry of this entity
Definition: entity_inline.hh:56
GridImp::template Codim< 0 >::Entity Entity
Definition: alugrid/3d/entity.hh:260
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:390
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:250
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Default Implementations for EntityImp.
Definition: common/entity.hh:738
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:266
EntityObject::ImplementationType EntityImp
Definition: alugrid/3d/entity.hh:494
Include standard header files.
Definition: agrid.hh:59
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:711
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:608
Definition: alugrid/3d/entity.hh:689
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:640
ThisType ALU3dGridEntityPointerType
typedef of my type
Definition: alugrid/3d/entity.hh:497
Definition: alugrid/3d/entity.hh:688
GridImp::template Codim< cd >::Entity Entity
Definition: alugrid/3d/entity.hh:95
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:606
Ghost ghost
PartitionSet for the ghost partition.
Definition: partitionset.hh:238
ImplTraits::template Codim< cd >::InterfaceType HItemType
Definition: alugrid/3d/entity.hh:90
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:557
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: alugrid/3d/entity.hh:89
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:717
ALU3dGridIntersectionIterator< GridImp > IntersectionIteratorImp
Definition: alugrid/3d/entity.hh:254
bool isGhost() const
methods for ghosts
Definition: alugrid/3d/entityseed.hh:175
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:261
GridImp::template Codim< 0 >::Geometry Geometry
Definition: alugrid/3d/entity.hh:252
[ provides Dune::Grid ]
Definition: alugrid/3d/entity.hh:36
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:700
ALU3dGridEntityPointerBase< 0, GridImp > BaseType
Definition: alugrid/3d/entity.hh:592
EntitySeed seed() const
return seed of entity
Definition: alugrid/3d/entity.hh:153
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:438
~ALU3dGridEntityPointerBase()
Destructor.
Definition: entity_inline.hh:432
ALU3dGridEntityPointerBase(const FactoryType &factory, const HElementType &item)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:299
MakeableInterfaceObject< Entity > EntityObject
underlying EntityImplementation
Definition: alugrid/3d/entity.hh:493
BNDFaceType * ghost() const
Definition: alugrid/3d/entityseed.hh:176
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:381
ImplTraits::VertexType VertexType
Definition: alugrid/3d/entity.hh:92
Geometry geometry() const
geometry of this entity
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:566
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:741
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:676
Provides proxy classes for IntersectionsIterators.
const FactoryType & factory() const
return reference to factory
Definition: alugrid/3d/entity.hh:425
const IMPLElementType & getItem() const
Definition: alugrid/3d/entity.hh:412
Definition: alugrid/3d/entity.hh:32
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
Definition: alugrid/3d/entity.hh:26
hierarchic index set of ALU3dGrid
Definition: alugrid/3d/grid.hh:80
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:534
const FactoryType & factory() const
return reference to factory
Definition: alugrid/3d/entity.hh:150
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition: entity_inline.hh:30
ALU3dGridEntityPointer< cd, GridImp > ALU3dGridEntityPointerType
typedef of my type
Definition: alugrid/3d/entity.hh:720
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: entity_inline.hh:49
void updateEntityPointer(HElementType *item, int level)
Definition: entity_inline.hh:587
bool equals(const ALU3dGridEntityPointerType &i) const
equality
Definition: entity_inline.hh:459
ALU3dGridEntityPointer(const ALU3dGridEntityPointerType &org)
copy constructor
Definition: alugrid/3d/entity.hh:669
all entities
Definition: gridenums.hh:139
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:467
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
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
ALU3dGridEntitySeedType seed_
Definition: alugrid/3d/entity.hh:572
void removeElement()
reset item pointer to NULL
Definition: entity_inline.hh:22
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:544
int level() const
level of this element
Definition: entity_inline.hh:42
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:87
const FactoryType & factory_
Definition: alugrid/3d/entity.hh:569
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/3d/entity.hh:270
EntityImp & entityImp() const
Definition: alugrid/3d/entity.hh:578
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridLeafIntersectionIteratorType
Definition: alugrid/3d/entity.hh:257
Definition: alu3dinclude.hh:201
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:687
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/3d/entity.hh:101
static const int defaultValue
Definition: alugrid/3d/entity.hh:723
Definition: alugrid/3d/entity.hh:30
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:422
void getEntity(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:366
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
ALU3dGridElementType
Definition: topology.hh:13
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:698
LevelIntersectionIteratorWrapper< GridImp > ALU3dGridLevelIntersectionIteratorType
Definition: alugrid/3d/entity.hh:258
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:765
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:701
Entity::Implementation ImplementationType
Definition: common/grid.hh:1468
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:93
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
Definition: alugrid/3d/entity.hh:488
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:491
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridIntersectionIteratorType
Definition: alugrid/3d/entity.hh:256
bool hasFather() const
returns true if father entity exists
Definition: alugrid/3d/entity.hh:332
Definition: alugrid/3d/entity.hh:202
ALU3dGridEntityPointer< codimension, GridImp > EntityPointerImp
make type of entity pointer implementation available in derived classes
Definition: alugrid/3d/entity.hh:500
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:489
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:98
void reset(int l)
reset item pointer to NULL
Definition: entity_inline.hh:12
EntitySeed seed() const
return key for this entity
Definition: alugrid/3d/entity.hh:431
bool isGhost() const
returns true if entity is ghost
Definition: alugrid/3d/entity.hh:428
Leaf iterator.
Definition: alugrid/3d/entity.hh:34
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition: alugrid/3d/entity.hh:503
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:609
Definition: alugrid/3d/entity.hh:468
Definition: alugrid/3d/grid.hh:84
void freeEntity()
put entity to entity stack
Definition: entity_inline.hh:446
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition: alugrid/3d/entity.hh:253
Wrapper class for entities.
Definition: common/entity.hh:61
const ItemType & getItem() const
Definition: alugrid/3d/entity.hh:144
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:500
ALU3dGridEntity(const FactoryType &factory, int level)
Constructor.