Dune Core Modules (unstable)

datahandle.hh
1// SPDX-FileCopyrightText: Copyright © 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
12#include <dune/grid/albertagrid/misc.hh>
13#include <dune/grid/albertagrid/albertaheader.hh>
16
17#if HAVE_ALBERTA
18
19namespace Dune
20{
21
22 namespace Alberta
23 {
24
25 template< class Grid, class RestrictProlongOperator >
26 class AdaptRestrictProlongHandler
27 {
28 static const int dimension = Grid::dimension;
29
30 typedef typename Grid::template Codim< 0 >::Entity Entity;
31 typedef Dune::MakeableInterfaceObject< Entity > EntityObject;
32 typedef typename EntityObject::ImplementationType EntityImp;
33
34 typedef Alberta::ElementInfo< dimension > ElementInfo;
35 typedef Alberta::Patch< dimension > Patch;
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
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
Different resources needed by all grid implementations.
provides a wrapper for ALBERTA's refinement patches and the corners for geometryInFather
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)