DUNE-FEM (unstable)

capabilities.hh
1#ifndef DUNE_FEM_CAPABILITIES_HH
2#define DUNE_FEM_CAPABILITIES_HH
3
5
7
8#include <dune/fem/misc/griddeclaration.hh>
9#include <dune/fem/misc/metaprogramming.hh>
10
11namespace 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#if HAVE_DUNE_P4ESTGRID
47 template< int dim, int dimworld, class ctype >
48 struct hasHierarchicIndexSet< P4estGrid< dim, dimworld, ctype > >
49 {
50 static const bool v = true;
51 };
52#endif // #if HAVE_DUNE_ALUGRID
53
54 template<>
55 struct hasHierarchicIndexSet< OneDGrid >
56 {
57 static const bool v = false;
58 };
59
60 template< int dim >
61 struct hasHierarchicIndexSet< UGGrid< dim > >
62 {
63 static const bool v = false;
64 };
65
66 template< int dim, class CoordCont >
67 struct hasHierarchicIndexSet< YaspGrid< dim, CoordCont > >
68 {
69 static const bool v = false;
70 };
71
72
73 template< class HostGrid, class CoordFunction, class Allocator >
74 struct hasHierarchicIndexSet< GeometryGrid< HostGrid, CoordFunction, Allocator > >
75 {
76 //static const bool v = hasHierarchicIndexSet< HostGrid > :: v;
77 static const bool v = false ;
78 };
79
80 } // namespace Capabilities
81
82
83 namespace Fem
84 {
85
86 // Fem Capabilities
87 // ----------------
88
89 namespace Capabilities
90 {
91
92 // hasAllCodimEntities
93 // -------------------
94
95 template< class Grid >
96 class hasAllCodimEntities
97 {
98 template< unsigned int codim >
99 struct Codim
100 : public Dune::Capabilities::hasEntity< Grid, codim >
101 {};
102
103 public:
104 static const bool v = Loop< MetaAnd, Codim, Grid :: dimension > :: v;
105 static const bool value = v;
106 };
107
108
109 // supportsCallbackAdaptation
110 // --------------------------
111
112 template< class Grid >
113 struct supportsCallbackAdaptation
114 {
115 static const bool v = false;
116 };
117
118 template< class Grid >
119 struct supportsCallbackAdaptation< const Grid >
120 {
121 static const bool v = Dune::Fem::Capabilities::supportsCallbackAdaptation< Grid > :: v;
122 };
123
124#if HAVE_DUNE_ALUGRID
125 template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
126 struct supportsCallbackAdaptation< ALUGrid< dim, dimworld, elType, refineType, Comm > >
127 {
128 static const bool v = true;
129 };
130#endif // #if HAVE_DUNE_ALUGRID
131
132#if HAVE_DUNE_P4ESTGRID
133 template< int dim, int dimworld, class ctype >
134 struct supportsCallbackAdaptation< P4estGrid< dim, dimworld, ctype > >
135 {
136 static const bool v = true;
137 };
138#endif // #if HAVE_DUNE_ALUGRID
139
140 template< int dim, int dimworld >
141 struct supportsCallbackAdaptation< AlbertaGrid< dim, dimworld > >
142 {
143 static const bool v = true;
144 };
145
146 template< class HostGrid, class CoordFunction, class Allocator >
147 struct supportsCallbackAdaptation< GeometryGrid< HostGrid, CoordFunction, Allocator > >
148 {
149 static const bool v = supportsCallbackAdaptation< HostGrid > :: v;
150 };
151
152#if HAVE_DUNE_METAGRID
153 template< class HostGrid >
154 struct supportsCallbackAdaptation< CartesianGrid< HostGrid > >
155 {
156 static const bool v = supportsCallbackAdaptation< HostGrid > :: v;
157 };
158#endif // #if HAVE_DUNE_METAGRID
159
160
161
162 // isLocallyAdaptive
163 // -----------------
164
165 template< class Grid >
166 struct isLocallyAdaptive
167 {
168 static const bool v = false;
169 };
170
171 template< class Grid >
172 struct isLocallyAdaptive< const Grid >
173 {
174 static const bool v = Dune::Fem::Capabilities::isLocallyAdaptive< Grid > :: v;
175 };
176
177#if HAVE_DUNE_ALUGRID
178 template< int dim, int dimworld, ALUGridElementType elType, ALUGridRefinementType refineType, class Comm >
179 struct isLocallyAdaptive< ALUGrid< dim, dimworld, elType, refineType, Comm > >
180 {
181 static const bool v = true;
182 };
183#endif //#f HAVE_DUNE_ALUGRID
184
185#if HAVE_DUNE_P4ESTGRID
186 template< int dim, int dimworld, class ctype >
187 struct isLocallyAdaptive< P4estGrid< dim, dimworld, ctype > >
188 {
189 static const bool v = true;
190 };
191#endif // #if HAVE_DUNE_P4ESTGRID
192
193 template< int dim, int dimworld >
194 struct isLocallyAdaptive< AlbertaGrid< dim, dimworld > >
195 {
196 static const bool v = true;
197 };
198
199 template< int dim >
200 struct isLocallyAdaptive< UGGrid< dim > >
201 {
202 static const bool v = true;
203 };
204
205 template<>
206 struct isLocallyAdaptive< OneDGrid >
207 {
208 static const bool v = true;
209 };
210
211 template< class HostGrid, class CoordFunction, class Allocator >
212 struct isLocallyAdaptive< GeometryGrid< HostGrid, CoordFunction, Allocator > >
213 {
214 static const bool v = isLocallyAdaptive< HostGrid > :: v;
215 };
216
217#if HAVE_DUNE_METAGRID
218 template< class HostGrid >
219 struct isLocallyAdaptive< CartesianGrid< HostGrid > >
220 {
221 static const bool v = isLocallyAdaptive< HostGrid > :: v;
222 };
223#endif // #if HAVE_DUNE_METAGRID
224
225
226
227 // isMMesh
228 // -------
229
230 template< class Grid >
231 struct isMMesh
232 {
233 static const bool v = false;
234 };
235
236 } // namespace Capabilities
237
238 } // namespace Fem
239
240} // namespace Dune
241
242#endif // #ifndef DUNE_FEM_CAPABILITIES_HH
Various macros to work with Dune module version numbers.
A set of traits classes to store static information about grid implementation.
Dune namespace.
Definition: alignedallocator.hh:13
Specialize with 'true' for all codims that a grid implements entities for. (default=false)
Definition: capabilities.hh:58
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)