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>
22 class ALU3dGridEntity;
23 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
24 class ALU3dGridLevelIterator;
25 template<
int cd,
class Gr
idImp >
26 class ALU3dGridEntityPointer;
27 template<
int mydim,
int coorddim,
class Gr
idImp>
28 class ALU3dGridGeometry;
29 template<
class Gr
idImp>
30 class ALU3dGridHierarchicIterator;
31 template<
class Gr
idImp>
32 class ALU3dGridIntersectionIterator;
33 template<
int codim, PartitionIteratorType,
class Gr
idImp>
34 class ALU3dGridLeafIterator;
35 template<
int dim,
int dimworld, ALU3dGr
idElementType,
class >
44template<
int cd,
int dim,
class Gr
idImp>
46public 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)
187template<
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)
252 typedef typename GridImp::Traits::template Codim< cd >::Twists::Twist
Twist;
254#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 );
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();
456template<
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;
475 enum { codimension = codim };
478 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
550 return GridImp :: getRealImplementation(
entity_);
557template<
class Gr
idImp>
565 typedef ALU3dGridEntityPointer <cd,GridImp>
ThisType;
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;
626template<
int cd,
class Gr
idImp>
632 typedef ALU3dGridEntityPointer <cd,GridImp>
ThisType;
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
#define alugrid_assert(EX)
Definition alugrid_assert.hh:20
Provides proxy classes for IntersectionsIterators.
Definition alu3dinclude.hh:80
ALU3dGridElementType
Definition topology.hh:12
Definition alu3dinclude.hh:259
[ provides Dune::Grid ]
Definition 3d/grid.hh:468
EntitySeed seed_
the information necessary to make sense of this entity
Definition entity.hh:165
GridImp::template Codim< cd >::Geometry Geometry
Definition entity.hh:94
GeometryType type() const
type of geometry of this entity
Definition entity.hh:113
void removeElement()
reset item pointer to NULL
Definition entity.hh:127
int level() const
level of this element
Definition entity.hh:149
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition entity.hh:152
ImplTraits::template Codim< dim, cd >::InterfaceType HItemType
Definition entity.hh:88
ALU3dGridEntity()
Constructor.
Definition entity_imp.cc:28
PartitionType convertBndId(const HItemType &item) const
convert ALUGrid partition type to dune partition type
Definition entity_imp.cc:90
Geometry geometry() const
geometry of this entity
Definition entity_imp.cc:109
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition entity.hh:101
GridImp::template Codim< cd >::Entity Entity
Definition entity.hh:93
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
ImplTraits::template Codim< dim, cd >::ImplementationType ItemType
Definition entity.hh:89
EntitySeed seed() const
return seed of entity
Definition entity.hh:146
const ItemType & getItem() const
Definition entity.hh:143
void setElement(const HItemType &item)
Definition entity_imp.cc:48
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition entity.hh:97
ImplTraits::HBndSegType HBndSegType
Definition entity.hh:91
GeometryImpl geo_
the current geometry
Definition entity.hh:162
ImplTraits::VertexType VertexType
Definition entity.hh:90
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition entity.hh:87
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
Definition entity_imp.cc:80
int getIndex() const
index is unique within the grid hierarchy and per codim
Definition entity.hh:156
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition entity.hh:134
Definition iterator.hh:550
GridImp::MPICommunicatorType Comm
Definition entity.hh:636
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition entity.hh:658
static const int defaultValue
Definition entity.hh:664
@ dimworld
Definition entity.hh:634
ALU3dGridEntitySeed< cd, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition entity.hh:655
ALU3dGridEntityPointer< cd, GridImp > ALU3dGridEntityPointerType
typedef of my type
Definition entity.hh:661
ALU3dGridEntityPointerBase< cd, GridImp > BaseType
Definition entity.hh:631
ALU3dGridEntityPointer(const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition entity.hh:673
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition entity.hh:632
ALU3dGridEntityPointer()
Definition entity.hh:679
@ dim
Definition entity.hh:633
void updateEntityPointer(HElementType *item, int level)
Definition entity_inline.hh:326
ImplTraits::HBndSegType HBndSegType
Definition entity.hh:645
ImplTraits::BNDFaceType BNDFaceType
Definition entity.hh:646
ImplTraits::template Codim< dim, cd >::InterfaceType HElementType
Definition entity.hh:643
Definition iterator.hh:709
Definition iterator.hh:56
Leaf iterator.
Definition iterator.hh:635
const IMPLElementType & getItem() const
Definition entity.hh:392
GridImp::template Codim< 0 >::Entity Entity
Definition entity.hh:244
const BNDFaceType & getGhost() const
Definition entity.hh:395
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition entity.hh:237
BNDFaceType * ghost_
not zero if entity is ghost entity
Definition entity.hh:442
GridImp::template Codim< 0 >::Geometry Geometry
Definition entity.hh:236
bool hasFather() const
returns true if father entity exists
Definition entity.hh:312
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition entity.hh:260
IMPLElementType * item_
Definition entity.hh:439
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition entity.hh:246
Codim< codim >::Entity subEntity(int i) const
GeometryImpl geo_
the entity's geometry
Definition entity.hh:436
int getSubIndex(int i) const
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridLeafIntersectionIteratorType
Definition entity.hh:241
EntitySeed seed() const
return key for this entity
Definition entity.hh:405
Codim< codim >::Twist twist(int i) const
LeafIntersectionIteratorWrapper< GridImp > ALU3dGridIntersectionIteratorType
Definition entity.hh:240
int weight() const
weight of entity (ie number of leaf elements underneath)
Definition entity.hh:420
LevelIntersectionIteratorWrapper< GridImp > ALU3dGridLevelIntersectionIteratorType
Definition entity.hh:242
bool isGhost() const
returns true if entity is ghost
Definition entity.hh:402
int master() const
return rank number of master process
Definition entity.hh:426
int macroId() const
return macro id of this entity
Definition entity.hh:414
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition entity.hh:255
GridImp::template Codim< cd >::Entity Entity
Definition entity.hh:253
GridImp::Traits::template Codim< cd >::Twists::Twist Twist
Definition entity.hh:252
void updateGhostPointer(HBndSegType &ghostFace)
Definition entity_inline.hh:298
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition entity.hh:478
ThisType ALU3dGridEntityPointerType
typedef of my type
Definition entity.hh:483
int level() const
ask for level of entities
Definition entity.hh:524
ALU3dGridEntityPointerBase()
default empty constructor
Definition entity_inline.hh:238
ALU3dGridEntitySeedType seed_
Definition entity.hh:543
bool equals(const ALU3dGridEntityPointerType &i) const
equality
Definition entity_inline.hh:290
EntityObject entity_
Definition entity.hh:546
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition entity.hh:489
ALU3dGridEntityPointer< codimension, GridImp > EntityPointerImp
make type of entity pointer implementation available in derived classes
Definition entity.hh:486
Entity & dereference() const
dereferencing
Definition entity.hh:514
ThisType & operator=(const ThisType &org)
assignment operator
Definition entity_inline.hh:257
EntityImp & entityImp() const
Definition entity.hh:549
void done()
has to be called when iterator is finished
Definition entity_inline.hh:283
void clone(const ALU3dGridEntityPointerType &org)
Definition entity_inline.hh:266
ALU3dGridEntity< codimension, dim, GridImp > EntityImp
Definition entity.hh:480
void updateEntityPointer(HElementType *item, int level=-1)
Definition entity_inline.hh:309
Entity EntityObject
Definition entity.hh:479
ALU3dGridEntityPointer< cd, GridImp > ThisType
Definition entity.hh:565
ALU3dGridEntityPointer(const HBndSegType &ghostFace)
Constructor for EntityPointer that points to an ghost.
Definition entity.hh:602
ImplTraits::BNDFaceType BNDFaceType
Definition entity.hh:579
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition entity.hh:575
ImplTraits::HBndSegType HBndSegType
Definition entity.hh:578
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition entity.hh:591
ALU3dGridEntityPointer(const ALU3dGridEntityType &entity)
Constructor for EntityPointer that points to an entity (interior or ghost)
Definition entity.hh:613
ALU3dGridEntitySeed< cd, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition entity.hh:588
ALU3dGridEntityPointer()
Definition entity.hh:620
ImplTraits::template Codim< dim, cd >::InterfaceType HElementType
Definition entity.hh:576
GridImp::MPICommunicatorType Comm
Definition entity.hh:569
ALU3dGridEntityPointer(const ALU3dGridEntitySeedType &seed)
Constructor for EntityPointer that points to given entity.
Definition entity.hh:607
ALU3dGridEntityPointerBase< 0, GridImp > BaseType
Definition entity.hh:562
Definition entityseed.hh:212
int level() const
return level
Definition entityseed.hh:281
HElementType * item() const
get item from key
Definition entityseed.hh:159
bool isValid() const
Definition entityseed.hh:127
hierarchic index set of ALU3dGrid
Definition indexsets.hh:38
Factory class for ALUGrids.
Definition gridfactory.hh:28
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition intersectioniteratorwrapper.hh:251
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition intersectioniteratorwrapper.hh:355