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