DUNE PDELab (2.8)

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