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 ;
297 template<
int codim >
321 bool isLeaf ()
const;
329 return (this->
level()>0);
341 LocalGeometry geometryInFather ()
const;
360 bool mightVanish ()
const;
363 bool hasBoundaryIntersections ()
const;
369 bool mark(
int refCount )
const;
386 void reset (
int l );
399 template<
int cc>
int getSubIndex (
int i)
const;
404 int subIndex(
int i,
unsigned int codim)
const;
407 const IMPLElementType&
getItem ()
const {
return *item_; }
417 const GridImp&
grid()
const {
return factory_.grid(); }
423 bool isGhost ()
const {
return ImplTraits::isGhost( ghost_ ); }
436 int getIndex ()
const;
439 mutable GeometryImpl geo_;
445 mutable IMPLElementType* item_;
448 mutable BNDFaceType* ghost_;
462 template<
int codim,
class Gr
idImp >
466 enum { dim = GridImp::dimension };
467 enum { dimworld = GridImp::dimensionworld };
469 typedef typename GridImp::MPICommunicatorType Comm;
476 typedef typename ImplTraits::template Codim<codim>
::InterfaceType HElementType;
478 typedef typename ImplTraits::HBndSegType HBndSegType;
479 typedef typename ImplTraits::BNDFaceType BNDFaceType;
486 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
502 const HElementType & item);
506 const HElementType & item,
514 const HBndSegType & ghostFace );
575 return GridImp :: getRealImplementation(*
entity_);
582 template<
class Gr
idImp>
591 enum {
dim = GridImp::dimension };
594 typedef typename GridImp::MPICommunicatorType
Comm;
626 const HElementType & item)
676 template<
int cd,
class Gr
idImp>
677 class ALU3dGridEntityPointer :
678 public ALU3dGridEntityPointerBase<cd,GridImp>
683 enum {
dim = GridImp::dimension };
686 typedef typename GridImp::MPICommunicatorType
Comm;
724 const HElementType & item,
725 const int twist = defaultValue,
726 const int duneFace = defaultValue
769 #if COMPILE_ALUGRID_INLINE
770 #include "entity_imp.cc"
ALU3dGridEntityPointerBase(const FactoryType &factory, const HElementType &item)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:293
ALU3dGridEntityPointer< codimension, GridImp > EntityPointerImp
make type of entity pointer implementation available in derived classes
Definition: alugrid/3d/entity.hh:495
EntityObject * entity_
Definition: alugrid/3d/entity.hh:570
ALU3dGridElementType
Definition: topology.hh:13
int level() const
ask for level of entities
Definition: entity_inline.hh:475
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:417
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:494
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:384
const BNDFaceType & getGhost() const
Definition: alugrid/3d/entity.hh:410
ALU3dGridEntity(const FactoryType &factory, int level)
Constructor.
EntityObject::ImplementationType EntityImp
Definition: alugrid/3d/entity.hh:489
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:712
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:715
ALU3dGridIntersectionIterator< GridImp > IntersectionIteratorImp
Definition: alugrid/3d/entity.hh:254
void updateEntityPointer(HElementType *item, int level)
Definition: entity_inline.hh:581
all entities
Definition: gridenums.hh:135
Wrapper class for entities.
Definition: common/entity.hh:56
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
[ provides Dune::Grid ]
Definition: alugrid/3d/entity.hh:36
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:696
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:736
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:486
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:682
LevelIntersectionIteratorWrapper< GridImp > ALU3dGridLevelIntersectionIteratorType
Definition: alugrid/3d/entity.hh:258
static const int defaultValue
Definition: alugrid/3d/entity.hh:718
ImplTraits::VertexType VertexType
Definition: alugrid/3d/entity.hh:92
int level() const
ask for level of entities
Definition: entity_inline.hh:574
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:603
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridLeafIntersectionIteratorType
Definition: alugrid/3d/entity.hh:257
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:613
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:693
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:601
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:432
const GridImp & grid() const
return reference to grid
Definition: alugrid/3d/entity.hh:552
MakeableInterfaceObject< Entity > EntityObject
underlying EntityImplementation
Definition: alugrid/3d/entity.hh:488
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:538
ALU3dGridEntityPointerBase< cd, GridImp > BaseType
Definition: alugrid/3d/entity.hh:681
int level() const
level of this element
Definition: entity_inline.hh:42
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:423
bool isGhost() const
methods for ghosts
Definition: alugrid/3d/entityseed.hh:175
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:238
const IMPLElementType & getItem() const
Definition: alugrid/3d/entity.hh:407
EntitySeed seed() const
return seed of entity
Definition: alugrid/3d/entity.hh:153
Definition: alu3dinclude.hh:201
ALU3dGridEntityPointerBase< 0, GridImp > BaseType
Definition: alugrid/3d/entity.hh:587
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:481
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: alugrid/3d/entity.hh:266
ImplTraits::template Codim< cd >::InterfaceType HItemType
Definition: alugrid/3d/entity.hh:90
BNDFaceType * ghost() const
Definition: alugrid/3d/entityseed.hh:176
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:706
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: alugrid/3d/entity.hh:89
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:671
Definition: alugrid/3d/entity.hh:202
ALU3dGridEntityPointer(const ALU3dGridEntityPointerType &org)
copy constructor
Definition: alugrid/3d/entity.hh:664
EntityImp & entityImp() const
Definition: alugrid/3d/entity.hh:573
ALU3dGridEntityPointer(const FactoryType &factory, const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: alugrid/3d/entity.hh:635
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:250
ThisType ALU3dGridEntityPointerType
typedef of my type
Definition: alugrid/3d/entity.hh:492
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridIntersectionIteratorType
Definition: alugrid/3d/entity.hh:256
Default Implementations for EntityImp.
Definition: common/entity.hh:552
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:333
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:511
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
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:24
Definition: alugrid/3d/grid.hh:84
Definition: alugrid/3d/entity.hh:683
ALU3dGridEntityPointer(const ALU3dGridEntityType &entity)
Constructor for EntityPointer that points to an entity (interior or ghost)
Definition: alugrid/3d/entity.hh:649
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:420
Provides proxy classes for IntersectionsIterators.
Definition: alugrid/3d/entity.hh:483
Entity::Implementation ImplementationType
Definition: common/grid.hh:1377
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
Definition: alugrid/3d/entity.hh:684
GridImp::template Codim< 0 >::Geometry Geometry
Definition: alugrid/3d/entity.hh:252
ImplTraits::BNDFaceType BNDFaceType
Definition: alugrid/3d/entity.hh:604
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:463
Definition: alugrid/3d/entity.hh:28
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:23
ALU3dGridEntitySeedType seed_
Definition: alugrid/3d/entity.hh:567
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:528
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:686
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:93
const FactoryType & factory() const
return reference to factory
Definition: alugrid/3d/entity.hh:150
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:483
const FactoryType & factory_
Definition: alugrid/3d/entity.hh:564
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition: alugrid/3d/entity.hh:498
ALU3dGridEntityPointer(const FactoryType &factory, const HBndSegType &ghostFace)
Constructor for EntityPointer that points to an ghost.
Definition: alugrid/3d/entity.hh:630
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:461
bool hasFather() const
returns true if father entity exists
Definition: alugrid/3d/entity.hh:327
GridImp::MPICommunicatorType Comm
Definition: alugrid/3d/entity.hh:594
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition: alugrid/3d/entity.hh:253
~ALU3dGridEntityPointerBase()
Destructor.
Definition: entity_inline.hh:426
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:375
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:80
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:560
Definition: alugrid/3d/entity.hh:22
EntitySeed seed() const
return key for this entity
Definition: alugrid/3d/entity.hh:426
void getEntity(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:360
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
void freeEntity()
put entity to entity stack
Definition: entity_inline.hh:440
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: alugrid/3d/entity.hh:590
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:453
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:619
ImplTraits::HBndSegType HBndSegType
Definition: alugrid/3d/entity.hh:695
ALU3dGridEntityPointer(const FactoryType &factory, int level)
Definition: alugrid/3d/entity.hh:760
GridImp::template Codim< cd >::Geometry Geometry
Definition: alugrid/3d/entity.hh:96
void removeElement()
reset item pointer to NULL
Definition: entity_inline.hh:22