1 #ifndef DUNE_FEM_ADAPTCALLBACKHANDLE_HH 2 #define DUNE_FEM_ADAPTCALLBACKHANDLE_HH 4 #include <dune/grid/common/gridenums.hh> 5 #include <dune/grid/common/adaptcallback.hh> 22 template<
class Gr
id,
class DofManager,
class RestrictPro
longOperator >
24 :
public AdaptDataHandle
25 < Grid, RestrictProlongWrapper< Grid, DofManager, RestrictProlongOperator > >
28 typedef AdaptDataHandle< Grid, This > Base;
40 typedef typename Base::Entity
Entity;
43 : dofManager_( dofManager ),
46 initializeCalled_( false ),
47 finalizeCalled_( false )
52 : dofManager_( org.dofManager_ ),
54 wasChanged_( org.wasChanged_ ),
55 initializeCalled_( org.initializeCalled_ ),
56 finalizeCalled_( org.finalizeCalled_ )
65 assert( entity.partitionType() != GhostEntity );
74 void initialize (
unsigned int estimatedAdditionalElements = 0 )
77 if( initializeCalled_ ) return ;
85 initializeCalled_ =
true;
87 finalizeCalled_ = false ;
95 if( finalizeCalled_ ) return ;
109 finalizeCalled_ = true ;
112 initializeCalled_ = false ;
120 typedef typename Entity::HierarchicIterator HIterator;
123 const int childLevel = father.level() + 1;
124 const HIterator end = father.hend( childLevel );
125 for( HIterator it = father.hbegin( childLevel ); it != end; ++it )
138 rpOp_.restrictLocal( father, son, initialize );
147 typedef typename Entity::HierarchicIterator HIterator;
150 const int childLevel = father.level() + 1;
151 const HIterator end = father.hend( childLevel );
152 for( HIterator it = father.hbegin( childLevel ); it != end; ++it )
165 rpOp_.prolongLocal( father, son, initialize );
174 #endif // #ifndef DUNE_FEM_ADAPTCALLBACKHANDLE_HH void restrictLocal(const EntityType &father, const EntityType &son, bool initialize) const
restrict data to father and resize memory if doResize is true
Definition: dofmanager.hh:737
void reserveMemory(int nsize, bool dummy=false)
reserve memory for at least nsize elements, dummy is needed for dune-grid ALUGrid version ...
Definition: dofmanager.hh:1034
bool finalizeCalled_
Definition: adaptcallbackhandle.hh:37
RestrictProlongWrapper(DofManager &dofManager, RestrictProlongOperator &rpOp)
Definition: adaptcallbackhandle.hh:42
bool wasChanged_
Definition: adaptcallbackhandle.hh:35
void prolongLocal(const EntityType &father, const EntityType &son, bool initialize) const
prolong data to children and resize memory if doResize is true
Definition: dofmanager.hh:753
void compress()
Compress all data that is hold by this dofmanager.
Definition: dofmanager.hh:1106
DofManager & dofManager_
Definition: adaptcallbackhandle.hh:31
Definition: datacollector.hh:45
void initialize(unsigned int estimatedAdditionalElements=0)
initialize basically reserves some memory on the DofManager
Definition: adaptcallbackhandle.hh:74
void postRefinement(const Entity &father) const
Definition: adaptcallbackhandle.hh:143
void preAdapt(const unsigned int estimatedAdditionalElements)
Definition: adaptcallbackhandle.hh:70
void postAdapt()
Definition: adaptcallbackhandle.hh:71
void preCoarsening(const Entity &father) const
Definition: adaptcallbackhandle.hh:116
Definition: coordinate.hh:4
void restrictLocal(const Entity &father, const Entity &son, bool initialize) const
Definition: adaptcallbackhandle.hh:133
bool isValidEntity(const Entity &entity) const
Definition: adaptcallbackhandle.hh:59
bool notifyGlobalChange(const bool wasChanged) const
communicate new sequence number
Definition: dofmanager.hh:1137
RestrictProlongWrapper(const RestrictProlongWrapper &org)
Definition: adaptcallbackhandle.hh:51
Base::Entity Entity
Definition: adaptcallbackhandle.hh:40
Definition: adaptcallbackhandle.hh:23
void finalize()
finalize calls the compress on the DofManager
Definition: adaptcallbackhandle.hh:92
RestrictProlongOperator & rpOp_
Definition: adaptcallbackhandle.hh:32
bool initializeCalled_
Definition: adaptcallbackhandle.hh:36
NewIndexSetRestrictProlongType & indexSetRestrictProlong()
returns the index set restriction and prolongation operator
Definition: dofmanager.hh:989
void prolongLocal(const Entity &father, const Entity &son, bool initialize) const
Definition: adaptcallbackhandle.hh:160