dune-grid  2.4.1
alugrid/2d/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_ALU2DGRIDDATAHANDLE_HH
4 #define DUNE_ALU2DGRIDDATAHANDLE_HH
5 
6 //- system includes
7 #include <iostream>
8 
10 
11 //- local includes
12 #include "alu2dinclude.hh"
13 
14 using std::endl;
15 using std::cout;
16 using std::flush;
17 
18 namespace ALU2DSPACENAME
19 {
20 
22  //
23  // --AdaptRestrictProlong
24  //
26  template< class GridType, class AdaptDataHandle >
28  : public AdaptRestrictProlong2d ALU2DDIMWORLD( GridType::dimensionworld, GridType::elementType )
29  {
30  GridType & grid_;
32  typedef typename EntityType :: ImplementationType RealEntityType;
34 
35  EntityType & reFather_;
36  EntityType & reSon_;
37  RealEntityType & realFather_;
38  RealEntityType & realSon_;
39 
40  AdaptDataHandle &rp_;
41 
42  int maxlevel_;
43 
44 
45  public:
47  AdaptRestrictProlong2dImpl ( GridType &grid,
48  EntityType &f, RealEntityType &rf,
49  EntityType &s, RealEntityType &rs,
50  AdaptDataHandle &rp )
51  : grid_(grid)
52  , reFather_(f)
53  , reSon_(s)
54  , realFather_(rf)
55  , realSon_(rs)
56  , rp_(rp)
57  , maxlevel_(-1)
58  {}
59 
61  {}
62 
64  int preCoarsening ( HElementType &father )
65  {
66  maxlevel_ = std::max( maxlevel_, father.level() );
67  //father.resetRefinedTag();
68  realFather_.setElement( father );
69  rp_.preCoarsening( reFather_ );
70 
71  return 0;
72  }
73 
75  int postRefinement ( HElementType &father )
76  {
77  maxlevel_ = std::max( maxlevel_, father.level()+1 );
78  //father.resetRefinedTag();
79  realFather_.setElement( father );
80  rp_.postRefinement( reFather_ );
81 
82  return 0;
83  }
84 
85  int maxLevel () const { return maxlevel_; }
86  };
87 
88 } // namespace ALU2DSPACENAME
89 
90 #endif // #ifndef DUNE_ALU2DGRIDDATAHANDLE_HH
HmeshType::helement_t HElementType
Definition: alu2dinclude.hh:108
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and ALUGrid ...
#define ALU2DDIMWORLD(dimw, eltype)
Definition: alu2dinclude.hh:37
AdaptRestrictProlong2dImpl(GridType &grid, EntityType &f, RealEntityType &rf, EntityType &s, RealEntityType &rs, AdaptDataHandle &rp)
Constructor.
Definition: alugrid/2d/datahandle.hh:47
int postRefinement(HElementType &father)
prolong data, elem is the father
Definition: alugrid/2d/datahandle.hh:75
int max(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:335
Definition: alu2dinclude.hh:52
Definition: objectfactory.hh:23
Definition: alugrid/2d/datahandle.hh:27
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1468
int preCoarsening(HElementType &father)
restrict data , elem is always the father
Definition: alugrid/2d/datahandle.hh:64
int maxLevel() const
Definition: alugrid/2d/datahandle.hh:85
virtual ~AdaptRestrictProlong2dImpl()
Definition: alugrid/2d/datahandle.hh:60