Dune Core Modules (2.6.0)

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