dune-alugrid 3.0.0
alu3diterators.hh
Go to the documentation of this file.
1#ifndef DUNE_ALU3DITERATORS_HH
2#define DUNE_ALU3DITERATORS_HH
3
4// Dune includes
5#include <dune/grid/common/grid.hh>
6
7// Local includes
8#include "alu3dinclude.hh"
9#include "topology.hh"
10
11namespace ALUGrid
12{
13
14 //*************************************************************
15 // definition of original LeafIterators of ALUGrid
16 //
17 // default is element (codim = 0)
18 template< int codim, class Comm >
20 {
22 typedef typename AccessIterator< HElementType >::Handle IteratorType;
23 };
24
25 //******************************************************************
26 // LevelIterators
27 //******************************************************************
28 template< int codim, class Comm >
30
31 template< class Comm >
36
37 template< class Comm >
42
43 template< class Comm >
48
49 template< class Comm >
54
55
56 //*********************************************************
57 // LevelIterator Wrapper
58 //*********************************************************
59 template< class val_t >
61 : public IteratorSTI< val_t >
62 {
63 public:
65
66 virtual int size () = 0;
67 virtual void next () = 0;
68 virtual void first() = 0;
69 virtual int done () const = 0;
70 virtual val_t & item () const = 0;
71 virtual IteratorSTI< val_t > * clone () const { alugrid_assert (false); abort(); return 0; }
72 };
73
74 typedef Dune::PartitionIteratorType PartitionIteratorType;
75
76 // defines the pair of element and boundary
77 template< int codim, class Comm >
79 {
82 typedef std::pair< ElType *, HBndSegType * > val_t;
83 };
84
85 template< int codim, PartitionIteratorType pitype, class Comm >
87
88 // the element level iterator
89 template< PartitionIteratorType pitype, class Comm >
90 class ALU3dGridLevelIteratorWrapper< 0, pitype, Comm >
91 : public IteratorWrapperInterface< typename IteratorElType< 0, Comm >::val_t >
92 {
93 typedef typename IteratorElType< 0, Comm >::ElType ElType;
94 typedef typename IteratorElType< 0, Comm >::HBndSegType HBndSegType;
95 typedef ALU3DSPACE LevelIterator< ElType > IteratorType;
96
97 // the iterator
98 IteratorType it_;
99
100 public:
102 mutable val_t elem_;
103
104 // constructor creating iterator
105 template< class GridImp >
106 ALU3dGridLevelIteratorWrapper ( const GridImp &grid, int level, const int nlinks )
107 : it_( grid.myGrid(), level ),
108 elem_( (ElType *)0, (HBndSegType *)0 )
109 {}
110
111 // copy constructor
113 : it_( org.it_ ), elem_(org.elem_)
114 {
115 }
116
117 int size () { return it_->size(); }
118 void next () { it_->next(); }
119 void first() { it_->first(); }
120 int done () const { return it_->done(); }
121 val_t & item () const
122 {
123 alugrid_assert ( ! done () );
124 elem_.first = & it_->item();
125 return elem_;
126 }
127 };
128
129 // the face level iterator
130 template< PartitionIteratorType pitype, class Comm >
131 class ALU3dGridLevelIteratorWrapper< 1, pitype, Comm >
132 : public IteratorWrapperInterface< typename IteratorElType< 1, Comm >::val_t >
133 {
134 typedef typename IteratorElType< 1, Comm >::ElType ElType;
135 typedef typename IteratorElType< 1, Comm >::HBndSegType HBndSegType;
136 typedef ALU3DSPACE any_has_level_periodic< ElType > StopRule_t;
137 typedef GridIterator< ElType, StopRule_t > IteratorType;
138
139 // the iterator
140 IteratorType it_;
141
142
143 public:
145 mutable val_t elem_;
146
147 // constructor creating iterator
148 template< class GridImp >
149 ALU3dGridLevelIteratorWrapper ( const GridImp &grid, int level, const int nlinks )
150 : it_( grid.myGrid(), StopRule_t(level) ),
151 elem_( (ElType *)0, (HBndSegType*)0 )
152 {}
153
154 // copy constructor
156 : it_( org.it_ ), elem_(org.elem_)
157 {}
158
159 int size () { return it_->size(); }
160 void next () { it_->next(); }
161 void first() { it_->first(); }
162 int done () const { return it_->done(); }
163 val_t & item () const
164 {
165 alugrid_assert ( ! done () );
166 elem_.first = & it_->item();
167 return elem_;
168 }
169 };
170
171 // the vertex level iterator, little bit different to the others
172 // this implementation uses the vertex leaf iterator and runs over all
173 // vertices with level <= the given iteration level
174 template< PartitionIteratorType pitype, class Comm >
175 class ALU3dGridLevelIteratorWrapper< 3, pitype, Comm >
176 : public IteratorWrapperInterface< typename IteratorElType< 3, Comm >::val_t >
177 {
178 typedef typename IteratorElType< 3, Comm >::ElType ElType;
179 typedef typename IteratorElType< 3, Comm >::HBndSegType HBndSegType;
181 typedef typename VertexListType::IteratorType IteratorType;
182
183 public:
185
186 protected:
188 mutable val_t elem_;
189
190 mutable int count_;
191 const int size_;
192
193 public:
194 // constructor creating iterator
195 template< class GridImp >
196 ALU3dGridLevelIteratorWrapper ( const GridImp &grid, int level, const int nlinks )
197 : vxList_ ( grid.getVertexList( level ) ),
198 elem_( (ElType *)0, (HBndSegType *)0 ),
199 count_( 0 ),
200 size_( vxList_.size() )
201 {
202 alugrid_assert ( vxList_.up2Date() );
203 }
204
205 // copy constructor
207 : vxList_(org.vxList_),
208 elem_(org.elem_),
209 count_(org.count_),
210 size_(org.size_)
211 {
212 }
213
214 // returns size of leaf iterator, wrong here, return leaf size
215 int size () { return size_; }
216
218 void next ()
219 {
220 ++count_;
221 return ;
222 }
223
224 void first()
225 {
226 count_ = 0;
227 }
228 int done () const { return (count_ >= size_) ? 1 : 0; }
229 val_t & item () const
230 {
231 alugrid_assert ( ! done () );
232 elem_.first = vxList_.getItemList()[count_];
233 alugrid_assert ( elem_.first );
234 return elem_;
235 }
236 private:
237 val_t & getItem () const
238 {
239 //elem_.first = vxList_.getItemList()[count_];
240 alugrid_assert ( ! done () );
241 elem_.first = vxList_.getItemList()[count_];
242 return elem_;
243 }
244 };
245
246 template< int codim, PartitionIteratorType pitype, class Comm >
248
249 //typedef std::pair< ALUHElementType<0>::ElementType * , HBndSegType * > LeafValType;
250 //typedef IteratorWrapperInterface<LeafValType> IteratorWrapperInterfaceType;
251
252 //**********************************************************
253 // LeafIterator Wrapper
254 //**********************************************************
255 template< PartitionIteratorType pitype, class Comm >
256 class ALU3dGridLeafIteratorWrapper< 0, pitype, Comm >
257 : public IteratorWrapperInterface< typename IteratorElType< 0, Comm >::val_t >
258 {
259 typedef typename IteratorElType< 0, Comm >::ElType ElType;
260 typedef typename IteratorElType< 0, Comm >::HBndSegType HBndSegType;
261 typedef LeafIterator< ElType > IteratorType;
262
263 // the ALU3dGrid Iterator
264 IteratorType it_;
265
266 public:
268
269 private:
270 mutable val_t elem_;
271
272 public:
273 // constructor creating Iterator
274 template< class GridImp >
275 ALU3dGridLeafIteratorWrapper ( const GridImp &grid, int level, const int links )
276 : it_( grid.myGrid() ),
277 elem_( (ElType *)0, (HBndSegType *)0 )
278 {}
279
280 // constructor copying iterator
282 : it_( org.it_ ), elem_(org.elem_)
283 {}
284
285 int size () { return it_->size(); }
286 void next () { it_->next(); }
287 void first() { it_->first(); }
288 int done () const { return it_->done(); }
289 val_t & item () const
290 {
291 alugrid_assert ( ! done () );
292 elem_.first = & it_->item();
293 return elem_;
294 }
295 };
296
297 template< class ElType, PartitionIteratorType pitype, class Comm >
299 {
300 typedef is_leaf_entity< ElType > StopRule_t;
301 };
302
303 // only in parallel we need only the interior items, in serial all items
304 // are interior, to make the check fasterm this is only in parallel
305 // implemented
306 template< class ElType >
307 struct LeafStopRule< ElType, Dune::Interior_Partition, Dune::ALUGridMPIComm >
308 {
309 typedef is_interior_leaf_entity< ElType > StopRule_t;
310 };
311
312 template< PartitionIteratorType pitype, class Comm >
313 class ALU3dGridLeafIteratorWrapper< 1, pitype, Comm >
314 : public IteratorWrapperInterface< typename IteratorElType< 1, Comm >::val_t >
315 {
316 typedef typename IteratorElType< 1, Comm >::ElType ElType;
317 typedef typename IteratorElType< 1, Comm >::HBndSegType HBndSegType;
318 typedef typename LeafStopRule< ElType, pitype, Comm >::StopRule_t StopRule_t;
319 typedef GridIterator< ElType, StopRule_t > IteratorType;
320
321 // the face iterator
322 IteratorType it_;
323
324 public:
326 private:
327 mutable val_t elem_;
328 public:
329 // constructor creating Iterator
330 template< class GridImp >
331 ALU3dGridLeafIteratorWrapper ( const GridImp &grid, int level, const int links )
332 : it_( grid.myGrid(), StopRule_t() ),
333 elem_( (ElType *)0, (HBndSegType *)0 )
334 {}
335
336 // constructor copying iterator
338 : it_( org.it_ ), elem_(org.elem_){}
339
343
344 int size () { return it_->size(); }
345 void next () { it_->next(); }
346 void first() { it_->first(); }
347 int done () const { return it_->done(); }
348 val_t & item () const
349 {
350 alugrid_assert ( ! done () );
351 elem_.first = & it_->item();
352 return elem_;
353 }
354
355 };
356
357 template< PartitionIteratorType pitype, class Comm >
358 class ALU3dGridLeafIteratorWrapper< 2, pitype, Comm >
359 : public IteratorWrapperInterface< typename IteratorElType< 2, Comm >::val_t >
360 {
361 typedef typename IteratorElType< 2, Comm >::ElType ElType;
362 typedef typename IteratorElType< 2, Comm >::HBndSegType HBndSegType;
363 typedef typename LeafStopRule< ElType, pitype, Comm >::StopRule_t StopRule_t;
364 typedef GridIterator< ElType, StopRule_t > IteratorType;
365
366 public:
368
369 private:
370 // the edge iterator
371 IteratorType it_;
372
373 mutable val_t elem_;
374
375 public:
376 // constructor creating Iterator
377 template< class GridImp >
378 ALU3dGridLeafIteratorWrapper ( const GridImp &grid, int level, const int links )
379 : it_( grid.myGrid(), StopRule_t() ),
380 elem_( (ElType *)0, (HBndSegType *)0 )
381 {}
382
383 // constructor copying iterator
385 : it_( org.it_ ), elem_(org.elem_) {}
386
387 int size () { return it_->size(); }
388 void next () { it_->next(); }
389 void first() { it_->first(); }
390 int done () const { return it_->done(); }
391 val_t & item () const
392 {
393 alugrid_assert ( ! done () );
394 elem_.first = & it_->item();
395 return elem_;
396 }
397 };
398
399
400 // the vertex leaf iterator, little bit different to the others
401 template< PartitionIteratorType pitype, class Comm >
402 class ALU3dGridLeafIteratorWrapper< 3, pitype, Comm >
403 : public IteratorWrapperInterface< typename IteratorElType< 3, Comm >::val_t >
404 {
405 typedef typename IteratorElType< 3, Comm >::ElType ElType;
406 typedef typename IteratorElType< 3, Comm >::HBndSegType HBndSegType;
408 typedef typename LeafVertexListType::IteratorType IteratorType;
409 typedef typename LeafVertexListType::ItemType VxItemType;
410 typedef typename LeafStopRule< ElType, pitype, Comm >::StopRule_t StopRule_t;
411
412 typedef typename LeafVertexListType :: IteratorType ListIteratorType;
413
414 public:
416
417 protected:
419 mutable val_t elem_;
420
421 mutable int count_;
422 const int size_;
423
424 const StopRule_t rule_;
425
426 public:
427 // constructor creating iterator
428 template< class GridImp >
429 ALU3dGridLeafIteratorWrapper ( const GridImp &grid, int level, const int nlinks )
430 : vxList_( grid.getLeafVertexList() ),
431 elem_( (ElType *)0, (HBndSegType *)0 ),
432 count_( 0 ),
433 size_( vxList_.size() ),
434 rule_()
435 {
436 alugrid_assert ( vxList_.up2Date() );
437 }
438
439 // copy constructor
441 : vxList_(org.vxList_)
442 , elem_(org.elem_)
443 , count_(org.count_) , size_(org.size_)
444 , rule_()
445 {
446 }
447
448 // returns size of leaf iterator, wrong here, return leaf size
449 int size () { return size_; }
450
452 void next ()
453 {
454 ++count_;
455 goNextValid();
456 return ;
457 }
458
459 void first()
460 {
461 count_ = 0;
462 goNextValid();
463 }
464 int done () const { return (count_ >= size_) ? 1 : 0; }
465 val_t & item () const
466 {
467 alugrid_assert ( ! done () );
468 alugrid_assert ( elem_.first );
469 return elem_;
470 }
471 private:
472 val_t & getItem () const
473 {
474 //elem_.first = vxList_.getItemList()[count_].first;
475 alugrid_assert ( ! done () );
476 elem_.first = vxList_.getItemList()[count_].first;
477 return elem_;
478 }
479 void goNextValid()
480 {
481 if( done() ) return ;
482 if( getItem().first == 0)
483 {
484 ++count_;
485 goNextValid();
486 }
487 else
488 {
489 alugrid_assert ( elem_.first );
490 if(! rule_( elem_.first ) )
491 {
492 ++count_;
493 goNextValid();
494 }
495 }
496 }
497 };
498
499 template< int codim >
501 {
502 // type is hface_STI or hedge_STI
504
506
507 typedef IteratorSTI< ElType > IteratorType;
508 IteratorType * inner_;
509 IteratorType * outer_;
510
511 public:
512 // constructor creating leafBorderIteratorTT
513 LeafLevelIteratorTTProxy( GitterImplType & gitter , int link )
514 {
515 std::pair < IteratorSTI< ElType > * , IteratorSTI< ElType > * >
516 p = gitter.leafBorderIteratorTT( (ElType *) 0 , link );
517
518 inner_ = p.first;
519 outer_ = p.second;
520 }
521
522 // constructor creating levelBorderIteratorTT
523 LeafLevelIteratorTTProxy( GitterImplType & gitter , int link , int level )
524 {
525 std::pair < IteratorSTI< ElType > * , IteratorSTI< ElType > * >
526 p = gitter.levelBorderIteratorTT( (ElType *) 0 , link , level );
527
528 inner_ = p.first;
529 outer_ = p.second;
530 }
531
533 : inner_(org.inner_->clone())
534 , outer_(org.outer_->clone())
535 {}
536
538 {
539 delete inner_;
540 delete outer_;
541 }
542
543 IteratorType & inner () { alugrid_assert (inner_); return *inner_; }
544 IteratorType & outer () { alugrid_assert (outer_); return *outer_; }
545 };
546
547
548 typedef std::pair< ALUHElementType< 0, Dune::ALUGridMPIComm >::ElementType *, Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HBndSegType * > LeafValType;
549
550 //****************************
551 //
552 // --GhostIterator
553 //
554 //****************************
556 : public IteratorWrapperInterface< LeafValType >
557 {
558 public:
560
563
564 protected:
566
567 // this tpye is hface_STI
569
571
573
574 typedef IteratorSTI < ElType > InnerIteratorType;
576
577 // number of links
578 const int nl_;
579
580 // current link
581 int link_;
582
584 public:
586 private:
587 // the pair of elementand boundary face
588 mutable val_t elem_;
589 // true if ghost cells are enabled
590 const bool ghostCellsEnabled_ ;
591 public:
592 typedef ElementPllXIF_t ItemType;
593
594 template< class GridImp >
595 ALU3dGridGhostIterator ( const GridImp &grid, int level, const int nlinks )
596 : gitter_( grid.myGrid() ),
597 iterTT_( 0 ),
598 it_( 0 ),
599 nl_( nlinks ),
600 link_( nlinks ), // makes default status == done
601 elem_( (HElementType *)0, (HBndSegType *)0 ),
602 ghostCellsEnabled_( grid.ghostCellsEnabled() )
603 {}
604
606 : gitter_(org.gitter_)
607 , iterTT_(0) , it_(0)
608 , nl_(org.nl_)
609 , link_(org.link_)
610 , usingInner_(false)
611 , elem_(org.elem_)
612 , ghostCellsEnabled_( org.ghostCellsEnabled_ )
613 {
614 if( org.iterTT_ )
615 {
616 iterTT_ = new IteratorType ( *org.iterTT_ );
618 if( org.it_ )
619 {
620 alugrid_assert ( ! org.it_->done() );
621 it_ = (usingInner_) ? &( iterTT_->inner() ) : &( iterTT_->outer() );
622 }
623 }
624 }
625
630
631 protected:
633 {
634 return new IteratorType ( gitter_, link_ );
635 }
636
638 {
639 if(iterTT_) delete iterTT_;
640 iterTT_ = 0;
641 it_ = 0;
642 usingInner_ = false;
643 }
644
646 {
648
649 if (!usingInner_)
650 {
651 ++link_;
652
654 if(link_ < nl_)
655 {
659 if (!it_) createIterator();
660 }
661 }
662 }
663
665 {
666 it_ = 0;
667 if (!usingInner_)
668 {
670 it_ = &( iterTT_->inner() );
671 InnerIteratorType & it = iterTT_->inner();
672 it.first();
673 if(!it.done())
674 {
675 usingInner_ = true;
676 std::pair < ElementPllXIF_t *, int > p = it.item ().accessPllX ().accessOuterPllX () ;
677 std::pair< HElementType *, HBndSegType * > elems( (HElementType *)0, (HBndSegType *)0 );
678 p.first->getAttachedElement(elems);
679
680 alugrid_assert ( elems.first || elems.second );
681
682 if(elems.second)
683 {
684 return;
685 }
686 }
687 }
688
689 usingInner_ = false;
690 InnerIteratorType & out = iterTT_->outer();
691 out.first();
692 if(!out.done())
693 {
694 std::pair < ElementPllXIF_t *, int > p = out.item ().accessPllX ().accessOuterPllX () ;
695 std::pair< HElementType *, HBndSegType * > elems( (HElementType *)0, (HBndSegType *)0 );
696 p.first->getAttachedElement(elems);
697
698 alugrid_assert ( elems.second );
699 it_ = &out;
700 return ;
701 }
702
703 it_ = 0;
704 }
705
706 virtual void checkLeafEntity ()
707 {
708 if(it_)
709 {
710 if(!it_->done())
711 {
712 val_t & el = item();
713 HBndSegType * pll = el.second;
714 alugrid_assert ( pll );
715
716 // this occurs if internal element is leaf but the corresponding
717 // ghost is not leaf, we have to go next
718 if ( ! pll->isLeafEntity() ) next();
719 }
720 }
721 }
722
723 public:
724 int size () // ???? gives size only of small part of ghost cells ????
725 {
726 // if no iterator then size is zero
727 // which can happen in the case of parallel grid with 1 processor
728 if(!it_)
729 {
730 return 0;
731 }
732 return it_->size();
733 }
734
735 // go next ghost
736 void next ()
737 {
738 if(it_)
739 {
740 // if not done increment
741 if( !it_->done() ) it_->next();
742
743 // if now done, create new iterator
744 if( it_->done() ) createIterator();
745
747 }
748 }
749
750 void first()
751 {
752 if( ghostCellsEnabled_ )
753 {
754 link_ = -1;
755 usingInner_ = false;
756 // create iterator calls also first of iterators
759 if( it_ ) alugrid_assert ( !it_->done());
760 }
761 }
762
763 int done () const
764 {
765 alugrid_assert ( (link_ >= nl_) ? (it_ == 0) : 1 );
766 return ((link_ >= nl_ || !it_ ) ? 1 : 0);
767 }
768
769 val_t & item () const
770 {
772 std::pair < ElementPllXIF_t *, int > p = it_->item ().accessPllX ().accessOuterPllX () ;
773 std::pair < HElementType * , HBndSegType * > p2;
774 p.first->getAttachedElement(p2);
775 alugrid_assert (p2.second);
776 elem_.second = p2.second;
777 return elem_;
778 }
779
780 }; // end ALU3dGridGhostIterator
781
782
783 // the leaf ghost partition iterator
784 template<>
787 {
788 protected:
791 {
792 return new IteratorType ( this->gitter_, this->link_ );
793 }
794
796 {
797 if(this->it_)
798 {
799 if(! this->it_->done())
800 {
801 val_t & el = this->item();
802 HBndSegType * pll = el.second;
803 alugrid_assert ( pll );
804
805 // this occurs if internal element is leaf but the corresponding
806 // ghost is not leaf, we have to go next
807 if ( ! pll->isLeafEntity() ) this->next();
808 }
809 }
810 }
811
812 public:
813 template <class GridImp>
814 ALU3dGridLeafIteratorWrapper(const GridImp & grid, int level , const int nlinks )
815 : ALU3dGridGhostIterator(grid,level,nlinks) {}
816
819 };
820
821 // the level ghost partition iterator
822 template<>
825 {
826 const int level_;
827 const int mxl_;
828 protected:
831 {
832 // create new level Iterator Proxy
833 return new IteratorType ( this->gitter_, this->link_ , level_ );
834 }
835
836 // for level iterators don't check leaf entity
838 {
839 if(this->it_)
840 {
841 if(! this->it_->done())
842 {
843 val_t & el = this->item();
844
845 alugrid_assert ( el.second );
846 HBndSegType & pll = *(el.second);
847
848 // this occurs if internal element is leaf but the corresponding
849 // ghost is not leaf, we have to go next if level of ghost is not
850 // our level
851 if ( ! pll.down() )
852 {
853 if( pll.ghostLevel() != level_ ) this->next();
854 }
855 }
856 }
857 }
858
859 public:
860 template <class GridImp>
861 ALU3dGridLevelIteratorWrapper(const GridImp & grid,int level , const int nlinks )
862 : ALU3dGridGhostIterator(grid,level,nlinks)
863 , level_(level) , mxl_(grid.maxLevel()){}
864
866 : ALU3dGridGhostIterator(org) , level_(org.level_) , mxl_(org.mxl_){}
867 };
868
870 //
871 // Helper class to get item from Helement
872 //
874 template< class GridImp, int cd >
875 struct GetItem;
876
877 template< class GridImp >
878 struct GetItem< GridImp, 1 >
879 {
880 enum { cd = 1 };
881 enum { elType = GridImp::elementType };
882
883 typedef typename GridImp::MPICommunicatorType Comm;
884
888
889 static ItemType *getItem ( HElementType &el, int i )
890 {
891 return static_cast< GEOElementType & >( el ).myhface( i );
892 }
893
894 static int numItems ()
895 {
897 }
898 };
899
900 template< class GridImp >
901 struct GetItem< GridImp, 2 >
902 {
903 enum { cd = 2 };
904 enum { elType = GridImp::elementType };
905
906 typedef typename GridImp::MPICommunicatorType Comm;
907
911
912 static ItemType *getItem ( HElementType &el, int i )
913 {
914 return static_cast< GEOElementType & >( el ).myhedge( i );
915 }
916
917 static int numItems ()
918 {
920 }
921 };
922
923 template< class GridImp >
924 struct GetItem< GridImp, 3 >
925 {
926 enum { cd = 3 };
927 enum { elType = GridImp::elementType };
928
929 typedef typename GridImp::MPICommunicatorType Comm;
930
934
935 static ItemType *getItem ( HElementType &el, int i )
936 {
937 return static_cast< GEOElementType & >( el ).myvertex( i );
938 }
939
940 static int numItems ()
941 {
943 }
944 };
945
946
948 template< int codim >
950 : public IteratorWrapperInterface< typename IteratorElType< codim, Dune::ALUGridMPIComm >::val_t >
951 {
952 public:
958
959 private:
960 template< Dune::ALU3dGridElementType elType, int cd >
961 struct SelectVector;
962
963 template< Dune::ALU3dGridElementType elType >
964 struct SelectVector< elType, 1 >
965 {
967
968 static const std::vector< int > &getNotOnItemVector ( int face )
969 {
970 return GEOElementType::facesNotOnFace( face );
971 }
972 };
973
974 template< Dune::ALU3dGridElementType elType >
975 struct SelectVector< elType, 2 >
976 {
978 static const std::vector< int > &getNotOnItemVector( int face )
979 {
980 return GEOElementType::edgesNotOnFace( face );
981 }
982 };
983
984 template< Dune::ALU3dGridElementType elType >
985 struct SelectVector< elType, 3 >
986 {
988 static const std::vector< int > &getNotOnItemVector ( int face )
989 {
990 return GEOElementType::verticesNotOnFace( face );
991 }
992 };
993
994 typedef ElType *getItemFunc_t ( HElementType &el, int i );
995
996 private:
997 typedef Dune :: ALU3dGridItemListType GhostItemListType;
998 GhostItemListType &ghList_;
999 typedef typename GhostItemListType :: IteratorType IteratorType;
1000 IteratorType curr_;
1001 IteratorType end_;
1002 mutable val_t elem_;
1003 mutable size_t count_;
1004 const bool ghostCellsEnabled_ ;
1005
1006 public:
1007 template< class GhostElementIteratorImp, class GridImp >
1008 ALU3dGridGhostIteratorHigherCodim ( GhostElementIteratorImp *, const GridImp &grid,
1009 int level, const int nlinks, GhostItemListType &ghList )
1010 : ghList_( ghList ),
1011 elem_( (ElType *)0, (HBndSegType *)0 ),
1012 count_( 0 ),
1013 ghostCellsEnabled_( grid.ghostCellsEnabled() )
1014 {
1015 if( ! ghostCellsEnabled_ )
1016 {
1017 count_ = ghList_.getItemList().size() ;
1018 return ;
1019 }
1020
1021 if( ! ghList_.up2Date() )
1022 {
1023 GhostElementIteratorImp ghostIter(grid,level,nlinks);
1024 updateGhostList(grid,ghostIter,ghList_);
1025 }
1026 }
1027
1029 : ghList_( org.ghList_ )
1030 , elem_(org.elem_)
1031 , count_(org.count_)
1032 , ghostCellsEnabled_(org.ghostCellsEnabled_)
1033 {}
1034
1035 int size () { return ghList_.getItemList().size(); }
1036 void first() { if( ghostCellsEnabled_ ) count_ = 0; }
1037 void next () { ++count_; }
1038 int done () const { return (count_ >= ghList_.getItemList().size() ? 1 : 0); }
1039 val_t & item () const
1040 {
1041 alugrid_assert ( ! done() );
1042 void * item = ghList_.getItemList()[count_];
1043 elem_.first = ((ElType * ) item);
1044 alugrid_assert ( elem_.first );
1045 return elem_;
1046 }
1047
1048 protected:
1049 template <class GridImp, class GhostElementIteratorImp>
1050 void updateGhostList(const GridImp & grid, GhostElementIteratorImp & ghostIter, GhostItemListType & ghList)
1051 {
1052 int count = 0;
1053 for( ghostIter.first(); !ghostIter.done(); ghostIter.next() )
1054 {
1055 ++count;
1056 }
1057
1058 const int numItems = SelectVector< GridImp::elementType, codim >::getNotOnItemVector(0).size();
1059 const int maxSize = numItems * count;
1060
1061 ghList.getItemList().reserve(maxSize);
1062 ghList.getItemList().resize(0);
1063 std::map< int , int > visited;
1064
1065 const std::map<int,int>::iterator visitedEnd = visited.end();
1066 for( ghostIter.first(); !ghostIter.done(); ghostIter.next() )
1067 {
1068 GhostPairType ghPair = ghostIter.item().second->getGhost();
1069 const std::vector<int> & notOnFace = SelectVector< GridImp::elementType, codim >::
1070 getNotOnItemVector(ghPair.second);
1071 for(int i=0; i<numItems; ++i)
1072 {
1073 ElType * item = GetItem<GridImp,codim>::getItem( *(ghPair.first) , notOnFace[i] );
1074 int idx = item->getIndex();
1075 //For the 2d grid do not write non-2d vertices in ghost list
1076 if( GridImp::dimension == 2 && codim == 3 && !(item->is2d()) ) continue;
1077 if( visited.find(idx) == visitedEnd )
1078 {
1079 ghList.getItemList().push_back( (void *) item );
1080 visited[idx] = 1;
1081 }
1082 }
1083 }
1084 ghList.markAsUp2Date();
1085 }
1086 };
1087
1088 // the leaf ghost partition iterator
1089 template<>
1092 {
1093 enum { codim = 1 };
1095
1096 public:
1097 template <class GridImp>
1098 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1099 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLeafList(codim)) {}
1100
1103 };
1104
1105 // the leaf ghost partition iterator
1106 template<>
1109 {
1110 enum { codim = 2 };
1112
1113 public:
1114 template <class GridImp>
1115 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1116 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLeafList(codim)) {}
1117
1120 };
1121
1122 // the leaf ghost partition iterator
1123 template<>
1126 {
1127 enum { codim = 3 };
1129
1130 public:
1131 template <class GridImp>
1132 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1133 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLeafList(codim)) {}
1134
1137 };
1138
1139 // the level ghost partition iterator
1140 template<>
1143 {
1144 enum { codim = 1 };
1146
1147 public:
1148 template <class GridImp>
1149 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1150 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLevelList(codim,level)) {}
1151
1154 };
1155
1156 // the level ghost partition iterator
1157 template<>
1160 {
1161 enum { codim = 2 };
1163
1164 public:
1165 template <class GridImp>
1166 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1167 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLevelList(codim,level)) {}
1168
1171 };
1172
1173 // the level ghost partition iterator
1174 template<>
1177 {
1178 enum { codim = 3 };
1180
1181 public:
1182 template <class GridImp>
1183 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1184 : ALU3dGridGhostIteratorHigherCodim<codim>((GhostElementIteratorType *)0,grid,level,nlinks,grid.getGhostLevelList(codim,level)) {}
1185
1188 };
1189
1190 // the all partition iterator
1191 template<>
1193 : public IteratorWrapperInterface< IteratorElType< 0, Dune::ALUGridMPIComm >::val_t >
1194 {
1195 enum { codim = 0 };
1198
1199 public:
1201 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1202 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1203 private:
1204 IteratorType iter_;
1205 public:
1206
1207 template <class GridImp>
1208 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1209 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1210 GhostIteratorType ( grid, level, nlinks ) )
1211 {
1212 }
1213
1215 : iter_ (org.iter_) {}
1216
1217 int size () { return iter_.size(); }
1218 void next () { iter_.next(); }
1219 void first() { iter_.first(); }
1220 int done () const {return iter_.done(); }
1221 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1222 };
1223
1224 // the all partition iterator
1225 template<>
1227 : public IteratorWrapperInterface< IteratorElType< 1, Dune::ALUGridMPIComm >::val_t >
1228 {
1229 enum { codim = 1 };
1232
1233 public:
1235 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1236 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1237 private:
1238 IteratorType iter_;
1239 public:
1240
1241 template <class GridImp>
1242 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1243 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1244 GhostIteratorType ( grid, level, nlinks ) )
1245 {
1246 }
1247
1249 : iter_ (org.iter_) {}
1250
1251 int size () { return iter_.size(); }
1252 void next () { iter_.next(); }
1253 void first() { iter_.first(); }
1254 int done () const {return iter_.done(); }
1255 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1256 };
1257
1258 // the all partition iterator
1259 template<>
1261 : public IteratorWrapperInterface< IteratorElType< 2, Dune::ALUGridMPIComm >::val_t >
1262 {
1263 enum { codim = 2 };
1266
1267 public:
1269 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1270 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1271 private:
1272 IteratorType iter_;
1273 public:
1274
1275 template <class GridImp>
1276 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1277 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1278 GhostIteratorType ( grid, level, nlinks ) )
1279 {
1280 }
1281
1283 : iter_ (org.iter_) {}
1284
1285 int size () { return iter_.size(); }
1286 void next () { iter_.next(); }
1287 void first() { iter_.first(); }
1288 int done () const {return iter_.done(); }
1289 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1290 };
1291
1292 // the all partition iterator
1293 template<>
1295 : public IteratorWrapperInterface< IteratorElType< 3, Dune::ALUGridMPIComm >::val_t >
1296 {
1297 enum { codim = 3 };
1300
1301 public:
1303 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1304 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1305 private:
1306 IteratorType iter_;
1307 public:
1308
1309 template <class GridImp>
1310 ALU3dGridLeafIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1311 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1312 GhostIteratorType ( grid, level, nlinks ) )
1313 {
1314 }
1315
1317 : iter_ (org.iter_) {}
1318
1319 int size () { return iter_.size(); }
1320 void next () { iter_.next(); }
1321 void first() { iter_.first(); }
1322 int done () const {return iter_.done(); }
1323 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1324 };
1325
1326 // the all partition iterator
1327 template<>
1329 : public IteratorWrapperInterface< LeafValType >
1330 {
1333
1334 public:
1336 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1337 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1338 private:
1339 IteratorType iter_;
1340 public:
1341
1342 template <class GridImp>
1343 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1344 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1345 GhostIteratorType ( grid, level, nlinks ) )
1346 {
1347 }
1348
1350 : iter_(org.iter_) {}
1351
1352 int size () { return iter_.size(); }
1353 void next () { iter_.next(); }
1354 void first() { iter_.first(); }
1355 int done () const {return iter_.done(); }
1356 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1357 };
1358
1359 // placed here because we need ALU3dGridLevelIteratorWrapper<0,Dune::All_Partition> here
1360 // the edge level iterator
1361 template< PartitionIteratorType pitype, class Comm >
1362 class ALU3dGridLevelIteratorWrapper< 2, pitype, Comm >
1363 : public IteratorWrapperInterface< typename IteratorElType< 2, Comm >::val_t >
1364 {
1365 public:
1369
1371
1372 private:
1373 mutable val_t elem_;
1374 const int level_;
1375
1376 typedef Dune :: ALU3dGridItemListType ItemListType;
1377 ItemListType & edgeList_;
1378
1379 size_t count_ ;
1380 bool maxLevel_;
1381
1382 public:
1383 // constructor creating iterator
1384 template< class GridImp >
1385 ALU3dGridLevelIteratorWrapper ( const GridImp &grid, int level, const int nlinks )
1386 : elem_( (ElType *)0, (HBndSegType *)0 ),
1387 level_( level ),
1388 edgeList_( grid.getEdgeList( level ) ),
1389 count_( 0 )
1390 {
1391 if( ! edgeList_.up2Date() )
1392 updateEdgeList(grid,level,nlinks);
1393 }
1394
1395 // copy constructor
1397 : elem_(org.elem_)
1398 , level_(org.level_)
1399 , edgeList_( org.edgeList_ )
1400 , count_(org.count_)
1401 {
1402 }
1403
1404 int size () { return edgeList_.getItemList().size(); }
1405 void next ()
1406 {
1407 ++count_;
1408 }
1409
1410 void first()
1411 {
1412 count_ = 0;
1413 }
1414
1415 int done () const { return ((count_ >= edgeList_.size()) ? 1: 0); }
1416
1417 val_t & item () const
1418 {
1419 alugrid_assert ( ! done () );
1420 elem_.first = ( (ElType *) edgeList_.getItemList()[count_]);
1421
1422 alugrid_assert ( elem_.first );
1423 return elem_;
1424 }
1425
1426 private:
1427 template <class GridImp>
1428 void updateEdgeList(const GridImp & grid, int level, int nlinks)
1429 {
1431 typedef typename ElementLevelIterator :: val_t el_val_t;
1432 ElementLevelIterator iter(grid,level,nlinks);
1433
1434 edgeList_.getItemList().resize(0);
1435 std::map< int, int > visited;
1436
1437 for( iter.first(); ! iter.done(); iter.next() )
1438 {
1441
1442 GEOElementType *elem = 0;
1443 el_val_t & item = iter.item();
1444
1445 if( item.first )
1446 elem = static_cast< GEOElementType * > (item.first);
1447 else if( item.second )
1448 elem = static_cast< GEOElementType * > (item.second->getGhost().first);
1449
1450 alugrid_assert ( elem );
1451 for(int e=0; e<numEdges; ++e)
1452 {
1453 ElType * edge = elem->myhedge(e);
1454 if( edge->isGhost() ) continue;
1455
1456 int idx = edge->getIndex();
1457 if( visited.find(idx) == visited.end() )
1458 {
1459 edgeList_.getItemList().push_back( (void *) edge );
1460 visited[idx] = 1;
1461 }
1462 }
1463 }
1464 edgeList_.markAsUp2Date();
1465 }
1466 };
1467
1468 // the all partition iterator
1469 template<>
1471 : public IteratorWrapperInterface< IteratorElType< 1, Dune::ALUGridMPIComm >::val_t >
1472 {
1473 enum { codim = 1 };
1476
1477 public:
1479 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1480 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1481 private:
1482 IteratorType iter_;
1483 public:
1484
1485 template <class GridImp>
1486 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1487 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1488 GhostIteratorType ( grid, level, nlinks ) )
1489 {
1490 }
1491
1493 : iter_ (org.iter_) {}
1494
1495 int size () { return iter_.size(); }
1496 void next () { iter_.next(); }
1497 void first() { iter_.first(); }
1498 int done () const {return iter_.done(); }
1499 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1500 };
1501
1502 // the all partition iterator
1503 template<>
1505 : public IteratorWrapperInterface< IteratorElType< 2, Dune::ALUGridMPIComm >::val_t >
1506 {
1507 enum { codim = 2 };
1510
1511 public:
1513 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1514 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1515 private:
1516 IteratorType iter_;
1517 public:
1518
1519 template <class GridImp>
1520 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1521 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1522 GhostIteratorType ( grid, level, nlinks ) )
1523 {
1524 }
1525
1527 : iter_ (org.iter_) {}
1528
1529 int size () { return iter_.size(); }
1530 void next () { iter_.next(); }
1531 void first() { iter_.first(); }
1532 int done () const {return iter_.done(); }
1533 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1534 };
1535
1536 // the all partition iterator
1537 template<>
1539 : public IteratorWrapperInterface < IteratorElType< 3, Dune::ALUGridMPIComm >::val_t >
1540 {
1541 enum { codim = 3 };
1544
1545 public:
1547 // use ALUGrids AlignIterator to combine Interior and Ghost Iterator
1548 typedef AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType;
1549 private:
1550 IteratorType iter_;
1551 public:
1552
1553 template <class GridImp>
1554 ALU3dGridLevelIteratorWrapper (const GridImp & grid, int level , const int nlinks )
1555 : iter_ ( InteriorIteratorType ( grid, level, nlinks ) ,
1556 GhostIteratorType ( grid, level, nlinks ) )
1557 {
1558 }
1559
1561 : iter_ (org.iter_) {}
1562
1563 int size () { return iter_.size(); }
1564 void next () { iter_.next(); }
1565 void first() { iter_.first(); }
1566 int done () const {return iter_.done(); }
1567 val_t & item () const { alugrid_assert ( ! done() ); return iter_.item(); }
1568 };
1569
1570} // namespace ALUGrid
1571
1572#endif // #ifndef DUNE_ALU3DITERATORS_HH
#define ALU3DSPACE
Definition alu3dinclude.hh:24
#define alugrid_assert(EX)
Definition alugrid_assert.hh:20
Definition alu3dinclude.hh:50
Dune::PartitionIteratorType PartitionIteratorType
Definition alu3diterators.hh:74
std::pair< ALUHElementType< 0, Dune::ALUGridMPIComm >::ElementType *, Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HBndSegType * > LeafValType
Definition alu3diterators.hh:548
Definition alu3dinclude.hh:80
Definition alu3dinclude.hh:92
Definition alu3dinclude.hh:259
Definition alu3dinclude.hh:345
VertexListType & getItemList()
Definition alu3dinclude.hh:367
bool up2Date() const
Definition alu3dinclude.hh:357
VertexListType::iterator IteratorType
Definition alu3dinclude.hh:349
Definition alu3dinclude.hh:381
std::pair< VertexType *, int > ItemType
Definition alu3dinclude.hh:384
VertexListType & getItemList()
Definition alu3dinclude.hh:404
VertexListType::iterator IteratorType
Definition alu3dinclude.hh:386
bool up2Date() const
Definition alu3dinclude.hh:394
Definition alu3dinclude.hh:426
bool up2Date() const
Definition alu3dinclude.hh:436
void markAsUp2Date()
Definition alu3dinclude.hh:439
size_t size() const
Definition alu3dinclude.hh:434
ItemListType & getItemList()
Definition alu3dinclude.hh:444
Definition alu3diterators.hh:20
AccessIterator< HElementType >::Handle IteratorType
Definition alu3diterators.hh:22
Dune::ALU3dBasicImplTraits< Comm >::HElementType HElementType
Definition alu3diterators.hh:21
Definition alu3diterators.hh:29
Dune::ALU3dBasicImplTraits< Comm >::HElementType ElementType
Definition alu3diterators.hh:34
Dune::ALU3dBasicImplTraits< Comm >::HFaceType ElementType
Definition alu3diterators.hh:40
Dune::ALU3dBasicImplTraits< Comm >::HEdgeType ElementType
Definition alu3diterators.hh:46
Dune::ALU3dBasicImplTraits< Comm >::VertexType ElementType
Definition alu3diterators.hh:52
Definition alu3diterators.hh:62
virtual int done() const =0
virtual val_t & item() const =0
virtual IteratorSTI< val_t > * clone() const
Definition alu3diterators.hh:71
virtual ~IteratorWrapperInterface()
Definition alu3diterators.hh:64
Definition alu3diterators.hh:79
std::pair< ElType *, HBndSegType * > val_t
Definition alu3diterators.hh:82
ALUHElementType< codim, Comm >::ElementType ElType
Definition alu3diterators.hh:80
Dune::ALU3dBasicImplTraits< Comm >::HBndSegType HBndSegType
Definition alu3diterators.hh:81
Definition alu3diterators.hh:86
val_t elem_
Definition alu3diterators.hh:102
int size()
Definition alu3diterators.hh:117
IteratorElType< 0, Comm >::val_t val_t
Definition alu3diterators.hh:101
int done() const
Definition alu3diterators.hh:120
void next()
Definition alu3diterators.hh:118
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:106
val_t & item() const
Definition alu3diterators.hh:121
void first()
Definition alu3diterators.hh:119
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:112
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:149
int done() const
Definition alu3diterators.hh:162
int size()
Definition alu3diterators.hh:159
void first()
Definition alu3diterators.hh:161
val_t elem_
Definition alu3diterators.hh:145
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:155
IteratorElType< 1, Comm >::val_t val_t
Definition alu3diterators.hh:144
val_t & item() const
Definition alu3diterators.hh:163
void next()
Definition alu3diterators.hh:160
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:196
int done() const
Definition alu3diterators.hh:228
val_t & item() const
Definition alu3diterators.hh:229
void next()
if level of item is larger then walk level, go next
Definition alu3diterators.hh:218
VertexListType & vxList_
Definition alu3diterators.hh:187
IteratorElType< 3, Comm >::val_t val_t
Definition alu3diterators.hh:184
const int size_
Definition alu3diterators.hh:191
int size()
Definition alu3diterators.hh:215
void first()
Definition alu3diterators.hh:224
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:206
val_t elem_
Definition alu3diterators.hh:188
Definition alu3diterators.hh:247
void next()
Definition alu3diterators.hh:286
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int links)
Definition alu3diterators.hh:275
int size()
Definition alu3diterators.hh:285
val_t & item() const
Definition alu3diterators.hh:289
void first()
Definition alu3diterators.hh:287
int done() const
Definition alu3diterators.hh:288
IteratorElType< 0, Comm >::val_t val_t
Definition alu3diterators.hh:267
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:281
Definition alu3diterators.hh:299
is_leaf_entity< ElType > StopRule_t
Definition alu3diterators.hh:300
is_interior_leaf_entity< ElType > StopRule_t
Definition alu3diterators.hh:309
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:337
IteratorElType< 1, Comm >::val_t val_t
Definition alu3diterators.hh:325
int done() const
Definition alu3diterators.hh:347
int size()
Definition alu3diterators.hh:344
void next()
Definition alu3diterators.hh:345
void first()
Definition alu3diterators.hh:346
~ALU3dGridLeafIteratorWrapper()
Definition alu3diterators.hh:340
val_t & item() const
Definition alu3diterators.hh:348
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int links)
Definition alu3diterators.hh:331
val_t & item() const
Definition alu3diterators.hh:391
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:384
int done() const
Definition alu3diterators.hh:390
int size()
Definition alu3diterators.hh:387
void next()
Definition alu3diterators.hh:388
void first()
Definition alu3diterators.hh:389
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int links)
Definition alu3diterators.hh:378
IteratorElType< 2, Comm >::val_t val_t
Definition alu3diterators.hh:367
const int size_
Definition alu3diterators.hh:422
val_t & item() const
Definition alu3diterators.hh:465
int done() const
Definition alu3diterators.hh:464
val_t elem_
Definition alu3diterators.hh:419
void first()
Definition alu3diterators.hh:459
int size()
Definition alu3diterators.hh:449
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:440
const StopRule_t rule_
Definition alu3diterators.hh:424
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:429
void next()
if level of item is larger then walk level, go next
Definition alu3diterators.hh:452
LeafVertexListType & vxList_
Definition alu3diterators.hh:418
IteratorElType< 3, Comm >::val_t val_t
Definition alu3diterators.hh:415
Definition alu3diterators.hh:501
IteratorType & outer()
Definition alu3diterators.hh:544
LeafLevelIteratorTTProxy(GitterImplType &gitter, int link)
Definition alu3diterators.hh:513
IteratorType & inner()
Definition alu3diterators.hh:543
LeafLevelIteratorTTProxy(GitterImplType &gitter, int link, int level)
Definition alu3diterators.hh:523
~LeafLevelIteratorTTProxy()
Definition alu3diterators.hh:537
LeafLevelIteratorTTProxy(const LeafLevelIteratorTTProxy &org)
Definition alu3diterators.hh:532
Definition alu3diterators.hh:557
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HBndSegType HBndSegType
Definition alu3diterators.hh:562
IteratorSTI< ElType > InnerIteratorType
Definition alu3diterators.hh:574
void removeIterators()
Definition alu3diterators.hh:637
virtual void checkLeafEntity()
Definition alu3diterators.hh:706
val_t & item() const
Definition alu3diterators.hh:769
ElementPllXIF_t ItemType
Definition alu3diterators.hh:592
void next()
Definition alu3diterators.hh:736
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HElementType HElementType
Definition alu3diterators.hh:561
LeafValType val_t
Definition alu3diterators.hh:585
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::GitterImplType GitterImplType
Definition alu3diterators.hh:559
virtual IteratorType * newIterator()
Definition alu3diterators.hh:632
GitterImplType & gitter_
Definition alu3diterators.hh:565
ALU3dGridGhostIterator(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:595
int link_
Definition alu3diterators.hh:581
~ALU3dGridGhostIterator()
Definition alu3diterators.hh:626
void first()
Definition alu3diterators.hh:750
ALU3dGridGhostIterator(const ALU3dGridGhostIterator &org)
Definition alu3diterators.hh:605
bool usingInner_
Definition alu3diterators.hh:583
ALUHElementType< 1, Dune::ALUGridMPIComm >::ElementType ElType
Definition alu3diterators.hh:568
int done() const
Definition alu3diterators.hh:763
const int nl_
Definition alu3diterators.hh:578
InnerIteratorType * it_
Definition alu3diterators.hh:575
int size()
Definition alu3diterators.hh:724
IteratorType * iterTT_
Definition alu3diterators.hh:572
LeafLevelIteratorTTProxy< 1 > IteratorType
Definition alu3diterators.hh:570
void checkInnerOuter()
Definition alu3diterators.hh:664
void createIterator()
Definition alu3diterators.hh:645
LeafLevelIteratorTTProxy< 1 > IteratorType
Definition alu3diterators.hh:789
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:817
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:814
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:865
LeafLevelIteratorTTProxy< 1 > IteratorType
Definition alu3diterators.hh:829
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:861
Definition alu3diterators.hh:875
static ItemType * getItem(HElementType &el, int i)
Definition alu3diterators.hh:889
Dune::ALU3dImplTraits< GridImp::elementType, Comm >::GEOElementType GEOElementType
Definition alu3diterators.hh:886
Dune::ALU3dBasicImplTraits< Comm >::HElementType HElementType
Definition alu3diterators.hh:885
static int numItems()
Definition alu3diterators.hh:894
GridImp::MPICommunicatorType Comm
Definition alu3diterators.hh:883
IteratorElType< 1, Comm >::ElType ItemType
Definition alu3diterators.hh:887
static int numItems()
Definition alu3diterators.hh:917
IteratorElType< 2, Comm >::ElType ItemType
Definition alu3diterators.hh:910
Dune::ALU3dImplTraits< GridImp::elementType, Comm >::GEOElementType GEOElementType
Definition alu3diterators.hh:909
Dune::ALU3dBasicImplTraits< Comm >::HElementType HElementType
Definition alu3diterators.hh:908
GridImp::MPICommunicatorType Comm
Definition alu3diterators.hh:906
static ItemType * getItem(HElementType &el, int i)
Definition alu3diterators.hh:912
Dune::ALU3dBasicImplTraits< Comm >::HElementType HElementType
Definition alu3diterators.hh:931
IteratorElType< 3, Comm >::ElType ItemType
Definition alu3diterators.hh:933
Dune::ALU3dImplTraits< GridImp::elementType, Comm >::GEOElementType GEOElementType
Definition alu3diterators.hh:932
GridImp::MPICommunicatorType Comm
Definition alu3diterators.hh:929
static ItemType * getItem(HElementType &el, int i)
Definition alu3diterators.hh:935
static int numItems()
Definition alu3diterators.hh:940
Ghost Iterator.
Definition alu3diterators.hh:951
void next()
Definition alu3diterators.hh:1037
int size()
Definition alu3diterators.hh:1035
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HElementType HElementType
Definition alu3diterators.hh:953
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:957
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::GhostPairType GhostPairType
Definition alu3diterators.hh:955
ALU3dGridGhostIteratorHigherCodim(GhostElementIteratorImp *, const GridImp &grid, int level, const int nlinks, GhostItemListType &ghList)
Definition alu3diterators.hh:1008
void first()
Definition alu3diterators.hh:1036
int done() const
Definition alu3diterators.hh:1038
Dune::ALU3dBasicImplTraits< Dune::ALUGridMPIComm >::HBndSegType HBndSegType
Definition alu3diterators.hh:954
ALU3dGridGhostIteratorHigherCodim(const ALU3dGridGhostIteratorHigherCodim &org)
Definition alu3diterators.hh:1028
void updateGhostList(const GridImp &grid, GhostElementIteratorImp &ghostIter, GhostItemListType &ghList)
Definition alu3diterators.hh:1050
val_t & item() const
Definition alu3diterators.hh:1039
IteratorElType< codim, Dune::ALUGridMPIComm >::ElType ElType
Definition alu3diterators.hh:956
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1098
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1101
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1115
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1118
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1132
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1135
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1149
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1152
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1166
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1169
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1183
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1186
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1208
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1202
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1200
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1214
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1242
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1234
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1236
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1248
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1270
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1268
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1276
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1282
ALU3dGridLeafIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1310
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1304
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1302
ALU3dGridLeafIteratorWrapper(const ALU3dGridLeafIteratorWrapper &org)
Definition alu3diterators.hh:1316
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1343
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1337
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1349
int done() const
Definition alu3diterators.hh:1415
Dune::ALU3dBasicImplTraits< Comm >::HBndSegType HBndSegType
Definition alu3diterators.hh:1367
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1396
Dune::ALU3dBasicImplTraits< Comm >::GEOEdgeType GEOEdgeType
Definition alu3diterators.hh:1368
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1385
void next()
Definition alu3diterators.hh:1405
IteratorElType< 2, Comm >::val_t val_t
Definition alu3diterators.hh:1370
int size()
Definition alu3diterators.hh:1404
val_t & item() const
Definition alu3diterators.hh:1417
ALUHElementType< 2, Comm >::ElementType ElType
Definition alu3diterators.hh:1366
void first()
Definition alu3diterators.hh:1410
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1480
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1492
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1486
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1478
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1520
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1512
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1514
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1526
ALU3dGridLevelIteratorWrapper(const ALU3dGridLevelIteratorWrapper &org)
Definition alu3diterators.hh:1560
IteratorElType< codim, Dune::ALUGridMPIComm >::val_t val_t
Definition alu3diterators.hh:1546
ALU3dGridLevelIteratorWrapper(const GridImp &grid, int level, const int nlinks)
Definition alu3diterators.hh:1554
AlignIterator< InteriorIteratorType, GhostIteratorType, val_t > IteratorType
Definition alu3diterators.hh:1548
Definition topology.hh:15
type of class for specialization of parallel ALUGrid (MPI_Comm as communicator)
Definition declaration.hh:39