DUNE-FEM (unstable)

datacollector.hh
1 #ifndef DUNE_FEM_DATACOLLECTOR_HH
2 #define DUNE_FEM_DATACOLLECTOR_HH
3 
4 //-System includes
5 #include <cassert>
6 #include <cstdlib>
7 
8 #include <vector>
9 #include <utility>
10 #include <iostream>
11 
12 //-Dune includes
13 #include <dune/common/dynvector.hh>
14 #include <dune/common/version.hh>
15 
16 //- local includes
17 #include <dune/fem/misc/gridobjectstreams.hh>
18 #include <dune/fem/operator/common/objpointer.hh>
19 
20 namespace Dune
21 {
22 
23  namespace Fem
24  {
25 
39  // external forward declerations
40  // -----------------------------
41 
42  template<class>
43  struct DiscreteFunctionTraits;
44 
45  template <class GridImp> class DofManager;
46 
47  template <class LocalOp, class ParamType> class LocalInlinePlus;
48 
49 
50  // define read or write stream
51  struct DataCollectorTraits
52  {
53  enum ReadWriteType { readData , writeData };
54  };
55 
56  template <class A, class B >
57  class CombinedLocalDataCollect
58  : public LocalInlinePlus< CombinedLocalDataCollect< A, B >, typename A::Traits::ParamType >
59  {
60  protected:
61  const A& a_;
62  const B& b_;
63  public:
64  CombinedLocalDataCollect( const A& a, const B& b ) : a_( a ), b_( b ) {}
65 
66  template <class Arg>
67  void apply(Arg & arg) const
68  {
69  a_.apply( arg );
70  b_.apply( arg );
71  }
72 
73  template <class Arg1, class Arg2>
74  void apply(Arg1 & arg1, Arg2 & arg2) const
75  {
76  a_.apply( arg1, arg2 );
77  b_.apply( arg1, arg2 );
78  }
79  };
80 
81  template <class ParamT>
82  class LocalInterface : public ObjPointerStorage
83  {
84  public:
85  typedef LocalInterface<ParamT> MyType;
86  struct Traits
87  {
88  typedef ParamT ParamType;
89  };
90 
91  template <class PT>
92  struct ObjectStreamExtractor
93  {
94  typedef PT ObjectStreamType ;
95  };
96 
97  template < class T1 , class T2 >
98  struct ObjectStreamExtractor< std::pair< T1* , const T2* > >
99  {
100  typedef T1 ObjectStreamType ;
101  };
102 
103  typedef typename ObjectStreamExtractor< ParamT > :: ObjectStreamType ObjectStreamType;
104 
105  protected:
106  typedef ParamT ParamType;
107  typedef void FuncType(MyType &, ParamType & p);
108  typedef typename std::pair < MyType * , FuncType * > PairType;
109  typedef typename std::vector < PairType > ListType;
110 
111  template <class OpType>
112  struct AddToWrapper
113  {
115  static void applyWrapper(MyType & m, ParamType & p )
116  {
117  static_cast<OpType &> (m).apply(p);
118  }
119 
122  static void addToList (ListType & vec , const OpType & op )
123  {
124  PairType p( const_cast<OpType *> (&op) , applyWrapper);
125  vec.push_back(p);
126  }
127  };
128 
129  // copy list of op to this class
130  static void copyList (ListType & vec, const MyType & op )
131  {
132  const ListType & ve = op.vec_;
133  if(ve.size() > 0)
134  {
135  ListType tmp ( vec );
136  vec.resize( vec.size() + ve.size() );
137 
138  // copy list to new vector
139  for(unsigned int i=0; i<tmp.size(); i++)
140  vec[i] = tmp[i];
141  for(unsigned int i=tmp.size(); i<vec.size(); i++)
142  vec[i] = ve[i-tmp.size()];
143  }
144  }
145 
146  public:
147  LocalInterface () : vec_ (0) {}
148 
149  template <class OpType>
150  LocalInterface (const OpType & op)
151  {
152  AddToWrapper<OpType>::addToList(vec_,op);
153  }
154 
155  LocalInterface (const MyType & op)
156  {
157  copyList(vec_,op);
158  }
159 
160  virtual ~LocalInterface() {};
161 
163  void apply ( ParamType & p ) const
164  {
165  const size_t size = vec_.size();
166  for(size_t i=0; i<size; ++i)
167  {
168  assert( vec_[i].second );
169  assert( vec_[i].first );
170  // vec_[i].second contains the pointer to the function that makes the
171  // correct cast to the real type of vec_[i].first
172  (*vec_[i].second)( *(vec_[i].first) , p );
173  }
174  }
175 
176  template <class OpType>
177  MyType & operator + (const OpType & op)
178  {
179  AddToWrapper<OpType>::addToList(vec_,op);
180  return *this;
181  }
182 
183  MyType & operator + (const MyType & op)
184  {
185  copyList(vec_,op);
186  return *this;
187  }
188 
189  template <class OpType>
190  MyType & operator += (const OpType & op)
191  {
192  AddToWrapper<OpType>::addToList(vec_,op);
193  return *this;
194  }
195 
196  MyType & operator += (const MyType & op)
197  {
198  copyList(vec_,op);
199  return *this;
200  }
201 
202  template <class OpType>
203  void remove(const OpType & op)
204  {
205  typedef typename ListType :: iterator iterator;
206  iterator end = vec_.end();
207  for(iterator it = vec_.begin(); it != end; ++it)
208  {
209  if( &op == (*it).first )
210  {
211  vec_.erase( it );
212  return ;
213  }
214  }
215  }
216 
217  template <class OpType>
218  MyType & operator = (const OpType & op)
219  {
220  AddToWrapper<OpType>::addToList(vec_,op);
221  return *this;
222  }
223 
224  bool empty () const { return (vec_.size() == 0); }
225 
226  private:
227  mutable ListType vec_;
228  };
229 
230  template <class LocalOp, class ParamT>
231  class LocalInlinePlus : public LocalInterface<ParamT>
232  {
233  public:
236  struct Traits
237  {
238  typedef ParamT ParamType;
239  typedef LocalInterface<ParamType> LocalInterfaceType;
240  };
241 
242  template <class B>
243  CombinedLocalDataCollect<LocalOp,B> & operator + (const B & b)
244  {
245  //std::cout << "operator + of LocalInlinePlus \n";
246  typedef CombinedLocalDataCollect<LocalOp,B> CombinedType;
247  CombinedType * combo = new CombinedType ( asImp() , b );
248  this->saveObjPointer( combo );
249  return *combo;
250  }
251  LocalOp & asImp() { return static_cast<LocalOp &> (*this); }
252  };
253 
260  template <class GridType, class ObjectStreamImp = DummyObjectStream >
262  {
263  public:
264  typedef ObjectStreamImp ObjectStreamType;
265 
266 
267  typedef typename GridType::template Codim<0>::Entity EntityType;
268 
270  typedef std::pair < ObjectStreamType * , const EntityType * > DataCollectorParamType;
271 
272  public:
273  typedef LocalInterface<DataCollectorParamType> LocalInterfaceType;
274 
275  struct Traits
276  {
277  typedef LocalInterface<DataCollectorParamType> LocalInterfaceType;
278  };
279 
281  DataCollectorInterface () : dc_ (0) {}
282 
285 
289  virtual void apply (ObjectStreamType &str, const EntityType & entity ) const
290  {
291  // if dc_ was set (otherwise we might be load balancing only the grid)
292  if(dc_)
293  {
294  (*dc_).apply(str, entity );
295  }
296  };
297 
298  virtual const LocalInterfaceType & getLocalInterfaceOp () const
299  {
300  if(dc_)
301  return dc_->getLocalInterfaceOp ();
302  else
303  {
304  std::cerr << "No LocalInterfaceOperator \n";
305  assert(false);
306  return *(new LocalInterfaceType());
307  }
308  };
309 
310  virtual LocalInterfaceType & getLocalInterfaceOp ()
311  {
312  if(dc_)
313  return dc_->getLocalInterfaceOp ();
314  else
315  {
316  std::cerr << "No LocalInterfaceOperator \n";
317  assert(false);
318  return *(new LocalInterfaceType());
319  }
320  };
321 
323  template <class OpType>
324  MyType & operator += (const OpType & dc)
325  {
326  if(dc_)
327  {
328  //std::cout << "Operator += with OpType \n";
329  dc_ = dcConv_;
330  MyType * tmp = const_cast<OpType &> (dc).convert();
331  dc_ = &(*dc_).operator += (*tmp);
332  }
333  else
334  {
335  dc_ = const_cast<OpType *> (&dc);
336  dcConv_ = const_cast<OpType &> (dc).convert();
337  }
338  return (*this);
339  }
340 
342  virtual MyType & operator += (const MyType & dc)
343  {
344  if(dc_)
345  {
346  //std::cout << "Operator += with MyType \n";
347  dc_ = dcConv_;
348  dc_ = &(*dc_).operator += (dc);
349  }
350  else
351  {
352  dc_ = const_cast<MyType *> (&dc);
353  dcConv_ = const_cast<MyType *> (&dc);
354  }
355  return (*this);
356  }
357 
359  template <class OpType>
360  MyType & operator = (const OpType & dc)
361  {
362  //std::cout << "Store operator \n";
363  dc_ = const_cast<OpType *> (&dc);
364  dcConv_ = const_cast<OpType &> (dc).convert();
365  return (*this);
366  }
367 
369  MyType & operator = (const MyType & dc)
370  {
371  //std::cout << "No need to do this, use += \n";
372  dc_ = const_cast<MyType *> (dc.dc_);
373  dcConv_ = const_cast<MyType *> (dc.dcConv_);
374  return (*this);
375  }
376 
378  virtual void clear()
379  {
380  dc_ = 0;
381  dcConv_ = 0;
382  }
383  private:
384  MyType *dc_;
385  MyType *dcConv_;
386  };
387 
388 
390  template <class GridType>
392  {
394  public:
395 
396  typedef std::pair < int * , int * > DataCollectorParamType;
397  typedef LocalInterface<DataCollectorParamType> LocalInterfaceType;
401  void apply (int , int ) const
402  {
403  std::cerr << "WARNING: apply: did nothing! \n";
404  };
405 
407  template <class OpType>
408  MyType & operator += (const OpType & dc)
409  {
410  return (*this);
411  }
412 
414  template <class OpType>
415  MyType & operator = (const OpType & dc)
416  {
417  return (*this);
418  }
419  };
420 
421 
430  template <class GridType,
431  class LocalDataCollectImp >
433  : public DataCollectorInterface< GridType, typename LocalDataCollectImp :: ObjectStreamType >
434  , public ObjPointerStorage
435  {
436  public:
437  typedef typename LocalDataCollectImp :: ObjectStreamType ObjectStreamType;
438  typedef typename GridType::template Codim<0>::Entity EntityType;
439 
440  protected:
442  typedef typename DataCollectorTraits :: ReadWriteType ReadWriteType;
443 
446 
447  typedef typename std::pair < ObjectStreamType * , const EntityType * > ParamType;
448  typedef LocalInterface<ParamType> LocalInterfaceType;
449 
450  friend class DataCollectorInterface<GridType, ObjectStreamType>;
452 
453  public:
455  DataCollector (GridType & grid,
456  DofManagerType & dm,
457  LocalDataCollectImp & ldc,
458  const ReadWriteType rwType,
459  int numChildren = 8)
460  : grid_(grid) , dm_ ( dm ), ldc_ (ldc)
461  , rwType_( rwType )
462  , numChildren_(numChildren)
463  {}
464 
466  virtual ~DataCollector () {}
467 
469  template <class LocalDataCollectType>
470  DataCollector<GridType,
471  CombinedLocalDataCollect <LocalDataCollectImp,LocalDataCollectType> > &
473  {
475  typedef CombinedLocalDataCollect <LocalDataCollectImp,LocalDataCollectType> COType;
476 
477  COType *newLDCOp = new COType ( ldc_ , const_cast<CopyType &> (op).getLocalOp() );
478  typedef DataCollector <GridType, COType> OPType;
479 
480  OPType *dcOp = new OPType ( grid_ , dm_ , *newLDCOp, rwType_ );
481 
482  // memorize this new generated object because is represents this
483  // operator and is deleted if this operator is deleted
484  saveObjPointer( dcOp , newLDCOp );
485 
486  return *dcOp;
487  }
488 
490  template <class LocalDataCollectType>
493  {
494  typedef LocalInterface<ParamType> COType;
495 
496  COType *newLDCOp = new COType ( ldc_ + op.getLocalOp() );
497  typedef DataCollector <GridType, COType> OPType;
498 
499  OPType *dcOp = new OPType ( grid_ , dm_ , *newLDCOp, rwType_ );
500 
501  // memorize this new generated object because is represents this
502  // operator and is deleted if this operator is deleted
503  saveObjPointer( dcOp , newLDCOp );
504 
505  return *dcOp;
506  }
507 
509  DataCollectorInterfaceType &
511  {
512  //std::cout << "operator += with Interface Type \n";
513  typedef LocalInterface<ParamType> COType;
514 
515  COType *newLDCOp = new COType ( ldc_ + op.getLocalInterfaceOp() );
516  typedef DataCollector<GridType, COType> OPType;
517 
518  OPType *dcOp = new OPType ( grid_ , dm_ , *newLDCOp, rwType_ );
519 
520  // memorize this new generated object because is represents this
521  // operator and is deleted if this operator is deleted
522  saveObjPointer( dcOp , newLDCOp );
523 
524  return *dcOp;
525  }
526 
528  const LocalDataCollectImp & getLocalOp () const
529  {
530  return ldc_;
531  }
532 
534  LocalDataCollectImp & getLocalOp ()
535  {
536  return ldc_;
537  }
538 
539  const LocalInterfaceType & getLocalInterfaceOp () const
540  {
541  //std::cout << "getLocalInter \n";
542  return ldc_;
543  }
544 
545  LocalInterfaceType & getLocalInterfaceOp ()
546  {
547  //std::cout << "getLocalInter \n";
548  return ldc_;
549  }
550 
552  bool writeData() const { return rwType_ == DataCollectorTraits :: writeData ; }
553 
556  void apply ( ObjectStreamType & str, const EntityType & entity ) const
557  {
558  ParamType p( &str , &entity );
559  // apply local operators
560  ldc_.apply( p );
561  }
562 
564  void inlineData (ObjectStreamType & str, const EntityType & entity ) const
565  {
566  // read/write macro element
567  inlineLocal(str, entity );
568 
569  // if given entity is not leaf then pack entire hierarchy
570  if( ! entity.isLeaf() )
571  {
572  const int mxlvl = grid_.maxLevel();
573 
574  typedef typename EntityType::HierarchicIterator HierarchicIteratorType;
575  const HierarchicIteratorType endit = entity.hend( mxlvl );
576  for(HierarchicIteratorType it = entity.hbegin( mxlvl );
577  it != endit; ++it )
578  {
579  inlineLocal(str, *it);
580  }
581  }
582  }
583 
585  void xtractData (ObjectStreamType & str, const EntityType & entity ) const
586  {
587  // read/write macro element
588  xtractLocal(str, entity );
589 
590  // if given entity is not leaf then unpack entire hierarchy
591  if( ! entity.isLeaf() )
592  {
593  const int mxlvl = grid_.maxLevel();
594 
595  typedef typename EntityType::HierarchicIterator HierarchicIteratorType;
596  const HierarchicIteratorType endit = entity.hend( mxlvl );
597  for(HierarchicIteratorType it = entity.hbegin( mxlvl );
598  it != endit; ++it )
599  {
600  xtractLocal(str, *it);
601  }
602  }
603  }
604 
605  private:
607  {
608  typedef LocalInterface<ParamType> COType;
609 
610  COType *newLDCOp = new COType ( ldc_ );
611  typedef DataCollector <GridType, COType> OPType;
612 
613  OPType *dcOp = new OPType ( grid_ , dm_ , *newLDCOp, rwType_ );
614 
615  // memorize this new generated object because is represents this
616  // operator and is deleted if this operator is deleted
617  saveObjPointer( dcOp , newLDCOp );
618 
619  return dcOp;
620  }
621 
622  // write data of entity
623  void inlineLocal(ObjectStreamType & str, const EntityType& entity ) const
624  {
625  assert( writeData() );
626 
627  ParamType p( &str , &entity );
628  // apply local operators
629  ldc_.apply( p );
630  }
631 
632  // read data of entity
633  void xtractLocal(ObjectStreamType & str, const EntityType& entity ) const
634  {
635  assert( ! writeData() );
636 
637  ParamType p( &str , &entity );
638  // apply local operators
639  ldc_.apply( p );
640  }
641 
643  GridType &grid_;
644 
646  DofManagerType &dm_;
647 
649  LocalDataCollectImp &ldc_;
650 
652  const ReadWriteType rwType_;
653 
654  // number of childs one element can have
655  const int numChildren_;
656  };
657 
658 
659  //***********************************************************************
660  template< class DiscreteFunctionType >
661  struct LocalDataInlinerTraits
662  {
664  DiscreteFunctionSpaceType;
665  typedef typename DiscreteFunctionSpaceType::GridType GridType;
666  typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
667  typedef typename GridType :: template Codim< 0 > :: Entity GridEntityType;
668 
669  typedef DofManager < GridType > DofManagerType ;
670  typedef typename DofManagerType :: InlineStreamType ObjectStreamType;
671 
672  typedef std::pair< ObjectStreamType *, const GridEntityType * > ParamType;
673  typedef LocalInterface< ParamType > LocalInterfaceType;
674  };
675 
676 
678  template< class DiscreteFunctionType,
679  class ContainsCheck >
681  : public LocalInlinePlus< LocalDataInliner< DiscreteFunctionType, ContainsCheck >,
682  typename LocalDataInlinerTraits< DiscreteFunctionType >::ParamType >
683  {
684  public:
685  typedef LocalDataInlinerTraits< DiscreteFunctionType > Traits;
686  typedef typename Traits::ObjectStreamType ObjectStreamType;
687 
688  typedef typename Traits::DofManagerType DofManagerType;
689 
690  typedef typename Traits::EntityType EntityType;
691  typedef typename Traits::GridEntityType GridEntityType;
692  typedef typename Traits::ParamType ParamType;
693 
694  typedef LocalInterface<ParamType> LocalInterfaceType;
695 
697  // we cannot use ConstLocalFunction here, since DiscreteFunctionType could
698  // be the FemPy::DiscreteFunctionList which only takes dofs vectors
700 
703  const ContainsCheck& containsCheck )
704  : df_ (df),
705  dm_( DofManagerType::instance( df.gridPart().grid() ) ),
706  containsCheck_( containsCheck ),
707  ldv_()
708  {}
709 
712  : df_ (other.df_),
713  dm_( other.dm_ ),
714  containsCheck_( other.containsCheck_ ),
715  ldv_()
716  {}
717 
719  void apply ( ParamType & p ) const
720  {
721  assert( p.first && p.second );
722  const EntityType& entity = df_.space().gridPart().convert( *p.second );
723  inlineData( *p.first, entity, *p.second );
724  }
725 
726  typename DataCollectorTraits :: ReadWriteType
727  readWriteInfo() const { return DataCollectorTraits :: writeData ; }
728  protected:
730  void inlineData ( ObjectStreamType& str,
731  const EntityType& entity,
732  const GridEntityType& gridEntity ) const
733  {
734  if( ! containsCheck_.contains ( entity ) ) return ;
735 
736  assert( df_.space().indexSet().contains( entity ) );
737 
738  ldv_.resize( df_.space().basisFunctionSet( entity ).size() );
739  df_.getLocalDofs( entity, ldv_ );
740  for( const DofType &dof : ldv_ )
741  str.write( dof );
742  }
743 
744  protected:
745  const DiscreteFunctionType & df_;
746  DofManagerType& dm_ ;
747  const ContainsCheck containsCheck_;
748  mutable LocalDofVectorType ldv_;
749  };
750 
751 
752  template< class DiscreteFunctionType >
753  struct LocalDataXtractorTraits
754  {
756  DiscreteFunctionSpaceType;
757  typedef typename DiscreteFunctionSpaceType::GridType GridType;
758  typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
759  typedef typename GridType :: template Codim< 0 > :: Entity GridEntityType;
760 
761  typedef DofManager < GridType > DofManagerType ;
762  typedef typename DofManagerType :: XtractStreamType ObjectStreamType;
763 
764  typedef std::pair< ObjectStreamType *, const GridEntityType * > ParamType;
765  typedef LocalInterface< ParamType > LocalInterfaceType;
766  };
767 
768 
770  template< class DiscreteFunctionType,
771  class ContainsCheck >
773  : public LocalInlinePlus< LocalDataXtractor< DiscreteFunctionType, ContainsCheck >,
774  typename LocalDataXtractorTraits< DiscreteFunctionType >::ParamType >
775  {
776  public:
777  typedef LocalDataXtractorTraits< DiscreteFunctionType > Traits;
778  typedef typename Traits::ObjectStreamType ObjectStreamType;
779 
780  typedef typename Traits::DofManagerType DofManagerType;
781 
782  typedef typename Traits::EntityType EntityType;
783  typedef typename Traits::GridEntityType GridEntityType;
784  typedef typename Traits::ParamType ParamType;
785 
786  typedef typename Traits::LocalInterfaceType LocalInterfaceType;
787 
789  // we cannot use ConstLocalFunction here, since DiscreteFunctionType could
790  // be the FemPy::DiscreteFunctionList which only takes dofs vectors
792 
795  const ContainsCheck& containsCheck )
796  : df_ (df),
797  dm_( DofManagerType :: instance( df.gridPart().grid() ) ),
798  containsCheck_( containsCheck ),
799  ldv_()
800  {}
801 
804  : df_( other.df_ ),
805  dm_( other.dm_ ),
806  containsCheck_( other.containsCheck_ ),
807  ldv_()
808  {}
809 
811  void apply ( ParamType & p ) const
812  {
813  assert( p.first && p.second );
814  const EntityType& entity = df_.space().gridPart().convert( *p.second );
815  xtractData( *p.first, entity, *p.second );
816  }
817 
818  typename DataCollectorTraits :: ReadWriteType
819  readWriteInfo() const { return DataCollectorTraits :: readData ; }
820  protected:
822  void xtractData (ObjectStreamType & str,
823  const EntityType& entity,
824  const GridEntityType& gridEntity ) const
825  {
826  if( ! containsCheck_.contains ( entity ) ) return ;
827 
828  // make sure entity is contained in set
829  assert( df_.space().indexSet().contains( entity ) );
830 
831  ldv_.resize( df_.space().basisFunctionSet( entity ).size() );
832  for( DofType &dof : ldv_ )
833  str.read( dof );
834  df_.setLocalDofs( entity, ldv_ );
835  }
836 
837  protected:
839  DofManagerType &dm_;
840  const ContainsCheck containsCheck_;
841  mutable LocalDofVectorType ldv_;
842  };
843 
846  } // namespace Fem
847 
848 } // namespace Dune
849 
850 #endif // #ifndef DUNE_FEM_DATACOLLECTOR_HH
Wrapper class for entities.
Definition: entity.hh:66
Definition: datacollector.hh:262
MyType & operator=(const OpType &dc)
Assignement operator.
Definition: datacollector.hh:360
virtual void clear()
clear object list
Definition: datacollector.hh:378
virtual ~DataCollectorInterface()
Virtual desctructor.
Definition: datacollector.hh:284
virtual void apply(ObjectStreamType &str, const EntityType &entity) const
Definition: datacollector.hh:289
DataCollectorInterface()
empty constructor
Definition: datacollector.hh:281
MyType & operator+=(const OpType &dc)
Assignement operator.
Definition: datacollector.hh:324
The DataCollector is an example for a grid walk done while load balancing moves entities from one pro...
Definition: datacollector.hh:435
void apply(ObjectStreamType &str, const EntityType &entity) const
Definition: datacollector.hh:556
LocalDataCollectImp & getLocalOp()
return reference to loacl Operator
Definition: datacollector.hh:534
DataCollector(GridType &grid, DofManagerType &dm, LocalDataCollectImp &ldc, const ReadWriteType rwType, int numChildren=8)
create DiscreteOperator with a LocalOperator
Definition: datacollector.hh:455
void inlineData(ObjectStreamType &str, const EntityType &entity) const
write all data of all entities blowe this Entity to the stream
Definition: datacollector.hh:564
void xtractData(ObjectStreamType &str, const EntityType &entity) const
read all data of all entities blowe this Entity from the stream
Definition: datacollector.hh:585
bool writeData() const
return true if data collector is writing data instead of reading
Definition: datacollector.hh:552
virtual ~DataCollector()
Desctructor.
Definition: datacollector.hh:466
const LocalDataCollectImp & getLocalOp() const
return reference to loacl Operator
Definition: datacollector.hh:528
DataCollector< GridType, CombinedLocalDataCollect< LocalDataCollectImp, LocalDataCollectType > > & operator+(const DataCollector< GridType, LocalDataCollectType > &op)
operator + (combine this operator) and return new Object
Definition: datacollector.hh:472
DataCollector< GridType, LocalInterface< ParamType > > & operator+=(const DataCollector< GridType, LocalDataCollectType > &op)
oeprator += combine and return this Object
Definition: datacollector.hh:492
void getLocalDofs(const EntityType &entity, Vector &localDofs) const
fill local Dofs to dof vector associated with the entity
Definition: discretefunction.hh:946
void setLocalDofs(const EntityType &entity, const LocalDofs &localDofs)
set local Dofs to dof vector associated with the entity
Definition: discretefunction.hh:938
GridPartType ::GridType GridType
type of underlying dune grid
Definition: discretefunctionspace.hh:214
Definition: dofmanager.hh:786
empty data collector
Definition: datacollector.hh:392
MyType & operator=(const OpType &dc)
Assignement operator.
Definition: datacollector.hh:415
void apply(int, int) const
Definition: datacollector.hh:401
MyType & operator+=(const OpType &dc)
Assignement operator.
Definition: datacollector.hh:408
Inline DiscreteFunction data during load balancing.
Definition: datacollector.hh:683
LocalDataInliner(const DiscreteFunctionType &df, const ContainsCheck &containsCheck)
constructor
Definition: datacollector.hh:702
LocalDataInliner(const LocalDataInliner &other)
copy constructor
Definition: datacollector.hh:711
void apply(ParamType &p) const
store data to stream
Definition: datacollector.hh:719
void inlineData(ObjectStreamType &str, const EntityType &entity, const GridEntityType &gridEntity) const
store data to stream
Definition: datacollector.hh:730
Inline DiscreteFunction data during load balancing.
Definition: datacollector.hh:775
LocalDataXtractor(const LocalDataXtractor &other)
copy constructor
Definition: datacollector.hh:803
LocalDataXtractor(DiscreteFunctionType &df, const ContainsCheck &containsCheck)
constructor
Definition: datacollector.hh:794
void apply(ParamType &p) const
store data to stream
Definition: datacollector.hh:811
void xtractData(ObjectStreamType &str, const EntityType &entity, const GridEntityType &gridEntity) const
store data to stream
Definition: datacollector.hh:822
Definition: objpointer.hh:42
void saveObjPointer(DiscrOpType *discrOp)
Store new generated DiscreteOperator Pointer.
Definition: objpointer.hh:58
forward declaration
Definition: discretefunction.hh:51
TupleDiscreteFunctionSpace< typename DiscreteFunctions::DiscreteFunctionSpaceType ... > DiscreteFunctionSpaceType
type for the discrete function space this function lives in
Definition: discretefunction.hh:69
const DiscreteFunctionSpaceType & space() const
obtain a reference to the corresponding DiscreteFunctionSpace
Definition: discretefunction.hh:709
Various macros to work with Dune module version numbers.
This file implements a dense vector with a dynamic size.
concept Entity
Model of a grid entity.
Definition: entity.hh:107
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::bool_constant<(sizeof...(II)==0)> empty(std::integer_sequence< T, II... >)
Checks whether the sequence is empty.
Definition: integersequence.hh:80
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
Static tag representing a codimension.
Definition: dimension.hh:24
Traits class for a DiscreteFunction.
Definition: discretefunction.hh:61
Definition: datacollector.hh:237
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 9, 22:29, 2024)