dune-fem 2.12-git
Loading...
Searching...
No Matches
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
9namespace 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
33 grid_( &grid )
34 {}
35
36 LeafGridPart ( const LeafGridPart& other )
37 : BaseType( other.grid_->leafGridView() ),
38 grid_( other.grid_ )
39 {}
40
41 LeafGridPart& operator= ( const LeafGridPart& ) = default;
42
49 using BaseType::grid;
50
52 GridType &grid () { assert( grid_ ); return *grid_; }
53
56 private:
57 GridType *grid_;
58 };
59
60
61
62 namespace GridPartCapabilities
63 {
64
65 template< class Grid >
66 struct hasGrid< LeafGridPart< Grid > >
67 {
68 static const bool v = true;
69 };
70
71 template< class Grid >
72 struct hasSingleGeometryType< LeafGridPart< Grid > >
74 {};
75
76 template< class Grid >
77 struct isCartesian< LeafGridPart< Grid > >
78 : public Dune::Capabilities::isCartesian< Grid >
79 {};
80
81 template< class Grid, int codim >
82 struct hasEntity< LeafGridPart< Grid >, codim >
83 : public Dune::Capabilities::hasEntity< Grid, codim >
84 {};
85
86 template< class Grid, int codim >
87 struct canCommunicate< LeafGridPart< Grid >, codim >
88 : public Dune::Capabilities::canCommunicate< Grid, codim >
89 {};
90
91 template< class Grid >
92 struct isConforming< LeafGridPart< Grid > >
93 {
95 };
96
97 } // namespace GridPartCapabilities
98
99 } // namespace Fem
100
101} // namespace Dune
102
103#endif // #ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
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 leafgridpart.hh:21
GridType & grid()
Returns const reference to the underlying grid.
Definition leafgridpart.hh:52
LeafGridPart(const LeafGridPart &other)
Definition leafgridpart.hh:36
BaseType::GridType GridType
type of Grid implementation
Definition leafgridpart.hh:26
LeafGridPart & operator=(const LeafGridPart &)=default
LeafGridPart(GridType &grid)
Definition leafgridpart.hh:31