dune-alugrid  3.0.0
iterator.hh
Go to the documentation of this file.
1 #ifndef DUNE_ALU3DGRIDITERATOR_HH
2 #define DUNE_ALU3DGRIDITERATOR_HH
3 
4 // System includes
5 #include <type_traits>
6 
7 // Dune includes
8 #include <dune/grid/common/grid.hh>
12 
13 // Local includes
14 #include "alu3dinclude.hh"
15 #include "topology.hh"
16 #include "faceutility.hh"
17 #include "alu3diterators.hh"
18 
19 namespace Dune {
20  // Forward declarations
21  template<int cd, int dim, class GridImp>
22  class ALU3dGridEntity;
23  template<int cd, PartitionIteratorType pitype, class GridImp >
24  class ALU3dGridLevelIterator;
25  template<int cd, class GridImp >
26  class ALU3dGridEntityPointer;
27  template<int mydim, int coorddim, class GridImp>
28  class ALU3dGridGeometry;
29  template<class GridImp>
30  class ALU3dGridHierarchicIterator;
31  template<class GridImp>
32  class ALU3dGridIntersectionIterator;
33  template<int codim, PartitionIteratorType pitype, class GridImp>
34  class ALU3dGridLeafIterator;
35  template< int, int, ALU3dGridElementType, class >
36  class ALU3dGrid;
37  template< int, int, ALU3dGridElementType, class >
38  class ALU3dGridFaceInfo;
39  template< ALU3dGridElementType, class >
41 
42 //**********************************************************************
43 //
44 // --ALU3dGridIntersectionIterator
45 // --IntersectionIterator
53 template<class GridImp>
55 //: public IntersectionIteratorDefaultImplementation <GridImp,ALU3dGridIntersectionIterator>
56 {
57  enum { dim = GridImp::dimension };
58  enum { dimworld = GridImp::dimensionworld };
59 
60  typedef typename GridImp::MPICommunicatorType Comm;
61 
62  typedef ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits;
63 
64  typedef typename ImplTraits::HElementType HElementType ;
65  typedef typename ImplTraits::HBndSegType HBndSegType;
66  typedef typename ImplTraits::GEOElementType GEOElementType;
67  typedef typename ImplTraits::IMPLElementType IMPLElementType;
68  typedef typename ImplTraits::GEOFaceType GEOFaceType;
69  typedef typename ImplTraits::NeighbourPairType NeighbourPairType;
70  typedef typename ImplTraits::BNDFaceType BNDFaceType;
71 
72  typedef typename ALU3dImplTraits< tetra, Comm >::GEOElementType GEOTetraElementType;
73  typedef typename ALU3dImplTraits< tetra, Comm >::BNDFaceType GEOTriangleBndType;
74  typedef typename ALU3dImplTraits< hexa, Comm >::GEOElementType GEOHexaElementType;
75  typedef typename ALU3dImplTraits< hexa, Comm >::BNDFaceType GEOQuadBndType;
76 
78 
79  typedef typename std::conditional<
80  tetra == GridImp::elementType,
81  ALU3dGridGeometricFaceInfoTetra< dim, dimworld, Comm >,
82  ALU3dGridGeometricFaceInfoHexa< dim, dimworld, Comm > >::type GeometryInfoType;
83 
84  typedef ElementTopologyMapping<GridImp::elementType> ElementTopo;
85  typedef FaceTopologyMapping<GridImp::elementType> FaceTopo;
86 
87  enum { numFaces = (dim==3) ? EntityCount<GridImp::elementType>::numFaces : (GridImp::elementType==tetra ? 3 : 4) };
88  enum { numVerticesPerFace =
89  GeometryInfoType::numVerticesPerFace };
90  enum { numVertices = (dim==3) ? EntityCount<GridImp::elementType>::numVertices : (GridImp::elementType==tetra ? 3 : 4)};
91 
92  typedef ALU3dGridIntersectionIterator<GridImp> ThisType;
93 
94  friend class ALU3dGridEntity<0,dim,GridImp>;
95  friend class IntersectionIteratorWrapper<GridImp,ThisType>;
96 
97 protected:
99 
100  typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
101  typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
102 
103 public:
104  typedef ALUTwists< (dim == 3 ) ? GridImp::elementType == tetra ? 3 : 4 : 2, dim-1 > Twists;
105  typedef typename Twists::Twist Twist;
106 
107  typedef typename GridImp::template Codim<0>::Entity Entity;
108  typedef typename GridImp::template Codim<1>::Geometry Geometry;
109  typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
110  typedef typename GridImp::template Codim<0>::EntityPointerImpl EntityPointerImpl;
111 
114  typedef Dune::Intersection< GridImp, Dune::ALU3dGridIntersectionIterator< GridImp > > Intersection;
115 
116  typedef FieldVector<alu3d_ctype, dimworld> NormalType;
117 
119  explicit ALU3dGridIntersectionIterator( const bool levelIntersectionIterator = false );
120 
123 
126 
128  bool equals (const ALU3dGridIntersectionIterator<GridImp> & i) const;
129 
131  void increment ();
132 
134  EntityPointerImpl outside() const;
135 
137  EntityPointerImpl inside() const;
138 
140  bool boundary () const;
141 
143  bool neighbor () const;
144 
146  int boundaryId () const;
147 
149  size_t boundarySegmentIndex() const;
150 
156 
161  Geometry geometry () const;
162 
164  GeometryType type () const;
165 
168  int indexInInside () const;
169 
174 
177  int indexInOutside () const;
178 
180  Twist twistInInside () const;
181 
183  Twist twistInOutside () const;
184 
187  NormalType unitOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const ;
188 
191  NormalType outerNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
192 
195  NormalType integrationOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
196 
198  int level () const;
199 
200  int outsideLevel () const { return connector_.outsideLevel(); }
201 
203  bool conforming () const
204  {
206  }
207 
209  const GEOFaceType& getItem() const { return connector_.face(); }
210 
212  int weight() const
213  {
214  return this->getItem().weight();
215  }
216 
217 protected:
218  // set interator to end iterator
219  void done () ;
220  template< class EntityType > void done ( const EntityType &en ) { done(); }
221 
222  // reset IntersectionIterator to first neighbour
223  void setFirstItem(const HElementType & elem, int wLevel);
224 
225  // reset IntersectionIterator to first neighbour
226  void setInteriorItem(const HElementType & elem,
227  const BNDFaceType& bnd, int wLevel);
228 
229  // reset IntersectionIterator to first neighbour
230  template <class EntityType>
231  void first(const EntityType & en, int wLevel,
232  const bool conformingRefinement,
233  const bool ghostCellsEnabled );
234 
235  // set new face
236  void setNewFace(const GEOFaceType& newFace);
237 
238 private:
239  // set new face (only LeafIntersectionIterator)
240  void setGhostFace(const GEOFaceType& newFace);
241 
242 protected:
243  // generate local geometries
244  void buildLocalGeometries() const;
245 
246  // get the face corresponding to the index
248  getFace ( const GEOTriangleBndType &bnd, int index ) const;
249 
250  // get the face corresponding to the index
252  getFace ( const GEOQuadBndType &bnd, int index ) const;
253 
254  // get the face corresponding to the index
256  getFace ( const GEOTetraElementType &elem, int index ) const;
257 
259  getFace ( const GEOHexaElementType &elem, int index ) const;
260 
264  mutable GeometryInfoType geoProvider_; // need to initialise
265 
267  const IMPLElementType* item_;
268 
270  const BNDFaceType* ghost_;
271 
272  mutable int innerLevel_;
273  mutable int index_;
274 
278 
279  // unit outer normal
281 
282 public:
283  // used by SharedPointer
284  void invalidate() {}
285  // refCount used by SharedPointer
286  unsigned int refCount_;
287 };
288 
289 template<class GridImp>
291 public ALU3dGridIntersectionIterator<GridImp>
292 {
293  enum { dim = GridImp::dimension };
294  enum { dimworld = GridImp::dimensionworld };
295 
296  typedef typename GridImp::MPICommunicatorType Comm;
297 
298  typedef ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits;
299 
300  typedef typename ImplTraits::HElementType HElementType ;
301  typedef typename ImplTraits::GEOElementType GEOElementType;
302  typedef typename ImplTraits::IMPLElementType IMPLElementType;
303  typedef typename ImplTraits::GEOFaceType GEOFaceType;
304  typedef typename ImplTraits::NeighbourPairType NeighbourPairType;
305  typedef typename ImplTraits::BNDFaceType BNDFaceType;
306 
307  typedef ALU3dGridFaceInfo< dim, dimworld, GridImp::elementType, Comm > FaceInfoType;
308 
309  typedef typename std::conditional<
310  tetra == GridImp::elementType,
311  ALU3dGridGeometricFaceInfoTetra< dim, dimworld, Comm >,
312  ALU3dGridGeometricFaceInfoHexa< dim, dimworld, Comm > >::type GeometryInfoType;
313 
314  typedef ElementTopologyMapping<GridImp::elementType> ElementTopo;
315  typedef FaceTopologyMapping<GridImp::elementType> FaceTopo;
316 
317  enum { numFaces = (dim==3) ? EntityCount<GridImp::elementType>::numFaces : (GridImp::elementType==tetra ? 3 : 4) };
318  enum { numVerticesPerFace =
319  GeometryInfoType::numVerticesPerFace };
320  enum { numVertices = (dim==3) ? EntityCount<GridImp::elementType>::numVertices : (GridImp::elementType==tetra ? 3 : 4)};
321 
322  typedef ALU3dGridIntersectionIterator<GridImp> BaseType;
323  typedef ALU3dGridLevelIntersectionIterator<GridImp> ThisType;
324 
325  friend class ALU3dGridEntity<0,dim,GridImp>;
326  friend class IntersectionIteratorWrapper<GridImp,ThisType>;
327 protected:
328  using BaseType :: item_;
329  using BaseType :: ghost_;
331  using BaseType :: index_;
334  using BaseType :: boundary;
335  using BaseType :: done ;
336  using BaseType :: getFace;
337  using BaseType :: neighbor ;
338 
339 public:
342 
345 
347  void assign(const ThisType & org);
348 
350  void increment ();
351 
352  // reset IntersectionIterator to first neighbour
353  template <class EntityType>
354  void first(const EntityType & en, int wLevel,
355  const bool conformingRefinement,
356  const bool ghostCellsEnabled );
357 
359  bool neighbor () const;
360 
362  bool conforming () const
363  {
365  ( !neighbor() || this->connector_.conformanceState() == FaceInfoType::CONFORMING ) : true );
366  // for conforming refinement use base implementation
367  // otherwise its true
369  BaseType :: conforming() : true ;
370  }
371 
372 private:
373  // set new face
374  void setNewFace(const GEOFaceType& newFace);
375 
376  // reset IntersectionIterator to first neighbour
377  void setFirstItem(const HElementType & elem, int wLevel);
378 
379  // reset IntersectionIterator to first neighbour
380  void setInteriorItem(const HElementType & elem,
381  const BNDFaceType& bnd, int wLevel);
382 
383  bool levelNeighbor_;
384  bool isLeafItem_;
385 };
386 
388 //
389 // --IterationImpl
390 //
392 template <class InternalIteratorType >
394 {
395 public:
396  typedef typename InternalIteratorType :: val_t val_t;
397 
398  // here the items level will do
399  template <class GridImp, int codim>
400  class GetLevel
401  {
402  public:
403  template <class ItemType>
404  static int getLevel(const GridImp & grid, const ItemType & item, int level )
405  {
406  alugrid_assert ( & item );
407  return (level < 0) ? item.level() : level;
408  }
409  };
410 
411  // level is not needed for codim = 0
412  template <class GridImp>
413  class GetLevel<GridImp,0>
414  {
415  public:
416  template <class ItemType>
417  static int getLevel(const GridImp & grid, const ItemType & item, int level )
418  {
419  return level;
420  }
421  };
422 
423  template <class GridImp>
424  class GetLevel<GridImp,3>
425  {
426  public:
427  template <class ItemType>
428  static int getLevel(const GridImp & grid, const ItemType & item, int level)
429  {
430  return (level < 0) ? grid.getLevelOfLeafVertex(item) : level;
431  }
432  };
433 
434 protected:
435  // set iterator to first item
436  template <class GridImp, class IteratorImp>
437  void firstItem(const GridImp & grid, IteratorImp & it, int level )
438  {
439  InternalIteratorType & iter = it.internalIterator();
440  iter.first();
441  ValidItem<IteratorImp::codimension, GridImp> validate;
442  while(!validate(grid,iter))
443  {
444  iter.next();
445  if(iter.done())
446  {
447  it.removeIter();
448  return ;
449  }
450  }
451  if( ! iter.done() )
452  {
453  alugrid_assert ( iter.size() > 0 );
454  setItem(grid,it,iter,level);
455  }
456  else
457  {
458  it.removeIter();
459  }
460  }
461 
462  // set the iterators entity to actual item
463  template <class GridImp, class IteratorImp>
464  void setItem (const GridImp & grid, IteratorImp & it, InternalIteratorType & iter, int level)
465  {
466  enum { codim = IteratorImp :: codimension };
467  val_t & item = iter.item();
468  alugrid_assert ( item.first || item.second );
469  if( item.first )
470  {
471  it.updateEntityPointer( item.first ,
472  GetLevel<GridImp,codim>::getLevel(grid, *(item.first) , level) );
473  }
474  else
475  it.updateGhostPointer( *item.second );
476  }
477 
478  // increment iterator
479  template <class GridImp, class IteratorImp>
480  void incrementIterator(const GridImp & grid, IteratorImp & it, int level)
481  {
482  // if iter_ is zero, then end iterator
483  InternalIteratorType & iter = it.internalIterator();
484  ValidItem<IteratorImp::codimension, GridImp> validate;
485  do{
486  iter.next();
487 
488  if(iter.done())
489  {
490  it.removeIter();
491  return ;
492  }
493 
494  }while(!(validate(grid,iter) ) );
495 
496  setItem(grid,it,iter,level);
497  return ;
498  }
499 
500 private:
501  // in 2d check if item is valid
502  template <int codim, class GridImp>
503  struct ValidItem
504  {
505  bool operator()(const GridImp & grid, InternalIteratorType & iter)
506  {
507  if(GridImp::dimension ==3 || iter.done()) return true;
508  else if (GridImp::dimension == 2)
509  {
510  typedef typename ALU3dImplTraits<GridImp::elementType, typename GridImp::MPICommunicatorType>::template Codim<GridImp::dimension, codim>::ImplementationType GEOElementType;
511  val_t & item = iter.item();
512  alugrid_assert ( item.first || item.second );
513  if( item.first )
514  {
515  GEOElementType* elem = static_cast<GEOElementType*> (item.first);
516  //an element is valid if the 2d flag is set
517  return elem->is2d();
518  }
519  //if we have a ghost entity, it is the right one, as we did not insert non-2d elements into the ghostlist
520  // see alu3diterators.hh method updateGhostlist
521  else if( item.second )
522  return true;
523  }
524  return false;
525  }
526  };
527 
528  template <class GridImp>
529  struct ValidItem<0, GridImp>
530  {
531  bool operator()(const GridImp & grid, InternalIteratorType & iter)
532  {
533  return true;
534  }
535  };
536 
537 };
538 
539 //**********************************************************************
540 //
541 // --ALU3dGridLevelIterator
542 // --LevelIterator
546 template<int cd, PartitionIteratorType pitype, class GridImp>
547 class ALU3dGridLevelIterator
548 : public ALU3dGridEntityPointer< cd, GridImp >,
549  public ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, typename GridImp::MPICommunicatorType > >
550 {
551  enum { dim = GridImp::dimension };
552  enum { dimworld = GridImp::dimensionworld };
553 
554  typedef typename GridImp::MPICommunicatorType Comm;
555 
556  friend class ALU3dGridEntity<3,dim,GridImp>;
557  friend class ALU3dGridEntity<2,dim,GridImp>;
558  friend class ALU3dGridEntity<1,dim,GridImp>;
559  friend class ALU3dGridEntity<0,dim,GridImp>;
560  friend class ALU3dGrid< dim, dimworld, GridImp::elementType, Comm >;
561 
562  friend class ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, Comm > >;
563  typedef ALU3dGridEntityPointer< cd, GridImp > BaseType;
564 
565 public:
566  typedef typename GridImp::template Codim<cd>::Entity Entity;
568 
570  typedef ALU3dGridLevelIterator<cd,pitype,GridImp> ThisType;
571  // the wrapper for the original iterator of the ALU3dGrid
572  typedef typename ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, Comm > IteratorType;
574  typedef typename ALU3DSPACE IteratorElType< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, Comm >::val_t val_t;
575 
577  ALU3dGridLevelIterator () : grid_( nullptr ), iter_(), level_( 0 ) {}
578 
580  ALU3dGridLevelIterator(const GridImp& grid, int level, bool);
581 
583  ALU3dGridLevelIterator(const GridImp& grid, int level);
584 
586  ALU3dGridLevelIterator(const ThisType & org);
587 
588  // destructor
590 
592  void increment ();
593 
595  void releaseEntity () {}
596 
598  ThisType & operator = (const ThisType & org);
599 private:
601  void assign (const ThisType & org);
602 
603  const GridImp &grid () const { alugrid_assert( grid_ ); return *grid_; }
604 
605  // reference to factory class (ie grid)
606  const GridImp *grid_;
607 
608  // the internal iterator
609  std::unique_ptr< IteratorType > iter_ ;
610 
611  // actual level
612  int level_;
613 
614  // deletes iter_
615  void removeIter ();
616 
617  IteratorType & internalIterator ()
618  {
619  alugrid_assert ( iter_ );
620  return *iter_;
621  }
622 };
623 
624 //********************************************************************
625 //
626 // --ALU3dGridLeafIterator
627 // --LeafIterator
628 //
629 //********************************************************************
631 template<int cdim, PartitionIteratorType pitype, class GridImp>
632 class ALU3dGridLeafIterator
633 : public ALU3dGridEntityPointer< cdim, GridImp >,
634  public ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLeafIteratorWrapper< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, pitype, typename GridImp::MPICommunicatorType > >
635 {
636  enum { dim = GridImp :: dimension };
637 
638  friend class ALU3dGridEntity<cdim,dim,GridImp>;
639  enum { codim = cdim };
640 
641  typedef typename GridImp::MPICommunicatorType Comm;
642 
644 
645 public:
646  typedef typename GridImp::template Codim<cdim>::Entity Entity;
647 
648  typedef typename ALU3DSPACE ALU3dGridLeafIteratorWrapper< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, pitype, Comm > IteratorType ;
650 
652  typedef typename ALU3DSPACE IteratorElType< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, Comm >::val_t val_t;
653 
655 
657  ALU3dGridLeafIterator () : grid_( nullptr ), iter_() {}
658 
660  ALU3dGridLeafIterator(const GridImp& grid, int level);
661 
663  ALU3dGridLeafIterator(const GridImp& grid, int level , bool isBegin);
664 
666  ALU3dGridLeafIterator(const ThisType & org);
667 
670 
672  void increment ();
673 
675  void releaseEntity () {}
676 
678  ThisType & operator = (const ThisType & org);
679 
680 private:
681  const GridImp &grid () const { alugrid_assert( grid_ ); return *grid_; }
682 
683  // reference to grid class (ie grid)
684  const GridImp *grid_;
685 
686  // the internal iterator
687  std::unique_ptr< IteratorType > iter_;
688 
690  void assign (const ThisType & org);
691 
692  // deletes iter_
693  void removeIter () ;
694 
695  // return reference to iter_
696  InternalIteratorType & internalIterator ()
697  {
698  alugrid_assert ( iter_ );
699  return *iter_;
700  }
701 };
702 
703 // - HierarchicIteraor
704 // --HierarchicIterator
705 template<class GridImp>
706 class ALU3dGridHierarchicIterator
707 : public ALU3dGridEntityPointer<0,GridImp>
708 // public HierarchicIteratorDefaultImplementation <GridImp,ALU3dGridHierarchicIterator>
709 {
710  typedef ALU3dGridHierarchicIterator<GridImp> ThisType;
711  enum { dim = GridImp::dimension };
712 
713  typedef typename GridImp::MPICommunicatorType Comm;
714 
715  typedef ALU3dImplTraits< GridImp::elementType, Comm > ImplTraits;
716  typedef typename ImplTraits::HElementType HElementType;
717  typedef typename ImplTraits::HBndSegType HBndSegType;
718 
719  template < class PointerType, class CommT >
720  class GhostElementStorage;
721 
723  template < class PointerType >
724  class GhostElementStorage< PointerType, ALUGridNoComm >
725  {
726  public:
727  GhostElementStorage() {}
728  explicit GhostElementStorage( const PointerType& ) {}
729  PointerType& operator * () { PointerType* p = 0; alugrid_assert ( false ); abort(); return *p; }
730  const PointerType* ghost () const { return 0; }
731  PointerType* nextGhost () const { return 0; }
732  PointerType* operator -> () const { return 0; }
733  bool operator != (const PointerType* ) const { return false; }
734  bool operator ! () const { return true ; }
735  GhostElementStorage& operator= (const GhostElementStorage& ) { return *this; }
736  GhostElementStorage& operator= (const PointerType* ) { return *this; }
737  bool valid () const { return false; }
738  };
739 
741  template < class PointerType >
742  class GhostElementStorage< PointerType, ALUGridMPIComm >
743  {
744  private:
745  // pointers to ghost and current ghost
746  const HBndSegType * ghost_;
747  HBndSegType * nextGhost_;
748  public:
749  GhostElementStorage() : ghost_( 0 ), nextGhost_( 0 ) {}
750  explicit GhostElementStorage( const PointerType& gh ) : ghost_( &gh ), nextGhost_( 0 ) {}
751  GhostElementStorage( const GhostElementStorage& org )
752  : ghost_( org.ghost_ ), nextGhost_( org.nextGhost_ ) {}
753 
754  PointerType& operator * () { alugrid_assert ( nextGhost_ ); return *nextGhost_; }
755  const PointerType* ghost () const { return ghost_; }
756  PointerType* nextGhost () const { return nextGhost_; }
757  PointerType* operator -> () { return nextGhost_; }
758  bool operator != (const PointerType* p ) const { return (nextGhost_ != p); }
759  bool operator ! () const { return nextGhost_ == 0; }
760  GhostElementStorage& operator= (const GhostElementStorage& org)
761  {
762  ghost_ = org.ghost_;
763  nextGhost_ = org.nextGhost_;
764  return *this;
765  }
766  GhostElementStorage& operator= (PointerType* p)
767  {
768  nextGhost_ = p;
769  return *this;
770  }
771  bool valid () const { return (ghost_ != 0); }
772  };
773 
774 public:
775  typedef typename GridImp::template Codim<0>::Entity Entity;
776  typedef typename GridImp::ctype ctype;
777 
779  ALU3dGridHierarchicIterator(const HElementType & elem,
780  int maxlevel, bool end );
781 
783  ALU3dGridHierarchicIterator(const HBndSegType& ghost,
784  int maxlevel,
785  bool end);
786 
789 
791  void increment();
792 
794  void releaseEntity () {}
795 
797  ThisType & operator = (const ThisType & org);
798 
799 private:
800  // assign iterator
801  void assign(const ThisType & org);
802 
804  int getLevel(const HElementType* item) const;
805 
807  int getLevel(const HBndSegType* face) const;
808 
809  // go to next valid element
810  template <class HItemType>
811  HItemType* goNextElement (const HItemType* startElem, HItemType * oldEl);
812 
814  const HElementType * elem_;
815 
816  // pointers to ghost and current ghost
817  GhostElementStorage< HBndSegType, Comm > ghostElem_;
818 
820  int maxlevel_;
821 };
822 
823 
824 } // end namespace Dune
825 
826 #include "iterator_imp.cc"
827 
828 #endif
Dune::ALU3dGridIntersectionIterator::ImplementationType
ALU3dGridIntersectionIterator< GridImp > ImplementationType
Definition: iterator.hh:112
Dune::ALU3dGridLeafIterator::val_t
ALU3DSPACE IteratorElType<(GridImp::dimension==2 &&cdim==2) ? 3 :cdim, Comm >::val_t val_t
Definition: iterator.hh:652
Dune::ALU3dGridLevelIntersectionIterator
Definition: 3d/grid.hh:68
Dune::ALU3dGridTreeIterator
Definition: iterator.hh:393
Dune::ALU3dGridIntersectionIterator::getFace
const ALU3dImplTraits< tetra, Comm >::GEOFaceType * getFace(const GEOTriangleBndType &bnd, int index) const
Definition: iterator_imp.cc:422
Dune::ALU3dGridFaceInfo::outsideLevel
int outsideLevel() const
Definition: faceutility_imp.cc:357
Dune::ALU3dGridLeafIterator::releaseEntity
void releaseEntity()
release entity
Definition: iterator.hh:675
Dune::ALU3dGridLeafIterator::operator=
ThisType & operator=(const ThisType &org)
assignment of iterators
Definition: iterator.cc:178
Dune::ALU3dImplTraits< hexa, Comm >::GEOElementType
GitterType::Geometric::hexa_GEO GEOElementType
Definition: alu3dinclude.hh:310
Dune::ALU3dGridLeafIterator::Entity
GridImp::template Codim< cdim >::Entity Entity
Definition: iterator.hh:646
Dune::ALU3dGridHierarchicIterator::releaseEntity
void releaseEntity()
release entity
Definition: iterator.hh:794
Dune::ALU3dGridFaceInfo::face
const GEOFaceType & face() const
Returns the ALU3dGrid face.
Definition: faceutility_imp.cc:320
Dune::ALU3dGridLevelIterator::increment
void increment()
prefix increment
Definition: iterator.cc:111
alu3diterators.hh
Dune::ALU3dGridIntersectionIterator::LocalGeometryImpl
GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl
Definition: iterator.hh:101
Dune::ALU3dGridVertexList
Definition: alu3dinclude.hh:344
twists.hh
Dune::ALU3dGridIntersectionIterator::twistInOutside
Twist twistInOutside() const
returns twist of face compared to outer element
Definition: iterator_imp.cc:309
Dune::ALU3dGridHierarchicIterator::ctype
GridImp::ctype ctype
Definition: iterator.hh:776
memory.hh
Dune::ALU3dGridIntersectionIterator::innerLevel_
int innerLevel_
Definition: iterator.hh:272
Dune::ALU3dGridIntersectionIterator::assign
void assign(const ALU3dGridIntersectionIterator< GridImp > &org)
assignment of iterators
Definition: iterator_imp.cc:143
Dune::ALU3dGridLevelIntersectionIterator::neighbor
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: iterator_imp.cc:607
Dune::ALU3dGridIntersectionIterator::unitOuterNormal_
NormalType unitOuterNormal_
Definition: iterator.hh:280
Dune::ALU3dGridGeometricFaceInfo
Definition: iterator.hh:40
Dune::ALU3dGridEntityPointer::Comm
GridImp::MPICommunicatorType Comm
Definition: entity.hh:636
Dune::ALU3dGridIntersectionIterator::refCount_
unsigned int refCount_
Definition: iterator.hh:286
Dune::ALU3dGridIntersectionIterator::outerNormal
NormalType outerNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:334
Dune::ALU3dGridTreeIterator::GetLevel< GridImp, 3 >::getLevel
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:428
Dune::ALU3dImplTraits
Definition: alu3dinclude.hh:259
Dune::ALU3dGridTreeIterator::firstItem
void firstItem(const GridImp &grid, IteratorImp &it, int level)
Definition: iterator.hh:437
Dune::ALU3dGridFaceInfo< dim, dimworld, GridImp::elementType, Comm >
Dune::tetra
Definition: topology.hh:12
Dune::ALU3dGridIntersectionIterator::inside
EntityPointerImpl inside() const
access entity where iteration started
Definition: iterator_imp.cc:251
Dune::ALU3dGridLevelIntersectionIterator::first
void first(const EntityType &en, int wLevel, const bool conformingRefinement, const bool ghostCellsEnabled)
Definition: iterator_imp.cc:504
Dune::ALU3dGridLevelIterator::ALU3dGridLevelIterator
ALU3dGridLevelIterator()
default constructor
Definition: iterator.hh:577
Dune::ALU3dGridHierarchicIterator::operator=
ThisType & operator=(const ThisType &org)
the assignment operator
Definition: iterator.cc:293
Dune::ALU3dGridFaceInfo::conformanceState
ConformanceState conformanceState() const
Description of conformance on the face.
Definition: faceutility_imp.cc:438
Dune::ALU3dGridIntersectionIterator::IntersectionLevel
Definition: iterator.hh:98
Dune::ALU3dGridIntersectionIterator::integrationOuterNormal
NormalType integrationOuterNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:326
Dune::ALU3dGridIntersectionIterator::geometry
Geometry geometry() const
Definition: iterator_imp.cc:376
Dune::ALU3dGridIntersectionIterator::Entity
GridImp::template Codim< 0 >::Entity Entity
Definition: iterator.hh:107
Dune::ALU3dGridTreeIterator::GetLevel
Definition: iterator.hh:400
Dune::ALU3dGridLevelIterator::operator=
ThisType & operator=(const ThisType &org)
assignment of iterators
Definition: iterator.cc:103
Dune::ALU3dGridLeafIterator
Leaf iterator.
Definition: entity.hh:34
Dune::ALU3dGridTreeIterator::val_t
InternalIteratorType ::val_t val_t
Definition: iterator.hh:396
faceutility.hh
Dune::IntersectionIteratorWrapper
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:25
Dune::ALU3dGridTreeIterator::setItem
void setItem(const GridImp &grid, IteratorImp &it, InternalIteratorType &iter, int level)
Definition: iterator.hh:464
Dune::ALU3dGridIntersectionIterator::Twist
Twists::Twist Twist
Definition: iterator.hh:105
Dune::ALU3dGridIntersectionIterator::LocalGeometry
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: iterator.hh:109
Dune::ALU3dGridIntersectionIterator::increment
void increment()
increment iterator
Definition: iterator_imp.cc:178
Dune::ALU3dGridLeafIterator::IteratorType
ALU3DSPACE ALU3dGridLeafIteratorWrapper<(GridImp::dimension==2 &&cdim==2) ? 3 :cdim, pitype, Comm > IteratorType
Definition: iterator.hh:648
Dune::ALU3dGridLeafIterator::InternalIteratorType
IteratorType InternalIteratorType
Definition: iterator.hh:651
Dune::ALU3dGridLevelIterator
Definition: entity.hh:24
Dune::ALU3dGridLeafIterator::~ALU3dGridLeafIterator
~ALU3dGridLeafIterator()
destructor deleting real iterator
Definition: iterator.cc:162
alu3dinclude.hh
Dune::ALU3dGridHierarchicIterator::increment
void increment()
increment
Definition: iterator.cc:374
Dune::ALU3dGridIntersectionIterator::geoProvider_
GeometryInfoType geoProvider_
Definition: iterator.hh:264
Dune::ALU3dGridIntersectionIterator::setInteriorItem
void setInteriorItem(const HElementType &elem, const BNDFaceType &bnd, int wLevel)
Definition: iterator_imp.cc:65
Dune::ALU3dGridIntersectionIterator::ALU3dGridIntersectionIterator
ALU3dGridIntersectionIterator(const bool levelIntersectionIterator=false)
The default Constructor.
Definition: iterator_imp.cc:27
Dune::ALU3dGridLevelIterator::IteratorType
ALU3DSPACE ALU3dGridLevelIteratorWrapper<(GridImp::dimension==2 &&cd==2) ? 3 :cd, pitype, Comm > IteratorType
Definition: iterator.hh:572
Dune::ALU3dGridTreeIterator::GetLevel::getLevel
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:404
Dune::ALU3dGridIntersectionIterator::boundarySegmentIndex
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: iterator_imp.cc:404
Dune::ALU3dGridIntersectionIterator::setFirstItem
void setFirstItem(const HElementType &elem, int wLevel)
Definition: iterator_imp.cc:48
Dune::ALU3dGridIntersectionIterator::equals
bool equals(const ALU3dGridIntersectionIterator< GridImp > &i) const
The copy constructor.
Definition: iterator_imp.cc:168
Dune::ALU3dGridFaceInfo< dim, dimworld, GridImp::elementType, Comm >::CONFORMING
Definition: faceutility.hh:48
Dune::ALU3dGridLevelIterator::val_t
ALU3DSPACE IteratorElType<(GridImp::dimension==2 &&cd==2) ? 3 :cd, Comm >::val_t val_t
Definition: iterator.hh:574
Dune::ALU3dGridIntersectionIterator::ghost_
const BNDFaceType * ghost_
current pointer to ghost face if iterator was started from ghost element
Definition: iterator.hh:270
alugrid_assert
#define alugrid_assert(EX)
Definition: alugrid_assert.hh:20
Dune::ALU3dGridIntersectionIterator::IntersectionLeaf
Definition: iterator.hh:98
Dune::ALU3dGridIntersectionIterator::weight
int weight() const
return communication weight
Definition: iterator.hh:212
Dune::ALU3dGridLeafIterator::increment
void increment()
prefix increment
Definition: iterator.cc:215
Dune::ALU3dGridIntersectionIterator::buildLocalGeometries
void buildLocalGeometries() const
Definition: iterator_imp.cc:412
Dune::ALU3dGridFaceInfo::conformingRefinement
bool conformingRefinement() const
return true if conforming refinement is enabled
Definition: faceutility.hh:138
Dune::ALU3dGridLevelIterator::~ALU3dGridLevelIterator
~ALU3dGridLevelIterator()
Definition: iterator.cc:64
Dune::ALU3dGridIntersectionIterator::neighbor
bool neighbor() const
return true if across the face an neighbor on leaf exists
Definition: iterator_imp.cc:271
Dune::ALU3dGridIntersectionIterator::geometryInInside
LocalGeometry geometryInInside() const
Definition: iterator_imp.cc:286
Dune::ALU3dGridLevelIterator::releaseEntity
void releaseEntity()
release entity
Definition: iterator.hh:595
Dune::ALU3dGridIntersectionIterator::level
int level() const
return level of iterator (level of item)
Definition: iterator_imp.cc:477
Dune::ALU3dImplTraits< tetra, Comm >::GEOElementType
GitterType::Geometric::tetra_GEO GEOElementType
Definition: alu3dinclude.hh:271
Dune::ALU3dGridIntersectionIterator::boundary
bool boundary() const
return true if intersection is with boundary.
Definition: iterator_imp.cc:265
Dune::ALU3dGridIntersectionIterator
Definition: entity.hh:32
Dune::ALU3dGrid
[ provides Dune::Grid ]
Definition: communication.hh:37
Dune::ALU3dGridIntersectionIterator::geometryInOutside
LocalGeometry geometryInOutside() const
Definition: iterator_imp.cc:316
Dune::ALU3dGridIntersectionIterator::EntityPointerImpl
GridImp::template Codim< 0 >::EntityPointerImpl EntityPointerImpl
Definition: iterator.hh:110
Dune::ALU3dGridLevelIntersectionIterator::ALU3dGridLevelIntersectionIterator
ALU3dGridLevelIntersectionIterator()
The default Constructor.
Definition: iterator_imp.cc:494
Dune::ALU3dGridEntityPointerBase< cd, GridImp >::level
int level() const
ask for level of entities
Definition: entity.hh:524
Dune::ALU3dGridTreeIterator::incrementIterator
void incrementIterator(const GridImp &grid, IteratorImp &it, int level)
Definition: iterator.hh:480
Dune::ALU3dGridIntersectionIterator::Intersection
Dune::Intersection< GridImp, Dune::ALU3dGridIntersectionIterator< GridImp > > Intersection
type of the intersection
Definition: iterator.hh:114
Dune::ALU3dGridIntersectionIterator::intersectionSelfLocal_
LocalGeometryImpl intersectionSelfLocal_
Definition: iterator.hh:276
Dune::ALU3dGridIntersectionIterator::intersectionGlobal_
GeometryImpl intersectionGlobal_
Definition: iterator.hh:275
ALU3DSPACE
#define ALU3DSPACE
Definition: alu3dinclude.hh:24
Dune::ALU3dGridIntersectionIterator::GeometryImpl
GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl
Definition: iterator.hh:100
Dune::ALU3dGridHierarchicIterator::ALU3dGridHierarchicIterator
ALU3dGridHierarchicIterator(const HElementType &elem, int maxlevel, bool end)
the normal Constructor
Definition: iterator.cc:233
Dune::ALU3dGridLevelIntersectionIterator::increment
void increment()
increment iterator
Definition: iterator_imp.cc:582
iterator_imp.cc
Dune::ALU3dGridIntersectionIterator::index_
int index_
Definition: iterator.hh:273
Dune::ALU3dGridIntersectionIterator::unitOuterNormal
NormalType unitOuterNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:367
Dune::ALU3dGridEntity
Definition: entity.hh:22
Dune::ALU3dGridIntersectionIterator::done
void done(const EntityType &en)
Definition: iterator.hh:220
Dune::ALU3dGridLeafIterator::ThisType
ALU3dGridLeafIterator< cdim, pitype, GridImp > ThisType
Definition: iterator.hh:654
Dune::ALU3dGridLevelIntersectionIterator::conforming
bool conforming() const
return true if intersection is conforming
Definition: iterator.hh:362
Dune::ALU3dGridIntersectionIterator::twistInInside
Twist twistInInside() const
returns twist of face compared to inner element
Definition: iterator_imp.cc:302
Dune::ALU3dImplTraits< tetra, Comm >::BNDFaceType
GitterImplType::Objects::Hbnd3Default BNDFaceType
Definition: alu3dinclude.hh:275
Dune::ALU3dGridTreeIterator::GetLevel< GridImp, 0 >::getLevel
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:417
Dune::ALU3dGridHierarchicIterator::Entity
GridImp::template Codim< 0 >::Entity Entity
Definition: iterator.hh:775
Dune::ALU3dGridIntersectionIterator::item_
const IMPLElementType * item_
current element from which we started the intersection iterator
Definition: iterator.hh:267
Dune::ALU3dGridIntersectionIterator::NormalType
FieldVector< alu3d_ctype, dimworld > NormalType
Definition: iterator.hh:116
Dune::ALU3dGridIntersectionIterator::conforming
bool conforming() const
return true if intersection is conforming
Definition: iterator.hh:203
Dune::ALU3dGridIntersectionIterator::IntersectionIteratorType
IntersectionIteratorType
Definition: iterator.hh:98
Dune::ALU3dGridIntersectionIterator::intersectionNeighborLocal_
LocalGeometryImpl intersectionNeighborLocal_
Definition: iterator.hh:277
Dune::ALU3dGridIntersectionIterator::indexInOutside
int indexInOutside() const
Definition: iterator_imp.cc:295
Dune::ALU3dGridIntersectionIterator::setNewFace
void setNewFace(const GEOFaceType &newFace)
Definition: iterator_imp.cc:455
Dune::ALU3dGridLevelIterator::InternalIteratorType
IteratorType InternalIteratorType
Definition: iterator.hh:573
Dune::ALU3dGridIntersectionIterator::outside
EntityPointerImpl outside() const
access neighbor
Definition: iterator_imp.cc:234
Dune::ALU3dGridEntityPointer
Definition: entity.hh:26
Dune::ALU3dGridIntersectionIterator::type
GeometryType type() const
obtain the type of reference element for this intersection
Definition: iterator_imp.cc:385
Dune::ALU3dGridIntersectionIterator::Geometry
GridImp::template Codim< 1 >::Geometry Geometry
Definition: iterator.hh:108
Dune::ALU3dGridIntersectionIterator::connector_
FaceInfoType connector_
Definition: iterator.hh:263
Dune::ALU3dGridIntersectionIterator::first
void first(const EntityType &en, int wLevel, const bool conformingRefinement, const bool ghostCellsEnabled)
Definition: iterator_imp.cc:87
Dune::ALU3dGridIntersectionIterator::boundaryId
int boundaryId() const
return information about the Boundary
Definition: iterator_imp.cc:396
Dune::ALU3dGridIntersectionIterator::outsideLevel
int outsideLevel() const
Definition: iterator.hh:200
Dune
Definition: alu3dinclude.hh:79
Dune::ALU3dGridEntityPointer::Entity
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entity.hh:658
Dune::ALU3dGridIntersectionIterator::IntersectionBoth
Definition: iterator.hh:98
Dune::ALU3dGridLeafIterator::ALU3dGridLeafIterator
ALU3dGridLeafIterator()
default constructor
Definition: iterator.hh:657
Dune::ALU3dGridEntityPointerBase< cd, GridImp >
Dune::ALU3dGridIntersectionIterator::indexInInside
int indexInInside() const
Definition: iterator_imp.cc:278
Dune::ALU3dGridIntersectionIterator::done
void done()
Definition: iterator_imp.cc:38
Dune::ALU3dGridLevelIterator::ThisType
ALU3dGridLevelIterator< cd, pitype, GridImp > ThisType
typedef of my type
Definition: iterator.hh:570
Dune::ALUTwists
Definition: twists.hh:22
Dune::ALU3dGridLevelIntersectionIterator::assign
void assign(const ThisType &org)
assignment of iterators
Definition: iterator_imp.cc:574
topology.hh
Dune::ALU3dImplTraits< hexa, Comm >::BNDFaceType
GitterImplType::Objects::Hbnd4Default BNDFaceType
Definition: alu3dinclude.hh:314
Dune::ALU3dGridIntersectionIterator::getItem
const GEOFaceType & getItem() const
return current face
Definition: iterator.hh:209
Dune::ALU3dGridIntersectionIterator::invalidate
void invalidate()
Definition: iterator.hh:284
intersectioniteratorwrapper.hh
Provides proxy classes for IntersectionsIterators.