dune-fem 2.12-git
Loading...
Searching...
No Matches
levelgridpart.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
2#define DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
3
4#include <dune/grid/common/capabilities.hh>
5
8
9namespace Dune
10{
11
12 namespace Fem
13 {
14
15 // LevelGridPart
16 // -------------
17
18 template< class Grid >
20 : public GridView2GridPart< typename Grid::LevelGridView, LevelGridPart< Grid > >
21 {
23
24 public:
26 typedef typename BaseType::GridType GridType;
27
34 grid_( &grid ),
35 level_( level )
36 {}
37
44 using BaseType::grid;
45
47 GridType &grid () { assert( grid_ ); return *grid_; }
48
54 int level() const { return level_; }
55
56 private:
57 GridType *grid_;
58 int level_;
59 };
60
61
62
63 namespace GridPartCapabilities
64 {
65
66 template< class Grid >
67 struct hasGrid< LevelGridPart< Grid > >
68 {
69 static const bool v = true;
70 };
71
72 template< class Grid >
73 struct hasSingleGeometryType< LevelGridPart< Grid > >
75 {};
76
77 template< class Grid >
78 struct isCartesian< LevelGridPart< Grid > >
79 : public Dune::Capabilities::isCartesian< Grid >
80 {};
81
82 template< class Grid, int codim >
83 struct hasEntity< LevelGridPart< Grid >, codim >
84 : public Dune::Capabilities::hasEntity< Grid, codim >
85 {};
86
87 template< class Grid, int codim >
88 struct canCommunicate< LevelGridPart< Grid >, codim >
89 : public Dune::Capabilities::canCommunicate< Grid, codim >
90 {};
91
92 template< class Grid >
93 struct isConforming< LevelGridPart< Grid > >
94 {
96 };
97
98 } // namespace GridPartCapabilities
99
100 } // namespace Fem
101
102} // namespace Dune
103
104#endif // #ifndef DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
bool isConforming() const
static const bool v
Definition gridpart/common/capabilities.hh:19
static const bool v
Definition gridpart/common/capabilities.hh:71
Definition gridview2gridpart.hh:83
BaseType::GridType GridType
type of Grid implementation
Definition gridview2gridpart.hh:90
const GridType & grid() const
Returns const reference to the underlying grid.
Definition gridview2gridpart.hh:154
Definition levelgridpart.hh:21
GridType & grid()
Returns const reference to the underlying grid.
Definition levelgridpart.hh:47
int level() const
Return the level that this grid part was created for.
Definition levelgridpart.hh:54
LevelGridPart(GridType &grid, int level)
Definition levelgridpart.hh:32
BaseType::GridType GridType
type of Grid implementation
Definition levelgridpart.hh:26