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