3 #ifndef DUNE_ALU3DGRIDENTITY_HH
4 #define DUNE_ALU3DGRIDENTITY_HH
14 #include "iterator.hh"
15 #include "entityseed.hh"
21 template<
int cd,
int dim,
class Gr
idImp>
22 class ALU3dGridEntity;
23 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
24 class ALU3dGridLevelIterator;
25 template<
int cd,
class Gr
idImp >
26 class ALU3dGridEntityPointer;
27 template<
int mydim,
int coorddim,
class Gr
idImp>
28 class ALU3dGridGeometry;
29 template<
class Gr
idImp>
30 class ALU3dGridHierarchicIterator;
31 template<
class Gr
idImp>
32 class ALU3dGridIntersectionIterator;
33 template<
int codim, PartitionIteratorType,
class Gr
idImp>
34 class ALU3dGridLeafIterator;
35 template< ALU3dGr
idElementType,
class >
44 template<
int cd,
int dim,
class Gr
idImp>
49 template <
class Gr
idType,
int cdim>
52 template <
class ItemType>
53 static int getLevel(
const GridType &
grid,
const ItemType & item )
62 template <
class Gr
idType>
63 struct GetLevel<GridType,3>
65 template <
class ItemType>
66 static int getLevel(
const GridType &
grid,
const ItemType & item)
68 return (item.isLeafEntity()) ? grid.getLevelOfLeafVertex(item) : item.level();
72 enum { dimworld = GridImp::dimensionworld };
74 typedef typename GridImp::MPICommunicatorType Comm;
76 friend class ALU3dGrid< GridImp::elementType, Comm >;
84 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
89 typedef ALU3dImplTraits< GridImp::elementType, Comm >
ImplTraits;
91 typedef typename ImplTraits::template Codim<cd>::ImplementationType
ItemType;
123 void
setElement(const HItemType & item, const int level, int twist=0, int face = -1);
129 void
setGhost(const HBndSegType &ghost);
135 void
reset ( int l );
138 bool
equals ( const ALU3dGridEntity<cd,dim,GridImp> & org ) const;
141 void
setEntity ( const ALU3dGridEntity<cd,dim,GridImp> & org );
147 const GridImp&
grid()
const {
return factory_.grid(); }
160 int getIndex ()
const;
166 mutable GeometryImpl geo_;
201 template<
int dim,
class Gr
idImp>
205 static const int dimworld = remove_const< GridImp >::type::dimensionworld;
208 typedef typename GridImp::MPICommunicatorType Comm;
210 typedef ALU3dImplTraits< elementType, Comm >
ImplTraits;
213 typedef typename ImplTraits::GEOElementType GEOElementType;
214 typedef typename ImplTraits::BNDFaceType BNDFaceType;
215 typedef typename ImplTraits::IMPLElementType IMPLElementType;
216 typedef typename ImplTraits::HBndSegType
HBndSegType;
218 enum { refine_element_t = ImplTraits::refine_element_t };
219 enum { bisect_element_t = ImplTraits::bisect_element_t };
220 enum { coarse_element_t = ImplTraits::coarse_element_t };
221 enum { nosplit_element_t = ImplTraits::nosplit_element_t };
223 typedef typename ImplTraits::MarkRuleType MarkRuleType;
244 typedef typename GridImp :: ReferenceElementType ReferenceElementType;
246 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
247 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
252 typedef typename GridImp::template Codim< 0 >::Geometry
Geometry;
260 typedef typename GridImp::template Codim<0>::Entity
Entity;
270 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
293 template<
int cc>
int count ()
const ;
297 template<
int codim >
321 bool isLeaf ()
const;
327 bool hasFather ()
const
329 return (this->
level()>0);
341 LocalGeometry geometryInFather ()
const;
360 bool mightVanish ()
const;
363 bool hasBoundaryIntersections ()
const;
369 bool mark(
int refCount )
const;
386 void reset (
int l );
399 template<
int cc>
int getSubIndex (
int i)
const;
404 int subIndex(
int i,
unsigned int codim)
const;
407 const IMPLElementType&
getItem ()
const {
return *item_; }
410 const BNDFaceType& getGhost ()
const
417 const GridImp&
grid()
const {
return factory_.grid(); }
423 bool isGhost ()
const {
return ImplTraits::isGhost( ghost_ ); }
436 int getIndex ()
const;
439 mutable GeometryImpl geo_;
445 mutable IMPLElementType* item_;
448 mutable BNDFaceType* ghost_;
462 template<
int codim,
class Gr
idImp >
466 enum { dim = GridImp::dimension };
467 enum { dimworld = GridImp::dimensionworld };
469 typedef typename GridImp::MPICommunicatorType Comm;
475 typedef ALU3dImplTraits<GridImp::elementType, Comm > ImplTraits;
476 typedef typename ImplTraits::template Codim<codim>
::InterfaceType HElementType;
478 typedef typename ImplTraits::HBndSegType HBndSegType;
479 typedef typename ImplTraits::BNDFaceType BNDFaceType;
486 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
502 const HElementType & item);
506 const HElementType & item,
514 const HBndSegType & ghostFace );
575 return GridImp :: getRealImplementation(*
entity_);
582 template<
class Gr
idImp>
591 enum {
dim = GridImp::dimension };
594 typedef typename GridImp::MPICommunicatorType
Comm;
600 typedef ALU3dImplTraits<GridImp::elementType, Comm >
ImplTraits;
626 const HElementType & item)
676 template<
int cd,
class Gr
idImp>
683 enum {
dim = GridImp::dimension };
686 typedef typename GridImp::MPICommunicatorType
Comm;
692 typedef ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits;
695 typedef typename ImplTraits::HBndSegType HBndSegType;
696 typedef typename ImplTraits::BNDFaceType BNDFaceType;
724 const HElementType & item,
725 const int twist = defaultValue,
726 const int duneFace = defaultValue
769 #if COMPILE_ALUGRID_INLINE
770 #include "entity_imp.cc"