DUNE-FEM (unstable)

leafgridpart.hh
1#ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
2#define DUNE_FEM_GRIDPART_LEAFGRIDPART_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 // LeafGridPart
16 // ------------
17
18 template< class Grid >
19 class LeafGridPart
20 : public GridView2GridPart< typename Grid::LeafGridView, LeafGridPart< Grid > >
21 {
22 typedef GridView2GridPart< typename Grid::LeafGridView, LeafGridPart< Grid > > BaseType;
23
24 public:
26 typedef typename BaseType::GridType GridType;
27
31 explicit LeafGridPart ( GridType &grid )
32 : BaseType( grid.leafGridView() ),
33 grid_( &grid )
34 {}
35
36 LeafGridPart ( const LeafGridPart& other )
37 : BaseType( other.grid_->leafGridView() ),
38 grid_( other.grid_ )
39 {}
40
47 using BaseType::grid;
48
50 GridType &grid () { assert( grid_ ); return *grid_; }
51
54 private:
55 GridType *grid_;
56 };
57
58
59
60 namespace GridPartCapabilities
61 {
62
63 template< class Grid >
64 struct hasGrid< LeafGridPart< Grid > >
65 {
66 static const bool v = true;
67 };
68
69 template< class Grid >
70 struct hasSingleGeometryType< LeafGridPart< Grid > >
72 {};
73
74 template< class Grid >
75 struct isCartesian< LeafGridPart< Grid > >
76 : public Dune::Capabilities::isCartesian< Grid >
77 {};
78
79 template< class Grid, int codim >
80 struct hasEntity< LeafGridPart< Grid >, codim >
81 : public Dune::Capabilities::hasEntity< Grid, codim >
82 {};
83
84 template< class Grid, int codim >
85 struct canCommunicate< LeafGridPart< Grid >, codim >
86 : public Dune::Capabilities::canCommunicate< Grid, codim >
87 {};
88
89 template< class Grid >
90 struct isConforming< LeafGridPart< Grid > >
91 {
93 };
94
95 } // namespace GridPartCapabilities
96
97 } // namespace Fem
98
99} // namespace Dune
100
101#endif // #ifndef DUNE_FEM_GRIDPART_LEAFGRIDPART_HH
A set of traits classes to store static information about grid implementation.
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition: grid.hh:805
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 a conforming leaf grid. (default=false)
Definition: capabilities.hh:115
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)