dune-fem  2.8-git
leafgridpart.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
2 #define DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
3 
4 #include <dune/grid/common/capabilities.hh>
5 
8 
9 namespace Dune
10 {
11 
12  namespace Fem
13  {
14 
15  // LeafGridPart
16  // ------------
17 
18  template< class Grid >
20  : public GridView2GridPart< typename Grid::LeafGridView, LeafGridPart< Grid > >
21  {
23 
24  public:
26  typedef typename BaseType::GridType GridType;
27 
31  explicit LeafGridPart ( GridType &grid )
32  : BaseType( grid.leafGridView() ),
33  grid_( grid )
34  {}
35 
42  using BaseType::grid;
43 
45  GridType &grid () { return grid_; }
46 
48  int level () const { return grid().maxLevel(); }
49 
52  private:
53  GridType &grid_;
54  };
55 
56 
57 
58  namespace GridPartCapabilities
59  {
60 
61  template< class Grid >
62  struct hasGrid< LeafGridPart< Grid > >
63  {
64  static const bool v = true;
65  };
66 
67  template< class Grid >
69  : public Dune::Capabilities::hasSingleGeometryType< Grid >
70  {};
71 
72  template< class Grid >
73  struct isCartesian< LeafGridPart< Grid > >
74  : public Dune::Capabilities::isCartesian< Grid >
75  {};
76 
77  template< class Grid, int codim >
78  struct hasEntity< LeafGridPart< Grid >, codim >
79  : public Dune::Capabilities::hasEntity< Grid, codim >
80  {};
81 
82  template< class Grid, int codim >
83  struct canCommunicate< LeafGridPart< Grid >, codim >
84  : public Dune::Capabilities::canCommunicate< Grid, codim >
85  {};
86 
87  template< class Grid >
88  struct isConforming< LeafGridPart< Grid > >
89  {
90  static const bool v = Dune::Capabilities::isLeafwiseConforming< Grid >::v;
91  };
92 
93  } // namespace GridPartCapabilities
94 
95  } // namespace Fem
96 
97 } // namespace Dune
98 
99 #endif // #ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_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: leafgridpart.hh:21
int level() const
Level of the grid part.
Definition: leafgridpart.hh:48
GridType & grid()
Returns const reference to the underlying grid.
Definition: leafgridpart.hh:45
BaseType::GridType GridType
type of Grid implementation
Definition: leafgridpart.hh:26
LeafGridPart(GridType &grid)
Definition: leafgridpart.hh:31