dune-grid 2.9.0
albertagrid/datahandle.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_ALBERTAGRIDDATAHANDLE_HH
6#define DUNE_ALBERTAGRIDDATAHANDLE_HH
7
8#include <iostream>
9
11
16
17#if HAVE_ALBERTA
18
19namespace Dune
20{
21
22 namespace Alberta
23 {
24
25 template< class Grid, class RestrictProlongOperator >
27 {
28 static const int dimension = Grid::dimension;
29
30 typedef typename Grid::template Codim< 0 >::Entity Entity;
32 typedef typename EntityObject::ImplementationType EntityImp;
33
36
37 Grid &grid_;
38 RestrictProlongOperator &rpOp_;
39 EntityObject father_;
40
41 public:
42 AdaptRestrictProlongHandler ( Grid &grid, RestrictProlongOperator &rpOp )
43 : grid_( grid ),
44 rpOp_( rpOp ),
45 father_( EntityImp( grid_ ) )
46 {}
47
48 void restrictLocal ( const Patch &patch, int i )
49 {
50 ElementInfo fatherInfo = patch.elementInfo( i, grid_.levelProvider() );
51 father_.impl().setElement( fatherInfo, 0 );
52 rpOp_.preCoarsening( (const Entity &)father_ );
53 }
54
55 void prolongLocal ( const Patch &patch, int i )
56 {
57 ElementInfo fatherInfo = patch.elementInfo( i, grid_.levelProvider() );
58 father_.impl().setElement( fatherInfo, 0 );
59 rpOp_.postRefinement( (const Entity &)father_ );
60 }
61 };
62
63 }
64
65}
66
67#endif // #if HAVE_ALBERTA
68
69#endif
provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
provides a wrapper for ALBERTA's el_info structure
Include standard header files.
Definition: agrid.hh:60
Definition: albertagrid/datahandle.hh:27
AdaptRestrictProlongHandler(Grid &grid, RestrictProlongOperator &rpOp)
Definition: albertagrid/datahandle.hh:42
void restrictLocal(const Patch &patch, int i)
Definition: albertagrid/datahandle.hh:48
void prolongLocal(const Patch &patch, int i)
Definition: albertagrid/datahandle.hh:55
Definition: refinement.hh:40
ElementInfo elementInfo(int i, const LevelProvider &levelProvider) const
Definition: refinement.hh:105
Implementation & impl()
access to the underlying implementation
Definition: common/entity.hh:80
Grid abstract base class.
Definition: common/grid.hh:375
static constexpr int dimension
The dimension of the grid.
Definition: common/grid.hh:387
InterfaceType::Implementation ImplementationType
Definition: common/grid.hh:1108
Different resources needed by all grid implementations.