dune-fem  2.4.1-rc
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 
32  explicit LeafGridPart ( GridType &grid )
33  : BaseType( grid.leafGridView() ),
34  grid_( grid )
35  {}
36 
43  using BaseType::grid;
44 
46  GridType &grid () { return grid_; }
47 
49  int level () const { return grid().maxLevel(); }
50 
53  private:
54  GridType &grid_;
55  };
56 
57 
58 
59  namespace GridPartCapabilities
60  {
61 
62  template< class Grid >
63  struct hasGrid< LeafGridPart< Grid > >
64  {
65  static const bool v = true;
66  };
67 
68  template< class Grid >
70  : public Dune::Capabilities::hasSingleGeometryType< Grid >
71  {};
72 
73  template< class Grid >
74  struct isCartesian< LeafGridPart< Grid > >
75  : public Dune::Capabilities::isCartesian< Grid >
76  {};
77 
78  template< class Grid, int codim >
79  struct hasEntity< LeafGridPart< Grid >, codim >
80  : public Dune::Capabilities::hasEntity< Grid, codim >
81  {};
82 
83  template< class Grid >
84  struct isParallel< LeafGridPart< Grid > >
85  : public Dune::Capabilities::isParallel< Grid >
86  {};
87 
88  template< class Grid, int codim >
89  struct canCommunicate< LeafGridPart< Grid >, codim >
90  : public Dune::Capabilities::canCommunicate< Grid, codim >
91  {};
92 
93  template< class Grid >
94  struct isConforming< LeafGridPart< Grid > >
95  {
96  static const bool v = Dune::Capabilities::isLeafwiseConforming< Grid >::v;
97  };
98 
99  } // namespace GridPartCapabilities
100 
101  } // namespace Fem
102 
103 } // namespace Dune
104 
105 #endif // #ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
const GridType & grid() const
Returns const reference to the underlying grid.
Definition: gridview2gridpart.hh:144
BaseType::GridType GridType
type of Grid implementation
Definition: leafgridpart.hh:26
int level() const
Level of the grid part.
Definition: leafgridpart.hh:49
specialize with &#39;true&#39; if implementation supports parallelism (default=false)
Definition: gridpart/common/capabilities.hh:59
specialize with &#39;true&#39; for all codims that a grid implements entities for (default=false) ...
Definition: gridpart/common/capabilities.hh:49
LeafGridPart(GridType &grid)
Definition: leafgridpart.hh:32
specialize with &#39;true&#39; if implementation guarantees conforming level grids. (default=false) ...
Definition: gridpart/common/capabilities.hh:79
specialize with &#39;false&#39; if grid part has no underlying dune grid (default=true)
Definition: gridpart/common/capabilities.hh:17
specialize with &#39;true&#39; for all codims that a grid can communicate data on (default=false) ...
Definition: gridpart/common/capabilities.hh:69
Definition: coordinate.hh:4
specialize with &#39;true&#39; for if the codimension 0 entity of the grid part has only one possible geometr...
Definition: gridpart/common/capabilities.hh:28
Definition: leafgridpart.hh:19
specialize with &#39;true&#39; if the grid part is cartesian (default=false)
Definition: gridpart/common/capabilities.hh:39
Traits::GridType GridType
type of Grid implementation
Definition: gridpart.hh:90
GridType & grid()
Returns const reference to the underlying grid.
Definition: leafgridpart.hh:46
Definition: gridview2gridpart.hh:25