Go to the documentation of this file. 1 #ifndef ALU3DGRID_ENTITYKEY_HH
2 #define ALU3DGRID_ENTITYKEY_HH
10 template<
int cd,
class Gr
idImp>
13 template<
int cd,
int dim,
class Gr
idImp>
21 template<
int codim,
class Gr
idImp >
26 enum {
dim = GridImp::dimension };
29 typedef typename GridImp::MPICommunicatorType
Comm;
33 typedef typename ImplTraits::template Codim<dim, codim>::InterfaceType
HElementType;
34 typedef typename ImplTraits::template Codim<dim, codim>::EntitySeedType
KeyType ;
39 template <
int cd,
class Key>
48 return static_cast< HElementType* > ( key );
58 return static_cast< KeyType* > (const_cast< BNDFaceType* >( static_cast<const BNDFaceType*> (ghostFace)));
64 if( key->isboundary() )
66 return ((static_cast< BNDFaceType* > ( key ))->getGhost().first);
72 return static_cast< HElementType * > (static_cast< ImplementationType* > (key));
76 return static_cast< HElementType * > (0) ;
88 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
90 typedef typename GridImp::template Codim<codimension>::EntityImp
EntityImp;
165 return static_cast< HElementType * > (static_cast< ImplementationType* > (
item_));
178 return static_cast< KeyType* > (const_cast< ImplementationType* > (static_cast<const ImplementationType* > (
item)));
199 return item()->level();
209 template<
int cd,
class Gr
idImp>
216 enum { dim = GridImp::dimension };
217 enum { dimworld = GridImp::dimensionworld };
219 typedef typename GridImp::MPICommunicatorType Comm;
221 typedef ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits;
222 typedef typename ImplTraits::template Codim<dim, cd>::ImplementationType ImplementationType;
223 typedef typename ImplTraits::template Codim<dim, cd>::InterfaceType HElementType;
225 typedef typename ImplTraits::BNDFaceType BNDFaceType;
226 typedef ALU3dGridEntity<cd,dim,GridImp> ALU3dGridEntityType;
233 typedef typename GridImp::template Codim<cd>::Entity
Entity;
314 template<
class Gr
idImp>
323 enum { dim = GridImp::dimension };
324 enum { dimworld = GridImp::dimensionworld };
326 typedef typename GridImp::MPICommunicatorType
Comm;
330 typedef typename ImplTraits::template Codim<dim, cd>::InterfaceType
HElementType;
342 typedef typename GridImp::template Codim<cd>::Entity
Entity;
371 template <
int cd,
class Gr
idImp>
375 out << key.
item() <<
" " << key.
level() <<
" " << key.
twist() <<
" " << key.face();
385 template<
int codim,
class Gr
idImp >
392 template<
int codim,
class Gr
idImp >
395 : item_( toKey(&item) )
399 template<
int codim,
class Gr
idImp >
402 : item_( toKey(&ghostFace) )
406 template<
int codim,
class Gr
idImp >
413 template<
int codim,
class Gr
idImp >
422 template<
int codim,
class Gr
idImp >
427 return (item_ == i.
item_);
436 template<
int codim,
class Gr
idImp >
447 template<
int codim,
class Gr
idImp >
456 template<
int codim,
class Gr
idImp >
462 BaseType :: operator = ( org );
470 template<
int codim,
class Gr
idImp >
475 level_ = defaultValue ;
476 twist_ = defaultTwist ;
int level_
Definition: entityseed.hh:306
ALU3dGridEntity< 0, dim, GridImp > ALU3dGridEntityType
Definition: entityseed.hh:335
bool equals(const ALU3dGridEntitySeedType &key) const
equality, calls BaseType equals
Definition: entityseed.hh:298
void set(const HElementType &item, const int level)
set element and level
Definition: entityseed.hh:274
KeyType * toKey(const HElementType *item)
Definition: entityseed.hh:176
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: entityseed.hh:328
static Key * toKey(const HBndSegType *ghostFace)
Definition: entityseed.hh:56
HElementType * item() const
get item from key
Definition: entityseed.hh:159
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entityseed.hh:342
void set(const HElementType &item)
Definition: entityseed.hh:181
Definition: entity.hh:188
static HElementType * getItem(KeyType *key)
Definition: entityseed.hh:46
GridImp::MPICommunicatorType Comm
Definition: entityseed.hh:29
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entityseed.hh:459
static HElementType * getItem(KeyType *key)
Definition: entityseed.hh:60
ALU3dGridEntitySeed(const ALU3dGridEntityType &entity)
Constructor for EntitySeed that points to given entity.
Definition: entityseed.hh:258
int twist() const
return twist
Definition: entityseed.hh:283
ALU3dGridEntitySeedBase< codim, GridImp > ThisType
Definition: entityseed.hh:25
ImplTraits::HBndSegType HBndSegType
Definition: entityseed.hh:37
GridImp::MPICommunicatorType Comm
Definition: entityseed.hh:326
static BNDFaceType * ghost(KeyType *)
Definition: entityseed.hh:51
Definition: alu3dinclude.hh:259
HElementType * interior() const
return iterior item
Definition: entityseed.hh:162
ALU3dGridEntitySeed()
Constructor for EntitySeed that points to an element.
Definition: entityseed.hh:253
int level() const
Definition: entityseed.hh:196
ImplTraits::HBndSegType HBndSegType
Definition: entityseed.hh:333
static bool isGhost(KeyType *key)
Definition: entityseed.hh:78
BNDFaceType * ghost() const
Definition: entityseed.hh:170
Definition: entityseed.hh:11
static bool isGhost(KeyType *)
Definition: entityseed.hh:50
int twist_
Definition: entityseed.hh:308
Definition: entityseed.hh:26
ImplTraits::template Codim< dim, cd >::ImplementationType ImplementationType
Definition: entityseed.hh:329
ALU3dGridEntitySeed(const HElementType &item, int, int)
Constructor for EntitySeed that points to an interior element.
Definition: entityseed.hh:355
ALU3dGridEntitySeed(const HElementType &item)
Constructor for EntitySeed that points to an interior element.
Definition: entityseed.hh:351
ImplTraits::template Codim< dim, cd >::InterfaceType HElementType
Definition: entityseed.hh:330
std ::ostream & operator<<(std ::ostream &out, const ALU3dGridEntitySeed< cd, GridImp > &key)
print alugrid entity key to std::stream
Definition: entityseed.hh:372
GridImp::template Codim< codimension >::EntityImp EntityImp
underlying EntityImplementation
Definition: entityseed.hh:90
ImplTraits::template Codim< dim, codim >::EntitySeedType KeyType
Definition: entityseed.hh:34
Definition: entityseed.hh:40
ALU3dGridEntitySeed(const ALU3dGridEntitySeedType &org)
copy constructor
Definition: entityseed.hh:363
ALU3dGridEntitySeed< codimension, GridImp > EntitySeedImp
make type of entity pointer implementation available in derived classes
Definition: entityseed.hh:96
bool operator==(const ALU3dGridEntitySeedType &i) const
Definition: entityseed.hh:287
ImplTraits::template Codim< dim, codim >::InterfaceType HElementType
Definition: entityseed.hh:33
KeyType * toKey(const HBndSegType *ghostFace)
Definition: entityseed.hh:186
void clear()
clear the key data structure
Definition: entityseed.hh:472
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entityseed.hh:233
ALU3dGridEntitySeed(const HBndSegType &ghostFace)
Constructor for EntitySeed that points to an ghost.
Definition: entityseed.hh:359
bool operator!=(const ALU3dGridEntitySeedType &i) const
inequality operator
Definition: entityseed.hh:136
#define alugrid_assert(EX)
Definition: alugrid_assert.hh:20
~ALU3dGridEntitySeedBase()
Destructor.
Definition: entityseed.hh:99
GridImp::template Codim< codimension >::Entity Entity
type of Entity
Definition: entityseed.hh:88
ThisType ALU3dGridEntitySeedType
typedef of my type
Definition: entityseed.hh:345
KeyType * item_
Definition: entityseed.hh:206
ImplTraits::BNDFaceType BNDFaceType
Definition: entityseed.hh:332
ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits
Definition: entityseed.hh:31
int twist() const
Definition: entityseed.hh:202
bool isGhost() const
methods for ghosts
Definition: entityseed.hh:169
int level() const
return level
Definition: entityseed.hh:281
ImplTraits::template Codim< dim, codim >::ImplementationType ImplementationType
Definition: entityseed.hh:32
bool isValid() const
Definition: entityseed.hh:127
bool operator!=(const ALU3dGridEntitySeedType &i) const
Definition: entityseed.hh:292
Definition: entityseed.hh:22
static const int defaultValue
Definition: entityseed.hh:82
static Key * toKey(const HBndSegType *)
Definition: entityseed.hh:42
ThisType & operator=(const ThisType &org)
assignment operator
Definition: entityseed.hh:416
static const int defaultTwist
Definition: entityseed.hh:83
ALU3dGridEntitySeed< cd, GridImp > ThisType
Definition: entityseed.hh:322
ImplTraits::BNDFaceType BNDFaceType
Definition: entityseed.hh:36
ALU3dGridEntitySeedBase()
Constructor for EntitySeed that points to an element.
Definition: entityseed.hh:387
ALU3dGridEntitySeedBase< 0, GridImp > BaseType
Definition: entityseed.hh:319
ThisType ALU3dGridEntitySeedType
typedef of my type
Definition: entityseed.hh:93
bool equals(const ALU3dGridEntitySeedType &i) const
equality
Definition: entityseed.hh:424
ALU3dGridEntitySeed()
Constructor for EntitySeed that points to an element.
Definition: entityseed.hh:348
ALU3dGridEntitySeed< cd, GridImp > ALU3dGridEntitySeedType
typedef of my type
Definition: entityseed.hh:236
void clear()
invalidate seed
Definition: entityseed.hh:153
Definition: entityseed.hh:85
void set(const HBndSegType &ghostFace)
Definition: entityseed.hh:191
bool operator==(const ALU3dGridEntitySeedType &i) const
equality operator
Definition: entityseed.hh:130
Definition: entityseed.hh:27
ALU3dGridEntitySeed(const ImplementationType &item)
Constructor for EntitySeed that points to an element.
Definition: entityseed.hh:239
Definition: alu3dinclude.hh:79
static BNDFaceType * ghost(KeyType *key)
Definition: entityseed.hh:79