dune-alugrid  2.6-git
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 
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,
83 
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 
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<0>::EntityImp EntityImp;
109 
110  typedef typename GridImp::template Codim<1>::Geometry Geometry;
111  typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
112 
115  typedef Dune::Intersection< GridImp, Dune::ALU3dGridIntersectionIterator< GridImp > > Intersection;
116 
117  typedef FieldVector<alu3d_ctype, dimworld> NormalType;
118 
120  explicit ALU3dGridIntersectionIterator( const bool levelIntersectionIterator = false );
121 
124 
127 
129  bool equals (const ALU3dGridIntersectionIterator<GridImp> & i) const;
130 
132  void increment ();
133 
135  EntityImp outside() const;
136 
138  EntityImp inside() const;
139 
141  bool boundary () const;
142 
144  bool neighbor () const;
145 
147  int boundaryId () const;
148 
150  size_t boundarySegmentIndex() const;
151 
153  int segmentId() const;
154 
160 
165  Geometry geometry () const;
166 
168  GeometryType type () const;
169 
172  int indexInInside () const;
173 
178 
181  int indexInOutside () const;
182 
184  Twist twistInInside () const;
185 
187  Twist twistInOutside () const;
188 
191  NormalType unitOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const ;
192 
195  NormalType outerNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
196 
199  NormalType integrationOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
200 
202  int level () const;
203 
204  int outsideLevel () const { return connector_.outsideLevel(); }
205 
207  bool conforming () const
208  {
210  }
211 
213  const GEOFaceType& getItem() const { return connector_.face(); }
214 
216  int weight() const
217  {
218  return this->getItem().weight();
219  }
220 
221 protected:
222  // set interator to end iterator
223  void done () ;
224  template< class EntityType > void done ( const EntityType &en ) { done(); }
225 
226  // reset IntersectionIterator to first neighbour
227  void setFirstItem(const HElementType & elem, int wLevel);
228 
229  // reset IntersectionIterator to first neighbour
230  void setInteriorItem(const HElementType & elem,
231  const BNDFaceType& bnd, int wLevel);
232 
233  // reset IntersectionIterator to first neighbour
234  template <class EntityType>
235  void first(const EntityType & en, int wLevel, const GridImp& grid );
236 
237  // set new face
238  void setNewFace(const GEOFaceType& newFace);
239 
240 private:
241  // set new face (only LeafIntersectionIterator)
242  void setGhostFace(const GEOFaceType& newFace);
243 
244 protected:
245  // generate local geometries
246  void buildLocalGeometries() const;
247 
248  // get the face corresponding to the index
250  getFace ( const GEOTriangleBndType &bnd, int index ) const;
251 
252  // get the face corresponding to the index
254  getFace ( const GEOQuadBndType &bnd, int index ) const;
255 
256  // get the face corresponding to the index
258  getFace ( const GEOTetraElementType &elem, int index ) const;
259 
261  getFace ( const GEOHexaElementType &elem, int index ) const;
262 
266  mutable GeometryInfoType geoProvider_; // need to initialise
267 
269  const IMPLElementType* item_;
270 
272  const BNDFaceType* ghost_;
273 
275  const GridImp* grid_;
276 
277  mutable int innerLevel_;
278  mutable int index_;
279 
283 
284  // unit outer normal
286 
287 public:
288  // used by SharedPointer
289  void invalidate() { done(); }
290  // refCount used by SharedPointer
291  unsigned int refCount_;
292 };
293 
294 template<class GridImp>
296 public ALU3dGridIntersectionIterator<GridImp>
297 {
298  enum { dim = GridImp::dimension };
299  enum { dimworld = GridImp::dimensionworld };
300 
301  typedef typename GridImp::MPICommunicatorType Comm;
302 
304 
305  typedef typename ImplTraits::HElementType HElementType ;
306  typedef typename ImplTraits::GEOElementType GEOElementType;
307  typedef typename ImplTraits::IMPLElementType IMPLElementType;
308  typedef typename ImplTraits::GEOFaceType GEOFaceType;
309  typedef typename ImplTraits::NeighbourPairType NeighbourPairType;
310  typedef typename ImplTraits::BNDFaceType BNDFaceType;
311 
313 
314  typedef typename std::conditional<
315  tetra == GridImp::elementType,
318 
321 
322  enum { numFaces = (dim==3) ? EntityCount<GridImp::elementType>::numFaces : (GridImp::elementType==tetra ? 3 : 4) };
323  enum { numVerticesPerFace =
324  GeometryInfoType::numVerticesPerFace };
325  enum { numVertices = (dim==3) ? EntityCount<GridImp::elementType>::numVertices : (GridImp::elementType==tetra ? 3 : 4)};
326 
329 
330  friend class ALU3dGridEntity<0,dim,GridImp>;
331  friend class IntersectionIteratorWrapper<GridImp,ThisType>;
332 protected:
333  using BaseType :: item_;
334  using BaseType :: ghost_;
335  using BaseType :: grid_;
337  using BaseType :: index_;
340  using BaseType :: boundary;
341  using BaseType :: done ;
342  using BaseType :: getFace;
343  using BaseType :: neighbor ;
344 
345 public:
348 
351 
353  void assign(const ThisType & org);
354 
356  void increment ();
357 
358  // reset IntersectionIterator to first neighbour
359  template <class EntityType>
360  void first(const EntityType & en, int wLevel, const GridImp& grid );
361 
363  bool neighbor () const;
364 
366  bool conforming () const
367  {
369  ( !neighbor() || this->connector_.conformanceState() == FaceInfoType::CONFORMING ) : true );
370  // for conforming refinement use base implementation
371  // otherwise its true
373  BaseType :: conforming() : true ;
374  }
375 
376 private:
377  // set new face
378  void setNewFace(const GEOFaceType& newFace);
379 
380  // reset IntersectionIterator to first neighbour
381  void setFirstItem(const HElementType & elem, int wLevel);
382 
383  // reset IntersectionIterator to first neighbour
384  void setInteriorItem(const HElementType & elem,
385  const BNDFaceType& bnd, int wLevel);
386 
387  bool levelNeighbor_;
388  bool isLeafItem_;
389 };
390 
392 //
393 // --IterationImpl
394 //
396 template <class InternalIteratorType >
398 {
399 public:
400  typedef typename InternalIteratorType :: val_t val_t;
401 
402  // here the items level will do
403  template <class GridImp, int dim, int codim>
404  class GetLevel
405  {
406  public:
407  template <class ItemType>
408  static int getLevel(const GridImp & grid, const ItemType & item, int level )
409  {
410  alugrid_assert ( & item );
411  return (level < 0) ? item.level() : level;
412  }
413  };
414 
415  // level is not needed for codim = 0
416  template <class GridImp, int dim>
417  class GetLevel<GridImp,dim,0>
418  {
419  public:
420  template <class ItemType>
421  static int getLevel(const GridImp & grid, const ItemType & item, int level )
422  {
423  return level;
424  }
425  };
426 
427  template <class GridImp, int dim>
428  class GetLevel<GridImp, dim, dim>
429  {
430  public:
431  template <class ItemType>
432  static int getLevel(const GridImp & grid, const ItemType & item, int level)
433  {
434  return (level < 0) ? grid.getLevelOfLeafVertex(item) : level;
435  }
436  };
437 
438 protected:
439  // set iterator to first item
440  template <class GridImp, class IteratorImp>
441  void firstItem(const GridImp & grid, IteratorImp & it, int level )
442  {
443  InternalIteratorType & iter = it.internalIterator();
444  iter.first();
445  ValidItem<IteratorImp::codimension, GridImp> validate;
446  while(!validate(grid,iter))
447  {
448  iter.next();
449  if(iter.done())
450  {
451  it.removeIter();
452  return ;
453  }
454  }
455  if( ! iter.done() )
456  {
457  alugrid_assert ( iter.size() > 0 );
458  setItem(grid,it,iter,level);
459  }
460  else
461  {
462  it.removeIter();
463  }
464  }
465 
466  // set the iterators entity to actual item
467  template <class GridImp, class IteratorImp>
468  void setItem (const GridImp & grid, IteratorImp & it, InternalIteratorType & iter, int level)
469  {
470  enum { codim = IteratorImp :: codimension };
471  val_t & item = iter.item();
472  alugrid_assert ( item.first || item.second );
473  if( item.first )
474  {
475  it.updateEntityPointer( item.first ,
476  GetLevel<GridImp,GridImp::dimension,codim>::getLevel(grid, *(item.first) , level) );
477  }
478  else
479  it.updateGhostPointer( *item.second );
480  }
481 
482  // increment iterator
483  template <class GridImp, class IteratorImp>
484  void incrementIterator(const GridImp & grid, IteratorImp & it, int level)
485  {
486  // if iter_ is zero, then end iterator
487  InternalIteratorType & iter = it.internalIterator();
488  ValidItem<IteratorImp::codimension, GridImp> validate;
489  do{
490  iter.next();
491 
492  if(iter.done())
493  {
494  it.removeIter();
495  return ;
496  }
497 
498  }while(!(validate(grid,iter) ) );
499 
500  setItem(grid,it,iter,level);
501  return ;
502  }
503 
504 private:
505  // in 2d check if item is valid
506  template <int codim, class GridImp>
507  struct ValidItem
508  {
509  bool operator()(const GridImp & grid, InternalIteratorType & iter)
510  {
511  if(GridImp::dimension ==3 || iter.done()) return true;
512  else if (GridImp::dimension == 2)
513  {
514  typedef typename ALU3dImplTraits<GridImp::elementType, typename GridImp::MPICommunicatorType>::template Codim<GridImp::dimension, codim>::ImplementationType GEOElementType;
515  val_t & item = iter.item();
516  alugrid_assert ( item.first || item.second );
517  if( item.first )
518  {
519  GEOElementType* elem = static_cast<GEOElementType*> (item.first);
520  //an element is valid if the 2d flag is set
521  return elem->is2d();
522  }
523  //if we have a ghost entity, it is the right one, as we did not insert non-2d elements into the ghostlist
524  // see alu3diterators.hh method updateGhostlist
525  else if( item.second )
526  return true;
527  }
528  return false;
529  }
530  };
531 
532  template <class GridImp>
533  struct ValidItem<0, GridImp>
534  {
535  bool operator()(const GridImp & grid, InternalIteratorType & iter)
536  {
537  return true;
538  }
539  };
540 
541 };
542 
543 //**********************************************************************
544 //
545 // --ALU3dGridLevelIterator
546 // --LevelIterator
550 template<int cd, PartitionIteratorType pitype, class GridImp>
552 : public ALU3dGridEntityPointer< cd, GridImp >,
553  public ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, typename GridImp::MPICommunicatorType > >
554 {
555  enum { dim = GridImp::dimension };
556  enum { dimworld = GridImp::dimensionworld };
557 
558  typedef typename GridImp::MPICommunicatorType Comm;
559 
560  friend class ALU3dGridEntity<3,dim,GridImp>;
561  friend class ALU3dGridEntity<2,dim,GridImp>;
562  friend class ALU3dGridEntity<1,dim,GridImp>;
563  friend class ALU3dGridEntity<0,dim,GridImp>;
564  friend class ALU3dGrid< dim, dimworld, GridImp::elementType, Comm >;
565 
566  friend class ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, Comm > >;
567  typedef ALU3dGridEntityPointer< cd, GridImp > BaseType;
568 
569 public:
570  typedef typename GridImp::template Codim<cd>::Entity Entity;
572 
574  typedef ALU3dGridLevelIterator<cd,pitype,GridImp> ThisType;
575  // the wrapper for the original iterator of the ALU3dGrid
576  typedef typename ALU3DSPACE ALU3dGridLevelIteratorWrapper< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, pitype, Comm > IteratorType;
578  typedef typename ALU3DSPACE IteratorElType< (GridImp::dimension == 2 && cd == 2) ? 3 : cd, Comm >::val_t val_t;
579 
581  ALU3dGridLevelIterator () : grid_( nullptr ), iter_(), level_( 0 ) {}
582 
584  ALU3dGridLevelIterator(const GridImp& grid, int level, bool);
585 
587  ALU3dGridLevelIterator(const GridImp& grid, int level);
588 
590  ALU3dGridLevelIterator(const ThisType & org);
591 
592  // destructor
594 
596  void increment ();
597 
599  void releaseEntity () {}
600 
602  ThisType & operator = (const ThisType & org);
603 private:
605  void assign (const ThisType & org);
606 
607  const GridImp &grid () const { alugrid_assert( grid_ ); return *grid_; }
608 
609  // reference to factory class (ie grid)
610  const GridImp *grid_;
611 
612  // the internal iterator
613  std::unique_ptr< IteratorType > iter_ ;
614 
615  // actual level
616  int level_;
617 
618  // deletes iter_
619  void removeIter ();
620 
621  IteratorType & internalIterator ()
622  {
623  alugrid_assert ( iter_ );
624  return *iter_;
625  }
626 };
627 
628 //********************************************************************
629 //
630 // --ALU3dGridLeafIterator
631 // --LeafIterator
632 //
633 //********************************************************************
635 template<int cdim, PartitionIteratorType pitype, class GridImp>
637 : public ALU3dGridEntityPointer< cdim, GridImp >,
638  public ALU3dGridTreeIterator< ALU3DSPACE ALU3dGridLeafIteratorWrapper< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, pitype, typename GridImp::MPICommunicatorType > >
639 {
640  enum { dim = GridImp :: dimension };
641 
642  friend class ALU3dGridEntity<cdim,dim,GridImp>;
643  enum { codim = cdim };
644 
645  typedef typename GridImp::MPICommunicatorType Comm;
646 
648 
649 public:
650  typedef typename GridImp::template Codim<cdim>::Entity Entity;
651 
652  typedef typename ALU3DSPACE ALU3dGridLeafIteratorWrapper< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, pitype, Comm > IteratorType ;
653  friend class ALU3dGridTreeIterator< IteratorType > ;
654 
656  typedef typename ALU3DSPACE IteratorElType< (GridImp::dimension == 2 && cdim == 2) ? 3 : cdim, Comm >::val_t val_t;
657 
659 
661  ALU3dGridLeafIterator () : grid_( nullptr ), iter_() {}
662 
664  ALU3dGridLeafIterator(const GridImp& grid, int level);
665 
667  ALU3dGridLeafIterator(const GridImp& grid, int level , bool isBegin);
668 
670  ALU3dGridLeafIterator(const ThisType & org);
671 
674 
676  void increment ();
677 
679  void releaseEntity () {}
680 
682  ThisType & operator = (const ThisType & org);
683 
684 private:
685  const GridImp &grid () const { alugrid_assert( grid_ ); return *grid_; }
686 
687  // reference to grid class (ie grid)
688  const GridImp *grid_;
689 
690  // the internal iterator
691  std::unique_ptr< IteratorType > iter_;
692 
694  void assign (const ThisType & org);
695 
696  // deletes iter_
697  void removeIter () ;
698 
699  // return reference to iter_
700  InternalIteratorType & internalIterator ()
701  {
702  alugrid_assert ( iter_ );
703  return *iter_;
704  }
705 };
706 
707 // - HierarchicIteraor
708 // --HierarchicIterator
709 template<class GridImp>
711 : public ALU3dGridEntityPointer<0,GridImp>
712 // public HierarchicIteratorDefaultImplementation <GridImp,ALU3dGridHierarchicIterator>
713 {
715  enum { dim = GridImp::dimension };
716 
717  typedef typename GridImp::MPICommunicatorType Comm;
718 
720  typedef typename ImplTraits::HElementType HElementType;
721  typedef typename ImplTraits::HBndSegType HBndSegType;
722 
723  template < class PointerType, class CommT >
724  class GhostElementStorage;
725 
727  template < class PointerType >
728  class GhostElementStorage< PointerType, ALUGridNoComm >
729  {
730  public:
731  GhostElementStorage() {}
732  explicit GhostElementStorage( const PointerType& ) {}
733  PointerType& operator * () { PointerType* p = 0; alugrid_assert ( false ); abort(); return *p; }
734  const PointerType* ghost () const { return 0; }
735  PointerType* nextGhost () const { return 0; }
736  PointerType* operator -> () const { return 0; }
737  bool operator != (const PointerType* ) const { return false; }
738  bool operator ! () const { return true ; }
739  GhostElementStorage& operator= (const GhostElementStorage& ) { return *this; }
740  GhostElementStorage& operator= (const PointerType* ) { return *this; }
741  bool valid () const { return false; }
742  };
743 
745  template < class PointerType >
746  class GhostElementStorage< PointerType, ALUGridMPIComm >
747  {
748  private:
749  // pointers to ghost and current ghost
750  const HBndSegType * ghost_;
751  HBndSegType * nextGhost_;
752  public:
753  GhostElementStorage() : ghost_( 0 ), nextGhost_( 0 ) {}
754  explicit GhostElementStorage( const PointerType& gh ) : ghost_( &gh ), nextGhost_( 0 ) {}
755  GhostElementStorage( const GhostElementStorage& org )
756  : ghost_( org.ghost_ ), nextGhost_( org.nextGhost_ ) {}
757 
758  PointerType& operator * () { alugrid_assert ( nextGhost_ ); return *nextGhost_; }
759  const PointerType* ghost () const { return ghost_; }
760  PointerType* nextGhost () const { return nextGhost_; }
761  PointerType* operator -> () { return nextGhost_; }
762  bool operator != (const PointerType* p ) const { return (nextGhost_ != p); }
763  bool operator ! () const { return nextGhost_ == 0; }
764  GhostElementStorage& operator= (const GhostElementStorage& org)
765  {
766  ghost_ = org.ghost_;
767  nextGhost_ = org.nextGhost_;
768  return *this;
769  }
770  GhostElementStorage& operator= (PointerType* p)
771  {
772  nextGhost_ = p;
773  return *this;
774  }
775  bool valid () const { return (ghost_ != 0); }
776  };
777 
778 public:
779  typedef typename GridImp::template Codim<0>::Entity Entity;
780  typedef typename GridImp::ctype ctype;
781 
783  ALU3dGridHierarchicIterator(const HElementType & elem,
784  int maxlevel, bool end );
785 
787  ALU3dGridHierarchicIterator(const HBndSegType& ghost,
788  int maxlevel,
789  bool end);
790 
793 
795  void increment();
796 
798  void releaseEntity () {}
799 
801  ThisType & operator = (const ThisType & org);
802 
803 private:
804  // assign iterator
805  void assign(const ThisType & org);
806 
808  int getLevel(const HElementType* item) const;
809 
811  int getLevel(const HBndSegType* face) const;
812 
813  // go to next valid element
814  template <class HItemType>
815  HItemType* goNextElement (const HItemType* startElem, HItemType * oldEl);
816 
818  const HElementType * elem_;
819 
820  // pointers to ghost and current ghost
821  GhostElementStorage< HBndSegType, Comm > ghostElem_;
822 
824  int maxlevel_;
825 };
826 
827 
828 } // end namespace Dune
829 
830 #include "iterator_imp.cc"
831 
832 #endif
#define ALU3DSPACE
Definition: alu3dinclude.hh:24
#define alugrid_assert(EX)
Definition: alugrid_assert.hh:20
Provides proxy classes for IntersectionsIterators.
Definition: alu3dinclude.hh:80
@ tetra
Definition: topology.hh:12
Definition: alu3dinclude.hh:259
Definition: alu3dinclude.hh:345
[ provides Dune::Grid ]
Definition: alugrid/3d/grid.hh:463
Definition: entity.hh:47
Definition: iterator.hh:554
ALU3DSPACE IteratorElType<(GridImp::dimension==2 &&cd==2) ? 3 :cd, Comm >::val_t val_t
Definition: iterator.hh:578
void increment()
prefix increment
Definition: iterator.cc:112
ALU3DSPACE ALU3dGridLevelIteratorWrapper<(GridImp::dimension==2 &&cd==2) ? 3 :cd, pitype, Comm > IteratorType
Definition: iterator.hh:576
void releaseEntity()
release entity
Definition: iterator.hh:599
ThisType & operator=(const ThisType &org)
assignment of iterators
Definition: iterator.cc:104
ALU3dGridLevelIterator< cd, pitype, GridImp > ThisType
typedef of my type
Definition: iterator.hh:574
~ALU3dGridLevelIterator()
Definition: iterator.cc:65
ALU3dGridLevelIterator()
default constructor
Definition: iterator.hh:581
IteratorType InternalIteratorType
Definition: iterator.hh:577
Definition: entity.hh:629
GridImp::MPICommunicatorType Comm
Definition: entity.hh:636
GridImp::template Codim< cd >::Entity Entity
type of Entity
Definition: entity.hh:658
Definition: iterator.hh:713
ALU3dGridHierarchicIterator(const HElementType &elem, int maxlevel, bool end)
the normal Constructor
Definition: iterator.cc:235
GridImp::ctype ctype
Definition: iterator.hh:780
void releaseEntity()
release entity
Definition: iterator.hh:798
GridImp::template Codim< 0 >::Entity Entity
Definition: iterator.hh:779
ThisType & operator=(const ThisType &org)
the assignment operator
Definition: iterator.cc:295
void increment()
increment
Definition: iterator.cc:376
Definition: iterator.hh:56
void increment()
increment iterator
Definition: iterator_imp.cc:182
GridImp::template Codim< 0 >::Entity Entity
Definition: iterator.hh:107
ALU3dGridIntersectionIterator< GridImp > ImplementationType
Definition: iterator.hh:113
void first(const EntityType &en, int wLevel, const GridImp &grid)
Definition: iterator_imp.cc:88
LocalGeometry geometryInInside() const
Definition: iterator_imp.cc:290
LocalGeometryImpl intersectionNeighborLocal_
Definition: iterator.hh:282
NormalType outerNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:338
int outsideLevel() const
Definition: iterator.hh:204
const GEOFaceType & getItem() const
return current face
Definition: iterator.hh:213
int boundaryId() const
return information about the Boundary
Definition: iterator_imp.cc:396
int indexInInside() const
Definition: iterator_imp.cc:282
void done()
Definition: iterator_imp.cc:38
void setInteriorItem(const HElementType &elem, const BNDFaceType &bnd, int wLevel)
Definition: iterator_imp.cc:66
const BNDFaceType * ghost_
current pointer to ghost face if iterator was started from ghost element
Definition: iterator.hh:272
void done(const EntityType &en)
Definition: iterator.hh:224
GridImp::template Codim< 1 >::Geometry Geometry
Definition: iterator.hh:110
const ALU3dImplTraits< tetra, Comm >::GEOFaceType * getFace(const GEOTriangleBndType &bnd, int index) const
Definition: iterator_imp.cc:432
GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl
Definition: iterator.hh:101
EntityImp inside() const
access entity where iteration started
Definition: iterator_imp.cc:255
Geometry geometry() const
Definition: iterator_imp.cc:376
int index_
Definition: iterator.hh:278
int segmentId() const
return the segment id (non-consecutive)
Definition: iterator_imp.cc:414
unsigned int refCount_
Definition: iterator.hh:291
void setFirstItem(const HElementType &elem, int wLevel)
Definition: iterator_imp.cc:49
GeometryImpl intersectionGlobal_
Definition: iterator.hh:280
GeometryInfoType geoProvider_
Definition: iterator.hh:266
IntersectionIteratorType
Definition: iterator.hh:98
@ IntersectionLeaf
Definition: iterator.hh:98
@ IntersectionLevel
Definition: iterator.hh:98
@ IntersectionBoth
Definition: iterator.hh:98
NormalType integrationOuterNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:330
int level() const
return level of iterator (level of item)
Definition: iterator_imp.cc:487
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: iterator.hh:111
EntityImp outside() const
access neighbor
Definition: iterator_imp.cc:238
bool boundary() const
return true if intersection is with boundary.
Definition: iterator_imp.cc:269
const GridImp * grid_
pointer to grid implementation
Definition: iterator.hh:275
Twist twistInInside() const
returns twist of face compared to inner element
Definition: iterator_imp.cc:306
Twist twistInOutside() const
returns twist of face compared to outer element
Definition: iterator_imp.cc:313
NormalType unitOuterNormal(const FieldVector< alu3d_ctype, dim-1 > &local) const
Definition: iterator_imp.cc:367
LocalGeometry geometryInOutside() const
Definition: iterator_imp.cc:320
void invalidate()
Definition: iterator.hh:289
int innerLevel_
Definition: iterator.hh:277
GridImp::template Codim< 0 >::EntityImp EntityImp
Definition: iterator.hh:108
bool equals(const ALU3dGridIntersectionIterator< GridImp > &i) const
The copy constructor.
Definition: iterator_imp.cc:172
FaceInfoType connector_
Definition: iterator.hh:265
void buildLocalGeometries() const
Definition: iterator_imp.cc:422
void setNewFace(const GEOFaceType &newFace)
Definition: iterator_imp.cc:465
FieldVector< alu3d_ctype, dimworld > NormalType
Definition: iterator.hh:117
NormalType unitOuterNormal_
Definition: iterator.hh:285
Twists::Twist Twist
Definition: iterator.hh:105
void assign(const ALU3dGridIntersectionIterator< GridImp > &org)
assignment of iterators
Definition: iterator_imp.cc:146
LocalGeometryImpl intersectionSelfLocal_
Definition: iterator.hh:281
bool neighbor() const
return true if across the face an neighbor on leaf exists
Definition: iterator_imp.cc:275
GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl
Definition: iterator.hh:100
const IMPLElementType * item_
current element from which we started the intersection iterator
Definition: iterator.hh:269
bool conforming() const
return true if intersection is conforming
Definition: iterator.hh:207
int weight() const
return communication weight
Definition: iterator.hh:216
Dune::Intersection< GridImp, Dune::ALU3dGridIntersectionIterator< GridImp > > Intersection
type of the intersection
Definition: iterator.hh:115
GeometryType type() const
obtain the type of reference element for this intersection
Definition: iterator_imp.cc:385
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: iterator_imp.cc:404
ALU3dGridIntersectionIterator(const bool levelIntersectionIterator=false)
The default Constructor.
Definition: iterator_imp.cc:26
int indexInOutside() const
Definition: iterator_imp.cc:299
Leaf iterator.
Definition: iterator.hh:639
ALU3dGridLeafIterator< cdim, pitype, GridImp > ThisType
Definition: iterator.hh:658
GridImp::template Codim< cdim >::Entity Entity
Definition: iterator.hh:650
void increment()
prefix increment
Definition: iterator.cc:216
IteratorType InternalIteratorType
Definition: iterator.hh:655
void releaseEntity()
release entity
Definition: iterator.hh:679
ThisType & operator=(const ThisType &org)
assignment of iterators
Definition: iterator.cc:179
ALU3dGridLeafIterator()
default constructor
Definition: iterator.hh:661
ALU3DSPACE ALU3dGridLeafIteratorWrapper<(GridImp::dimension==2 &&cdim==2) ? 3 :cdim, pitype, Comm > IteratorType
Definition: iterator.hh:652
~ALU3dGridLeafIterator()
destructor deleting real iterator
Definition: iterator.cc:163
ALU3DSPACE IteratorElType<(GridImp::dimension==2 &&cdim==2) ? 3 :cdim, Comm >::val_t val_t
Definition: iterator.hh:656
int level() const
ask for level of entities
Definition: entity.hh:524
int outsideLevel() const
Definition: faceutility_imp.cc:358
bool conformingRefinement() const
return true if conforming refinement is enabled
Definition: faceutility.hh:139
const GEOFaceType & face() const
Returns the ALU3dGrid face.
Definition: faceutility_imp.cc:321
ConformanceState conformanceState() const
Description of conformance on the face.
Definition: faceutility_imp.cc:439
Definition: faceutility.hh:323
Definition: faceutility.hh:367
Definition: iterator.hh:297
void assign(const ThisType &org)
assignment of iterators
Definition: iterator_imp.cc:588
void first(const EntityType &en, int wLevel, const GridImp &grid)
Definition: iterator_imp.cc:515
ALU3dGridLevelIntersectionIterator()
The default Constructor.
Definition: iterator_imp.cc:505
bool conforming() const
return true if intersection is conforming
Definition: iterator.hh:366
void increment()
increment iterator
Definition: iterator_imp.cc:596
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: iterator_imp.cc:621
Definition: iterator.hh:40
Definition: iterator.hh:398
void incrementIterator(const GridImp &grid, IteratorImp &it, int level)
Definition: iterator.hh:484
InternalIteratorType ::val_t val_t
Definition: iterator.hh:400
void firstItem(const GridImp &grid, IteratorImp &it, int level)
Definition: iterator.hh:441
void setItem(const GridImp &grid, IteratorImp &it, InternalIteratorType &iter, int level)
Definition: iterator.hh:468
Definition: iterator.hh:405
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:408
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:421
static int getLevel(const GridImp &grid, const ItemType &item, int level)
Definition: iterator.hh:432
Definition: topology.hh:15
Definition: topology.hh:40
Definition: topology.hh:151
type of class for specialization of serial ALUGrid (No_Comm as communicator)
Definition: declaration.hh:31
type of class for specialization of parallel ALUGrid (MPI_Comm as communicator)
Definition: declaration.hh:39
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:26
Definition: twists.hh:23