Dune Core Modules (2.4.1)

datahandle.hh
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
14using std::endl;
15using std::cout;
16using std::flush;
17
18namespace ALU2DSPACENAME
19{
20
22 //
23 // --AdaptRestrictProlong
24 //
26 template< class GridType, class AdaptDataHandle >
27 class AdaptRestrictProlong2dImpl
28 : public AdaptRestrictProlong2d ALU2DDIMWORLD( GridType::dimensionworld, GridType::elementType )
29 {
30 GridType & grid_;
31 typedef Dune :: MakeableInterfaceObject<typename GridType::template Codim<0>::Entity> EntityType;
32 typedef typename EntityType :: ImplementationType RealEntityType;
33 typedef typename Dune::ALU2dImplTraits< GridType::dimensionworld, GridType::elementType >::HElementType HElementType ;
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
60 virtual ~AdaptRestrictProlong2dImpl ()
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
interfaces and wrappers needed for the callback adaptation provided by AlbertaGrid and ALUGrid
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)