dune-fem 2.12-git
Loading...
Searching...
No Matches
datacollector.hh
Go to the documentation of this file.
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
15
16//- local includes
19
20namespace 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
55
56 template <class A, class B >
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>
83 {
84 public:
86 struct Traits
87 {
88 typedef ParamT ParamType;
89 };
90
91 template <class PT>
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
104
105 protected:
106 typedef ParamT ParamType;
107 typedef void FuncType(MyType &, ParamType & p);
109 typedef typename std::vector < PairType > ListType;
110
111 template <class OpType>
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 {
153 }
154
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 {
180 return *this;
181 }
182
184 {
185 copyList(vec_,op);
186 return *this;
187 }
188
189 template <class OpType>
190 MyType & operator += (const OpType & op)
191 {
193 return *this;
194 }
195
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 {
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;
240 };
241
242 template <class 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
271
272 public:
274
279
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
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
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
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
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
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
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
540 {
541 //std::cout << "getLocalInter \n";
542 return ldc_;
543 }
544
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 >
662 {
663 typedef typename DiscreteFunctionType::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
674 };
675
676
678 template< class DiscreteFunctionType,
679 class ContainsCheck >
681 : public LocalInlinePlus< LocalDataInliner< DiscreteFunctionType, ContainsCheck >,
682 typename LocalDataInlinerTraits< DiscreteFunctionType >::ParamType >
683 {
684 public:
687
689
692 typedef typename Traits::ParamType ParamType;
693
695
697 // we cannot use ConstLocalFunction here, since DiscreteFunctionType could
698 // be the FemPy::DiscreteFunctionList which only takes dofs vectors
700
702 LocalDataInliner ( const DiscreteFunctionType & df,
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_ ),
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:
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_;
747 const ContainsCheck containsCheck_;
749 };
750
751
752 template< class DiscreteFunctionType >
754 {
755 typedef typename DiscreteFunctionType::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
766 };
767
768
770 template< class DiscreteFunctionType,
771 class ContainsCheck >
773 : public LocalInlinePlus< LocalDataXtractor< DiscreteFunctionType, ContainsCheck >,
774 typename LocalDataXtractorTraits< DiscreteFunctionType >::ParamType >
775 {
776 public:
779
781
784 typedef typename Traits::ParamType ParamType;
785
787
789 // we cannot use ConstLocalFunction here, since DiscreteFunctionType could
790 // be the FemPy::DiscreteFunctionList which only takes dofs vectors
792
794 LocalDataXtractor ( DiscreteFunctionType & df,
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_ ),
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:
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:
838 DiscreteFunctionType &df_;
840 const ContainsCheck containsCheck_;
842 };
843
846 } // namespace Fem
847
848} // namespace Dune
849
850#endif // #ifndef DUNE_FEM_DATACOLLECTOR_HH
int size() const
iterator end()
const IndexPair * pair(const std::size_t &local) const
iterator(ParallelIndexSet< TG, TL, N > &indexSet, const Father &father)
STL namespace.
const GridEntityAccess< Entity >::GridEntityType & gridEntity(const Entity &entity)
Definition gridpart.hh:510
void resize(size_type n, value_type c=value_type())
void write(const T &val)
Traits class for a DiscreteFunction.
Definition common/discretefunction.hh:61
Definition objpointer.hh:42
void saveObjPointer(DiscrOpType *discrOp)
Store new generated DiscreteOperator Pointer.
Definition objpointer.hh:58
Definition dofmanager.hh:786
Definition datacollector.hh:232
LocalOp & asImp()
Definition datacollector.hh:251
CombinedLocalDataCollect< LocalOp, B > & operator+(const B &b)
Definition datacollector.hh:243
Definition datacollector.hh:52
ReadWriteType
Definition datacollector.hh:53
@ readData
Definition datacollector.hh:53
@ writeData
Definition datacollector.hh:53
Definition datacollector.hh:59
void apply(Arg &arg) const
Definition datacollector.hh:67
void apply(Arg1 &arg1, Arg2 &arg2) const
Definition datacollector.hh:74
CombinedLocalDataCollect(const A &a, const B &b)
Definition datacollector.hh:64
const B & b_
Definition datacollector.hh:62
const A & a_
Definition datacollector.hh:61
Definition datacollector.hh:83
static void copyList(ListType &vec, const MyType &op)
Definition datacollector.hh:130
LocalInterface(const MyType &op)
Definition datacollector.hh:155
void apply(ParamType &p) const
for all pointer to local operators call the func pointer
Definition datacollector.hh:163
virtual ~LocalInterface()
Definition datacollector.hh:160
LocalInterface(const OpType &op)
Definition datacollector.hh:150
bool empty() const
Definition datacollector.hh:224
ObjectStreamExtractor< ParamT >::ObjectStreamType ObjectStreamType
Definition datacollector.hh:103
std::pair< MyType *, FuncType * > PairType
Definition datacollector.hh:108
LocalInterface< ParamT > MyType
Definition datacollector.hh:85
std::vector< PairType > ListType
Definition datacollector.hh:109
MyType & operator=(const OpType &op)
Definition datacollector.hh:218
LocalInterface()
Definition datacollector.hh:147
MyType & operator+=(const OpType &op)
Definition datacollector.hh:190
void remove(const OpType &op)
Definition datacollector.hh:203
MyType & operator+(const OpType &op)
Definition datacollector.hh:177
ParamT ParamType
Definition datacollector.hh:106
void FuncType(MyType &, ParamType &p)
Definition datacollector.hh:107
Definition datacollector.hh:87
ParamT ParamType
Definition datacollector.hh:88
PT ObjectStreamType
Definition datacollector.hh:94
Definition datacollector.hh:113
static void applyWrapper(MyType &m, ParamType &p)
applyWrapper knows the real type of Op
Definition datacollector.hh:115
static void addToList(ListType &vec, const OpType &op)
Definition datacollector.hh:122
Definition datacollector.hh:237
LocalInterface< ParamType > LocalInterfaceType
Definition datacollector.hh:239
ParamT ParamType
Definition datacollector.hh:238
Definition datacollector.hh:262
DataCollectorInterface< GridType, ObjectStreamImp > MyType
Definition datacollector.hh:269
std::pair< ObjectStreamType *, const EntityType * > DataCollectorParamType
Definition datacollector.hh:270
MyType & operator=(const OpType &dc)
Assignement operator.
Definition datacollector.hh:360
virtual void clear()
clear object list
Definition datacollector.hh:378
GridType::template Codim< 0 >::Entity EntityType
Definition datacollector.hh:267
MyType & operator+=(const OpType &dc)
Assignement operator.
Definition datacollector.hh:324
virtual LocalInterfaceType & getLocalInterfaceOp()
Definition datacollector.hh:310
LocalInterface< DataCollectorParamType > LocalInterfaceType
Definition datacollector.hh:273
virtual const LocalInterfaceType & getLocalInterfaceOp() const
Definition datacollector.hh:298
virtual ~DataCollectorInterface()
Virtual desctructor.
Definition datacollector.hh:284
ObjectStreamImp ObjectStreamType
Definition datacollector.hh:264
virtual void apply(ObjectStreamType &str, const EntityType &entity) const
Definition datacollector.hh:289
DataCollectorInterface()
empty constructor
Definition datacollector.hh:281
Definition datacollector.hh:276
LocalInterface< DataCollectorParamType > LocalInterfaceType
Definition datacollector.hh:277
empty data collector
Definition datacollector.hh:392
MyType & operator+=(const OpType &dc)
Assignement operator.
Definition datacollector.hh:408
MyType & operator=(const OpType &dc)
Assignement operator.
Definition datacollector.hh:415
void apply(int, int) const
Definition datacollector.hh:401
std::pair< int *, int * > DataCollectorParamType
Definition datacollector.hh:396
LocalInterface< DataCollectorParamType > LocalInterfaceType
Definition datacollector.hh:397
The DataCollector is an example for a grid walk done while load balancing moves entities from one pro...
Definition datacollector.hh:435
const LocalDataCollectImp & getLocalOp() const
return reference to loacl Operator
Definition datacollector.hh:528
void apply(ObjectStreamType &str, const EntityType &entity) const
Definition datacollector.hh:556
DofManager< GridType > DofManagerType
Definition datacollector.hh:445
DataCollector(GridType &grid, DofManagerType &dm, LocalDataCollectImp &ldc, const ReadWriteType rwType, int numChildren=8)
create DiscreteOperator with a LocalOperator
Definition datacollector.hh:455
const LocalInterfaceType & getLocalInterfaceOp() const
Definition datacollector.hh:539
std::pair< ObjectStreamType *, const EntityType * > ParamType
Definition datacollector.hh:447
LocalInterface< ParamType > LocalInterfaceType
Definition datacollector.hh:448
DataCollectorTraits::ReadWriteType ReadWriteType
Definition datacollector.hh:442
DataCollectorInterface< GridType, ObjectStreamType > BaseType
Definition datacollector.hh:441
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
LocalInterfaceType & getLocalInterfaceOp()
Definition datacollector.hh:545
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
DataCollectorInterface< GridType, ObjectStreamType > DataCollectorInterfaceType
Definition datacollector.hh:451
GridType::template Codim< 0 >::Entity EntityType
Definition datacollector.hh:438
LocalDataCollectImp::ObjectStreamType ObjectStreamType
Definition datacollector.hh:437
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
LocalDataCollectImp & getLocalOp()
return reference to loacl Operator
Definition datacollector.hh:534
DataCollector< EntityType, LocalDataCollectImp > MyType
Definition datacollector.hh:444
Definition datacollector.hh:662
LocalInterface< ParamType > LocalInterfaceType
Definition datacollector.hh:673
DiscreteFunctionSpaceType::GridType GridType
Definition datacollector.hh:665
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition datacollector.hh:664
DofManager< GridType > DofManagerType
Definition datacollector.hh:669
std::pair< ObjectStreamType *, const GridEntityType * > ParamType
Definition datacollector.hh:672
DofManagerType::InlineStreamType ObjectStreamType
Definition datacollector.hh:670
DiscreteFunctionSpaceType::EntityType EntityType
Definition datacollector.hh:666
GridType::template Codim< 0 >::Entity GridEntityType
Definition datacollector.hh:667
Inline DiscreteFunction data during load balancing.
Definition datacollector.hh:683
LocalDataInliner(const DiscreteFunctionType &df, const ContainsCheck &containsCheck)
constructor
Definition datacollector.hh:702
Traits::GridEntityType GridEntityType
Definition datacollector.hh:691
LocalDofVectorType ldv_
Definition datacollector.hh:748
Dune::DynamicVector< DofType > LocalDofVectorType
Definition datacollector.hh:699
Traits::EntityType EntityType
Definition datacollector.hh:690
LocalInterface< ParamType > LocalInterfaceType
Definition datacollector.hh:694
const DiscreteFunctionType & df_
Definition datacollector.hh:745
LocalDataInliner(const LocalDataInliner &other)
copy constructor
Definition datacollector.hh:711
const ContainsCheck containsCheck_
Definition datacollector.hh:747
void apply(ParamType &p) const
store data to stream
Definition datacollector.hh:719
DataCollectorTraits::ReadWriteType readWriteInfo() const
Definition datacollector.hh:727
Traits::ParamType ParamType
Definition datacollector.hh:692
LocalDataInlinerTraits< DiscreteFunctionType > Traits
Definition datacollector.hh:685
Traits::ObjectStreamType ObjectStreamType
Definition datacollector.hh:686
void inlineData(ObjectStreamType &str, const EntityType &entity, const GridEntityType &gridEntity) const
store data to stream
Definition datacollector.hh:730
Traits::DofManagerType DofManagerType
Definition datacollector.hh:688
DofManagerType & dm_
Definition datacollector.hh:746
DiscreteFunctionTraits< DiscreteFunctionType >::DofType DofType
Definition datacollector.hh:696
Definition datacollector.hh:754
DiscreteFunctionSpaceType::GridType GridType
Definition datacollector.hh:757
GridType::template Codim< 0 >::Entity GridEntityType
Definition datacollector.hh:759
DofManagerType::XtractStreamType ObjectStreamType
Definition datacollector.hh:762
std::pair< ObjectStreamType *, const GridEntityType * > ParamType
Definition datacollector.hh:764
DofManager< GridType > DofManagerType
Definition datacollector.hh:761
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition datacollector.hh:756
DiscreteFunctionSpaceType::EntityType EntityType
Definition datacollector.hh:758
LocalInterface< ParamType > LocalInterfaceType
Definition datacollector.hh:765
Inline DiscreteFunction data during load balancing.
Definition datacollector.hh:775
DiscreteFunctionType & df_
Definition datacollector.hh:838
const ContainsCheck containsCheck_
Definition datacollector.hh:840
Traits::ObjectStreamType ObjectStreamType
Definition datacollector.hh:778
LocalDataXtractorTraits< DiscreteFunctionType > Traits
Definition datacollector.hh:777
Traits::EntityType EntityType
Definition datacollector.hh:782
LocalDataXtractor(const LocalDataXtractor &other)
copy constructor
Definition datacollector.hh:803
Dune::DynamicVector< DofType > LocalDofVectorType
Definition datacollector.hh:791
LocalDofVectorType ldv_
Definition datacollector.hh:841
LocalDataXtractor(DiscreteFunctionType &df, const ContainsCheck &containsCheck)
constructor
Definition datacollector.hh:794
Traits::DofManagerType DofManagerType
Definition datacollector.hh:780
DiscreteFunctionTraits< DiscreteFunctionType >::DofType DofType
Definition datacollector.hh:788
DataCollectorTraits::ReadWriteType readWriteInfo() const
Definition datacollector.hh:819
DofManagerType & dm_
Definition datacollector.hh:839
Traits::GridEntityType GridEntityType
Definition datacollector.hh:783
void apply(ParamType &p) const
store data to stream
Definition datacollector.hh:811
Traits::LocalInterfaceType LocalInterfaceType
Definition datacollector.hh:786
Traits::ParamType ParamType
Definition datacollector.hh:784
void xtractData(ObjectStreamType &str, const EntityType &entity, const GridEntityType &gridEntity) const
store data to stream
Definition datacollector.hh:822
T begin(T... args)
T end(T... args)
T erase(T... args)
T forward(T... args)
T push_back(T... args)
T resize(T... args)
T size(T... args)