dune-grid  2.7.1
albertagrid/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_ALBERTAGRIDDATAHANDLE_HH
4 #define DUNE_ALBERTAGRIDDATAHANDLE_HH
5 
6 #include <iostream>
7 
9 
14 
15 #if HAVE_ALBERTA
16 
17 namespace Dune
18 {
19 
20  namespace Alberta
21  {
22 
23  template< class Grid, class RestrictProlongOperator >
25  {
26  static const int dimension = Grid::dimension;
27 
28  typedef typename Grid::template Codim< 0 >::Entity Entity;
30  typedef typename EntityObject::ImplementationType EntityImp;
31 
34 
35  Grid &grid_;
36  RestrictProlongOperator &rpOp_;
37  EntityObject father_;
38 
39  public:
40  AdaptRestrictProlongHandler ( Grid &grid, RestrictProlongOperator &rpOp )
41  : grid_( grid ),
42  rpOp_( rpOp ),
43  father_( EntityImp( grid_ ) )
44  {}
45 
46  void restrictLocal ( const Patch &patch, int i )
47  {
48  ElementInfo fatherInfo = patch.elementInfo( i, grid_.levelProvider() );
49  father_.impl().setElement( fatherInfo, 0 );
50  rpOp_.preCoarsening( (const Entity &)father_ );
51  }
52 
53  void prolongLocal ( const Patch &patch, int i )
54  {
55  ElementInfo fatherInfo = patch.elementInfo( i, grid_.levelProvider() );
56  father_.impl().setElement( fatherInfo, 0 );
57  rpOp_.postRefinement( (const Entity &)father_ );
58  }
59  };
60 
61  }
62 
63 }
64 
65 #endif // #if HAVE_ALBERTA
66 
67 #endif
provides a wrapper for ALBERTA's el_info structure
provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
Include standard header files.
Definition: agrid.hh:59
Definition: albertagrid/datahandle.hh:25
AdaptRestrictProlongHandler(Grid &grid, RestrictProlongOperator &rpOp)
Definition: albertagrid/datahandle.hh:40
void restrictLocal(const Patch &patch, int i)
Definition: albertagrid/datahandle.hh:46
void prolongLocal(const Patch &patch, int i)
Definition: albertagrid/datahandle.hh:53
Definition: refinement.hh:38
ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const
Definition: refinement.hh:103
Implementation & impl()
access to the underlying implementation
Definition: common/entity.hh:78
Grid abstract base class.
Definition: common/grid.hh:373
@ dimension
The dimension of the grid.
Definition: common/grid.hh:387
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1174
Different resources needed by all grid implementations.