1 #ifndef DUNE_ALU3DGRIDENTITY_HH
2 #define DUNE_ALU3DGRIDENTITY_HH
19 template<
int cd,
int dim,
class Gr
idImp>
21 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
23 template<
int cd,
class Gr
idImp >
25 template<
int mydim,
int coorddim,
class Gr
idImp>
27 template<
class Gr
idImp>
29 template<
class Gr
idImp>
31 template<
int codim, PartitionIteratorType,
class Gr
idImp>
33 template< ALU3dGr
idElementType,
class >
42 template<
int cd,
int dim,
class Gr
idImp>
47 template <
class Gr
idType,
int cdim>
50 template <
class ItemType>
51 static int getLevel(
const GridType &
grid,
const ItemType & item )
60 template <
class Gr
idType>
61 struct GetLevel<GridType,3>
63 template <
class ItemType>
64 static int getLevel(
const GridType &
grid,
const ItemType & item)
66 return (item.isLeafEntity()) ? grid.getLevelOfLeafVertex(item) : item.level();
70 enum { dimworld = GridImp::dimensionworld };
72 typedef typename GridImp::MPICommunicatorType Comm;
74 friend class ALU3dGrid< GridImp::elementType, Comm >;
82 typedef typename GridImp::Traits::template Codim< cd >::GeometryImpl GeometryImpl;
89 typedef typename ImplTraits::template Codim<cd>::ImplementationType
ItemType;
121 void
setElement(const HItemType & item, const int level, int twist=0, int face = -1);
127 void
setGhost(const HBndSegType &ghost);
133 void
reset ( int l );
136 bool
equals ( const ALU3dGridEntity<cd,dim,GridImp> & org ) const;
139 void
setEntity ( const ALU3dGridEntity<cd,dim,GridImp> & org );
145 const GridImp&
grid()
const {
return factory_.grid(); }
158 int getIndex ()
const;
164 mutable GeometryImpl geo_;
199 template<
int dim,
class Gr
idImp>
203 static const int dimworld = remove_const< GridImp >::type::dimensionworld;
206 typedef typename GridImp::MPICommunicatorType Comm;
211 typedef typename ImplTraits::GEOElementType GEOElementType;
212 typedef typename ImplTraits::BNDFaceType BNDFaceType;
213 typedef typename ImplTraits::IMPLElementType IMPLElementType;
214 typedef typename ImplTraits::HBndSegType
HBndSegType;
216 enum { refine_element_t = ImplTraits::refine_element_t };
217 enum { bisect_element_t = ImplTraits::bisect_element_t };
218 enum { coarse_element_t = ImplTraits::coarse_element_t };
219 enum { nosplit_element_t = ImplTraits::nosplit_element_t };
221 typedef typename ImplTraits::MarkRuleType MarkRuleType;
242 typedef typename GridImp :: ReferenceElementType ReferenceElementType;
244 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
245 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
250 typedef typename GridImp::template Codim< 0 >::Geometry
Geometry;
258 typedef typename GridImp::template Codim<0>::Entity
Entity;
268 typedef typename GridImp::template Codim<0>::EntitySeed
EntitySeed;
291 template<
int cc>
int count ()
const ;
298 typedef GenericGeometry::MapNumberingProvider< GridImp::dimension > Numbering;
299 const unsigned int tid =
type().id();
300 const int j = Numbering::template dune2generic< codim >( tid, i );
301 return subEntity< codim >( j );
304 template<
int codim >
305 typename Codim< codim >::EntityPointer subEntity (
int i )
const;
312 ALU3dGridLeafIntersectionIteratorType ileafbegin ()
const;
315 ALU3dGridLeafIntersectionIteratorType ileafend ()
const;
322 ALU3dGridLevelIntersectionIteratorType ilevelbegin ()
const;
325 ALU3dGridLevelIntersectionIteratorType ilevelend ()
const;
328 bool isLeaf ()
const;
334 bool hasFather ()
const
336 return (this->
level()>0);
348 LocalGeometry geometryInFather ()
const;
367 bool mightVanish ()
const;
370 bool hasBoundaryIntersections ()
const;
376 bool mark(
int refCount )
const;
393 void reset (
int l );
406 template<
int cc>
int getSubIndex (
int i)
const;
411 int subIndex(
int i,
unsigned int codim)
const;
414 const IMPLElementType&
getItem ()
const {
return *item_; }
417 const BNDFaceType& getGhost ()
const
424 const GridImp&
grid()
const {
return factory_.grid(); }
430 bool isGhost ()
const{
return ImplTraits::isGhost( ghost_ ); }
443 int getIndex ()
const;
446 mutable GeometryImpl geo_;
452 mutable IMPLElementType* item_;
455 mutable BNDFaceType* ghost_;
469 template<
int codim,
class Gr
idImp >
474 enum { dim = GridImp::dimension };
475 enum { dimworld = GridImp::dimensionworld };
477 typedef typename GridImp::MPICommunicatorType Comm;
484 typedef typename ImplTraits::template Codim<codim>
::InterfaceType HElementType;
486 typedef typename ImplTraits::HBndSegType HBndSegType;
487 typedef typename ImplTraits::BNDFaceType BNDFaceType;
494 typedef typename GridImp::template Codim<codimension>::Entity
Entity;
510 const HElementType & item);
514 const HElementType & item,
522 const HBndSegType & ghostFace );
586 return GridImp :: getRealImplementation(*
entity_);
593 template<
class Gr
idImp>
602 enum {
dim = GridImp::dimension };
605 typedef typename GridImp::MPICommunicatorType
Comm;
637 const HElementType & item)
694 template<
int cd,
class Gr
idImp>
695 class ALU3dGridEntityPointer :
696 public ALU3dGridEntityPointerBase<cd,GridImp>
701 enum {
dim = GridImp::dimension };
704 typedef typename GridImp::MPICommunicatorType
Comm;
742 const HElementType & item,
743 const int twist = defaultValue,
744 const int duneFace = defaultValue
787 #if COMPILE_ALUGRID_INLINE
788 #include "entity_imp.cc"