dune-fem  2.8-git
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 
9 namespace 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 
33  : BaseType( grid.levelGridView( level ) ),
34  grid_( grid ),
35  level_( level )
36  {}
37 
44  using BaseType::grid;
45 
47  GridType &grid () { return grid_; }
48 
50  int level () const { return level_; }
51 
54  private:
55  GridType &grid_;
56  int level_;
57  };
58 
59 
60 
61  namespace GridPartCapabilities
62  {
63 
64  template< class Grid >
65  struct hasGrid< LevelGridPart< Grid > >
66  {
67  static const bool v = true;
68  };
69 
70  template< class Grid >
72  : public Dune::Capabilities::hasSingleGeometryType< Grid >
73  {};
74 
75  template< class Grid >
76  struct isCartesian< LevelGridPart< Grid > >
77  : public Dune::Capabilities::isCartesian< Grid >
78  {};
79 
80  template< class Grid, int codim >
81  struct hasEntity< LevelGridPart< Grid >, codim >
82  : public Dune::Capabilities::hasEntity< Grid, codim >
83  {};
84 
85  template< class Grid, int codim >
86  struct canCommunicate< LevelGridPart< Grid >, codim >
87  : public Dune::Capabilities::canCommunicate< Grid, codim >
88  {};
89 
90  template< class Grid >
91  struct isConforming< LevelGridPart< Grid > >
92  {
93  static const bool v = Dune::Capabilities::isLevelwiseConforming< Grid >::v;
94  };
95 
96  } // namespace GridPartCapabilities
97 
98  } // namespace Fem
99 
100 } // namespace Dune
101 
102 #endif // #ifndef DUNE_FEM_GRIDPART_LEVELGRIDPART_HH
Definition: bindguard.hh:11
specialize with 'false' if grid part has no underlying dune grid (default=true)
Definition: gridpart/common/capabilities.hh:18
static const bool v
Definition: gridpart/common/capabilities.hh:19
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: gridpart/common/capabilities.hh:29
specialize with 'true' if the grid part is cartesian (default=false)
Definition: gridpart/common/capabilities.hh:40
specialize with 'true' for all codims that a grid implements entities for (default=false)
Definition: gridpart/common/capabilities.hh:50
specialize with 'true' for all codims that a grid can communicate data on (default=false)
Definition: gridpart/common/capabilities.hh:60
specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition: gridpart/common/capabilities.hh:70
static const bool v
Definition: gridpart/common/capabilities.hh:71
Definition: gridview2gridpart.hh:81
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridview2gridpart.hh:146
BaseType::GridType GridType
type of Grid implementation
Definition: gridview2gridpart.hh:88
Definition: levelgridpart.hh:21
GridType & grid()
Returns const reference to the underlying grid.
Definition: levelgridpart.hh:47
int level() const
Level of the grid part.
Definition: levelgridpart.hh:50
LevelGridPart(GridType &grid, int level)
Definition: levelgridpart.hh:32
BaseType::GridType GridType
type of Grid implementation
Definition: levelgridpart.hh:26