Go to the documentation of this file. 1 #ifndef DUNE_ALU3DGRIDENTITY_HH
2 #define DUNE_ALU3DGRIDENTITY_HH
8 #include <dune/grid/common/entity.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<
int dim,
int dimworld, ALU3dGr
idElementType,
class >
44 template<
int cd,
int dim,
class Gr
idImp>
46 public EntityDefaultImplementation <cd,dim,GridImp,ALU3dGridEntity>
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,dim>
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::dimension, GridImp::dimensionworld, GridImp::elementType, Comm >;
84 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
88 typedef typename ImplTraits::template Codim<dim, cd>::InterfaceType
HItemType;
89 typedef typename ImplTraits::template Codim<dim, cd>::ImplementationType
ItemType;
96 #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
98 #endif // #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
187 template<
int dim,
class Gr
idImp>
189 :
public EntityDefaultImplementation<0,dim,GridImp,ALU3dGridEntity>
191 static const int dimworld = std::remove_const< GridImp >::type::dimensionworld;
192 static const ALU3dGridElementType elementType = std::remove_const< GridImp >::type::elementType;
194 typedef typename GridImp::MPICommunicatorType Comm;
197 typedef typename ImplTraits::template Codim<dim, 0>::InterfaceType HElementType;
199 typedef typename ImplTraits::GEOElementType GEOElementType;
200 typedef typename ImplTraits::BNDFaceType BNDFaceType;
201 typedef typename ImplTraits::IMPLElementType IMPLElementType;
202 typedef typename ImplTraits::HBndSegType
HBndSegType;
204 enum { refine_element_t = ImplTraits::RefinementRules::refine_element_t };
205 enum { bisect_element_t = ImplTraits::RefinementRules::bisect_element_t };
206 enum { coarse_element_t = ImplTraits::RefinementRules::coarse_element_t };
207 enum { nosplit_element_t = ImplTraits::RefinementRules::nosplit_element_t };
209 typedef typename ImplTraits::MarkRuleType MarkRuleType;
211 friend class ALU3dGrid< GridImp::dimension, GridImp::dimensionworld, elementType, Comm >;
230 typedef typename GridImp :: ReferenceElementType ReferenceElementType;
232 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
233 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
245 #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
247 #endif // #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
252 typedef typename GridImp::Traits::template Codim< cd >::Twists::Twist
Twist;
254 #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
256 #endif // #if !DUNE_VERSION_NEWER(DUNE_GRID,3,0)
260 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
281 GeometryType
type ()
const;
289 template<
int cc>
int count ()
const ;
294 unsigned int subEntities (
unsigned int codim)
const;
298 template<
int codim >
301 template<
int codim >
305 bool isLeaf ()
const;
314 return (this->
level()>0);
326 LocalGeometry geometryInFather ()
const;
345 bool mightVanish ()
const;
348 bool hasBoundaryIntersections ()
const;
354 bool mark(
const int refCount,
const bool conformingRefinement )
const;
371 void reset (
int l );
384 template<
int cc>
int getSubIndex (
int i)
const;
389 int subIndex(
int i,
unsigned int codim)
const;
392 const IMPLElementType&
getItem ()
const {
return *item_; }
402 bool isGhost ()
const{
return ImplTraits::isGhost( ghost_ ); }
416 return (isGhost()) ? getGhost().ldbVertexIndex() :
getItem().ldbVertexIndex();
422 return (isGhost()) ? 0 :
getItem().weight();
428 return (isGhost()) ? getGhost().master() :
getItem().master();
456 template<
int codim,
class Gr
idImp >
460 enum { dim = GridImp::dimension };
461 enum { dimworld = GridImp::dimensionworld };
463 typedef typename GridImp::MPICommunicatorType Comm;
467 friend class ALU3dGrid < GridImp::dimension, GridImp::dimensionworld, GridImp::elementType, Comm >;
470 typedef typename ImplTraits::template Codim<dim, codim>::InterfaceType HElementType;
472 typedef typename ImplTraits::HBndSegType HBndSegType;
473 typedef typename ImplTraits::BNDFaceType BNDFaceType;
478 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
550 return GridImp :: getRealImplementation(
entity_);
557 template<
class Gr
idImp>
566 enum {
dim = GridImp::dimension };
569 typedef typename GridImp::MPICommunicatorType
Comm;
573 friend class ALU3dGrid < GridImp::dimension, GridImp::dimensionworld, GridImp::elementType,
Comm >;
576 typedef typename ImplTraits::template Codim<dim, cd>::InterfaceType
HElementType;
626 template<
int cd,
class Gr
idImp>
627 class ALU3dGridEntityPointer :
628 public ALU3dGridEntityPointerBase<cd,GridImp>
633 enum {
dim = GridImp::dimension };
636 typedef typename GridImp::MPICommunicatorType
Comm;
640 friend class ALU3dGrid < GridImp::dimension, GridImp::dimensionworld, GridImp::elementType,
Comm >;
643 typedef typename ImplTraits::template Codim<dim, cd>::InterfaceType
HElementType;
691 #if COMPILE_ALUGRID_INLINE
GridImp::template Codim< cd >::Entity Entity
Definition: entity.hh:253
void updateEntityPointer(HElementType *item, int level)
Definition: entity_inline.hh:326
ALU3dGridEntityPointerBase< 0, GridImp > BaseType
Definition: entity.hh:562
EntitySeed seed() const
return seed of entity
Definition: entity.hh:146
Geometry geometry() const
geometry of this entity
Definition: entity_imp.cc:109
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition: entity.hh:489
int master() const
return rank number of master process
Definition: entity.hh:426
EntitySeed seed() const
return key for this entity
Definition: entity.hh:405
ImplTraits::template Codim< dim, cd >::InterfaceType HElementType
Definition: entity.hh:576
ALU3dGridEntityPointer()
Definition: entity.hh:679
Definition: entity.hh:633
GridImp::template Codim< 0 >::Entity Entity
Definition: entity.hh:244
Definition: entity.hh:475
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: entity.hh:87
BNDFaceType * ghost_
not zero if entity is ghost entity
Definition: entity.hh:442
GridImp::template Codim< 0 >::Geometry Geometry
Definition: entity.hh:236
HElementType * item() const
get item from key
Definition: entityseed.hh:159
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entity.hh:591
static const int defaultValue
Definition: entity.hh:664
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
Definition: entity_imp.cc:80
const BNDFaceType & getGhost() const
Definition: entity.hh:395
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: entity.hh:152
Definition: entity.hh:188
GridImp::template Codim< cd >::Geometry Geometry
Definition: entity.hh:94
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: entity.hh:478
GridImp::MPICommunicatorType Comm
Definition: entity.hh:636
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:283
ALU3dGridEntitySeedType seed_
Definition: entity.hh:543
const ItemType & getItem() const
Definition: entity.hh:143
Definition: alu3dinclude.hh:259
ImplTraits::template Codim< dim, cd >::ImplementationType ItemType
Definition: entity.hh:89
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition: entity.hh:237
GeometryType type() const
type of geometry of this entity
Definition: entity.hh:113
ALU3dGridEntityPointer(const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: entity.hh:673
ALU3dGridEntity< codimension, dim, GridImp > EntityImp
Definition: entity.hh:480
int macroId() const
return macro id of this entity
Definition: entity.hh:414
ImplTraits::HBndSegType HBndSegType
Definition: entity.hh:91
EntityObject entity_
Definition: entity.hh:546
ALU3dGridEntityPointer(const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition: entity.hh:607
Leaf iterator.
Definition: entity.hh:34
ImplTraits::BNDFaceType BNDFaceType
Definition: entity.hh:646
int level() const
level of this element
Definition: entity.hh:149
const IMPLElementType & getItem() const
Definition: entity.hh:392
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition: entity.hh:101
GridImp::template Codim< cd >::Entity Entity
Definition: entity.hh:93
GeometryImpl geo_
the entity's geometry
Definition: entity.hh:436
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:257
GridImp::MPICommunicatorType Comm
Definition: entity.hh:569
ImplTraits::BNDFaceType BNDFaceType
Definition: entity.hh:579
ImplTraits::VertexType VertexType
Definition: entity.hh:90
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:309
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:312
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:298
ThisType ALU3dGridEntityPointerType
typedef of my type
Definition: entity.hh:483
void setElement(const HItemType &item)
Definition: entity_imp.cc:48
Entity & dereference() const
dereferencing
Definition: entity.hh:514
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:266
#define alugrid_assert(EX)
Definition: alugrid_assert.hh:20
ImplTraits::template Codim< dim, cd >::InterfaceType HItemType
Definition: entity.hh:88
Entity EntityObject
Definition: entity.hh:479
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition: entity.hh:134
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition: entity.hh:260
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: entity.hh:632
ALU3dGridEntityPointer(const ALU3dGridEntityType &entity)
Constructor for EntityPointer that points to an entity (interior or ghost)
Definition: entity.hh:613
bool isGhost() const
returns true if entity is ghost
Definition: entity.hh:402
Factory class for ALUGrids.
Definition: 3d/grid.hh:84
[ provides Dune::Grid ]
Definition: communication.hh:37
int level() const
ask for level of entities
Definition: entity.hh:524
GridImp::Traits::template Codim< cd >::Twists::Twist Twist
Definition: entity.hh:252
int getIndex() const
index is unique within the grid hierarchy and per codim
Definition: entity.hh:156
ImplTraits::template Codim< dim, cd >::InterfaceType HElementType
Definition: entity.hh:643
int level() const
return level
Definition: entityseed.hh:281
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: entity.hh:246
hierarchic index set of ALU3dGrid
Definition: 3d/grid.hh:80
bool equals(const ALU3dGridEntityPointerType &i) const
equality
Definition: entity_inline.hh:290
ALU3dGridEntityPointerBase()
default empty constructor
Definition: entity_inline.hh:238
ALU3dGridEntityPointerBase< cd, GridImp > BaseType
Definition: entity.hh:631
bool isValid() const
Definition: entityseed.hh:127
ALU3dGridElementType
Definition: topology.hh:12
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:250
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition: entity.hh:565
ALU3dGridEntity()
Constructor.
Definition: entity_imp.cc:28
GeometryImpl geo_
the current geometry
Definition: entity.hh:162
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: entity.hh:97
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: entity.hh:255
void removeElement()
reset item pointer to NULL
Definition: entity.hh:127
ALU3dGridEntityPointer()
Definition: entity.hh:620
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:354
ImplTraits::HBndSegType HBndSegType
Definition: entity.hh:645
EntitySeed seed_
the information necessary to make sense of this entity
Definition: entity.hh:165
ImplTraits::HBndSegType HBndSegType
Definition: entity.hh:578
ALU3dGridEntityPointer(const HBndSegType &ghostFace)
Constructor for EntityPointer that points to an ghost.
Definition: entity.hh:602
EntityImp & entityImp() const
Definition: entity.hh:549
PartitionType convertBndId(const HItemType &item) const
convert ALUGrid partition type to dune partition type
Definition: entity_imp.cc:90
IMPLElementType * item_
Definition: entity.hh:439
Definition: alu3dinclude.hh:79
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entity.hh:658
Definition: entity.hh:457
ALU3dGridEntityPointer< codimension, GridImp > EntityPointerImp
make type of entity pointer implementation available in derived classes
Definition: entity.hh:486
Definition: entity.hh:634
void setEntity(const ALU3dGridEntity< cd, dim, GridImp > &org)
set item from other entity, mainly for copy constructor of entity pointer
Definition: entity_imp.cc:41
int weight() const
weight of entity (ie number of leaf elements underneath)
Definition: entity.hh:420
Provides proxy classes for IntersectionsIterators.