3#ifndef DUNE_ALU2DGRIDINDEXSETS_HH
4#define DUNE_ALU2DGRIDINDEXSETS_HH
18#include "alu2dinclude.hh"
26 template<
int dim,
int dimworld, ALU2DSPACE ElementType eltype >
29 template<
int cd,
int dim,
class Gr
idImp>
30 class ALU2dGridEntity;
38 template <
int dim,
int dimworld, ALU2DSPACE ElementType eltype>
40 public IndexSet< ALU2dGrid< dim, dimworld, eltype >,
41 ALU2dGridHierarchicIndexSet< dim, dimworld, eltype >, int >
46 enum { numCodim = dim+1 };
48 friend class ALU2dGrid< dim, dimworld, eltype >;
55 typedef typename GridType::Traits::template Codim<0>::Entity EntityCodim0Type;
59 int index (
const typename GridType::Traits::template Codim< codim >::Entity &entity )
const
65 template<
class Entity >
72 int subIndex (
const EntityCodim0Type &e,
int i,
unsigned int codim )
const
81 const int codim = dim-type.dim();
82 assert( grid_.
geomTypes(codim).size() == 1 );
83 if( type != grid_.
geomTypes(codim)[0] )
return 0;
89 int size (
int codim )
const
96 const std::vector<GeometryType>&
geomTypes (
int codim)
const
102 template <
class EntityType>
103 bool contains (
const EntityType &)
const {
return true; }
107 const GridType & grid_;
117 template <
int dim,
int dimworld, ALU2DSPACE ElementType eltype>
119 public IdSet < ALU2dGrid< dim, dimworld, eltype >,
120 ALU2dGridLocalIdSet< dim, dimworld, eltype >, int >
125 friend class ALU2dGrid< dim, dimworld, eltype >;
128 enum { codimMultiplier = 300000000 };
129 typedef typename GridType::Traits::template Codim<0>::Entity EntityCodim0Type;
134 for(
int i=0; i<dim+1; i++)
135 codimStart_[i] = i*codimMultiplier;
139 void updateIdSet() {}
150 template <
class EntityType>
151 int id (
const EntityType & ep)
const
153 enum { cd = EntityType :: codimension };
154 assert( hset_.
size(cd) < codimMultiplier );
155 return codimStart_[cd] + hset_.
index(ep);
160 int id (
const typename GridType:: template Codim<codim> :: Entity & ep)
const
163 assert( hset_.
size(codim) < codimMultiplier );
164 return codimStart_[codim] + hset_.
index(ep);
168 int subId (
const EntityCodim0Type &e,
int i,
unsigned int codim )
const
170 assert( hset_.
size( codim ) < codimMultiplier );
171 return codimStart_[ codim ] + hset_.
subIndex( e, i, codim );
176 const HierarchicIndexSetType & hset_;
179 int codimStart_[dim+1];
Portable very large unsigned integers.
hierarchic index set of ALU2dGrid
Definition: indexsets.hh:42
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: indexsets.hh:96
int size(GeometryType type) const
Definition: indexsets.hh:79
int index(const typename GridType::Traits::template Codim< codim >::Entity &entity) const
return hierarchic index of given entity
Definition: indexsets.hh:59
int index(const Entity &entity) const
return hierarchic index of given entity
Definition: indexsets.hh:66
int subIndex(const EntityCodim0Type &e, int i, unsigned int codim) const
return subIndex of given entity for codim sub entity
Definition: indexsets.hh:72
int size(int codim) const
return size of indexset, i.e. maxindex+1
Definition: indexsets.hh:89
bool contains(const EntityType &) const
return true because all entities are contained in this set
Definition: indexsets.hh:103
hierarchic index set of ALU3dGrid
Definition: indexsets.hh:121
int id(const EntityType &ep) const
return global id of given entity
Definition: indexsets.hh:151
int id(const typename GridType::template Codim< codim > ::Entity &ep) const
return global id of given entity
Definition: indexsets.hh:160
int subId(const EntityCodim0Type &e, int i, unsigned int codim) const
return subId of given entity
Definition: indexsets.hh:168
int IdType
export type of id
Definition: indexsets.hh:143
[ provides Dune::Grid ]
Definition: grid.hh:213
const HierarchicIndexSet & hierarchicIndexSet() const
get hierarchic index set of the grid
ALU2dGridHierarchicIndexSet< dim, dimworld, elementType > HierarchicIndexSet
Type of the hierarchic index set.
Definition: grid.hh:276
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: grid.hh:442
int hierSetSize(int cd) const
number of grid entities in the entire grid for given codim
Wrapper class for entities.
Definition: entity.hh:57
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
static ReturnImplementationType< InterfaceType >::ImplementationType & getRealImplementation(InterfaceType &i)
return real implementation of interface class
Definition: grid.hh:1223
Id Set Interface.
Definition: indexidset.hh:403
Index Set Interface base class.
Definition: indexidset.hh:78
Different resources needed by all grid implementations.
Provides base classes for index and id sets.
Dune namespace.
Definition: alignment.hh:14
Standard Dune debug streams.