dune-grid  2.4.1
alugrid/3d/datahandle.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_ALU3DGRIDDATAHANDLE_HH
4 #define DUNE_ALU3DGRIDDATAHANDLE_HH
5 
6 //- system includes
7 #include <iostream>
8 
11 
12 //- local includes
13 #include "alu3dinclude.hh"
14 
15 using std::endl;
16 using std::cout;
17 using std::flush;
18 
19 namespace ALUGridSpace
20 {
21 
23  template <class GridType, class DataCollectorType, int codim >
25  : public GatherScatter
26  {
27  protected:
28  const GridType & grid_;
29  typedef typename GridType::template Codim<codim>::Entity EntityType;
31  typename GridType::template Codim<codim>::Entity> MakeableEntityType;
33 
34  typedef typename GridType::MPICommunicatorType Comm;
35 
37  typedef typename ImplTraits::template Codim< codim >::ImplementationType ImplElementType;
38  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
39 
42 
43  DataCollectorType & dc_;
44 
45  const bool variableSize_;
46 
47  typedef typename GatherScatter :: ObjectStreamType ObjectStreamType;
48 
49  typedef typename DataCollectorType:: DataType DataType;
50 
51  using GatherScatter :: setData ;
52  using GatherScatter :: sendData ;
53  using GatherScatter :: recvData ;
54  using GatherScatter :: containsItem ;
55 
56  public:
58  GatherScatterBaseImpl(const GridType & grid, MakeableEntityType & en,
59  RealEntityType & realEntity , DataCollectorType & dc)
60  : grid_(grid), entity_(en), realEntity_(realEntity) , dc_(dc)
61  , variableSize_( ! dc_.fixedsize(EntityType::dimension,codim) )
62  {}
63 
65  bool contains(int dim, int cd) const { return dc_.contains(dim,cd); }
66 
67  // returns true, if element is contained in set of comm interface
68  // this method must be overlaoded by the impl classes
69  virtual bool containsItem (const HElementType & elem) const = 0;
70 
71  // set elem to realEntity
72  virtual void setElement(const HElementType & elem) = 0;
73 
74  void setData ( ObjectStreamType & str , HElementType & elem )
75  {
76  // one of this should be either true
77  assert( this->containsItem( elem ) || elem.isGhost() );
78 
79  // set element and then start
80  setElement(elem);
81 
82  // make sure partition type is set correct
83  assert( elem.isGhost() == (entity_.partitionType() == Dune :: GhostEntity) );
84 
85  size_t size = getSize(str, entity_);
86  // use normal scatter method
87  dc_.scatter(str,entity_, size );
88  }
89 
91  void sendData ( ObjectStreamType & str , HElementType & elem )
92  {
93  // make sure element is contained in communication interface
94  //assert( this->containsItem( elem ) );
95  setElement(elem);
96 
97  // if varaible size, also send size
98  if( variableSize_ )
99  {
100  size_t size = dc_.size( entity_ );
101  str.write( size );
102  }
103 
104  dc_.gather(str, entity_ );
105  }
106 
108  void recvData ( ObjectStreamType & str , HElementType & elem )
109  {
110  assert( this->containsItem( elem ) );
111  setElement( elem );
112 
113  size_t size = getSize(str, entity_);
114  dc_.scatter(str,entity_, size );
115  }
116 
117  protected:
118  size_t getSize(ObjectStreamType & str, EntityType & en)
119  {
120  if(variableSize_)
121  {
122  size_t size;
123  str.read(size);
124  return size;
125  }
126  else
127  return dc_.size(en);
128  }
129  };
130 
131  //***********************************************************
132  //
133  // --specialisation for codim 0
134  //
135  //***********************************************************
136 
138  template <class GridType, class DataCollectorType >
139  class GatherScatterBaseImpl<GridType,DataCollectorType,0> : public GatherScatter
140  {
141  protected:
142  enum { codim = 0 };
143  const GridType & grid_;
144  typedef typename GridType::template Codim<0>::Entity EntityType;
146  typename GridType::template Codim<0>::Entity> MakeableEntityType;
148 
149  typedef typename GridType::MPICommunicatorType Comm;
150 
152  typedef typename ImplTraits::template Codim< codim >::ImplementationType ImplElementType;
153  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
154 
155  typedef typename ImplTraits::template Codim< 1 >::InterfaceType HFaceType;
156 
157  typedef typename ImplTraits::template Codim< codim >::GhostInterfaceType HGhostType;
158  typedef typename ImplTraits::template Codim< codim >::GhostImplementationType ImplGhostType;
159 
160  typedef typename ImplTraits::PllElementType PllElementType;
161 
164 
165  // data handle
166  DataCollectorType & dc_;
167 
168  const bool variableSize_;
169 
170  // used MessageBuffer
171  typedef typename GatherScatter :: ObjectStreamType ObjectStreamType;
172 
173  // use all other containsItem from the base class
174  using GatherScatter :: setData ;
175  using GatherScatter :: sendData ;
176  using GatherScatter :: recvData ;
177 
178  public:
179  // use all other containsItem from the base class
180  using GatherScatter :: containsItem ;
181 
183  GatherScatterBaseImpl(const GridType & grid, MakeableEntityType & en,
184  RealEntityType & realEntity , DataCollectorType & dc)
185  : grid_(grid), entity_(en), realEntity_(realEntity)
186  , dc_(dc) , variableSize_ ( ! dc_.fixedsize( EntityType :: dimension, codim ))
187  {}
188 
189  // return true if dim,codim combination is contained in data set
190  bool contains(int dim, int codim) const
191  {
192  return dc_.contains(dim,codim);
193  }
194 
195  // return true if item might from entity belonging to data set
196  virtual bool containsItem (const HElementType & elem) const
197  {
198  return elem.isLeafEntity();
199  }
200 
201  // return true if item might from entity belonging to data set
202  virtual bool containsItem (const HGhostType & ghost) const = 0;
203 
205  void sendData ( ObjectStreamType & str , const HElementType & elem )
206  {
207  assert( this->containsItem(elem) );
208  realEntity_.setElement( const_cast<HElementType &> (elem) );
209 
210  // write size in case of variable size
211  writeSize( str, entity_);
212  // gather data
213  dc_.gather(str, entity_);
214  }
215 
217  void sendData ( ObjectStreamType & str , const HGhostType& ghost)
218  {
219  assert( this->containsItem( ghost ) );
220 
221  // set ghost as entity
222  realEntity_.setGhost( const_cast <HGhostType &> (ghost) );
223 
224  // write size in case of variable size
225  writeSize( str, entity_);
226  // gather data
227  dc_.gather(str, entity_);
228  }
229 
231  void recvData ( ObjectStreamType & str , HElementType & elem )
232  {
233  // assert( this->containsItem( elem ) );
234  realEntity_.setElement( elem );
235 
236  size_t size = getSize(str, entity_);
237  dc_.scatter(str, entity_, size);
238  }
239 
242  {
243  assert( this->containsItem( ghost ) );
244 
245  // set ghost as entity
246  realEntity_.setGhost( ghost );
247 
248  size_t size = getSize(str , entity_ );
249  dc_.scatter(str, entity_, size );
250  }
251 
252  protected:
253  size_t getSize(ObjectStreamType & str, EntityType & en)
254  {
255  if(variableSize_)
256  {
257  size_t size;
258  str.read(size);
259  return size;
260  }
261  else
262  return dc_.size(en);
263  }
264 
265  // write variable size to stream
267  {
268  if( variableSize_ )
269  {
270  size_t size = dc_.size( en );
271  str.write( size );
272  }
273  }
274  };
275 
276 #if ALU3DGRID_PARALLEL
277  template< class GridType, class DataCollectorType, int codim >
279  class GatherScatterLeafData
280  : public GatherScatterBaseImpl< GridType, DataCollectorType, codim >
281  {
282  enum { dim = GridType :: dimension };
283 
284  typedef GatherScatterBaseImpl<GridType,DataCollectorType,codim> BaseType;
285  typedef typename GridType::template Codim<codim>::Entity EntityType;
287  typename GridType::template Codim<codim>::Entity> MakeableEntityType;
288  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
289 
290  typedef typename GridType::MPICommunicatorType Comm;
291 
293  typedef typename ImplTraits::template Codim< codim >::ImplementationType IMPLElementType;
294  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
295 
296  typedef typename ImplTraits::template Codim< 1 >::InterfaceType HFaceType;
297 
298  typedef typename ImplTraits::template Codim< 0 >::GhostInterfaceType HGhostType;
299  typedef typename ImplTraits::template Codim< 0 >::GhostImplementationType ImplGhostType;
300 
301  typedef typename ImplTraits::PllElementType PllElementType;
302 
303  public:
304  // use all other containsItem methods from the base class
305  using BaseType :: containsItem ;
306 
308  GatherScatterLeafData(const GridType & grid, MakeableEntityType & en,
309  RealEntityType & realEntity , DataCollectorType & dc)
310  : BaseType(grid,en,realEntity,dc)
311  {
312  // if leaf vertices are communicated,
313  // make sure that vertex list is up2date
314  // but only do this, if vertex data contained,
315  // because the list update is expensive
316  if( (codim == 3) && dc.contains(dim,codim) )
317  {
318  // call of this method forces update of list,
319  // if list is not up to date
320  grid.getLeafVertexList();
321  }
322  }
323 
324  // returns true, if element is contained in set of comm interface
325  bool containsItem (const HElementType & elem) const
326  {
327  return elem.isLeafEntity();
328  }
329 
330  // returns true, if element is contained in set of comm interface
331  bool containsItem (const HGhostType & ghost) const
332  {
333  return ghost.isLeafEntity();
334  }
335 
336  // returns true, if interior element is contained in set of comm interface
337  bool containsInterior (const HFaceType & face, PllElementType & pll) const
338  {
339  return face.isInteriorLeaf();
340  }
341 
342  // returns true, if ghost is contianed in set of comm interface
343  bool containsGhost (const HFaceType & face , PllElementType & pll) const
344  {
345  return pll.ghostLeaf();
346  }
347 
348  // set elem to realEntity
349  void setElement(const HElementType & elem)
350  {
351  this->realEntity_.setElement(elem);
352  }
353  };
354 
356  template <class GridType, class DataCollectorType , int codim >
357  class GatherScatterLevelData
358  : public GatherScatterBaseImpl<GridType,DataCollectorType,codim>
359  {
360  typedef GatherScatterBaseImpl<GridType,DataCollectorType,codim> BaseType;
361  typedef typename GridType::template Codim<codim>::Entity EntityType;
363  typename GridType::template Codim<codim>::Entity> MakeableEntityType;
364  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
365 
366  typedef typename GridType::MPICommunicatorType Comm;
367 
369  typedef typename ImplTraits::template Codim< codim >::ImplementationType IMPLElementType;
370  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
371 
372  typedef typename ImplTraits::template Codim< 1 >::InterfaceType HFaceType;
373 
374  typedef typename ImplTraits::template Codim< 0 >::GhostInterfaceType HGhostType;
375  typedef typename ImplTraits::template Codim< 0 >::GhostImplementationType ImplGhostType;
376 
377  typedef typename ImplTraits::PllElementType PllElementType;
378 
379  typedef typename GridType::LevelIndexSetImp LevelIndexSetImp;
380 
381  const LevelIndexSetImp & levelSet_;
382  const int level_;
383  public:
384  // use containsItem for ghost element from BaseType
385  using BaseType :: containsItem ;
386 
388  GatherScatterLevelData(const GridType & grid, MakeableEntityType & en,
389  RealEntityType & realEntity , DataCollectorType & dc,
390  const LevelIndexSetImp & levelSet, const int level)
391  : BaseType(grid,en,realEntity,dc) , levelSet_(levelSet) , level_(level)
392  {}
393 
394  // returns true, if element is contained in set of comm interface
395  bool containsItem (const HElementType & elem) const
396  {
397  return levelSet_.containsIndex(codim, elem.getIndex() );
398  }
399 
400  // set elem to realEntity
401  void setElement(const HElementType & elem)
402  {
403  this->realEntity_.setElement(elem,level_);
404  }
405 
406  };
407 
408 
410  template <class GridType, class DataCollectorType>
411  class GatherScatterLevelData<GridType,DataCollectorType,0>
412  : public GatherScatterBaseImpl<GridType,DataCollectorType,0>
413  {
414  enum { codim = 0 };
415  typedef GatherScatterBaseImpl<GridType,DataCollectorType,codim> BaseType;
416  typedef typename GridType::template Codim<codim>::Entity EntityType;
418  typename GridType::template Codim<codim>::Entity> MakeableEntityType;
419  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
420 
421  typedef typename GridType::MPICommunicatorType Comm;
422 
424  typedef typename ImplTraits::template Codim< codim >::ImplementationType IMPLElementType;
425  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
426 
427  typedef typename ImplTraits::template Codim< 1 >::InterfaceType HFaceType;
428 
429  typedef typename ImplTraits::template Codim< 0 >::GhostInterfaceType HGhostType;
430  typedef typename ImplTraits::template Codim< 0 >::GhostImplementationType ImplGhostType;
431 
432  typedef typename ImplTraits::PllElementType PllElementType;
433 
434  typedef typename GridType::LevelIndexSetImp LevelIndexSetImp;
435 
436  const LevelIndexSetImp & levelSet_;
437  const int level_;
438  public:
440  GatherScatterLevelData(const GridType & grid, MakeableEntityType & en,
441  RealEntityType & realEntity , DataCollectorType & dc,
442  const LevelIndexSetImp & levelSet, const int level)
443  : BaseType(grid,en,realEntity,dc) , levelSet_(levelSet) , level_(level) {}
444 
445  // returns true, if element is contained in set of comm interface
446  bool containsItem (const HElementType & elem) const
447  {
448  return levelSet_.containsIndex(codim, elem.getIndex() );
449  }
450 
451  // returns true, if element is contained in set of comm interface
452  bool containsItem (const HGhostType & ghost) const
453  {
454  assert( ghost.getGhost().first );
455  return containsItem( * (ghost.getGhost().first) );
456  }
457 
458  // returns true, if interior element is contained in set of comm interface
459  bool containsInterior (const HFaceType & face, PllElementType & pll) const
460  {
461  // if face level is not level_ then interior cannot be contained
462  if(face.level() != level_) return false;
463 
464  typedef Gitter::helement_STI HElementType;
465  typedef Gitter::hbndseg_STI HBndSegType;
466 
467  // check interior element here, might have a coarser level
468  pair< HElementType *, HBndSegType * > p( (HElementType *)0, (HBndSegType *)0 );
469  pll.getAttachedElement( p );
470  assert( p.first );
471  // check inside level
472  bool contained = (p.first->level() == level_);
473  assert( contained == this->containsItem( *p.first ));
474  return contained;
475  }
476 
477  // returns true, if ghost is contianed in set of comm interface
478  bool containsGhost (const HFaceType & face, PllElementType & pll) const
479  {
480  // if face level is not level_ then ghost cannot be contained
481  if(face.level() != level_) return false;
482  // otherwise check ghost level
483  return (pll.ghostLevel() == level_);
484  }
485  };
486 #endif // #if ALU3DGRID_PARALLEL
487 
489  template <class GridType, class DataCollectorType, class IndexOperatorType>
490  class GatherScatterLoadBalance : public GatherScatter
491  {
492  protected:
493  enum { codim = 0 };
494  typedef typename GridType::template Codim<0>::Entity EntityType;
496  typename GridType::template Codim<0>::Entity> MakeableEntityType;
498 
499  typedef typename GridType::MPICommunicatorType Comm;
500 
502  typedef typename ImplTraits::template Codim< codim >::ImplementationType IMPLElementType;
503  typedef typename ImplTraits::template Codim< codim >::InterfaceType HElementType;
504 
505  typedef typename ImplTraits::template Codim< 1 >::InterfaceType HFaceType;
506 
507  typedef typename ImplTraits::template Codim< 0 >::GhostInterfaceType HGhostType;
508  typedef typename ImplTraits::template Codim< 0 >::GhostImplementationType ImplGhostType;
509 
510  typedef typename ImplTraits::PllElementType PllElementType;
511 
512  GridType & grid_;
513 
516 
517  // data handle
518  DataCollectorType & dc_;
519  IndexOperatorType & idxOp_;
520 
521  // used MessageBuffer
522  typedef typename GatherScatter :: ObjectStreamType ObjectStreamType;
523 
524  using GatherScatter :: inlineData ;
525  using GatherScatter :: xtractData ;
526 
527  public:
530  RealEntityType & realEntity , DataCollectorType & dc, IndexOperatorType & idxOp )
531  : grid_(grid), entity_(en), realEntity_(realEntity)
532  , dc_(dc) , idxOp_(idxOp)
533  {}
534 
535  // return true if dim,codim combination is contained in data set
536  bool contains(int dim, int codim) const
537  {
538  return true;
539  }
540 
544  void inlineData ( ObjectStreamType & str , HElementType & elem )
545  {
546  str.write(grid_.maxLevel());
547  // set element and then start
548  assert( elem.level () == 0 );
549  realEntity_.setElement(elem);
550  dc_.inlineData(str,entity_);
551  }
552 
556  void xtractData ( ObjectStreamType & str , HElementType & elem )
557  {
558  assert( elem.level () == 0 );
559  int mxl;
560  str.read(mxl);
561  // set element and then start
562  grid_.setMaxLevel(mxl);
563 
564  // reserve memory for new elements
565  size_t elChunk = idxOp_.newElements();
566  assert( elChunk > 0 );
567 
568  realEntity_.setElement(elem);
569  dc_.xtractData(str,entity_, elChunk);
570  }
571 
573  void compress ()
574  {
575  dc_.compress();
576  }
577  };
578 
580  //
581  // --AdaptRestrictProlong
582  //
584  template< class GridType, class AdaptDataHandle >
586  : public AdaptRestrictProlongType
587  {
588  GridType & grid_;
589  typedef typename GridType::template Codim<0>::Entity EntityType;
591  typename GridType::template Codim<0>::Entity> MakeableEntityType;
592  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
593 
594  EntityType & reFather_;
595  EntityType & reSon_;
596  RealEntityType & realFather_;
597  RealEntityType & realSon_;
598 
599  AdaptDataHandle &rp_;
600 
601  typedef typename GridType::MPICommunicatorType Comm;
602 
604  typedef typename ImplTraits::HElementType HElementType;
605  typedef typename ImplTraits::HBndSegType HBndSegType;
606  typedef typename ImplTraits::BNDFaceType BNDFaceType;
607 
608  //using AdaptRestrictProlongType :: postRefinement ;
609  //using AdaptRestrictProlongType :: preCoarsening ;
610 
611  public:
613  AdaptRestrictProlongImpl ( GridType &grid,
614  MakeableEntityType &f, RealEntityType &rf,
615  MakeableEntityType &s, RealEntityType &rs,
616  AdaptDataHandle &rp )
617  : grid_(grid)
618  , reFather_(f)
619  , reSon_(s)
620  , realFather_(rf)
621  , realSon_(rs)
622  , rp_(rp)
623  {}
624 
626  {}
627 
629  int preCoarsening ( HElementType & father )
630  {
631  realFather_.setElement( father );
632  rp_.preCoarsening( reFather_ );
633 
634  // reset refinement marker
635  father.resetRefinedTag();
636  return 0;
637  }
638 
640  int postRefinement ( HElementType & father )
641  {
642  realFather_.setElement( father );
643  rp_.postRefinement( reFather_ );
644 
645  // resert refinement markers
646  father.resetRefinedTag();
647  for( HElementType *son = father.down(); son ; son = son->next() )
648  son->resetRefinedTag();
649 
650  return 0;
651  }
652 
654  int preCoarsening ( HBndSegType & ghost ) { return 0; }
655 
656 
658  int postRefinement ( HBndSegType & ghost ) { return 0; }
659  };
660 
661 
662 
663  template< class GridType, class AdaptDataHandle, class GlobalIdSetImp >
665  : public AdaptRestrictProlongImpl< GridType, AdaptDataHandle >
666  {
668  GlobalIdSetImp & set_;
669  typedef typename GridType::template Codim<0>::Entity EntityType;
671  typename GridType::template Codim<0>::Entity> MakeableEntityType;
672  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
673 
674  typedef typename GridType::MPICommunicatorType Comm;
675 
677  typedef typename ImplTraits::HElementType HElementType;
678  typedef typename ImplTraits::HBndSegType HBndSegType;
679 
680  using AdaptRestrictProlongType :: postRefinement ;
681  using AdaptRestrictProlongType :: preCoarsening ;
682 
683  public:
685  AdaptRestrictProlongGlSet ( GridType &grid,
686  MakeableEntityType &f, RealEntityType &rf,
687  MakeableEntityType &s, RealEntityType &rs,
688  AdaptDataHandle &rp,
689  GlobalIdSetImp & set )
690  : BaseType( grid, f, rf, s, rs, rp ),
691  set_( set )
692  {}
693 
695 
697  int postRefinement ( HElementType & elem )
698  {
699  set_.postRefinement( elem );
700  return BaseType :: postRefinement(elem );
701  }
702  };
703 
704  // this class is for counting the tree depth of the
705  // element when unpacking data from load balance
706  template <class GridType , class DataHandleType>
707  class LoadBalanceElementCount : public AdaptRestrictProlongType
708  {
709  GridType & grid_;
710  typedef typename GridType::template Codim<0>::Entity EntityType;
712  typename GridType::template Codim<0>::Entity> MakeableEntityType;
713  typedef typename MakeableEntityType :: ImplementationType RealEntityType;
714 
715  typedef typename GridType::Traits::LeafIndexSet LeafIndexSetType;
716 
717  EntityType & reFather_;
718  EntityType & reSon_;
719  RealEntityType & realFather_;
720  RealEntityType & realSon_;
721 
722  DataHandleType & dh_;
723 
724  typedef typename GridType::MPICommunicatorType Comm;
725 
727  typedef typename ImplTraits::HElementType HElementType;
728  typedef typename ImplTraits::HBndSegType HBndSegType;
729 
730  int newMemSize_;
731 
732  using AdaptRestrictProlongType :: postRefinement ;
733  using AdaptRestrictProlongType :: preCoarsening ;
734 
735  public:
737  LoadBalanceElementCount (GridType & grid,
738  MakeableEntityType & f, RealEntityType & rf,
739  MakeableEntityType & s, RealEntityType & rs,
740  DataHandleType & dh)
741  : grid_(grid)
742  , reFather_(f)
743  , reSon_(s)
744  , realFather_(rf)
745  , realSon_(rs)
746  , dh_(dh)
747  , newMemSize_ (1) // we have at least one element (the macro element)
748  {}
749 
751 
753  int postRefinement ( HElementType & elem )
754  {
755  // when called for a macro element, then a new tree is starting
756  // set to 1 because for only macro elements this method is not called
757  if( elem.level() == 0 ) newMemSize_ = 1;
758 
759  for( HElementType * son = elem.down() ; son ; son= son->next())
760  {
761  ++ newMemSize_;
762  }
763  return 0;
764  }
765 
767  int preCoarsening ( HElementType & elem )
768  {
769  return 0;
770  }
771 
774  int preCoarsening ( HBndSegType & el )
775  {
776  return 0;
777  }
778 
783  int postRefinement ( HBndSegType & el )
784  {
785  return 0;
786  }
787 
788  int newElements () const { return newMemSize_; }
789  };
790 
791 } // end namespace ALUGridSpace
792 
793 #endif // #ifndef DUNE_ALU3DGRIDDATAHANDLE_HH
GatherScatterLoadBalance(GridType &grid, MakeableEntityType &en, RealEntityType &realEntity, DataCollectorType &dc, IndexOperatorType &idxOp)
Constructor.
Definition: alugrid/3d/datahandle.hh:529
ImplTraits::template Codim< codim >::InterfaceType HElementType
Definition: alugrid/3d/datahandle.hh:503
int preCoarsening(HBndSegType &ghost)
restrict data for ghost elements
Definition: alugrid/3d/datahandle.hh:654
EntityType & entity_
Definition: alugrid/3d/datahandle.hh:514
IndexOperatorType & idxOp_
Definition: alugrid/3d/datahandle.hh:519
ImplTraits::template Codim< codim >::ImplementationType ImplElementType
Definition: alugrid/3d/datahandle.hh:37
int preCoarsening(HBndSegType &el)
Definition: alugrid/3d/datahandle.hh:774
int postRefinement(HBndSegType &el)
Definition: alugrid/3d/datahandle.hh:783
ImplTraits::template Codim< codim >::ImplementationType ImplElementType
Definition: alugrid/3d/datahandle.hh:152
DataCollectorType & dc_
Definition: alugrid/3d/datahandle.hh:518
Different resources needed by all grid implementations.
GatherScatter::ObjectStreamType ObjectStreamType
Definition: alugrid/3d/datahandle.hh:171
virtual ~LoadBalanceElementCount()
Definition: alugrid/3d/datahandle.hh:750
Dune::MakeableInterfaceObject< typename GridType::template Codim< 0 >::Entity > MakeableEntityType
Definition: alugrid/3d/datahandle.hh:146
ghost entities
Definition: gridenums.hh:33
ImplTraits::template Codim< codim >::InterfaceType HElementType
Definition: alugrid/3d/datahandle.hh:38
virtual bool containsItem(const HElementType &elem) const =0
const bool variableSize_
Definition: alugrid/3d/datahandle.hh:168
RealEntityType & realEntity_
Definition: alugrid/3d/datahandle.hh:41
ImplTraits::template Codim< 1 >::InterfaceType HFaceType
Definition: alugrid/3d/datahandle.hh:155
RealEntityType & realEntity_
Definition: alugrid/3d/datahandle.hh:515
void recvData(ObjectStreamType &str, HElementType &elem)
read Data of one element from stream
Definition: alugrid/3d/datahandle.hh:231
const bool variableSize_
Definition: alugrid/3d/datahandle.hh:45
void inlineData(ObjectStreamType &str, HElementType &elem)
Definition: alugrid/3d/datahandle.hh:544
Definition: objectfactory.hh:23
int preCoarsening(HElementType &father)
restrict data for elements
Definition: alugrid/3d/datahandle.hh:629
DataCollectorType & dc_
Definition: alugrid/3d/datahandle.hh:43
ImplTraits::template Codim< codim >::GhostInterfaceType HGhostType
Definition: alugrid/3d/datahandle.hh:157
DataCollectorType::DataType DataType
Definition: alugrid/3d/datahandle.hh:49
ImplTraits::template Codim< 0 >::GhostInterfaceType HGhostType
Definition: alugrid/3d/datahandle.hh:507
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and ALUGrid ...
EntityType & entity_
Definition: alugrid/3d/datahandle.hh:40
GridType::template Codim< codim >::Entity EntityType
Definition: alugrid/3d/datahandle.hh:29
ImplTraits::template Codim< codim >::GhostImplementationType ImplGhostType
Definition: alugrid/3d/datahandle.hh:158
void sendData(ObjectStreamType &str, HElementType &elem)
write Data of one element to stream
Definition: alugrid/3d/datahandle.hh:91
int postRefinement(HBndSegType &ghost)
prolong data for ghost elements
Definition: alugrid/3d/datahandle.hh:658
ImplTraits::PllElementType PllElementType
Definition: alugrid/3d/datahandle.hh:160
MakeableEntityType::ImplementationType RealEntityType
Definition: alugrid/3d/datahandle.hh:147
Definition: alugrid/3d/datahandle.hh:664
ImplTraits::template Codim< codim >::ImplementationType IMPLElementType
Definition: alugrid/3d/datahandle.hh:502
int postRefinement(HElementType &elem)
restrict data , elem is always the father
Definition: alugrid/3d/datahandle.hh:753
Definition: alu3dinclude.hh:201
int preCoarsening(HElementType &elem)
prolong data, elem is the father
Definition: alugrid/3d/datahandle.hh:767
void recvData(ObjectStreamType &str, HElementType &elem)
read Data of one element from stream
Definition: alugrid/3d/datahandle.hh:108
LoadBalanceElementCount(GridType &grid, MakeableEntityType &f, RealEntityType &rf, MakeableEntityType &s, RealEntityType &rs, DataHandleType &dh)
Constructor.
Definition: alugrid/3d/datahandle.hh:737
MakeableEntityType::ImplementationType RealEntityType
Definition: alugrid/3d/datahandle.hh:32
bool contains(int dim, int codim) const
Definition: alugrid/3d/datahandle.hh:536
virtual ~AdaptRestrictProlongGlSet()
Definition: alugrid/3d/datahandle.hh:694
size_t getSize(ObjectStreamType &str, EntityType &en)
Definition: alugrid/3d/datahandle.hh:253
Dune::MakeableInterfaceObject< typename GridType::template Codim< 0 >::Entity > MakeableEntityType
Definition: alugrid/3d/datahandle.hh:496
Definition: alugrid/3d/datahandle.hh:707
ImplTraits::template Codim< 1 >::InterfaceType HFaceType
Definition: alugrid/3d/datahandle.hh:505
GridType::template Codim< 0 >::Entity EntityType
Definition: alugrid/3d/datahandle.hh:494
size_t getSize(ObjectStreamType &str, EntityType &en)
Definition: alugrid/3d/datahandle.hh:118
ImplTraits::template Codim< 0 >::GhostImplementationType ImplGhostType
Definition: alugrid/3d/datahandle.hh:508
Ghost ghost
PartitionSet for the ghost partition.
Definition: partitionset.hh:238
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1468
Dune::MakeableInterfaceObject< typename GridType::template Codim< codim >::Entity > MakeableEntityType
Definition: alugrid/3d/datahandle.hh:31
void xtractData(ObjectStreamType &str, HElementType &elem)
Definition: alugrid/3d/datahandle.hh:556
Dune::ALU3dImplTraits< GridType::elementType, Comm > ImplTraits
Definition: alugrid/3d/datahandle.hh:36
Dune::ALU3dImplTraits< GridType::elementType, Comm > ImplTraits
Definition: alugrid/3d/datahandle.hh:501
GatherScatter::ObjectStreamType ObjectStreamType
Definition: alugrid/3d/datahandle.hh:47
EntityType & entity_
Definition: alugrid/3d/datahandle.hh:162
virtual void setElement(const HElementType &elem)=0
Definition: alugrid/3d/datahandle.hh:493
AdaptRestrictProlongImpl(GridType &grid, MakeableEntityType &f, RealEntityType &rf, MakeableEntityType &s, RealEntityType &rs, AdaptDataHandle &rp)
Constructor.
Definition: alugrid/3d/datahandle.hh:613
GridType::MPICommunicatorType Comm
Definition: alugrid/3d/datahandle.hh:499
virtual ~AdaptRestrictProlongImpl()
Definition: alugrid/3d/datahandle.hh:625
GridType::template Codim< 0 >::Entity EntityType
Definition: alugrid/3d/datahandle.hh:144
Definition: alugrid/3d/datahandle.hh:585
AdaptRestrictProlongGlSet(GridType &grid, MakeableEntityType &f, RealEntityType &rf, MakeableEntityType &s, RealEntityType &rs, AdaptDataHandle &rp, GlobalIdSetImp &set)
Constructor.
Definition: alugrid/3d/datahandle.hh:685
GatherScatterBaseImpl(const GridType &grid, MakeableEntityType &en, RealEntityType &realEntity, DataCollectorType &dc)
Constructor.
Definition: alugrid/3d/datahandle.hh:183
GridType::MPICommunicatorType Comm
Definition: alugrid/3d/datahandle.hh:34
int newElements() const
Definition: alugrid/3d/datahandle.hh:788
virtual bool containsItem(const HElementType &elem) const
Definition: alugrid/3d/datahandle.hh:196
int postRefinement(HElementType &elem)
prolong data, elem is the father
Definition: alugrid/3d/datahandle.hh:697
void sendData(ObjectStreamType &str, const HGhostType &ghost)
write Data of one ghost element to stream
Definition: alugrid/3d/datahandle.hh:217
void setData(ObjectStreamType &str, HElementType &elem)
Definition: alugrid/3d/datahandle.hh:74
const GridType & grid_
Definition: alugrid/3d/datahandle.hh:28
GatherScatterBaseImpl(const GridType &grid, MakeableEntityType &en, RealEntityType &realEntity, DataCollectorType &dc)
Constructor.
Definition: alugrid/3d/datahandle.hh:58
DataCollectorType & dc_
Definition: alugrid/3d/datahandle.hh:166
ImplTraits::template Codim< codim >::InterfaceType HElementType
Definition: alugrid/3d/datahandle.hh:153
ImplTraits::PllElementType PllElementType
Definition: alugrid/3d/datahandle.hh:510
RealEntityType & realEntity_
Definition: alugrid/3d/datahandle.hh:163
void writeSize(ObjectStreamType &str, EntityType &en)
Definition: alugrid/3d/datahandle.hh:266
the corresponding interface class is defined in bsinclude.hh
Definition: alugrid/3d/datahandle.hh:490
GridType::MPICommunicatorType Comm
Definition: alugrid/3d/datahandle.hh:149
the corresponding interface class is defined in bsinclude.hh
Definition: alugrid/3d/datahandle.hh:24
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:84
int postRefinement(HElementType &father)
prolong data for elements
Definition: alugrid/3d/datahandle.hh:640
void compress()
call compress on data
Definition: alugrid/3d/datahandle.hh:573
void sendData(ObjectStreamType &str, const HElementType &elem)
write Data of one element to stream
Definition: alugrid/3d/datahandle.hh:205
Dune::ALU3dImplTraits< GridType::elementType, Comm > ImplTraits
Definition: alugrid/3d/datahandle.hh:151
const GridType & grid_
Definition: alugrid/3d/datahandle.hh:143
MakeableEntityType::ImplementationType RealEntityType
Definition: alugrid/3d/datahandle.hh:497
GatherScatter::ObjectStreamType ObjectStreamType
Definition: alugrid/3d/datahandle.hh:522
GridType & grid_
Definition: alugrid/3d/datahandle.hh:512
bool contains(int dim, int cd) const
returns contains of dc_
Definition: alugrid/3d/datahandle.hh:65
void recvData(ObjectStreamType &str, HGhostType &ghost)
read Data of one element from stream
Definition: alugrid/3d/datahandle.hh:241
bool contains(int dim, int codim) const
Definition: alugrid/3d/datahandle.hh:190