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 
8 #include <dune/fem/misc/griddeclaration.hh>
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 >
24     struct hasHierarchicIndexSet;
25 
26     template< class Grid >
27     struct hasHierarchicIndexSet< const Grid >
28     {
29       static const bool v = false;
30     };
31 
32     template< class Grid >
33     struct hasHierarchicIndexSet
34     {
35       static const bool v = false;
36     };
37 
38 #if HAVE_DUNE_ALUGRID
39     template< int dim, int dimw, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
40     struct hasHierarchicIndexSet< ALUGrid< dim, dimw, elType, refineType, Comm > >
41     {
42       static const bool v = true;
43     };
44 #endif // #if HAVE_DUNE_ALUGRID
45 
46     template<>
47     struct hasHierarchicIndexSet< OneDGrid >
48     {
49       static const bool v = false;
50     };
51 
52     template< int dim >
53     struct hasHierarchicIndexSet< UGGrid< dim > >
54     {
55       static const bool v = false;
56     };
57 
58     template< int dim, class CoordCont >
59     struct hasHierarchicIndexSet< YaspGrid< dim, CoordCont > >
60     {
61       static const bool v = false;
62     };
63 
64 
65     template< class HostGrid, class CoordFunction, class Allocator >
66     struct hasHierarchicIndexSet< GeometryGrid< HostGrid, CoordFunction, Allocator > >
67     {
68       //static const bool v = hasHierarchicIndexSet< HostGrid > :: v;
69       static const bool v = false ;
70     };
71 
72   } // namespace Capabilities
73 
74 
75   namespace Fem
76   {
77 
78     // Fem Capabilities
79     // ----------------
80 
81     namespace Capabilities
82     {
83 
84       // hasAllCodimEntities
85       // -------------------
86 
87       template< class Grid >
88       class hasAllCodimEntities
89       {
90         template< unsigned int codim >
91         struct Codim
92         : public Dune::Capabilities::hasEntity< Grid, codim >
93         {};
94 
95       public:
96         static const bool v = Loop< MetaAnd, Codim, Grid :: dimension > :: v;
97         static const bool value = v;
98       };
99 
100 
101       // supportsCallbackAdaptation
102       // --------------------------
103 
104       template< class Grid >
105       struct supportsCallbackAdaptation
106       {
107         static const bool v = false;
108       };
109 
110       template< class Grid >
111       struct supportsCallbackAdaptation< const Grid >
112       {
113         static const bool v = Dune::Fem::Capabilities::supportsCallbackAdaptation< Grid > :: v;
114       };
115 
116 #if HAVE_DUNE_ALUGRID
117       template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
118       struct supportsCallbackAdaptation< ALUGrid< dim, dimworld, elType, refineType, Comm > >
119       {
120         static const bool v = true;
121       };
122 #endif // #if HAVE_DUNE_ALUGRID
123 
124       template< int dim, int dimworld >
125       struct supportsCallbackAdaptation< AlbertaGrid< dim, dimworld > >
126       {
127         static const bool v = true;
128       };
129 
130       template< class HostGrid, class CoordFunction, class Allocator >
131       struct supportsCallbackAdaptation< GeometryGrid< HostGrid, CoordFunction, Allocator > >
132       {
133         static const bool v = supportsCallbackAdaptation< HostGrid > :: v;
134       };
135 
136 #if HAVE_DUNE_METAGRID
137       template< class HostGrid >
138       struct supportsCallbackAdaptation< CartesianGrid< HostGrid > >
139       {
140         static const bool v = supportsCallbackAdaptation< HostGrid > :: v;
141       };
142 #endif // #if HAVE_DUNE_METAGRID
143 
144 
145 
146       // isLocallyAdaptive
147       // -----------------
148 
149       template< class Grid >
150       struct isLocallyAdaptive
151       {
152         static const bool v = false;
153       };
154 
155       template< class Grid >
156       struct isLocallyAdaptive< const Grid >
157       {
158         static const bool v = Dune::Fem::Capabilities::isLocallyAdaptive< Grid > :: v;
159       };
160 
161 #if HAVE_DUNE_ALUGRID
162       template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
163       struct isLocallyAdaptive< ALUGrid< dim, dimworld, elType, refineType, Comm > >
164       {
165         static const bool v = true;
166       };
167 #endif //#f HAVE_DUNE_ALUGRID
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
208