dune-fem  2.4.1-rc
misc/capabilities.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_CAPABILITIES_HH
2 #define DUNE_FEM_CAPABILITIES_HH
3 
4 #include <dune/common/version.hh>
5 
6 #include <dune/grid/common/capabilities.hh>
7 
9 #include <dune/fem/misc/metaprogramming.hh>
10 
11 namespace Dune
12 {
13 
14  // Core Capabilities
15  // -----------------
16 
17  namespace Capabilities
18  {
19 
20  // hasHierarchicIndexSet
21  // ---------------------
22 
23  template< class Grid >
25 
26  template< class Grid >
27  struct hasHierarchicIndexSet< const Grid >
28  {
29  static const bool v = false;
30  };
31 
32  template< class Grid >
34  {
35  static const bool v = false;
36  };
37 
38  template< int dim, int dimw, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
39  struct hasHierarchicIndexSet< ALUGrid< dim, dimw, elType, refineType, Comm > >
40  {
41  static const bool v = true;
42  };
43 
44  template<>
45  struct hasHierarchicIndexSet< OneDGrid >
46  {
47  static const bool v = false;
48  };
49 
50  template< int dim, int dimw, class ctype >
51  struct hasHierarchicIndexSet< SGrid< dim, dimw, ctype > >
52  {
53  static const bool v = false;
54  };
55 
56  template< int dim >
57  struct hasHierarchicIndexSet< UGGrid< dim > >
58  {
59  static const bool v = false;
60  };
61 
62  template< int dim, class CoordCont >
63  struct hasHierarchicIndexSet< YaspGrid< dim, CoordCont > >
64  {
65  static const bool v = false;
66  };
67 
68 
69  template< class HostGrid, class CoordFunction, class Allocator >
70  struct hasHierarchicIndexSet< GeometryGrid< HostGrid, CoordFunction, Allocator > >
71  {
72  //static const bool v = hasHierarchicIndexSet< HostGrid > :: v;
73  static const bool v = false ;
74  };
75 
76  } // namespace Capabilities
77 
78 
79  namespace Fem
80  {
81 
82  // Fem Capabilities
83  // ----------------
84 
85  namespace Capabilities
86  {
87 
88  // hasAllCodimEntities
89  // -------------------
90 
91  template< class Grid >
93  {
94  template< unsigned int codim >
95  struct Codim
96  : public Dune::Capabilities::hasEntity< Grid, codim >
97  {};
98 
99  public:
100  static const bool v = Loop< MetaAnd, Codim, Grid :: dimension > :: v;
101  static const bool value = v;
102  };
103 
104 
105  // supportsCallbackAdaptation
106  // --------------------------
107 
108  template< class Grid >
110  {
111  static const bool v = false;
112  };
113 
114  template< class Grid >
115  struct supportsCallbackAdaptation< const Grid >
116  {
118  };
119 
120  template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
121  struct supportsCallbackAdaptation< ALUGrid< dim, dimworld, elType, refineType, Comm > >
122  {
123  static const bool v = true;
124  };
125 
126  template< int dim, int dimworld >
127  struct supportsCallbackAdaptation< AlbertaGrid< dim, dimworld > >
128  {
129  static const bool v = true;
130  };
131 
132  template< class HostGrid, class CoordFunction, class Allocator >
133  struct supportsCallbackAdaptation< GeometryGrid< HostGrid, CoordFunction, Allocator > >
134  {
136  };
137 
138 #if HAVE_DUNE_METAGRID
139  template< class HostGrid >
140  struct supportsCallbackAdaptation< CartesianGrid< HostGrid > >
141  {
142  static const bool v = supportsCallbackAdaptation< HostGrid > :: v;
143  };
144 #endif // #if HAVE_DUNE_METAGRID
145 
146 
147 
148  // isLocallyAdaptive
149  // -----------------
150 
151  template< class Grid >
153  {
154  static const bool v = false;
155  };
156 
157  template< class Grid >
158  struct isLocallyAdaptive< const Grid >
159  {
161  };
162 
163  template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
164  struct isLocallyAdaptive< ALUGrid< dim, dimworld, elType, refineType, Comm > >
165  {
166  static const bool v = true;
167  };
168 
169  template< int dim, int dimworld >
170  struct isLocallyAdaptive< AlbertaGrid< dim, dimworld > >
171  {
172  static const bool v = true;
173  };
174 
175  template< int dim >
176  struct isLocallyAdaptive< UGGrid< dim > >
177  {
178  static const bool v = true;
179  };
180 
181  template<>
182  struct isLocallyAdaptive< OneDGrid >
183  {
184  static const bool v = true;
185  };
186 
187  template< class HostGrid, class CoordFunction, class Allocator >
188  struct isLocallyAdaptive< GeometryGrid< HostGrid, CoordFunction, Allocator > >
189  {
190  static const bool v = isLocallyAdaptive< HostGrid > :: v;
191  };
192 
193 #if HAVE_DUNE_METAGRID
194  template< class HostGrid >
195  struct isLocallyAdaptive< CartesianGrid< HostGrid > >
196  {
197  static const bool v = isLocallyAdaptive< HostGrid > :: v;
198  };
199 #endif // #if HAVE_DUNE_METAGRID
200 
201  } // namespace Capabilities
202 
203  } // namespace Fem
204 
205 } // namespace Dune
206 
207 #endif // #ifndef DUNE_FEM_CAPABILITIES_HH
Definition: griddeclaration.hh:41
Definition: griddeclaration.hh:38
Definition: griddeclaration.hh:44
Definition: misc/capabilities.hh:152
Definition: misc/capabilities.hh:109
static const bool v
Definition: misc/capabilities.hh:35
Definition: griddeclaration.hh:35
Definition: coordinate.hh:4
Definition: misc/capabilities.hh:92
Definition: misc/capabilities.hh:24