Dune Core Modules (2.6.0)

raviartthomas1cube3dlocalbasis.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
5
6#include <numeric>
7#include <vector>
8
10
11#include "../../common/localbasis.hh"
12
13namespace Dune
14{
24 template<class D, class R>
26 {
27
28 public:
31
34 {
35 sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
36 }
37
43 RT1Cube3DLocalBasis (unsigned int s)
44 {
45 sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
46 if (s & 1)
47 {
48 sign0 = -1.0;
49 }
50 if (s & 2)
51 {
52 sign1 = -1.0;
53 }
54 if (s & 4)
55 {
56 sign2 = -1.0;
57 }
58 if (s & 8)
59 {
60 sign3 = -1.0;
61 }
62 if (s & 16)
63 {
64 sign4 = -1.0;
65 }
66 if (s & 32)
67 {
68 sign5 = -1.0;
69 }
70 }
71
73 unsigned int size () const
74 {
75 return 36;
76 }
77
84 inline void evaluateFunction (const typename Traits::DomainType& in,
85 std::vector<typename Traits::RangeType>& out) const
86 {
87 out.resize(36);
88
89 out[0][0] = sign0*(-3.0*in[0]*in[0] + 4.0*in[0] - 1.0);
90 out[0][1] = 0.0;
91 out[0][2] = 0.0;
92
93 out[1][0] = sign1*(-2.0*in[0] + 3.0*in[0]*in[0]);
94 out[1][1] = 0.0;
95 out[1][2] = 0.0;
96
97 out[2][0] = 0.0;
98 out[2][1] = sign2*(-3.0*in[1]*in[1] + 4.0*in[1] - 1.0);
99 out[2][2] = 0.0;
100
101 out[3][0] = 0.0;
102 out[3][1] = sign3*(3.0*in[1]*in[1] - 2.0*in[1]);
103 out[3][2] = 0.0;
104
105 out[4][0] = 0.0;
106 out[4][1] = 0.0;
107 out[4][2] = sign4*(-3.0*in[2]*in[2] + 4.0*in[2] - 1.0);
108
109 out[5][0] = 0.0;
110 out[5][1] = 0.0;
111 out[5][2] = sign5*(3.0*in[2]*in[2] - 2.0*in[2]);
112
113 out[6][0] = -18.0*in[0]*in[0]*in[1] + 9.0*in[0]*in[0] + 24.0*in[0]*in[1] - 6.0*in[1] -12.0*in[0] + 3.0;
114 out[6][1] = 0.0;
115 out[6][2] = 0.0;
116
117 out[7][0] = -18.0*in[0]*in[0]*in[1] + 9.0*in[0]*in[0] + 12.0*in[0]*in[1] - 6.0*in[0];
118 out[7][1] = 0.0;
119 out[7][2] = 0.0;
120
121 out[8][0] = 0.0;
122 out[8][1] = 18.0*in[0]*in[1]*in[1] - 9.0*in[1]*in[1] - 24.0*in[0]*in[1] + 12.0*in[1] + 6.0*in[0] - 3.0;
123 out[8][2] = 0.0;
124
125 out[9][0] = 0.0;
126 out[9][1] = 6.0*in[1] - 12.0*in[0]*in[1] - 9.0*in[1]*in[1] + 18.0*in[0]*in[1]*in[1];
127 out[9][2] = 0.0;
128
129 out[10][0] = 0.0;
130 out[10][1] = 0.0;
131 out[10][2] = -3.0 + 6.0*in[0] + 12.0*in[2] - 24.0*in[0]*in[2] - 9.0*in[2]*in[2] + 18.0*in[0]*in[2]*in[2];
132
133 out[11][0] = 0.0;
134 out[11][1] = 0.0;
135 out[11][2] = 6.0*in[2] - 12.0*in[0]*in[2] - 9.0*in[2]*in[2] + 18.0*in[0]*in[2]*in[2];
136
137 out[12][0] = 3.0 - 12.0*in[0] - 6.0*in[2] + 24.0*in[0]*in[2] + 9.0*in[0]*in[0] - 18.0*in[0]*in[0]*in[2];
138 out[12][1] = 0.0;
139 out[12][2] = 0.0;
140
141 out[13][0] = -6.0*in[0] + 12.0*in[0]*in[2] + 9.0*in[0]*in[0] - 18.0*in[0]*in[0]*in[2];
142 out[13][1] = 0.0;
143 out[13][2] = 0.0;
144
145 out[14][0] = 0.0;
146 out[14][1] = 3.0 - 12.0*in[1] - 6.0*in[2] + 24.0*in[1]*in[2] + 9.0*in[1]*in[1] - 18.0*in[1]*in[1]*in[2];
147 out[14][2] = 0.0;
148
149 out[15][0] = 0.0;
150 out[15][1] = -6.0*in[1] + 12.0*in[1]*in[2] + 9.0*in[1]*in[1] - 18.0*in[1]*in[1]*in[2];
151 out[15][2] = 0.0;
152
153 out[16][0] = 0.0;
154 out[16][1] = 0.0;
155 out[16][2] = -3.0 + 6.0*in[1] + 12.0*in[2] - 24.0*in[1]*in[2] - 9.0*in[2]*in[2] + 18.0*in[1]*in[2]*in[2];
156
157 out[17][0] = 0.0;
158 out[17][1] = 0.0;
159 out[17][2] = 6.0*in[2] - 12.0*in[1]*in[2] - 9.0*in[2]*in[2] + 18.0*in[1]*in[2]*in[2];
160
161 out[18][0] = -9.0 + 36.0*in[0] + 18.0*in[1] + 18.0*in[2] - 72.0*in[0]*in[1] - 72.0*in[0]*in[2] - 36.0*in[1]*in[2] + 144.0*in[0]*in[1]*in[2] - 27.0*in[0]*in[0] + 54.0*in[0]*in[0]*in[1] + 54.0*in[0]*in[0]*in[2] - 108.0*in[0]*in[0]*in[1]*in[2];
162 out[18][1] = 0.0;
163 out[18][2] = 0.0;
164
165 out[19][0] = 18.0*in[0] - 36.0*in[0]*in[1] - 36.0*in[0]*in[2] + 72.0*in[0]*in[1]*in[2] - 27.0*in[0]*in[0] + 54.0*in[0]*in[0]*in[1] + 54.0*in[0]*in[0]*in[2] - 108.0*in[0]*in[0]*in[1]*in[2];
166 out[19][1] = 0.0;
167 out[19][2] = 0.0;
168
169 out[20][0] = 0.0;
170 out[20][1] = 9.0 - 18.0*in[0] - 36.0*in[1] - 18.0*in[2] + 72.0*in[0]*in[1] + 36.0*in[0]*in[2] + 72.0*in[1]*in[2] - 144.0*in[0]*in[1]*in[2] + 27.0*in[1]*in[1] - 54.0*in[1]*in[1]*in[0] - 54.0*in[1]*in[1]*in[2] + 108.0*in[0]*in[1]*in[1]*in[2];
171 out[20][2] = 0.0;
172
173 out[21][0] = 0.0;
174 out[21][1] = -18.0*in[1] + 36.0*in[0]*in[1] + 36.0*in[1]*in[2] - 72.0*in[0]*in[1]*in[2] + 27.0*in[1]*in[1] - 54.0*in[0]*in[1]*in[1] - 54.0*in[1]*in[1]*in[2] + 108.0*in[0]*in[1]*in[1]*in[2];
175 out[21][2] = 0.0;
176
177 out[22][0] = 0.0;
178 out[22][1] = 0.0;
179 out[22][2] = 9.0 - 18.0*in[0] - 18.0*in[1] - 36.0*in[2] + 36.0*in[0]*in[1] + 72.0*in[0]*in[2] + 72.0*in[1]*in[2] - 144.0*in[0]*in[1]*in[2] + 27.0*in[2]*in[2] - 54.0*in[0]*in[2]*in[2] - 54.0*in[1]*in[2]*in[2] + 108.0*in[0]*in[1]*in[2]*in[2];
180
181 out[23][0] = 0.0;
182 out[23][1] = 0.0;
183 out[23][2] = -18.0*in[2] + 36.0*in[0]*in[2] + 36.0*in[1]*in[2] - 72.0*in[0]*in[1]*in[2] + 27.0*in[2]*in[2] - 54.0*in[0]*in[2]*in[2] - 54.0*in[1]*in[2]*in[2] + 108.0*in[0]*in[1]*in[2]*in[2];
184
185 out[24][0] = 96.0*in[0] - 144.0*in[0]*in[1] - 144.0*in[0]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[0]*in[0] + 144.0*in[0]*in[0]*in[1] + 144.0*in[0]*in[0]*in[2] - 216.0*in[0]*in[0]*in[1]*in[2];
186 out[24][1] = 0.0;
187 out[24][2] = 0.0;
188
189 out[25][0] = 0.0;
190 out[25][1] = 96.0*in[1] - 144.0*in[0]*in[1] - 144.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[1]*in[1] + 144.0*in[0]*in[1]*in[1] + 144.0*in[1]*in[1]*in[2] - 216.0*in[0]*in[1]*in[1]*in[2];
191 out[25][2] = 0.0;
192
193 out[26][0] = 0.0;
194 out[26][1] = 0.0;
195 out[26][2] = 96.0*in[2] - 144.0*in[0]*in[2] - 144.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2] - 96.0*in[2]*in[2] + 144.0*in[0]*in[2]*in[2] + 144.0*in[1]*in[2]*in[2] - 216.0*in[0]*in[1]*in[2]*in[2];
196
197 out[27][0] = -144.0*in[0] + 288.0*in[0]*in[1] + 216.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[0]*in[0] - 288.0*in[0]*in[0]*in[1] - 216.0*in[0]*in[0]*in[2] + 432.0*in[0]*in[0]*in[1]*in[2];
198 out[27][1] = 0.0;
199 out[27][2] = 0.0;
200
201 out[28][0] = -144.0*in[0] + 216.0*in[0]*in[1] + 288.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[1] - 288.0*in[0]*in[0]*in[2] + 432.0*in[0]*in[0]*in[1]*in[2];
202 out[28][1] = 0.0;
203 out[28][2] = 0.0;
204
205 out[29][0] = 0.0;
206 out[29][1] = -144.0*in[1] + 288.0*in[0]*in[1] + 216.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[1]*in[1] - 288.0*in[0]*in[1]*in[1] - 216.0*in[1]*in[1]*in[2] + 432.0*in[0]*in[1]*in[1]*in[2];
207 out[29][2] = 0.0;
208
209 out[30][0] = 0.0;
210 out[30][1] = -144.0*in[1] + 216.0*in[0]*in[1] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[1]*in[1] - 216.0*in[0]*in[1]*in[1] - 288.0*in[1]*in[1]*in[2] + 432.0*in[0]*in[1]*in[1]*in[2];
211 out[30][2] = 0.0;
212
213 out[31][0] = 0.0;
214 out[31][1] = 0.0;
215 out[31][2] =-144.0*in[2] + 288.0*in[0]*in[2] + 216.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[2]*in[2] - 288.0*in[0]*in[2]*in[2] - 216.0*in[1]*in[2]*in[2] + 432.0*in[0]*in[1]*in[2]*in[2];
216
217 out[32][0] = 0.0;
218 out[32][1] = 0.0;
219 out[32][2] = -144.0*in[2] + 216.0*in[0]*in[2] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2] + 144.0*in[2]*in[2] - 216.0*in[0]*in[2]*in[2] - 288.0*in[1]*in[2]*in[2] + 432.0*in[0]*in[1]*in[2]*in[2];
220
221 out[33][0] = 216.0*in[0] - 432.0*in[0]*in[1] - 432.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1] + 432.0*in[0]*in[0]*in[2] - 864.0*in[0]*in[0]*in[1]*in[2];
222 out[33][1] = 0.0;
223 out[33][2] = 0.0;
224
225 out[34][0] = 0.0;
226 out[34][1] = 216.0*in[1] - 432.0*in[0]*in[1] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1] + 432.0*in[1]*in[1]*in[2] - 864.0*in[0]*in[1]*in[1]*in[2];
227 out[34][2] = 0.0;
228
229 out[35][0] = 0.0;
230 out[35][1] = 0.0;
231 out[35][2] = 216.0*in[2] - 432.0*in[0]*in[2] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2] - 216.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2] + 432.0*in[1]*in[2]*in[2] - 864.0*in[0]*in[1]*in[2]*in[2];
232 }
233
240 inline void evaluateJacobian (const typename Traits::DomainType& in,
241 std::vector<typename Traits::JacobianType>& out) const
242 {
243 out.resize(36);
244
245 out[0][0][0] = sign0*(-6.0*in[0] + 4);
246 out[0][0][1] = 0;
247 out[0][0][2] = 0;
248 out[0][1][0] = 0;
249 out[0][1][1] = 0;
250 out[0][1][2] = 0;
251 out[0][2][0] = 0;
252 out[0][2][1] = 0;
253 out[0][2][2] = 0;
254
255 out[1][0][0] = sign1*(-2 + 6.0*in[0]);
256 out[1][0][1] = 0;
257 out[1][0][2] = 0;
258 out[1][1][0] = 0;
259 out[1][1][1] = 0;
260 out[1][1][2] = 0;
261 out[1][2][0] = 0;
262 out[1][2][1] = 0;
263 out[1][2][2] = 0;
264
265 out[2][0][0] = 0;
266 out[2][0][1] = 0;
267 out[2][0][2] = 0;
268 out[2][1][0] = 0;
269 out[2][1][1] = sign2*(-6.0*in[1] + 4);
270 out[2][1][2] = 0;
271 out[2][2][0] = 0;
272 out[2][2][1] = 0;
273 out[2][2][2] = 0;
274
275 out[3][0][0] = 0;
276 out[3][0][1] = 0;
277 out[3][0][2] = 0;
278 out[3][1][0] = 0;
279 out[3][1][1] = sign3*(6.0*in[1] - 2);
280 out[3][1][2] = 0;
281 out[3][2][0] = 0;
282 out[3][2][1] = 0;
283 out[3][2][2] = 0;
284
285 out[4][0][0] = 0;
286 out[4][0][1] = 0;
287 out[4][0][2] = 0;
288 out[4][1][0] = 0;
289 out[4][1][1] = 0;
290 out[4][1][2] = 0;
291 out[4][2][0] = 0;
292 out[4][2][1] = 0;
293 out[4][2][2] = sign4*(-6.0*in[2] + 4);
294
295 out[5][0][0] = 0;
296 out[5][0][1] = 0;
297 out[5][0][2] = 0;
298 out[5][1][0] = 0;
299 out[5][1][1] = 0;
300 out[5][1][2] = 0;
301 out[5][2][0] = 0;
302 out[5][2][1] = 0;
303 out[5][2][2] = sign5*(6.0*in[2] - 2);
304
305 out[6][0][0] = -36.0*in[0]*in[1] + 18.0*in[0] + 24.0*in[1] - 12.0;
306 out[6][0][1] = -18.0*in[0]*in[0] + 24.0*in[0] - 6;
307 out[6][0][2] = 0.0;
308 out[6][1][0] = 0.0;
309 out[6][1][1] = 0.0;
310 out[6][1][2] = 0.0;
311 out[6][2][0] = 0.0;
312 out[6][2][1] = 0.0;
313 out[6][2][2] = 0.0;
314
315 out[7][0][0] = -36.0*in[0]*in[1] + 18.0*in[0] + 12.0*in[1] - 6.0;
316 out[7][0][1] = -18.0*in[0]*in[0] + 12.0*in[0];
317 out[7][0][2] = 0.0;
318 out[7][1][0] = 0.0;
319 out[7][1][1] = 0.0;
320 out[7][1][2] = 0.0;
321 out[7][2][0] = 0.0;
322 out[7][2][1] = 0.0;
323 out[7][2][2] = 0.0;
324
325 out[8][0][0] = 0.0;
326 out[8][0][1] = 0.0;
327 out[8][0][2] = 0.0;
328 out[8][1][0] = 18.0*in[1]*in[1] - 24.0*in[1] + 6.0;
329 out[8][1][1] = 36.0*in[0]*in[1] - 18.0*in[1] - 24.0*in[0] + 12.0;
330 out[8][1][2] = 0.0;
331 out[8][2][0] = 0.0;
332 out[8][2][1] = 0.0;
333 out[8][2][2] = 0.0;
334
335 out[9][0][0] = 0.0;
336 out[9][0][1] = 0.0;
337 out[9][0][2] = 0.0;
338 out[9][1][0] = -12.0*in[1] + 18.0*in[1]*in[1];
339 out[9][1][1] = 6.0 - 12.0*in[0] - 18.0*in[1] + 36.0*in[0]*in[1];;
340 out[9][1][2] = 0.0;
341 out[9][2][0] = 0.0;
342 out[9][2][1] = 0.0;
343 out[9][2][2] = 0.0;
344
345 out[10][0][0] = 0.0;
346 out[10][0][1] = 0.0;
347 out[10][0][2] = 0.0;
348 out[10][1][0] = 0.0;
349 out[10][1][1] = 0.0;
350 out[10][1][2] = 0.0;
351 out[10][2][0] = 6.0 - 24.0*in[2] + 18.0*in[2]*in[2];
352 out[10][2][1] = 0.0;
353 out[10][2][2] = 12.0 - 24.0*in[0] - 18.0*in[2] + 36.0*in[0]*in[2];
354
355 out[11][0][0] = 0.0;
356 out[11][0][1] = 0.0;
357 out[11][0][2] = 0.0;
358 out[11][1][0] = 0.0;
359 out[11][1][1] = 0.0;
360 out[11][1][2] = 0.0;
361 out[11][2][0] = -12.0*in[2] + 18.0*in[2]*in[2];
362 out[11][2][1] = 0.0;
363 out[11][2][2] = 6.0 - 12.0*in[0] - 18.0*in[2] + 36.0*in[0]*in[2];
364
365 out[12][0][0] = -12.0 + 24.0*in[2] + 18.0*in[0] - 36.0*in[0]*in[2];
366 out[12][0][1] = 0.0;
367 out[12][0][2] = -6.0 + 24.0*in[0] - 18.0*in[0]*in[0];
368 out[12][1][0] = 0.0;
369 out[12][1][1] = 0.0;
370 out[12][1][2] = 0.0;
371 out[12][2][0] = 0.0;
372 out[12][2][1] = 0.0;
373 out[12][2][2] = 0.0;
374
375 out[13][0][0] = -6.0 + 12.0*in[2] + 18.0*in[0] - 36.0*in[0]*in[2];
376 out[13][0][1] = 0.0;
377 out[13][0][2] = 12.0*in[0] - 18.0*in[0]*in[0];
378 out[13][1][0] = 0.0;
379 out[13][1][1] = 0.0;
380 out[13][1][2] = 0.0;
381 out[13][2][0] = 0.0;
382 out[13][2][1] = 0.0;
383 out[13][2][2] = 0.0;
384
385 out[14][0][0] = 0.0;
386 out[14][0][1] = 0.0;
387 out[14][0][2] = 0.0;
388 out[14][1][0] = 0.0;
389 out[14][1][1] = -12.0 + 24.0*in[2] + 18.0*in[1] - 36.0*in[1]*in[2];
390 out[14][1][2] = -6.0 + 24.0*in[1] - 18.0*in[1]*in[1];
391 out[14][2][0] = 0.0;
392 out[14][2][1] = 0.0;
393 out[14][2][2] = 0.0;
394
395 out[15][0][0] = 0.0;
396 out[15][0][1] = 0.0;
397 out[15][0][2] = 0.0;
398 out[15][1][0] = 0.0;
399 out[15][1][1] = -6.0 + 12.0*in[2] + 18.0*in[1] - 36.0*in[1]*in[2];
400 out[15][1][2] = 12.0*in[1] - 18.0*in[1]*in[1];
401 out[15][2][0] = 0.0;
402 out[15][2][1] = 0.0;
403 out[15][2][2] = 0.0;
404
405 out[16][0][0] = 0.0;
406 out[16][0][1] = 0.0;
407 out[16][0][2] = 0.0;
408 out[16][1][0] = 0.0;
409 out[16][1][1] = 0.0;
410 out[16][1][2] = 0.0;
411 out[16][2][0] = 0.0;
412 out[16][2][1] = 6.0 - 24.0*in[2] + 18.0*in[2]*in[2];
413 out[16][2][2] = 12.0 - 24.0*in[1] - 18.0*in[2] + 36.0*in[1]*in[2];
414
415 out[17][0][0] = 0.0;
416 out[17][0][1] = 0.0;
417 out[17][0][2] = 0.0;
418 out[17][1][0] = 0.0;
419 out[17][1][1] = 0.0;
420 out[17][1][2] = 0.0;
421 out[17][2][0] = 0.0;
422 out[17][2][1] = -12.0*in[2] + 18.0*in[2]*in[2];
423 out[17][2][2] = 6.0 - 12.0*in[1] - 18.0*in[2] + 36.0*in[1]*in[2];
424
425 out[18][0][0] = 36.0 - 72.0*in[1] - 72.0*in[2] + 144.0*in[1]*in[2] - 54.0*in[0] + 108.0*in[0]*in[1] + 108.0*in[0]*in[2] - 216.0*in[0]*in[1]*in[2];
426 out[18][0][1] = 18.0 - 72.0*in[0] - 36.0*in[2] + 144.0*in[0]*in[2] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[2];
427 out[18][0][2] = 18.0 - 72.0*in[0] - 36.0*in[1] + 144.0*in[0]*in[1] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[1];
428 out[18][1][0] = 0.0;
429 out[18][1][1] = 0.0;
430 out[18][1][2] = 0.0;
431 out[18][2][0] = 0.0;
432 out[18][2][1] = 0.0;
433 out[18][2][2] = 0.0;
434
435 out[19][0][0] = 18 - 36.0*in[1] - 36.0*in[2] + 72.0*in[1]*in[2] - 54.0*in[0] + 108.0*in[0]*in[1] + 108.0*in[0]*in[2] - 216.0*in[0]*in[1]*in[2];
436 out[19][0][1] = -36.0*in[0] + 72.0*in[0]*in[2] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[2];
437 out[19][0][2] = -36.0*in[0] + 72.0*in[0]*in[1] + 54.0*in[0]*in[0] - 108.0*in[0]*in[0]*in[1];
438 out[19][1][0] = 0.0;
439 out[19][1][1] = 0.0;
440 out[19][1][2] = 0.0;
441 out[19][2][0] = 0.0;
442 out[19][2][1] = 0.0;
443 out[19][2][2] = 0.0;
444
445 out[20][0][0] = 0.0;
446 out[20][0][1] = 0.0;
447 out[20][0][2] = 0.0;
448 out[20][1][0] = -18.0 + 72.0*in[1] + 36.0*in[2] - 144.0*in[1]*in[2] - 54.0*in[1]*in[1] + 108.0*in[1]*in[1]*in[2];
449 out[20][1][1] = -36.0 + 72.0*in[0] + 72.0*in[2] - 144.0*in[0]*in[2] + 54.0*in[1] - 108.0*in[1]*in[0] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
450 out[20][1][2] = -18.0 + 36.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1] - 54.0*in[1]*in[1] + 108.0*in[0]*in[1]*in[1];
451 out[20][2][0] = 0.0;
452 out[20][2][1] = 0.0;
453 out[20][2][2] = 0.0;
454
455 out[21][0][0] = 0.0;
456 out[21][0][1] = 0.0;
457 out[21][0][2] = 0.0;
458 out[21][1][0] = 36.0*in[1] - 72.0*in[1]*in[2] - 54.0*in[1]*in[1] + 108.0*in[1]*in[1]*in[2];
459 out[21][1][1] = -18.0 + 36.0*in[0] + 36.0*in[2] - 72.0*in[0]*in[2] + 54.0*in[1] - 108.0*in[0]*in[1] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
460 out[21][1][2] = 36.0*in[1] - 72.0*in[0]*in[1] - 54.0*in[1]*in[1] + 108.0*in[0]*in[1]*in[1];
461 out[21][2][0] = 0.0;
462 out[21][2][1] = 0.0;
463 out[21][2][2] = 0.0;
464
465 out[22][0][0] = 0.0;
466 out[22][0][1] = 0.0;
467 out[22][0][2] = 0.0;
468 out[22][1][0] = 0.0;
469 out[22][1][1] = 0.0;
470 out[22][1][2] = 0.0;
471 out[22][2][0] = -18.0 + 36.0*in[1] + 72.0*in[2] - 144.0*in[1]*in[2] - 54.0*in[2]*in[2] + 108.0*in[1]*in[2]*in[2];
472 out[22][2][1] = -18.0 + 36.0*in[0] + 72.0*in[2] - 144.0*in[0]*in[2] - 54.0*in[2]*in[2] + 108.0*in[0]*in[2]*in[2];
473 out[22][2][2] = -36.0 + 72.0*in[0] + 72.0*in[1] - 144.0*in[0]*in[1] + 54.0*in[2] - 108.0*in[0]*in[2] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
474
475 out[23][0][0] = 0.0;
476 out[23][0][1] = 0.0;
477 out[23][0][2] = 0.0;
478 out[23][1][0] = 0.0;
479 out[23][1][1] = 0.0;
480 out[23][1][2] = 0.0;
481 out[23][2][0] = 36.0*in[2] - 72.0*in[1]*in[2] - 54.0*in[2]*in[2] + 108.0*in[1]*in[2]*in[2];
482 out[23][2][1] = 36.0*in[2] - 72.0*in[0]*in[2] - 54.0*in[2]*in[2] + 108.0*in[0]*in[2]*in[2];
483 out[23][2][2] = -18.0 + 36.0*in[0] + 36.0*in[1] - 72.0*in[0]*in[1] + 54.0*in[2] - 108.0*in[0]*in[2] - 108.0*in[1]*in[2] + 216.0*in[0]*in[1]*in[2];
484
485 out[24][0][0] = 96.0 - 144.0*in[1] - 144.0*in[2] + 216.0*in[1]*in[2] - 192.0*in[0] + 288.0*in[0]*in[1] + 288.0*in[0]*in[2] - 432.0*in[0]*in[1]*in[2];
486 out[24][0][1] = -144.0*in[0] + 216.0*in[0]*in[2] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[2];
487 out[24][0][2] = -144.0*in[0] + 216.0*in[0]*in[1] + 144.0*in[0]*in[0] - 216.0*in[0]*in[0]*in[1];
488 out[24][1][0] = 0.0;
489 out[24][1][1] = 0.0;
490 out[24][1][2] = 0.0;
491 out[24][2][0] = 0.0;
492 out[24][2][1] = 0.0;
493 out[24][2][2] = 0.0;
494
495 out[25][0][0] = 0.0;
496 out[25][0][1] = 0.0;
497 out[25][0][2] = 0.0;
498 out[25][1][0] = -144.0*in[1] + 216.0*in[1]*in[2] + 144.0*in[1]*in[1] - 216.0*in[1]*in[1]*in[2];
499 out[25][1][1] = 96.0 - 144.0*in[0] - 144.0*in[2] + 216.0*in[0]*in[2] - 192.0*in[1] + 288.0*in[0]*in[1] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2];
500 out[25][1][2] = -144.0*in[1] + 216.0*in[0]*in[1] + 144.0*in[1]*in[1] - 216.0*in[0]*in[1]*in[1];
501 out[25][2][0] = 0.0;
502 out[25][2][1] = 0.0;
503 out[25][2][2] = 0.0;
504
505 out[26][0][0] = 0.0;
506 out[26][0][1] = 0.0;
507 out[26][0][2] = 0.0;
508 out[26][1][0] = 0.0;
509 out[26][1][1] = 0.0;
510 out[26][1][2] = 0.0;
511 out[26][2][0] = -144.0*in[2] + 216.0*in[1]*in[2] + 144.0*in[2]*in[2] - 216.0*in[1]*in[2]*in[2];
512 out[26][2][1] = -144.0*in[2] + 216.0*in[0]*in[2] + 144.0*in[2]*in[2] - 216.0*in[0]*in[2]*in[2];
513 out[26][2][2] = 96.0 - 144.0*in[0] - 144.0*in[1] + 216.0*in[0]*in[1] - 192.0*in[2] + 288.0*in[0]*in[2] + 288.0*in[1]*in[2] - 432.0*in[0]*in[1]*in[2];
514
515 out[27][0][0] = -144.0 + 288.0*in[1] + 216.0*in[2] - 432.0*in[1]*in[2] + 288.0*in[0] - 576.0*in[0]*in[1] - 432.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2];
516 out[27][0][1] = 288.0*in[0] - 432.0*in[0]*in[2] - 288.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[2];
517 out[27][0][2] = 216.0*in[0] - 432.0*in[0]*in[1] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1];
518 out[27][1][0] = 0.0;
519 out[27][1][1] = 0.0;
520 out[27][1][2] = 0.0;
521 out[27][2][0] = 0.0;
522 out[27][2][1] = 0.0;
523 out[27][2][2] = 0.0;
524
525 out[28][0][0] = -144.0 + 216.0*in[1] + 288.0*in[2] - 432.0*in[1]*in[2] + 288.0*in[0] - 432.0*in[0]*in[1] - 576.0*in[0]*in[2] + 864.0*in[0]*in[1]*in[2];
526 out[28][0][1] = 216.0*in[0] - 432.0*in[0]*in[2] - 216.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[2];
527 out[28][0][2] = 288.0*in[0] - 432.0*in[0]*in[1] - 288.0*in[0]*in[0] + 432.0*in[0]*in[0]*in[1];
528 out[28][1][0] = 0.0;
529 out[28][1][1] = 0.0;
530 out[28][1][2] = 0.0;
531 out[28][2][0] = 0.0;
532 out[28][2][1] = 0.0;
533 out[28][2][2] = 0.0;
534
535 out[29][0][0] = 0.0;
536 out[29][0][1] = 0.0;
537 out[29][0][2] = 0.0;
538 out[29][1][0] = 288.0*in[1] - 432.0*in[1]*in[2] - 288.0*in[1]*in[1] + 432.0*in[1]*in[1]*in[2];
539 out[29][1][1] = -144.0 + 288.0*in[0] + 216.0*in[2] - 432.0*in[0]*in[2] + 288.0*in[1] - 576.0*in[0]*in[1] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
540 out[29][1][2] = 216.0*in[1] - 432.0*in[0]*in[1] - 216.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1];
541 out[29][2][0] = 0.0;
542 out[29][2][1] = 0.0;
543 out[29][2][2] = 0.0;
544
545 out[30][0][0] = 0.0;
546 out[30][0][1] = 0.0;
547 out[30][0][2] = 0.0;
548 out[30][1][0] = 216.0*in[1] - 432.0*in[1]*in[2] - 216.0*in[1]*in[1] + 432.0*in[1]*in[1]*in[2];
549 out[30][1][1] = -144.0 + 216.0*in[0] + 288.0*in[2] - 432.0*in[0]*in[2] + 288.0*in[1] - 432.0*in[0]*in[1] - 576.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
550 out[30][1][2] = 288.0*in[1] - 432.0*in[0]*in[1] - 288.0*in[1]*in[1] + 432.0*in[0]*in[1]*in[1];
551 out[30][2][0] = 0.0;
552 out[30][2][1] = 0.0;
553 out[30][2][2] = 0.0;
554
555 out[31][0][0] = 0.0;
556 out[31][0][1] = 0.0;
557 out[31][0][2] = 0.0;
558 out[31][1][0] = 0.0;
559 out[31][1][1] = 0.0;
560 out[31][1][2] = 0.0;
561 out[31][2][0] = 288.0*in[2] - 432.0*in[1]*in[2] - 288.0*in[2]*in[2] + 432.0*in[1]*in[2]*in[2];
562 out[31][2][1] = 216.0*in[2] - 432.0*in[0]*in[2] - 216.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2];
563 out[31][2][2] = -144.0 + 288.0*in[0] + 216.0*in[1] - 432.0*in[0]*in[1] + 288.0*in[2] - 576.0*in[0]*in[2] - 432.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
564
565 out[32][0][0] = 0.0;
566 out[32][0][1] = 0.0;
567 out[32][0][2] = 0.0;
568 out[32][1][0] = 0.0;
569 out[32][1][1] = 0.0;
570 out[32][1][2] = 0.0;
571 out[32][2][0] = 216.0*in[2] - 432.0*in[1]*in[2] - 216.0*in[2]*in[2] + 432.0*in[1]*in[2]*in[2];
572 out[32][2][1] = 288.0*in[2] - 432.0*in[0]*in[2] - 288.0*in[2]*in[2] + 432.0*in[0]*in[2]*in[2];
573 out[32][2][2] = -144.0 + 216.0*in[0] + 288.0*in[1] - 432.0*in[0]*in[1] + 288.0*in[2] - 432.0*in[0]*in[2] - 576.0*in[1]*in[2] + 864.0*in[0]*in[1]*in[2];
574
575 out[33][0][0] = 216.0 - 432.0*in[1] - 432.0*in[2] + 864.0*in[1]*in[2] - 432.0*in[0] + 864.0*in[0]*in[1] + 864.0*in[0]*in[2] - 1728.0*in[0]*in[1]*in[2];
576 out[33][0][1] = -432.0*in[0] + 864.0*in[0]*in[2] + 432.0*in[0]*in[0] - 864.0*in[0]*in[0]*in[2];
577 out[33][0][2] = -432.0*in[0] + 864.0*in[0]*in[1] + 432.0*in[0]*in[0] - 864.0*in[0]*in[0]*in[1];
578 out[33][1][0] = 0.0;
579 out[33][1][1] = 0.0;
580 out[33][1][2] = 0.0;
581 out[33][2][0] = 0.0;
582 out[33][2][1] = 0.0;
583 out[33][2][2] = 0.0;
584
585 out[34][0][0] = 0.0;
586 out[34][0][1] = 0.0;
587 out[34][0][2] = 0.0;
588 out[34][1][0] = -432.0*in[1] + 864.0*in[1]*in[2] + 432.0*in[1]*in[1] - 864.0*in[1]*in[1]*in[2];
589 out[34][1][1] = 216.0 - 432.0*in[0] - 432.0*in[2] + 864.0*in[0]*in[2] - 432.0*in[1] + 864.0*in[0]*in[1] + 864.0*in[1]*in[2] - 1728.0*in[0]*in[1]*in[2];
590 out[34][1][2] = -432.0*in[1] + 864.0*in[0]*in[1] + 432.0*in[1]*in[1] - 864.0*in[0]*in[1]*in[1];
591 out[34][2][0] = 0.0;
592 out[34][2][1] = 0.0;
593 out[34][2][2] = 0.0;
594
595 out[35][0][0] = 0.0;
596 out[35][0][1] = 0.0;
597 out[35][0][2] = 0.0;
598 out[35][1][0] = 0.0;
599 out[35][1][1] = 0.0;
600 out[35][1][2] = 0.0;
601 out[35][2][0] = -432.0*in[2] + 864.0*in[1]*in[2] + 432.0*in[2]*in[2] - 864.0*in[1]*in[2]*in[2];
602 out[35][2][1] = -432.0*in[2] + 864.0*in[0]*in[2] + 432.0*in[2]*in[2] - 864.0*in[0]*in[2]*in[2];
603 out[35][2][2] = 216.0 - 432.0*in[0] - 432.0*in[1] + 864.0*in[0]*in[1] - 432.0*in[2] + 864.0*in[0]*in[2] + 864.0*in[1]*in[2] - 1728.0*in[0]*in[1]*in[2];
604 }
605
607 void partial (const std::array<unsigned int, 3>& order,
608 const typename Traits::DomainType& in, // position
609 std::vector<typename Traits::RangeType>& out) const // return value
610 {
611 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
612 if (totalOrder == 0) {
613 evaluateFunction(in, out);
614 } else {
615 DUNE_THROW(NotImplemented, "Desired derivative order is not implemented");
616 }
617 }
618
620 unsigned int order () const
621 {
622 return 3;
623 }
624
625 private:
626 R sign0, sign1, sign2, sign3, sign4, sign5;
627 };
628}
629#endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS1_CUBE3D_LOCALBASIS_HH
A dense n x m matrix.
Definition: fmatrix.hh:68
vector space out of a tensor product of fields.
Definition: fvector.hh:93
Default exception for dummy implementations.
Definition: exceptions.hh:261
First order Raviart-Thomas shape functions on the reference hexahedron.
Definition: raviartthomas1cube3dlocalbasis.hh:26
void partial(const std::array< unsigned int, 3 > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of all shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:607
unsigned int size() const
number of shape functions
Definition: raviartthomas1cube3dlocalbasis.hh:73
RT1Cube3DLocalBasis(unsigned int s)
Make set number s, where 0 <= s < 64.
Definition: raviartthomas1cube3dlocalbasis.hh:43
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:84
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:240
RT1Cube3DLocalBasis()
Standard constructor.
Definition: raviartthomas1cube3dlocalbasis.hh:33
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas1cube3dlocalbasis.hh:620
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:331
Dune namespace.
Definition: alignedallocator.hh:10
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)