3 #include <dune/common/exceptions.hh>
10 template<
int cd,
int dim,
class Gr
idImp>
20 template<
int cd,
int dim,
class Gr
idImp>
28 template<
int cd,
int dim,
class Gr
idImp>
32 return (item_ == org.item_);
35 template<
int cd,
int dim,
class Gr
idImp>
41 template<
int cd,
int dim,
class Gr
idImp>
47 template<
int cd,
int dim,
class Gr
idImp>
51 return partitionType_;
54 template<
int cd,
int dim,
class Gr
idImp>
67 template<
int dim,
class Gr
idImp>
76 template<
int dim,
class Gr
idImp>
90 template<
int dim,
class Gr
idImp>
97 isLeaf_ = org.isLeaf_;
103 template<
int dim,
class Gr
idImp>
108 if( ! key.isGhost() )
114 template<
int dim,
class Gr
idImp>
119 item_ =
static_cast<IMPLElementType *
> (&element);
122 assert( ! item_->isGhost() );
124 level_ = (*item_).level();
125 isLeaf_ = ((*item_).down() == 0);
131 template<
int dim,
class Gr
idImp>
136 item_ =
static_cast<IMPLElementType *
> ( ghost.getGhost().first );
140 assert(item_->isGhost());
142 level_ = item_->level();
144 ghost_ =
static_cast<BNDFaceType *
> (&ghost);
147 BNDFaceType * dwn =
static_cast<BNDFaceType *
> (ghost.down());
148 if ( ! dwn ) isLeaf_ =
true;
151 assert( ghost.level() == level_ );
152 if(dwn->ghostLevel() == level_)
166 template<
int dim,
class Gr
idImp>
173 template<
int dim,
class Gr
idImp>
177 return (item_ == org.item_);
180 template<
int dim,
class Gr
idImp>
187 template<
int dim,
class Gr
idImp>
191 return (*item_).getIndex();
194 template<
int dim,
class Gr
idImp>
198 return grid().referenceElement().size(cc);
201 template<
int dim,
class Gr
idImp>
207 assert( (isGhost()) ? item_->isGhost() : true );
211 template<
int dim,
class Gr
idImp>
217 template<
int dim,
class Gr
idImp>
230 template<
int dim,
class Gr
idImp>
237 template<
int dim,
class Gr
idImp>
245 template<
int dim,
class Gr
idImp>
253 template<
int dim,
class Gr
idImp>
262 template<
int dim,
class Gr
idImp>
271 template<
int dim,
class Gr
idImp>
275 return item_->hasBeenRefined();
278 template<
int dim,
class Gr
idImp>
282 return ((*item_).requestrule() == coarse_element_t);
291 template<
int codim,
class Gr
idImp >
294 const HElementType &item)
300 template<
int codim,
class Gr
idImp >
303 const HBndSegType & ghostFace )
306 , entity_ ( factory_.template getNewEntity<codim> ( ghostFace.level() ))
312 template<
int codim,
class Gr
idImp >
322 template<
int codim,
class Gr
idImp >
327 , entity_ ( factory_.template getNewEntity<codim> ( level ) )
335 template<
int codim,
class Gr
idImp >
338 const HElementType &item,
343 , seed_( item, level, twist, duneFace )
347 template<
int codim,
class Gr
idImp >
350 : factory_(org.factory_)
358 template<
int codim,
class Gr
idImp >
365 assert( entity_ == 0 );
366 entity_ = factory_.template getNewEntity<codim> ();
368 entityImp().setEntity( org.
entityImp() );
372 template<
int codim,
class Gr
idImp >
381 template<
int codim,
class Gr
idImp >
386 assert( &factory_ == &org.
factory_ );
391 HElementType* item = seed_.
item();
404 if( item->isGhost() )
408 entityImp().setEntity( org.
entityImp() );
413 entityImp().setElement( seed_ );
424 template<
int codim,
class Gr
idImp >
431 template<
int codim,
class Gr
idImp >
439 template<
int codim,
class Gr
idImp >
445 entityImp().removeElement();
446 factory_.template freeEntity<codim> ( (
EntityObject *) entity_ );
451 template<
int codim,
class Gr
idImp >
456 return (seed_.equals( i.
seed_ ));
459 template<
int codim,
class Gr
idImp >
464 assert( seed_.item() );
467 entity_ = factory_.template getNewEntity<codim> ();
468 entityImp().setElement( seed_ );
470 assert( seed_.item() == & entityImp().getItem() );
474 template<
int codim,
class Gr
idImp >
477 assert( seed_.item() );
478 return seed_.item()->level();
481 template<
int codim,
class Gr
idImp >
486 entityImp().setGhost( ghostFace );
489 seed_.set( ghostFace );
492 template<
int codim,
class Gr
idImp >
497 if( item && entity_ )
499 entityImp().setElement( seed_ );
509 template<
int codim,
class Gr
idImp >
519 template<
int codim,
class Gr
idImp >
525 template<
int codim,
class Gr
idImp >
535 template<
int codim,
class Gr
idImp >
543 assert( &factory_ == &org.
factory_ );
551 entityImp().setElement( seed_ );
558 template<
int codim,
class Gr
idImp >
563 assert( seed_.item() );
566 entity_ = factory_.template getNewEntity<codim> ();
567 entityImp().setElement( seed_ );
569 assert( seed_.item() == & entityImp().getItem() );
573 template<
int codim,
class Gr
idImp >
576 return seed_.level();
579 template<
int codim,
class Gr
idImp >
583 seed_.set( *item, level );
584 if( item && entity_ )
586 entityImp().setElement( seed_ );
ALU3dGridEntityPointerBase(const FactoryType &factory, const HElementType &item)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:293
EntityObject * entity_
Definition: alugrid/3d/entity.hh:570
int level() const
ask for level of entities
Definition: entity_inline.hh:475
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:494
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:384
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
void updateEntityPointer(HElementType *item, int level)
Definition: entity_inline.hh:581
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:486
int level() const
ask for level of entities
Definition: entity_inline.hh:574
Definition: alugrid/3d/entity.hh:26
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:693
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:432
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:538
ghost entities
Definition: gridenums.hh:29
int level() const
level of this element
Definition: entity_inline.hh:42
void reset(int l)
reset item pointer to NULL
Definition: entity_inline.hh:12
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:238
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:481
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
Definition: alugrid/3d/entity.hh:202
EntityImp & entityImp() const
Definition: alugrid/3d/entity.hh:573
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:333
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
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:24
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:463
ALU3dGridEntitySeedType seed_
Definition: alugrid/3d/entity.hh:567
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:528
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:483
const FactoryType & factory_
Definition: alugrid/3d/entity.hh:564
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:461
~ALU3dGridEntityPointerBase()
Destructor.
Definition: entity_inline.hh:426
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:375
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:560
Definition: alugrid/3d/entity.hh:22
HElementType * item() const
get item from key
Definition: alugrid/3d/entityseed.hh:165
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
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
all interior entities
Definition: gridenums.hh:25
void removeElement()
reset item pointer to NULL
Definition: entity_inline.hh:22