DUNE-FEM (unstable)

levelgridpart.hh
1#ifndef DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
2#define DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
3
5
6#include <dune/fem/gridpart/common/capabilities.hh>
7#include <dune/fem/gridpart/common/gridview2gridpart.hh>
8
9namespace Dune
10{
11
12 namespace Fem
13 {
14
15 // LevelGridPart
16 // -------------
17
18 template< class Grid >
19 class LevelGridPart
20 : public GridView2GridPart< typename Grid::LevelGridView, LevelGridPart< Grid > >
21 {
22 typedef GridView2GridPart< typename Grid::LevelGridView, LevelGridPart< Grid > > BaseType;
23
24 public:
26 typedef typename BaseType::GridType GridType;
27
32 LevelGridPart ( GridType &grid, int level )
33 : BaseType( grid.levelGridView( level ) ),
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
A set of traits classes to store static information about grid implementation.
Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
level grid view for the given grid and level.
Definition: grid.hh:788
Dune namespace.
Definition: alignedallocator.hh:13
specialize with 'true' for all codims that a grid can communicate data on (default=false)
Definition: capabilities.hh:97
Specialize with 'true' for all codims that a grid implements entities for. (default=false)
Definition: capabilities.hh:58
Specialize with 'true' for if the codimension 0 entity of the grid has only one possible geometry typ...
Definition: capabilities.hh:27
Specialize with 'true' if the grid is a Cartesian grid. Cartesian grids satisfy the following propert...
Definition: capabilities.hh:48
Specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition: capabilities.hh:106
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)