dune-fem 2.8.0
Loading...
Searching...
No Matches
adaptationmanager.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_ADAPTATIONMANAGER_HH
2#define DUNE_FEM_ADAPTATIONMANAGER_HH
3
4//- system includes
5#include <string>
6
7//- local includes
8#include <dune/common/timer.hh>
11
17
22
24
25namespace Dune
26{
27
28 namespace Fem
29 {
30
60 {
61 public:
64
67
71 virtual void adapt ()
72 {
73 //std::cout << "called AdaptationManagerInterface::adapt()" << std::endl;
74 if(am_) am_->adapt();
75 else
76 {
77 std::cerr << "WARNING: AdaptationManagerInterface::adapt: no adaptation manager assigned! \n";
78 }
79 }
80
84 virtual bool adaptive () const
85 {
86 return (am_) ? (am_->adaptive()) : false;
87 }
88
92 virtual const char * methodName() const
93 {
94 return (am_) ? (am_->methodName()) : "unknown method";
95 }
96
101 {
103 am_ = const_cast<AdaptationManagerInterface *> (&am);
104 return (*this);
105 }
106
108 virtual bool loadBalance ()
109 {
110 return (am_) ? (am_->loadBalance()) : false;
111 }
112
114 virtual int balanceCounter () const
115 {
116 return (am_) ? (am_->balanceCounter()) : 0;
117 }
118
120 virtual double adaptationTime () const
121 {
122 return 0.0;
123 }
124
125 private:
128 };
129
131 template <class GridType>
133 {
134 public:
137 generic = 1,
138 callback = 2
139 };
140
141 public:
149 AdaptationMethod ( const GridType &grid, const ParameterReader &parameter = Parameter::container() )
151 {
152 const bool output = ( Parameter :: verbose() && MPIManager::isMainThread() );
153 int am = 1;
154 const std::string methodNames [] = { "none", "generic", "callback" };
155 am = parameter.getEnum("fem.adaptation.method", methodNames, am);
156 init(am,output);
157 }
158 private:
159 void init(int am,const bool output)
160 {
161
162 // chose adaptation method
163 if(am == 2) adaptationMethod_ = callback;
164 else if(am == 1) adaptationMethod_ = generic;
165 else adaptationMethod_ = none;
166
167 // for structred grid adaptation is disabled
169 {
171 if( output )
172 {
173 std::cerr << "WARNING: AdaptationMethod: adaptation disabled for structured grid! \n";
174 }
175 }
176
177 if( output )
178 {
179 std::cout << "Created AdaptationMethod: adaptation method = " << methodName() << std::endl;
180 }
181 }
182 public:
184 virtual ~AdaptationMethod () {}
185
187 virtual const char * methodName() const
188 {
189 switch (adaptationMethod_) {
190 case generic: return "generic";
191 case callback: return "callback";
192 case none: return "no adaptation";
193 default: return "unknown method";
194 }
195 }
196
198 virtual bool adaptive () const { return adaptationMethod_ != none; }
199
200 protected:
203 };
204
210 template <class GridType, class RestProlOperatorImp >
213 public ObjPointerStorage
214 {
216 typedef typename BaseType :: AdaptationMethodType AdaptationMethodType;
217
218 template <class AdaptManager, class GridImp, bool isGoodGrid>
219 struct CallAdaptationMethod
220 {
221 template <class DofManagerImp, class RPOpImp>
222 static void adapt(const AdaptManager& am, GridImp & grid,
223 DofManagerImp& dm , RPOpImp& rpop,
224 AdaptationMethodType adaptMethod)
225 {
226 // use generic adapt method
227 if( adaptMethod == BaseType :: generic )
228 {
229 am.template genericAdapt<All_Partition> ();
230 return ;
231 }
232
233 // use grid call back adapt method
234 if( adaptMethod == BaseType :: callback )
235 {
236 // combine dof manager and restrict prolong operator
238
239 // create new handle
240 RPType restrictProlongHandle ( dm , rpop );
241
242 // reserve memory
243 restrictProlongHandle.initialize();
244
245 // call grid adaptation
246 grid.adapt( restrictProlongHandle );
247
248 // do compress (if not already called)
249 restrictProlongHandle.finalize();
250 return ;
251 }
252 }
253 };
254
255 template <class AdaptManager, class GridImp>
256 struct CallAdaptationMethod<AdaptManager,GridImp,false>
257 {
258 template <class DofManagerImp, class RPOpImp>
259 static void adapt(const AdaptManager& am, GridImp & grid,
260 DofManagerImp& dm , RPOpImp& rpop,
261 AdaptationMethodType adaptMethod)
262 {
263 // use generic adapt method
264 if(adaptMethod != BaseType :: none )
265 {
266 // use partition type All_Partition,
267 // since we also need to iterate on ghosts
268 // for wasChanged information gathering
269 am.template genericAdapt<All_Partition> ();
270 return ;
271 }
272 }
273 };
274
277
280
281 public:
282 typedef typename GridType :: Traits :: LocalIdSet LocalIdSet;
283
293 AdaptationManagerBase ( GridType &grid, RestProlOperatorImp &rpOp, const ParameterReader &parameter = Parameter::container() )
294 : BaseType( grid, parameter ),
295 grid_( grid ),
296 dm_( DofManagerType::instance( grid_ ) ),
297 rpOp_( rpOp ),
298 adaptTime_( 0.0 ),
299 wasChanged_( false )
300 {}
301
304
308 RestProlOperatorImp & getRestProlOp ()
309 {
310 return rpOp_;
311 }
312
320 virtual void adapt ()
321 {
322 // only call in single thread mode
323 if( ! Fem :: MPIManager :: singleThreadMode() )
324 {
325 assert( Fem :: MPIManager :: singleThreadMode() );
326 DUNE_THROW(InvalidStateException,"AdaptationManagerBase::adapt: only call in single thread mode!");
327 }
328
329 // get stopwatch
330 Dune::Timer timer;
331
332 const bool supportsCallback = Capabilities :: supportsCallbackAdaptation< GridType > :: v;
333 CallAdaptationMethod< ThisType, GridType, supportsCallback >
334 :: adapt(*this,grid_,dm_,rpOp_,this->adaptationMethod_);
335
336 // take time
337 adaptTime_ = timer.elapsed();
338 }
339
341 virtual bool loadBalance ()
342 {
343 return false;
344 }
345
347 virtual int balanceCounter () const
348 {
349 return 0;
350 }
351
353 virtual double adaptationTime() const
354 {
355 return adaptTime_;
356 }
357
358 protected:
359 static DofManagerType& getDofManager(const GridType& grid)
360 {
361 return DofManagerType :: instance( grid );
362 }
363
364 private:
370 template <PartitionIteratorType pitype>
371 void genericAdapt () const
372 {
373 // initialize restrict prolong operator (e.g. PetscRestrictProlong... )
374 rpOp_.initialize();
375
376 // call pre-adapt, returns true if at least
377 // one element is marked for coarsening
378 bool restr = grid_.preAdapt();
379
380 // get macro grid view
381 typedef typename GridType::LevelGridView MacroGridView;
382 typedef typename MacroGridView :: template Codim<0>::
383 template Partition<pitype> :: Iterator MacroIterator;
384
385 // reset flag
386 wasChanged_ = false ;
387
388 if(restr)
389 {
390
391 // get macro grid view
392 MacroGridView macroView = grid_.levelGridView( 0 );
393
394 // make a hierarchical to insert all elements
395 // that are father of elements that might be coarsened
396
397 {
398 // get macro iterator
399 MacroIterator endit = macroView.template end<0,pitype> ();
400 for(MacroIterator it = macroView.template begin<0,pitype>();
401 it != endit; ++it )
402 {
403 hierarchicRestrict( *it , dm_.indexSetRestrictProlongNoResize() );
404 }
405 }
406
407 // if at least one element was found for restriction
408 if( wasChanged_ )
409 {
410 // now resize memory
411 dm_.resizeForRestrict();
412
413 // now project all data to fathers
414 {
415 // get macro iterator
416 MacroIterator endit = macroView.template end<0,pitype> ();
417 for(MacroIterator it = macroView.template begin<0,pitype>();
418 it != endit; ++it )
419 {
420 hierarchicRestrict( *it , rpOp_ );
421 }
422 }
423 }
424 }
425
426 // adapt grid due to preset markers
427 // returns true if at least one element was refined
428 const bool refined = grid_.adapt();
429
430 // if coarsening or refinement was done
431 // adjust sizes
432 if( refined || restr )
433 {
434 // resizes the index sets (insert all new indices)
435 // and resizes the memory
436 dm_.resize();
437 }
438
439 // in case elements were created do prolongation
440 if( refined )
441 {
442 // get macro grid view
443 MacroGridView macroView = grid_.levelGridView( 0 );
444
445 // make run through grid to project data
446 MacroIterator endit = macroView.template end<0,pitype> ();
447 for(MacroIterator it = macroView.template begin<0,pitype>();
448 it != endit; ++it )
449 {
450 hierarchicProlong( *it , rpOp_ );
451 }
452 }
453
454 // notifyGlobalChange make wasChanged equal on all cores
455 if( dm_.notifyGlobalChange( wasChanged_ ) )
456 {
457 // compress index sets and data
458 // this will increase the sequence counter
459 dm_.compress();
460 }
461
462 // do cleanup
463 grid_.postAdapt();
464
465 // finalize restrict prolong operator (e.g. PetscRestrictProlong... )
466 rpOp_.finalize();
467 }
468
469 private:
471 template <class EntityType, class RestrictOperatorType >
472 bool hierarchicRestrict ( const EntityType& entity, RestrictOperatorType & restop ) const
473 {
474 if( ! entity.isLeaf() )
475 {
476 // true means we are going to restrict data
477 bool doRestrict = true;
478
479 // check partition type
480 const bool isGhost = entity.partitionType() == GhostEntity ;
481
482 // if the children have children then we have to go deeper
483 const int childLevel = entity.level() + 1;
484 typedef typename EntityType::HierarchicIterator HierarchicIterator;
485
486 // check all children first
487 {
488 const HierarchicIterator endit = entity.hend( childLevel );
489 for(HierarchicIterator it = entity.hbegin( childLevel ); it != endit; ++it)
490 {
491 doRestrict &= hierarchicRestrict( *it , restop );
492 }
493 }
494
495 // if doRestrict is still true, restrict data
496 if(doRestrict)
497 {
498 // we did at least one restriction
499 wasChanged_ = true;
500
501 // do not restrict the solution on ghosts, this will
502 // fail, but we still need the wasChanged info, so simply
503 // calling hierarchicRestrict on interior won't work either
504 if( ! isGhost )
505 {
506 // true for first child, otherwise false
507 bool initialize = true;
508 const HierarchicIterator endit = entity.hend( childLevel );
509 for(HierarchicIterator it = entity.hbegin( childLevel ); it != endit; ++it)
510 {
511 // restrict solution
512 restop.restrictLocal( entity, *it , initialize);
513 // reset initialize flag
514 initialize = false;
515 }
516 restop.restrictFinalize(entity);
517 }
518 }
519 }
520
521 // if all children return mightBeCoarsened,
522 // then doRestrict on father remains true
523 return entity.mightVanish();
524 }
525
526 template <class EntityType, class ProlongOperatorType >
527 void hierarchicProlong ( const EntityType &entity, ProlongOperatorType & prolop ) const
528 {
529 typedef typename EntityType::HierarchicIterator HierarchicIterator;
530
531 // NOTE: initialize not working here
532 // because we call hierarchically
533
534 // first call on this element
535 bool initialize = true;
536
537 // check partition type
538 const bool isGhost = entity.partitionType() == GhostEntity ;
539
540 const int maxLevel = grid_.maxLevel();
541 const HierarchicIterator endit = entity.hend( maxLevel );
542 for( HierarchicIterator it = entity.hbegin( maxLevel ); it != endit; ++it )
543 {
544 // should only get here on non-leaf entities
545 assert( !entity.isLeaf() );
546
547 const EntityType & son = *it;
548 if( son.isNew() )
549 {
550 // the grid was obviously changed if we get here
551 wasChanged_ = true ;
552
553 // do not prolong the solution on ghosts, this will
554 // fail, but we still need the wasChanged info, so simply
555 // calling hierarchicRestrict on interior won't work either
556 if( ! isGhost )
557 {
558 EntityType vati = son.father();
559 prolop.prolongLocal( vati , son , initialize );
560 initialize = false;
561 }
562 }
563 }
564 }
565
566 protected:
568 GridType &grid_;
569
572
574 RestProlOperatorImp &rpOp_;
575
578
580 mutable bool wasChanged_;
581 };
582
584 template <class KeyType, class ObjectType>
586 {
587 static ObjectType* createObject(const KeyType& key)
588 {
589 return new ObjectType(0);
590 }
591 static void deleteObject(ObjectType* obj)
592 {
593 delete obj;
594 }
595 };
596
602 template <class GridType, class RestProlOperatorImp>
607 {
608 // type of key
609 typedef const GridType* KeyType;
610 // object type
611 typedef size_t ObjectType;
612 // type of factory
614
615 // type of singleton list
617
620
621 using BaseType :: rpOp_;
622
623 // reference counter to ensure only one instance per grid exists
624 ObjectType& referenceCounter_;
625
626 // do not copy
628
629 public:
648 AdaptationManager ( GridType &grid, RestProlOperatorImp &rpOp, int balanceCounter, const ParameterReader &parameter = Parameter::container() )
649 : BaseType(grid,rpOp, parameter)
650 , Base2Type( grid, rpOp )
651 , referenceCounter_( ProviderType :: getObject( &grid ) )
652 , balanceStep_( parameter.getValue< int >( "fem.loadbalancing.step", 1 ) )
653 , balanceCounter_( balanceCounter )
654 {
655 if( ++referenceCounter_ > 1 )
656 DUNE_THROW(InvalidStateException,"Only one instance of AdaptationManager allowed per grid instance");
657 if( Parameter::verbose() )
658 std::cout << "Created LoadBalancer: balanceStep = " << balanceStep_ << std::endl;
659 }
660
678 AdaptationManager ( GridType &grid, RestProlOperatorImp &rpOp, const ParameterReader &parameter = Parameter::container() )
679 : AdaptationManager( grid, rpOp, 0, parameter )
680 {
681 }
682
685 {
686 -- referenceCounter_;
687 ProviderType :: removeObject( referenceCounter_ );
688 }
689
691 virtual bool loadBalance ()
692 {
693 // same as for the adapt method
694 rpOp_.initialize () ;
695
696 // call load balance
697 const bool result = Base2Type :: loadBalance( );
698
699 // finalize rp object (mostly RestrictProlongDefault for PetscDF)
700 rpOp_.finalize () ;
701 return result ;
702 }
703
705 virtual double loadBalanceTime() const
706 {
707 return Base2Type::loadBalanceTime();
708 }
709
711 virtual void adapt ()
712 {
713 // adapt grid
714 BaseType :: adapt ();
715
716 // if adaptation is enabled
717 if( this->adaptive() && (balanceStep_ > 0) )
718 {
719 // if balance counter has readed balanceStep do load balance
720 const bool callBalance = (++balanceCounter_ >= balanceStep_);
721
722#ifndef NDEBUG
723 // make sure load balance is called on every process
724 int willCall = (callBalance) ? 1 : 0;
725 const int iCall = willCall;
726
727 // send info from rank 0 to all other
728 Base2Type::grid_.comm().broadcast(&willCall, 1 , 0);
729
730 assert( willCall == iCall );
731#endif
732
733 if( callBalance )
734 {
735 // balance work load and restore consistency in the data
736 loadBalance();
737 balanceCounter_ = 0;
738 }
739 else
740 {
741 // only restore consistency in the data
742 Base2Type::communicate();
743 }
744 }
745 }
746
748 int balanceCounter () const { return balanceCounter_; }
749
751 void backup() const
752 {
753 std::tuple<const int& > value( balanceCounter_ );
754 PersistenceManager::backupValue("loadbalancer",value);
755 }
756
758 void restore()
759 {
760 std::tuple< int& > value( balanceCounter_ );
761 PersistenceManager::restoreValue("loadbalancer",value);
762 }
763
764 private:
765 // call loadBalance ervery balanceStep_ step
766 const int balanceStep_ ;
767 // count actual balance call
768 int balanceCounter_;
769 };
770
771 namespace hpDG
772 {
773
774 // AdaptationManager
775 // -----------------
776
784 template< class DiscreteFunctionSpace, class DataProjection >
787 {
789
790 public:
795
796 private:
797 using GridType = typename DiscreteFunctionSpaceType::GridType;
799
801
802 public:
808 : space_( space ),
809 dataProjection_( std::forward< DataProjectionType >( dataProjection ) ),
810 dofManager_( DofManagerType::instance( space.gridPart().grid() ) ),
811 commList_( dataProjection_ ),
812 time_( 0. )
813 {}
814
822 AdaptationManager ( const ThisType & ) = delete;
823
825 ThisType &operator= ( const ThisType & ) = delete;
826
834 bool adaptive () const { return true; }
835
837 void adapt ()
838 {
839 // only call in single thread mode
840 if( ! Fem :: MPIManager :: singleThreadMode() )
841 {
842 assert( Fem :: MPIManager :: singleThreadMode() );
843 DUNE_THROW(InvalidStateException,"AdaptationManager::adapt: only call in single thread mode!");
844 }
845
846 Dune::Timer timer;
847
848 DataProjectionWrapper wrapper( dataProjection_, dofManager() );
849 space().adapt( wrapper );
850
851 if( dofManager().notifyGlobalChange( static_cast< bool >( wrapper ) ) )
852 dofManager().compress();
853
854 commList_.exchange();
855
856 time_ = timer.elapsed();
857 }
858
860 const char *methodName () const { return "discrete function space adaptation"; }
861
863 double adaptationTime () const { return time_; }
864
872 bool loadBalance () { return false; }
873
875 int balanceCounter () const { return 0; }
876
878 double loadBalanceTime () const { return 0.; }
879
882 DataProjection& dataProjection() { return dataProjection_; }
883 private:
884 DiscreteFunctionSpaceType &space () { return space_.get(); }
885
886 const DiscreteFunctionSpaceType &space () const { return space_.get(); }
887
888 DofManagerType &dofManager () { return dofManager_.get(); }
889
890 const DofManagerType &dofManager () const { return dofManager_.get(); }
891
892 std::reference_wrapper< DiscreteFunctionSpaceType > space_;
893 DataProjectionType dataProjection_;
894 std::reference_wrapper< DofManagerType > dofManager_;
895 mutable CommunicationManagerList commList_;
896 double time_;
897 };
898
899 // AdaptationManager::DataProjectionWrapper
900 // ----------------------------------------
901
902 template< class DiscreteFunctionSpace, class DataProjection >
905 {
907
908 public:
911
913 : dataProjection_( dataProjection ),
914 dofManager_( dofManager ),
915 modified_( false )
916 {}
917
918 void operator() ( const EntityType &entity,
919 const BasisFunctionSetType &prior,
920 const BasisFunctionSetType &present,
921 const std::vector< std::size_t > &origin,
922 const std::vector< std::size_t > &destination )
923 {
924 dofManager_.get().resizeMemory();
925 dataProjection_.get()( entity, prior, present, origin, destination );
926 modified_ = true;
927 }
928
929 template <class TemporaryStorage>
930 void operator() ( TemporaryStorage& tmp )
931 {
932 dataProjection_.get()( tmp );
933 modified_ = true;
934 }
935
936 explicit operator bool () const
937 {
938 return modified_;
939 }
940
941 private:
942 std::reference_wrapper< DataProjectionType > dataProjection_;
943 std::reference_wrapper< DofManagerType > dofManager_;
944 bool modified_;
945 };
946
947 } // namespace hpDG
948
949
950
957 {
963 template <class GridType>
964 static void apply(GridType& grid, const int step)
965 {
966 typedef DofManager< GridType > DofManagerType;
967 DofManagerType& dm = DofManagerType :: instance(grid);
968 grid.globalRefine(step);
969 grid.loadBalance();
970 dm.resize();
971 dm.compress();
972 }
973 };
981 {
986 template <class GridType>
987 static void apply(GridType& grid)
988 {
989 typedef DofManager< GridType > DofManagerType;
990 DofManagerType& dm = DofManagerType :: instance(grid);
991 grid.preAdapt();
992 grid.adapt();
993 grid.postAdapt();
994 grid.loadBalance();
995 dm.resize();
996 dm.compress();
997 }
998 };
999
1002 } // namespace Fem
1003
1004} // namespace Dune
1005
1006#endif // #ifndef DUNE_FEM_ADAPTMANAGER_HH
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and ALUGrid
STL namespace.
Definition: bindguard.hh:11
static void backupValue(const std::string &token, const T &value)
Definition: persistencemanager.hh:395
static void restoreValue(const std::string &token, T &value)
Definition: persistencemanager.hh:401
base class for auto persistent objects
Definition: persistencemanager.hh:580
static ParameterContainer & container()
Definition: io/parameter.hh:193
static bool verbose()
obtain the cached value for fem.verbose
Definition: io/parameter.hh:445
Definition: misc/capabilities.hh:151
static bool isMainThread()
return true if the current thread is the main thread (i.e. thread 0)
Definition: mpimanager.hh:427
Definition: objpointer.hh:42
AdaptationManagerInterface class.
Definition: adaptationmanager.hh:60
virtual double adaptationTime() const
time that last adaptation cycle took
Definition: adaptationmanager.hh:120
virtual const char * methodName() const
returns name of adaptation method
Definition: adaptationmanager.hh:92
virtual void adapt()
on call of this method the internal adaptation operator is called.
Definition: adaptationmanager.hh:71
virtual bool adaptive() const
returns true if adaptation manager as adaptation method different to NONE
Definition: adaptationmanager.hh:84
virtual ~AdaptationManagerInterface()
destructor
Definition: adaptationmanager.hh:66
virtual bool loadBalance()
call load balance, returns true if grid was changed
Definition: adaptationmanager.hh:108
AdaptationManagerInterface()
default constructor
Definition: adaptationmanager.hh:63
AdaptationManagerInterface & operator=(const AdaptationManagerInterface &am)
Assignment operator, pointer to adaptation manager is stored.
Definition: adaptationmanager.hh:100
virtual int balanceCounter() const
Definition: adaptationmanager.hh:114
AdaptationMethod is a simple adaptation method reader class.
Definition: adaptationmanager.hh:133
AdaptationMethod(const GridType &grid, const ParameterReader &parameter=Parameter::container())
constructor of AdaptationMethod The following optional parameters are used
Definition: adaptationmanager.hh:149
virtual ~AdaptationMethod()
virtual destructor
Definition: adaptationmanager.hh:184
AdaptationMethodType adaptationMethod_
method identifier
Definition: adaptationmanager.hh:202
virtual const char * methodName() const
returns name of adaptation method
Definition: adaptationmanager.hh:187
virtual bool adaptive() const
returns true if adaptation manager as adaptation method different to NONE
Definition: adaptationmanager.hh:198
AdaptationMethodType
type of adaptation method
Definition: adaptationmanager.hh:136
@ none
no adaptation is performed
Definition: adaptationmanager.hh:136
@ generic
a generic restriction and prolongation algorithm is used
Definition: adaptationmanager.hh:137
@ callback
the callback mechanism from AlbertaGrid and ALUGrid is used
Definition: adaptationmanager.hh:138
This class manages the adaptation process. If the method adapt is called, then the grid is adapted an...
Definition: adaptationmanager.hh:214
virtual int balanceCounter() const
default load balancing counter is zero
Definition: adaptationmanager.hh:347
virtual ~AdaptationManagerBase()
destructor
Definition: adaptationmanager.hh:303
AdaptationManagerBase(GridType &grid, RestProlOperatorImp &rpOp, const ParameterReader &parameter=Parameter::container())
constructor of AdaptationManagerBase The following optional parameter can be used
Definition: adaptationmanager.hh:293
double adaptTime_
time that adaptation took
Definition: adaptationmanager.hh:577
GridType & grid_
corresponding grid
Definition: adaptationmanager.hh:568
bool wasChanged_
flag for restriction
Definition: adaptationmanager.hh:580
RestProlOperatorImp & rpOp_
Restriction and Prolongation Operator.
Definition: adaptationmanager.hh:574
virtual bool loadBalance()
default load balancing method which does nothing
Definition: adaptationmanager.hh:341
virtual double adaptationTime() const
time that last adaptation cycle took
Definition: adaptationmanager.hh:353
static DofManagerType & getDofManager(const GridType &grid)
Definition: adaptationmanager.hh:359
GridType::Traits::LocalIdSet LocalIdSet
Definition: adaptationmanager.hh:282
virtual void adapt()
according to adaption method parameter the adaption procedure is done, 0 == no adaptation 1 == generi...
Definition: adaptationmanager.hh:320
RestProlOperatorImp & getRestProlOp()
Definition: adaptationmanager.hh:308
DofManagerType & dm_
DofManager corresponding to grid.
Definition: adaptationmanager.hh:571
factory class to create adaptation manager reference counter
Definition: adaptationmanager.hh:586
static ObjectType * createObject(const KeyType &key)
Definition: adaptationmanager.hh:587
static void deleteObject(ObjectType *obj)
Definition: adaptationmanager.hh:591
This class manages the adaptation process including a load balancing after the adaptation step....
Definition: adaptationmanager.hh:607
int balanceCounter() const
returns actual balanceCounter for checkpointing
Definition: adaptationmanager.hh:748
void restore()
retore internal data
Definition: adaptationmanager.hh:758
AdaptationManager(GridType &grid, RestProlOperatorImp &rpOp, int balanceCounter, const ParameterReader &parameter=Parameter::container())
constructor of AdaptationManager
Definition: adaptationmanager.hh:648
virtual double loadBalanceTime() const
time that last load balance cycle took
Definition: adaptationmanager.hh:705
void backup() const
backup internal data
Definition: adaptationmanager.hh:751
virtual bool loadBalance()
call load balance, returns true if grid was changed
Definition: adaptationmanager.hh:691
virtual void adapt()
on call of this method the internal adaptation operator is called.
Definition: adaptationmanager.hh:711
AdaptationManager(GridType &grid, RestProlOperatorImp &rpOp, const ParameterReader &parameter=Parameter::container())
constructor of AdaptationManager
Definition: adaptationmanager.hh:678
~AdaptationManager()
destructor decreasing reference counter
Definition: adaptationmanager.hh:684
Manages the testriction and prolongation of discrete functions in -adaptive computations.
Definition: adaptationmanager.hh:787
void adapt()
perform adaptation
Definition: adaptationmanager.hh:837
AdaptationManager(DiscreteFunctionSpaceType &space, DataProjectionType &&dataProjection)
Definition: adaptationmanager.hh:807
int balanceCounter() const
please doc me
Definition: adaptationmanager.hh:875
bool adaptive() const
returns true
Definition: adaptationmanager.hh:834
AdaptationManager(const ThisType &)=delete
Deleted methods.
double adaptationTime() const
return time spent on adaptation
Definition: adaptationmanager.hh:863
DataProjection & dataProjection()
Definition: adaptationmanager.hh:882
bool loadBalance()
please doc me
Definition: adaptationmanager.hh:872
const char * methodName() const
return name of adaptation method
Definition: adaptationmanager.hh:860
double loadBalanceTime() const
please doc me
Definition: adaptationmanager.hh:878
typename BaseType::EntityType EntityType
Definition: adaptationmanager.hh:910
DataProjectionWrapper(DataProjectionType &dataProjection, DofManagerType &dofManager)
Definition: adaptationmanager.hh:912
typename BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: adaptationmanager.hh:909
A class with one static method apply to globally refine a grid. All index sets are adapted to the new...
Definition: adaptationmanager.hh:957
static void apply(GridType &grid, const int step)
apply global refinement and also adjust index sets and managed dof storage. However,...
Definition: adaptationmanager.hh:964
A class with one static method apply for invoking the local adaptation procedure on a given grid inst...
Definition: adaptationmanager.hh:981
static void apply(GridType &grid)
apply local refinement and also adjust index sets and managed dof storage. However,...
Definition: adaptationmanager.hh:987
Definition: adaptcallbackhandle.hh:26
Definition: dofmanager.hh:761
Abstract definition of the local restriction and prolongation of discrete functions.
Definition: dataprojection/dataprojection.hh:29
typename BasisFunctionSetType::EntityType EntityType
entity type
Definition: dataprojection/dataprojection.hh:38
typename DiscreteFunctionSpaceType::BasisFunctionSetType BasisFunctionSetType
basis function set type
Definition: dataprojection/dataprojection.hh:36
Interface class for load balancing.
Definition: loadbalancer.hh:37
This class manages the adaptation process. If the method adapt is called, then the grid is adapted an...
Definition: loadbalancer.hh:66
Singleton list for key/object pairs.
Definition: singletonlist.hh:53
discrete function space