dune-fem  2.8-git
gridpartadapter.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_GRID_GRIDPARTADAPTER_HH
2 #define DUNE_FEM_GRID_GRIDPARTADAPTER_HH
3 
4 #include <dune/common/exceptions.hh>
5 
7 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
14  // GridPartAdapter
15  // ---------------
16 
17  template< class GridView >
19  : public Fem::GridView2GridPart< GridView, GridPartAdapter< GridView >, false >
20  {
23 
24  public:
25  typedef GridView GridViewType;
26  typedef typename Base::GridType GridType;
27 
28  explicit GridPartAdapter ( const GridView &gridView ) : Base( gridView ) {}
29 
30  int level () const { DUNE_THROW( NotImplemented, "GridPartAdapter cannot provide level information" ); return -1; }
31  };
32 
33 
34  namespace GridPartCapabilities
35  {
36 
37  template< class GridView >
38  struct hasGrid< GridPartAdapter< GridView > >
39  {
40  static const bool v = true;
41  };
42 
43  template< class GridView >
44  struct hasSingleGeometryType< GridPartAdapter< GridView > >
45  : public Dune::Capabilities::hasSingleGeometryType< typename GridView::Grid >
46  {};
47 
48  template< class GridView >
49  struct isCartesian< GridPartAdapter< GridView > >
50  : public Dune::Capabilities::isCartesian< typename GridView::Grid >
51  {};
52 
53  template< class GridView, int codim >
54  struct hasEntity< GridPartAdapter< GridView >, codim >
55  : public Dune::Capabilities::hasEntity< typename GridView::Grid, codim >
56  {};
57 
58  template< class GridView, int codim >
59  struct canCommunicate< GridPartAdapter< GridView >, codim >
60  : public Dune::Capabilities::canCommunicate< typename GridView::Grid, codim >
61  {};
62 
63  template< class GridView >
64  struct isConforming< GridPartAdapter< GridView > >
65  {
66  static const bool v = GridView::conforming;
67  };
68 
69  } // namespace GridPartCapabilities
70 
71  } // namespace Fem
72 
73 } // namespace Dune
74 
75 #endif // #ifndef DUNE_FEM_GRID_GRIDPARTADAPTER_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: gridpartadapter.hh:20
GridPartAdapter(const GridView &gridView)
Definition: gridpartadapter.hh:28
Base::GridType GridType
Definition: gridpartadapter.hh:26
int level() const
Definition: gridpartadapter.hh:30
GridView GridViewType
Definition: gridpartadapter.hh:25
Definition: gridview2gridpart.hh:81
BaseType::GridType GridType
type of Grid implementation
Definition: gridview2gridpart.hh:88
const GridView & gridView() const
cast to underlying grid view
Definition: gridview2gridpart.hh:223