3 #ifndef DUNE_ALU2DGRIDENTITY_HH
4 #define DUNE_ALU2DGRIDENTITY_HH
19 template<
int cd,
int dim,
class Gr
idImp>
21 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
23 template<
int codim,
class Gr
idImp >
25 template<
int mydim,
int coorddim,
class Gr
idImp>
27 template<
class Gr
idImp>
29 template<
class Gr
idImp>
31 template<
class Gr
idImp>
33 template<
class Gr
idImp>
35 template<
int codim, PartitionIteratorType,
class Gr
idImp>
37 template<
int dim,
int dimworld, ALU2DSPACE ElementType eltype >
52 template<
int cd,
int dim,
class Gr
idImp>
56 static const int dimworld = GridImp::dimensionworld;
57 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
80 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
83 typedef typename GridImp :: GridObjectFactoryType
FactoryType;
89 typedef typename GridImp::template Codim<cd>::Entity
Entity;
91 typedef typename GridImp::template Codim<cd>::Geometry
Geometry;
94 typedef typename GridImp::template Codim<cd>::EntitySeed
EntitySeed;
97 typedef typename GridImp::template Codim<0>::EntityPointer
EntityPointer;
120 void setElement(
const ElementType &element,
int face=-1,
int level = -1)
const;
123 void setElement(
const HElementType & el,
const VertexType & vx);
152 const GridImp&
grid()
const {
return factory_.grid(); }
155 const FactoryType&
factory()
const {
return factory_; }
178 const FactoryType& factory_;
181 mutable ElementType * item_;
184 mutable GeometryImpl geoObj_;
209 template<
int dim,
class Gr
idImp>
213 static const int dimworld = GridImp::dimensionworld;
237 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
238 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
244 typedef typename GridImp::template Codim<0>::Geometry
Geometry;
249 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
257 typedef typename GridImp::template Codim<0>::Entity
Entity;
290 return (cc==0) ? 1 : item_->numvertices();
299 return (codim==0) ? 1 : item_->numvertices();
318 ALU2dGridIntersectionIteratorType
ibegin () const
319 DUNE_DEPRECATED_MSG("Use ileafbegin() instead.")
325 ALU2dGridIntersectionIteratorType
iend () const
326 DUNE_DEPRECATED_MSG("Use ileafend() instead.")
333 return ALU2dGridLevelIntersectionIteratorType( *
this, this->
level(),
false);
335 ALU2dGridLevelIntersectionIteratorType
ilevelend ()
const
337 return ALU2dGridLevelIntersectionIteratorType( *
this, this->
level(),
true);
341 return ALU2dGridLeafIntersectionIteratorType( *
this, this->
level(),
false);
343 ALU2dGridLeafIntersectionIteratorType
ileafend ()
const
345 return ALU2dGridLeafIntersectionIteratorType( *
this, this->
level(),
true);
349 bool isLeaf ()
const;
353 EntityPointer father ()
const;
358 return (this->
level()>0);
379 typename Codim<cc>::EntityPointer entity (
int i)
const;
383 template<
int codim >
391 if( item_->numvertices() == 3 )
394 switch (i) {
case 0 : j=2;
break;
399 else if ( codim == 2 )
401 if( item_->numvertices() == 4 )
403 switch (i) {
case 0 : j=0;
break;
409 return entity< codim >( j );
415 #if ALU2DGRID_PARALLEL
416 return grid().rankManager().partitionType( item_->getIndex() );
429 int subBoundaryId (
int i )
const;
442 LocalGeometry geometryInFather ()
const;
447 return ((item_->is(
ALU2DSPACE Refco::crs))==1);
452 return ((item_->wasRefined())==1);
463 bool mark(
int refCount)
const;
471 void setElement(
const HElementType &element,
int face=-1,
int level = -1)
const;
479 void reset (
int l );
501 const GridImp&
grid()
const {
return factory_.grid(); }
504 const FactoryType&
factory()
const {
return factory_; }
519 template<
int cc>
int getSubIndex (
int i)
const;
521 int subIndex (
int i,
unsigned int codim)
const;
524 const FactoryType& factory_;
527 mutable HElementType *item_;
530 mutable GeometryImpl geoObj_;
533 mutable bool isLeaf_;
547 template<
int codim,
class Gr
idImp >
548 class ALU2dGridEntityPointer
551 typedef ALU2dGridEntityPointer< codim, GridImp > ThisType;
553 static const int dim = GridImp::dimension;
554 static const int dimworld = GridImp::dimensionworld;
555 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
565 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
568 typedef typename GridImp::template Codim<codimension>::EntitySeed
EntitySeed;
577 const ElementType &item,
599 bool equals (
const ThisType & i)
const;
635 #include "entity_imp.cc"
int getFace() const
Definition: alugrid/2d/entity.hh:507
int getIndex() const
index is unique within the grid hierachie and per codim
HElementType & getItem() const
Definition: alugrid/2d/entity.hh:488
EntityPointer ownersFather() const
GridImp::template Codim< codimension >::EntitySeed EntitySeed
type of the seed
Definition: alugrid/2d/entity.hh:568
GeometryType type() const
return type of geometry
ElementType & getItem() const
return reference to current item
Definition: alugrid/2d/entity.hh:158
ALU2dGridIntersectionIteratorType iend() const
Definition: alugrid/2d/entity.hh:325
const FactoryType & factory_
reference to entity factory
Definition: alugrid/2d/entity.hh:624
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
EntitySeed seed_
the essential information
Definition: alugrid/2d/entity.hh:627
GridImp::template Codim< codimension >::Entity Entity
type of stored entity (interface)
Definition: alugrid/2d/entity.hh:565
ALU2dGridEntity(const FactoryType &factory, int level)
Constructor.
Hierarchic Iterator of ALU2dGrid.
Definition: alugrid/2d/entity.hh:28
ALU2dGridLevelIntersectionIteratorType ilevelbegin() const
Definition: alugrid/2d/entity.hh:331
void setElement(const ALU2dGridEntity &org) const
Definition: alugrid/2d/entity.hh:124
Definition: alu2dinclude.hh:97
[ provides Dune::Grid ]
Definition: alugrid/2d/entity.hh:38
Geometry geometry() const
geometry of this entity
LevelIntersectionIteratorWrapper< GridImp > ALU2dGridLevelIntersectionIteratorType
Definition: alugrid/2d/entity.hh:253
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Default Implementations for EntityImp.
Definition: common/entity.hh:738
int level() const
ask for level of entities
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
type of corresponding interface local geometry
Definition: alugrid/2d/entity.hh:246
Definition: alugrid/2d/entity.hh:32
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:83
Definition: alugrid/2d/entity.hh:210
Include standard header files.
Definition: agrid.hh:59
const GridImp & grid() const
return reference top grid
Definition: alugrid/2d/entity.hh:611
HmeshType::helement_t HElementType
Definition: alu2dinclude.hh:108
bool mightVanish() const
The former state() method has been replaced by:
Definition: alugrid/2d/entity.hh:445
Definition: alugrid/2d/entity.hh:22
ALU2dGridHierarchicIterator< GridImp > hbegin(int maxLevel) const
Definition: alugrid/2d/entity.hh:365
all interior entities
Definition: gridenums.hh:29
ALU2dGridEntityPointer< 0, GridImp > EntityPointer
tpye of entitypointer interface
Definition: alugrid/2d/entity.hh:260
ThisType & operator=(const ThisType &org)
assigment operator
EntityObj * entity_
entity that this EntityPointer points to
Definition: alugrid/2d/entity.hh:630
const GridImp & grid() const
return reference to grid
Definition: alugrid/2d/entity.hh:501
bool hasFather() const
returns true if father entity exists
Definition: alugrid/2d/entity.hh:356
void updateEntityPointer(ElementType *item, int face=-1, int level=-1)
update underlying item pointer and set entity
const GridImp & grid() const
return reference to grid
Definition: alugrid/2d/entity.hh:152
Definition: alugrid/2d/entity.hh:562
EntitySeed seed() const
return seed of entity
Definition: alugrid/2d/entity.hh:165
bool equals(const ALU2dGridEntity< cd, dim, GridImp > &org) const
compare 2 elements
Definition: alugrid/2d/entity.hh:36
~ALU2dGridEntityPointer()
Destructor.
Definition: alugrid/2d/entity.hh:34
int boundaryId() const
Id of the boundary which is associated with the entity, returns 0 for inner entities, arbitrary int otherwise.
PartitionType partitionType() const
Definition: alugrid/2d/entity.hh:134
GridImp::template Codim< cd >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/2d/entity.hh:94
GridImp::template Codim< 0 >::Entity Entity
type of entity interface
Definition: alugrid/2d/entity.hh:257
ALU2dGridLevelIntersectionIteratorType ilevelend() const
Definition: alugrid/2d/entity.hh:335
LeafIntersectionIteratorWrapper< GridImp > ALU2dGridLeafIntersectionIteratorType
tpye of intersection iterator
Definition: alugrid/2d/entity.hh:252
void setElement(const ElementType &element, int face=-1, int level=-1) const
set element as normal entity
hierarchic index set of ALU2dGrid
Definition: alugrid/2d/grid.hh:66
int getFace() const
Definition: alugrid/2d/entity.hh:171
Codim< codim >::EntityPointer subEntity(int i) const
Definition: alugrid/2d/entity.hh:384
all entities
Definition: gridenums.hh:139
const FactoryType & factory() const
return reference to factory
Definition: alugrid/2d/entity.hh:155
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: alugrid/2d/entity.hh:265
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:241
Definition: alugrid/2d/entity.hh:20
GridImp::template Codim< cd >::Entity Entity
type of our interface entity
Definition: alugrid/2d/entity.hh:89
bool isNew() const
Definition: alugrid/2d/entity.hh:450
Definition: alugrid/2d/entity.hh:30
MakeableInterfaceObject< Entity > EntityObj
Definition: alugrid/2d/entity.hh:571
FieldVector< alu2d_ctype, dim > & positionInOwnersFather() const
my position in local coordinates of the owners father
void removeElement()
set item pointer to NULL
ALU2dGridHierarchicIterator< GridImp > hend(int maxLevel) const
Returns iterator to one past the last son.
Definition: alugrid/2d/entity.hh:371
const FactoryType & factory() const
return reference to factory
Definition: alugrid/2d/entity.hh:504
GridImp::template Codim< 0 >::EntitySeed EntitySeed
typedef of my type
Definition: alugrid/2d/entity.hh:249
ALU2dGridEntityPointer(const FactoryType &factory, const ElementType &item, int face=-1, int level=-1)
Constructor for EntityPointer that points to an element.
ALU2dGridLeafIntersectionIteratorType ileafbegin() const
Definition: alugrid/2d/entity.hh:339
ALU2dGridLeafIntersectionIteratorType ALU2dGridIntersectionIteratorType
Definition: alugrid/2d/entity.hh:254
ALU2dGridLeafIntersectionIteratorType ileafend() const
Definition: alugrid/2d/entity.hh:343
PartitionType partitionType() const
return partition type of this entity ( see grid.hh )
Definition: alugrid/2d/entity.hh:413
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
Definition: alugrid/2d/entity.hh:26
bool equals(const ThisType &i) const
equality
Definition: alugrid/2d/grid.hh:60
GridImp::template Codim< cd >::Geometry Geometry
type of corresponding interface geometry
Definition: alugrid/2d/entity.hh:91
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/entity.hh:560
void setElement(const ALU2dGridEntity &org) const
Definition: alugrid/2d/entity.hh:474
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:28
#define ALU2DSPACE
Definition: alu2dinclude.hh:34
Entity & dereference() const
dereferencing
Definition: alugrid/2d/entity.hh:24
int count() const
Definition: alugrid/2d/entity.hh:287
GridImp::template Codim< 0 >::Geometry Geometry
type of our Geometry interface
Definition: alugrid/2d/entity.hh:244
void done()
has to be called when iterator is finished
int boundaryId() const
Id of the boundary which is associated with the entity, returns 0 for inner entities, arbitrary int otherwise.
Definition: alugrid/2d/entity.hh:306
unsigned int subEntities(unsigned int codim) const
Definition: alugrid/2d/entity.hh:296
ALU2dGridIntersectionIteratorType ibegin() const
Definition: alugrid/2d/entity.hh:318
ALU2dGridEntity< codimension, dim, GridImp > EntityImp
tpye of stored entity (implementation)
Definition: alugrid/2d/entity.hh:570
Dune::ALU2dImplTraits< dimworld, eltype >::template Codim< 2 >::InterfaceType VertexType
Definition: alugrid/2d/entity.hh:86
EntitySeed seed() const
return seed of entity
Definition: alugrid/2d/entity.hh:495
int level() const
level of this element
ALU2dGridEntityPointer< codimension, GridImp > EntityPointerImp
Definition: alugrid/2d/entity.hh:573
Dune::ALU2dImplTraits< dimworld, eltype >::template Codim< cd >::InterfaceType ElementType
Definition: alugrid/2d/entity.hh:85
GridImp::template Codim< 0 >::EntityPointer EntityPointer
tpye of EntityPointer
Definition: alugrid/2d/entity.hh:97