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>
204 return grid().referenceElement().size(codim);
207 template<
int dim,
class Gr
idImp>
213 assert( (isGhost()) ? item_->isGhost() : true );
217 template<
int dim,
class Gr
idImp>
223 template<
int dim,
class Gr
idImp>
236 template<
int dim,
class Gr
idImp>
243 template<
int dim,
class Gr
idImp>
251 template<
int dim,
class Gr
idImp>
259 template<
int dim,
class Gr
idImp>
268 template<
int dim,
class Gr
idImp>
277 template<
int dim,
class Gr
idImp>
281 return item_->hasBeenRefined();
284 template<
int dim,
class Gr
idImp>
288 return ((*item_).requestrule() == coarse_element_t);
297 template<
int codim,
class Gr
idImp >
300 const HElementType &item)
306 template<
int codim,
class Gr
idImp >
309 const HBndSegType & ghostFace )
312 , entity_ ( factory_.template getNewEntity<codim> ( ghostFace.level() ))
318 template<
int codim,
class Gr
idImp >
328 template<
int codim,
class Gr
idImp >
333 , entity_ ( factory_.template getNewEntity<codim> ( level ) )
341 template<
int codim,
class Gr
idImp >
344 const HElementType &item,
349 , seed_( item, level, twist, duneFace )
353 template<
int codim,
class Gr
idImp >
356 : factory_(org.factory_)
364 template<
int codim,
class Gr
idImp >
371 assert( entity_ == 0 );
372 entity_ = factory_.template getNewEntity<codim> ();
374 entityImp().setEntity( org.
entityImp() );
378 template<
int codim,
class Gr
idImp >
387 template<
int codim,
class Gr
idImp >
392 assert( &factory_ == &org.
factory_ );
397 HElementType* item = seed_.
item();
410 if( item->isGhost() )
414 entityImp().setEntity( org.
entityImp() );
419 entityImp().setElement( seed_ );
430 template<
int codim,
class Gr
idImp >
437 template<
int codim,
class Gr
idImp >
445 template<
int codim,
class Gr
idImp >
451 entityImp().removeElement();
452 factory_.template freeEntity<codim> ( (
EntityObject *) entity_ );
457 template<
int codim,
class Gr
idImp >
462 return (seed_.equals( i.
seed_ ));
465 template<
int codim,
class Gr
idImp >
470 assert( seed_.item() );
473 entity_ = factory_.template getNewEntity<codim> ();
474 entityImp().setElement( seed_ );
476 assert( seed_.item() == & entityImp().getItem() );
480 template<
int codim,
class Gr
idImp >
483 assert( seed_.item() );
484 return seed_.item()->level();
487 template<
int codim,
class Gr
idImp >
492 entityImp().setGhost( ghostFace );
495 seed_.set( ghostFace );
498 template<
int codim,
class Gr
idImp >
503 if( item && entity_ )
505 entityImp().setElement( seed_ );
515 template<
int codim,
class Gr
idImp >
525 template<
int codim,
class Gr
idImp >
531 template<
int codim,
class Gr
idImp >
541 template<
int codim,
class Gr
idImp >
549 assert( &factory_ == &org.
factory_ );
557 entityImp().setElement( seed_ );
564 template<
int codim,
class Gr
idImp >
569 assert( seed_.item() );
572 entity_ = factory_.template getNewEntity<codim> ();
573 entityImp().setElement( seed_ );
575 assert( seed_.item() == & entityImp().getItem() );
579 template<
int codim,
class Gr
idImp >
582 return seed_.level();
585 template<
int codim,
class Gr
idImp >
589 seed_.set( *item, level );
590 if( item && entity_ )
592 entityImp().setElement( seed_ );
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
int level() const
ask for level of entities
Definition: entity_inline.hh:481
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
EntityObject * entity_
Definition: alugrid/3d/entity.hh:575
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
void clone(const ALU3dGridEntityPointerType &org)
Definition: entity_inline.hh:390
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Include standard header files.
Definition: agrid.hh:59
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/3d/entity.hh:711
Ghost ghost
PartitionSet for the ghost partition.
Definition: partitionset.hh:238
all interior entities
Definition: gridenums.hh:29
ghost entities
Definition: gridenums.hh:33
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:717
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
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:381
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:566
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
Definition: alugrid/3d/entity.hh:26
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:534
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition: entity_inline.hh:30
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
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:467
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
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
Definition: alugrid/3d/entity.hh:30
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
ImplTraits::template Codim< cd >::InterfaceType HElementType
Definition: alugrid/3d/entity.hh:698
HElementType * item() const
get item from key
Definition: alugrid/3d/entityseed.hh:165
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: alugrid/3d/entity.hh:491
Definition: alugrid/3d/entity.hh:202
void updateGhostPointer(HBndSegType &ghostFace)
Definition: entity_inline.hh:489
void reset(int l)
reset item pointer to NULL
Definition: entity_inline.hh:12
Definition: alugrid/3d/entity.hh:468
void freeEntity()
put entity to entity stack
Definition: entity_inline.hh:446
void updateEntityPointer(HElementType *item, int level=-1)
Definition: entity_inline.hh:500