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>
78 reset (
int walkLevel )
90 template<
int dim,
class Gr
idImp>
97 isLeaf_ = org.isLeaf_;
103 template<
int dim,
class Gr
idImp>
105 ALU3dGridEntity<0,dim,GridImp>::
106 setElement(
const EntitySeed& key )
108 if( ! key.isGhost() )
109 setElement( *key.interior() );
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>
218 inline ALU3dGridHierarchicIterator<GridImp>
225 return ALU3dGridHierarchicIterator<GridImp>(factory_,*ghost_,maxlevel, isLeaf() );
227 return ALU3dGridHierarchicIterator<GridImp>(factory_,*item_,maxlevel, isLeaf() );
230 template<
int dim,
class Gr
idImp>
234 return ALU3dGridHierarchicIterator<GridImp> (factory_, *item_, maxlevel,
true);
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() ))
309 updateGhostPointer(
const_cast<HBndSegType &
> (ghostFace) );
312 template<
int codim,
class Gr
idImp >
322 template<
int codim,
class Gr
idImp >
327 , entity_ ( factory_.template getNewEntity<codim> ( level ) )
331 entityImp().reset(
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 >
360 getEntity(
const ALU3dGridEntityPointerType & org)
365 assert( entity_ == 0 );
366 entity_ = factory_.template getNewEntity<codim> ();
368 entityImp().setEntity( org.entityImp() );
372 template<
int codim,
class Gr
idImp >
373 inline ALU3dGridEntityPointerBase<codim,GridImp> &
381 template<
int codim,
class Gr
idImp >
384 clone (
const ALU3dGridEntityPointerType & org)
386 assert( &factory_ == &org.factory_ );
391 HElementType* item = seed_.item();
404 if( item->isGhost() )
407 assert( org.entity_ );
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 >
493 inline void ALU3dGridEntityPointerBase<codim,GridImp>::
494 updateEntityPointer( HElementType * item ,
int )
497 if( item && entity_ )
499 entityImp().setElement( seed_ );
509 template<
int codim,
class Gr
idImp >
510 inline ALU3dGridEntityPointer<codim,GridImp> ::
511 ALU3dGridEntityPointer(
const FactoryType& factory,
513 const HElementType &item,
519 template<
int codim,
class Gr
idImp >
520 inline ALU3dGridEntityPointer<codim,GridImp> ::
525 template<
int codim,
class Gr
idImp >
526 inline ALU3dGridEntityPointer<codim,GridImp> &
527 ALU3dGridEntityPointer<codim,GridImp>::
535 template<
int codim,
class Gr
idImp >
537 ALU3dGridEntityPointer<codim,GridImp> ::
543 assert( &factory_ == &org.factory_ );
551 entityImp().setElement( seed_ );
558 template<
int codim,
class Gr
idImp >
559 inline typename ALU3dGridEntityPointer<codim,GridImp>::Entity &
560 ALU3dGridEntityPointer<codim,GridImp>::dereference ()
const
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 >
574 inline int ALU3dGridEntityPointer<codim,GridImp>::level ()
const
576 return seed_.level();
579 template<
int codim,
class Gr
idImp >
580 inline void ALU3dGridEntityPointer<codim,GridImp>::
581 updateEntityPointer( HElementType * item,
int level)
583 seed_.set( *item, level );
584 if( item && entity_ )
586 entityImp().setElement( seed_ );
Definition: entity.hh:464
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: entity.hh:486
void freeEntity()
put entity to entity stack
Definition: entity_inline.hh:440
~ALU3dGridEntityPointerBase()
Destructor.
Definition: entity_inline.hh:426
int level() const
ask for level of entities
Definition: entity_inline.hh:475
ALU3dGridEntityPointerBase(const FactoryType &factory, const HElementType &item)
Constructor for EntityPointer that points to an element.
Definition: entity_inline.hh:293
bool equals(const ALU3dGridEntityPointerType &i) const
equality
Definition: entity_inline.hh:453
ALU3dGridEntitySeed< codimension, GridImp > ALU3dGridEntitySeedType
type of entity seed
Definition: entity.hh:498
Entity & dereference() const
dereferencing
Definition: entity_inline.hh:461
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entity_inline.hh:375
void done()
has to be called when iterator is finished
Definition: entity_inline.hh:432
Definition: entity.hh:204
GeometryType type() const
type of geometry of this entity
Definition: entity_inline.hh:56
void setEntity(const ALU3dGridEntity< cd, dim, GridImp > &org)
set item from other entity, mainly for copy constructor of entity pointer
void removeElement()
reset item pointer to NULL
Definition: entity_inline.hh:22
int level() const
level of this element
Definition: entity_inline.hh:42
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: entity_inline.hh:49
void setGhost(const HBndSegType &ghost)
setGhost is not valid for this codim
const GridImp & grid() const
return reference to grid
Definition: entity.hh:147
void reset(int l)
reset item pointer to NULL
Definition: entity_inline.hh:12
bool equals(const ALU3dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements by comparing the item pointers
Definition: entity_inline.hh:30
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:239
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:334
A few common exception classes.
Dune namespace.
Definition: alignment.hh:14
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:24
@ InteriorEntity
all interior entities
Definition: gridenums.hh:25
@ GhostEntity
ghost entities
Definition: gridenums.hh:29