17 #include "deal.II/base/polynomials_rt_bubbles.h" 19 #include <deal.II/base/quadrature_lib.h> 20 #include <deal.II/base/thread_management.h> 25 DEAL_II_NAMESPACE_OPEN
31 , raviart_thomas_space(k - 1)
33 , n_pols(compute_n_pols(k))
37 for (
unsigned int i = 0; i <
monomials.size(); ++i)
53 Assert(values.size() == n_pols || values.size() == 0,
55 Assert(grads.size() == n_pols || grads.size() == 0,
57 Assert(grad_grads.size() == n_pols || grad_grads.size() == 0,
59 Assert(third_derivatives.size() == n_pols || third_derivatives.size() == 0,
61 Assert(fourth_derivatives.size() == n_pols || fourth_derivatives.size() == 0,
65 (void)third_derivatives;
67 (void)fourth_derivatives;
70 const unsigned int n_sub = raviart_thomas_space.n();
77 std::lock_guard<std::mutex> lock(mutex);
79 static std::vector<Tensor<1, dim>> p_values;
80 static std::vector<Tensor<2, dim>> p_grads;
81 static std::vector<Tensor<3, dim>> p_grad_grads;
82 static std::vector<Tensor<4, dim>> p_third_derivatives;
83 static std::vector<Tensor<5, dim>> p_fourth_derivatives;
85 p_values.resize((values.size() == 0) ? 0 : n_sub);
86 p_grads.resize((grads.size() == 0) ? 0 : n_sub);
87 p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub);
90 raviart_thomas_space.compute(unit_point,
95 p_fourth_derivatives);
96 for (
unsigned int i = 0; i < p_values.size(); ++i)
97 values[i] = p_values[i];
98 for (
unsigned int i = 0; i < p_grads.size(); ++i)
99 grads[i] = p_grads[i];
100 for (
unsigned int i = 0; i < p_grad_grads.size(); ++i)
101 grad_grads[i] = p_grad_grads[i];
106 const unsigned int n_derivatives = 3;
107 double monoval_plus[dim][n_derivatives + 1];
108 double monoval[dim][n_derivatives + 1];
110 double monoval_i[dim][n_derivatives + 1];
111 double monoval_j[dim][n_derivatives + 1];
112 double monoval_jplus[dim][n_derivatives + 1];
114 unsigned int start = n_sub;
126 for (
unsigned int d = 0; d < dim; ++d)
127 monomials[my_degree + 1].value(unit_point(d),
131 for (
unsigned int i = 0; i <= my_degree; ++i, ++start)
133 for (
unsigned int d = 0; d < dim; ++d)
134 monomials[i].value(unit_point(d), n_derivatives, monoval_i[d]);
136 if (values.size() != 0)
138 values[start][0] = monoval_i[0][0] * monoval_plus[1][1];
139 values[start][1] = -monoval_i[0][1] * monoval_plus[1][0];
141 values[start + my_degree + 1][0] =
142 -monoval_plus[0][0] * monoval_i[1][1];
143 values[start + my_degree + 1][1] =
144 monoval_plus[0][1] * monoval_i[1][0];
147 if (grads.size() != 0)
149 grads[start][0][0] = monoval_i[0][1] * monoval_plus[1][1];
150 grads[start][0][1] = monoval_i[0][0] * monoval_plus[1][2];
151 grads[start][1][0] = -monoval_i[0][2] * monoval_plus[1][0];
152 grads[start][1][1] = -monoval_i[0][1] * monoval_plus[1][1];
154 grads[start + my_degree + 1][0][0] =
155 -monoval_plus[0][1] * monoval_i[1][1];
156 grads[start + my_degree + 1][0][1] =
157 -monoval_plus[0][0] * monoval_i[1][2];
158 grads[start + my_degree + 1][1][0] =
159 monoval_plus[0][2] * monoval_i[1][0];
160 grads[start + my_degree + 1][1][1] =
161 monoval_plus[0][1] * monoval_i[1][1];
164 if (grad_grads.size() != 0)
166 grad_grads[start][0][0][0] = monoval_i[0][2] * monoval_plus[1][1];
167 grad_grads[start][0][0][1] = monoval_i[0][1] * monoval_plus[1][2];
168 grad_grads[start][0][1][0] = monoval_i[0][1] * monoval_plus[1][2];
169 grad_grads[start][0][1][1] = monoval_i[0][0] * monoval_plus[1][3];
170 grad_grads[start][1][0][0] =
171 -monoval_i[0][3] * monoval_plus[1][0];
172 grad_grads[start][1][0][1] =
173 -monoval_i[0][2] * monoval_plus[1][1];
174 grad_grads[start][1][1][0] =
175 -monoval_i[0][2] * monoval_plus[1][1];
176 grad_grads[start][1][1][1] =
177 -monoval_i[0][1] * monoval_plus[1][2];
179 grad_grads[start + my_degree + 1][0][0][0] =
180 -monoval_plus[0][2] * monoval_i[1][1];
181 grad_grads[start + my_degree + 1][0][0][1] =
182 -monoval_plus[0][1] * monoval_i[1][2];
183 grad_grads[start + my_degree + 1][0][1][0] =
184 -monoval_plus[0][1] * monoval_i[1][2];
185 grad_grads[start + my_degree + 1][0][1][1] =
186 -monoval_plus[0][0] * monoval_i[1][3];
187 grad_grads[start + my_degree + 1][1][0][0] =
188 monoval_plus[0][3] * monoval_i[1][0];
189 grad_grads[start + my_degree + 1][1][0][1] =
190 monoval_plus[0][2] * monoval_i[1][1];
191 grad_grads[start + my_degree + 1][1][1][0] =
192 monoval_plus[0][2] * monoval_i[1][1];
193 grad_grads[start + my_degree + 1][1][1][1] =
194 monoval_plus[0][1] * monoval_i[1][2];
211 for (
unsigned int d = 0; d < dim; ++d)
213 monomials[my_degree + 1].value(unit_point(d),
216 monomials[my_degree].value(unit_point(d), n_derivatives, monoval[d]);
219 const unsigned int n_curls = (my_degree + 1) * (2 * my_degree + 1);
221 for (
unsigned int i = 0; i <= my_degree; ++i)
223 for (
unsigned int d = 0; d < dim; ++d)
224 monomials[i].value(unit_point(d), n_derivatives, monoval_i[d]);
226 for (
unsigned int j = 0; j <= my_degree; ++j)
228 for (
unsigned int d = 0; d < dim; ++d)
230 monomials[j].value(unit_point(d),
233 monomials[j + 1].value(unit_point(d),
238 if (values.size() != 0)
240 values[start][0] = monoval_i[0][0] * monoval_j[1][0] *
242 static_cast<double>(j + my_degree + 2);
244 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][0];
246 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][0];
248 values[start + n_curls][0] =
249 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][0];
250 values[start + n_curls][1] =
251 monoval_j[0][0] * monoval_i[1][0] * monoval[2][0] *
252 static_cast<double>(j + my_degree + 2);
253 values[start + n_curls][2] =
254 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][0];
256 values[start + 2 * n_curls][0] =
257 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][1];
258 values[start + 2 * n_curls][1] =
259 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][1];
260 values[start + 2 * n_curls][2] =
261 monoval_j[0][0] * monoval[1][0] * monoval_i[2][0] *
262 static_cast<double>(j + my_degree + 2);
268 values[start + 1][0] =
269 monoval_i[0][0] * monoval[1][0] * monoval_j[2][0] *
270 static_cast<double>(j + my_degree + 2);
271 values[start + 1][1] =
272 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][0];
273 values[start + 1][2] =
274 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][0];
276 values[start + n_curls + 1][0] =
277 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][0];
278 values[start + n_curls + 1][1] =
279 monoval[0][0] * monoval_i[1][0] * monoval_j[2][0] *
280 static_cast<double>(j + my_degree + 2);
281 values[start + n_curls + 1][2] =
282 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][0];
284 values[start + 2 * n_curls + 1][0] =
285 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][1];
286 values[start + 2 * n_curls + 1][1] =
287 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][1];
288 values[start + 2 * n_curls + 1][2] =
289 monoval[0][0] * monoval_j[1][0] * monoval_i[2][0] *
290 static_cast<double>(j + my_degree + 2);
294 if (grads.size() != 0)
296 grads[start][0][0] = monoval_i[0][1] * monoval_j[1][0] *
298 static_cast<double>(j + my_degree + 2);
299 grads[start][0][1] = monoval_i[0][0] * monoval_j[1][1] *
301 static_cast<double>(j + my_degree + 2);
302 grads[start][0][2] = monoval_i[0][0] * monoval_j[1][0] *
304 static_cast<double>(j + my_degree + 2);
306 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][0];
308 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][0];
310 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][1];
312 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][0];
314 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][0];
316 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][1];
318 grads[start + n_curls][0][0] =
319 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][0];
320 grads[start + n_curls][0][1] =
321 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][0];
322 grads[start + n_curls][0][2] =
323 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][1];
324 grads[start + n_curls][1][0] =
325 monoval_j[0][1] * monoval_i[1][0] * monoval[2][0] *
326 static_cast<double>(j + my_degree + 2);
327 grads[start + n_curls][1][1] =
328 monoval_j[0][0] * monoval_i[1][1] * monoval[2][0] *
329 static_cast<double>(j + my_degree + 2);
330 grads[start + n_curls][1][2] =
331 monoval_j[0][0] * monoval_i[1][0] * monoval[2][1] *
332 static_cast<double>(j + my_degree + 2);
333 grads[start + n_curls][2][0] =
334 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][0];
335 grads[start + n_curls][2][1] =
336 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][0];
337 grads[start + n_curls][2][2] =
338 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][1];
340 grads[start + 2 * n_curls][0][0] =
341 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][1];
342 grads[start + 2 * n_curls][0][1] =
343 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][1];
344 grads[start + 2 * n_curls][0][2] =
345 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][2];
346 grads[start + 2 * n_curls][1][0] =
347 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][1];
348 grads[start + 2 * n_curls][1][1] =
349 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][1];
350 grads[start + 2 * n_curls][1][2] =
351 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][2];
352 grads[start + 2 * n_curls][2][0] =
353 monoval_j[0][1] * monoval[1][0] * monoval_i[2][0] *
354 static_cast<double>(j + my_degree + 2);
355 grads[start + 2 * n_curls][2][1] =
356 monoval_j[0][0] * monoval[1][1] * monoval_i[2][0] *
357 static_cast<double>(j + my_degree + 2);
358 grads[start + 2 * n_curls][2][2] =
359 monoval_j[0][0] * monoval[1][0] * monoval_i[2][1] *
360 static_cast<double>(j + my_degree + 2);
364 grads[start + 1][0][0] =
365 monoval_i[0][1] * monoval[1][0] * monoval_j[2][0] *
366 static_cast<double>(j + my_degree + 2);
367 grads[start + 1][0][1] =
368 monoval_i[0][0] * monoval[1][1] * monoval_j[2][0] *
369 static_cast<double>(j + my_degree + 2);
370 grads[start + 1][0][2] =
371 monoval_i[0][0] * monoval[1][0] * monoval_j[2][1] *
372 static_cast<double>(j + my_degree + 2);
373 grads[start + 1][1][0] =
374 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][0];
375 grads[start + 1][1][1] =
376 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][0];
377 grads[start + 1][1][2] =
378 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][1];
379 grads[start + 1][2][0] =
380 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][0];
381 grads[start + 1][2][1] =
382 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][0];
383 grads[start + 1][2][2] =
384 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][1];
386 grads[start + n_curls + 1][0][0] =
387 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][0];
388 grads[start + n_curls + 1][0][1] =
389 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][0];
390 grads[start + n_curls + 1][0][2] =
391 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][1];
392 grads[start + n_curls + 1][1][0] =
393 monoval[0][1] * monoval_i[1][0] * monoval_j[2][0] *
394 static_cast<double>(j + my_degree + 2);
395 grads[start + n_curls + 1][1][1] =
396 monoval[0][0] * monoval_i[1][1] * monoval_j[2][0] *
397 static_cast<double>(j + my_degree + 2);
398 grads[start + n_curls + 1][1][2] =
399 monoval[0][0] * monoval_i[1][0] * monoval_j[2][1] *
400 static_cast<double>(j + my_degree + 2);
401 grads[start + n_curls + 1][2][0] =
402 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][0];
403 grads[start + n_curls + 1][2][1] =
404 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][0];
405 grads[start + n_curls + 1][2][2] =
406 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][1];
408 grads[start + 2 * n_curls + 1][0][0] =
409 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][1];
410 grads[start + 2 * n_curls + 1][0][1] =
411 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][1];
412 grads[start + 2 * n_curls + 1][0][2] =
413 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][2];
414 grads[start + 2 * n_curls + 1][1][0] =
415 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][1];
416 grads[start + 2 * n_curls + 1][1][1] =
417 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][1];
418 grads[start + 2 * n_curls + 1][1][2] =
419 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][2];
420 grads[start + 2 * n_curls + 1][2][0] =
421 monoval[0][1] * monoval_j[1][0] * monoval_i[2][0] *
422 static_cast<double>(j + my_degree + 2);
423 grads[start + 2 * n_curls + 1][2][1] =
424 monoval[0][0] * monoval_j[1][1] * monoval_i[2][0] *
425 static_cast<double>(j + my_degree + 2);
426 grads[start + 2 * n_curls + 1][2][2] =
427 monoval[0][0] * monoval_j[1][0] * monoval_i[2][1] *
428 static_cast<double>(j + my_degree + 2);
432 if (grad_grads.size() != 0)
434 grad_grads[start][0][0][0] =
435 monoval_i[0][2] * monoval_j[1][0] * monoval[2][0] *
436 static_cast<double>(j + my_degree + 2);
437 grad_grads[start][0][0][1] =
438 monoval_i[0][1] * monoval_j[1][1] * monoval[2][0] *
439 static_cast<double>(j + my_degree + 2);
440 grad_grads[start][0][0][2] =
441 monoval_i[0][1] * monoval_j[1][0] * monoval[2][1] *
442 static_cast<double>(j + my_degree + 2);
443 grad_grads[start][0][1][0] =
444 monoval_i[0][1] * monoval_j[1][1] * monoval[2][0] *
445 static_cast<double>(j + my_degree + 2);
446 grad_grads[start][0][1][1] =
447 monoval_i[0][0] * monoval_j[1][2] * monoval[2][0] *
448 static_cast<double>(j + my_degree + 2);
449 grad_grads[start][0][1][2] =
450 monoval_i[0][0] * monoval_j[1][1] * monoval[2][1] *
451 static_cast<double>(j + my_degree + 2);
452 grad_grads[start][0][2][0] =
453 monoval_i[0][1] * monoval_j[1][0] * monoval[2][1] *
454 static_cast<double>(j + my_degree + 2);
455 grad_grads[start][0][2][1] =
456 monoval_i[0][0] * monoval_j[1][1] * monoval[2][1] *
457 static_cast<double>(j + my_degree + 2);
458 grad_grads[start][0][2][2] =
459 monoval_i[0][0] * monoval_j[1][0] * monoval[2][2] *
460 static_cast<double>(j + my_degree + 2);
461 grad_grads[start][1][0][0] =
462 -monoval_i[0][3] * monoval_jplus[1][0] * monoval[2][0];
463 grad_grads[start][1][0][1] =
464 -monoval_i[0][2] * monoval_jplus[1][1] * monoval[2][0];
465 grad_grads[start][1][0][2] =
466 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][1];
467 grad_grads[start][1][1][0] =
468 -monoval_i[0][2] * monoval_jplus[1][1] * monoval[2][0];
469 grad_grads[start][1][1][1] =
470 -monoval_i[0][1] * monoval_jplus[1][2] * monoval[2][0];
471 grad_grads[start][1][1][2] =
472 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][1];
473 grad_grads[start][1][2][0] =
474 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][1];
475 grad_grads[start][1][2][1] =
476 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][1];
477 grad_grads[start][1][2][2] =
478 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][2];
479 grad_grads[start][2][0][0] =
480 -monoval_i[0][3] * monoval_j[1][0] * monoval_plus[2][0];
481 grad_grads[start][2][0][1] =
482 -monoval_i[0][2] * monoval_j[1][1] * monoval_plus[2][0];
483 grad_grads[start][2][0][2] =
484 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][1];
485 grad_grads[start][2][1][0] =
486 -monoval_i[0][2] * monoval_j[1][1] * monoval_plus[2][0];
487 grad_grads[start][2][1][1] =
488 -monoval_i[0][1] * monoval_j[1][2] * monoval_plus[2][0];
489 grad_grads[start][2][1][2] =
490 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][1];
491 grad_grads[start][2][2][0] =
492 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][1];
493 grad_grads[start][2][2][1] =
494 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][1];
495 grad_grads[start][2][2][2] =
496 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][2];
498 grad_grads[start + n_curls][0][0][0] =
499 -monoval_jplus[0][2] * monoval_i[1][1] * monoval[2][0];
500 grad_grads[start + n_curls][0][0][1] =
501 -monoval_jplus[0][1] * monoval_i[1][2] * monoval[2][0];
502 grad_grads[start + n_curls][0][0][2] =
503 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][1];
504 grad_grads[start + n_curls][0][1][0] =
505 -monoval_jplus[0][1] * monoval_i[1][2] * monoval[2][0];
506 grad_grads[start + n_curls][0][1][1] =
507 -monoval_jplus[0][0] * monoval_i[1][3] * monoval[2][0];
508 grad_grads[start + n_curls][0][1][2] =
509 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][1];
510 grad_grads[start + n_curls][0][2][0] =
511 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][1];
512 grad_grads[start + n_curls][0][2][1] =
513 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][1];
514 grad_grads[start + n_curls][0][2][2] =
515 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][2];
516 grad_grads[start + n_curls][1][0][0] =
517 monoval_j[0][2] * monoval_i[1][0] * monoval[2][0] *
518 static_cast<double>(j + my_degree + 2);
519 grad_grads[start + n_curls][1][0][1] =
520 monoval_j[0][1] * monoval_i[1][1] * monoval[2][0] *
521 static_cast<double>(j + my_degree + 2);
522 grad_grads[start + n_curls][1][0][2] =
523 monoval_j[0][1] * monoval_i[1][0] * monoval[2][1] *
524 static_cast<double>(j + my_degree + 2);
525 grad_grads[start + n_curls][1][1][0] =
526 monoval_j[0][1] * monoval_i[1][1] * monoval[2][0] *
527 static_cast<double>(j + my_degree + 2);
528 grad_grads[start + n_curls][1][1][1] =
529 monoval_j[0][0] * monoval_i[1][2] * monoval[2][0] *
530 static_cast<double>(j + my_degree + 2);
531 grad_grads[start + n_curls][1][1][2] =
532 monoval_j[0][0] * monoval_i[1][1] * monoval[2][1] *
533 static_cast<double>(j + my_degree + 2);
534 grad_grads[start + n_curls][1][2][0] =
535 monoval_j[0][1] * monoval_i[1][0] * monoval[2][1] *
536 static_cast<double>(j + my_degree + 2);
537 grad_grads[start + n_curls][1][2][1] =
538 monoval_j[0][0] * monoval_i[1][1] * monoval[2][1] *
539 static_cast<double>(j + my_degree + 2);
540 grad_grads[start + n_curls][1][2][2] =
541 monoval_j[0][0] * monoval_i[1][0] * monoval[2][2] *
542 static_cast<double>(j + my_degree + 2);
543 grad_grads[start + n_curls][2][0][0] =
544 -monoval_j[0][2] * monoval_i[1][1] * monoval_plus[2][0];
545 grad_grads[start + n_curls][2][0][1] =
546 -monoval_j[0][1] * monoval_i[1][2] * monoval_plus[2][0];
547 grad_grads[start + n_curls][2][0][2] =
548 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][1];
549 grad_grads[start + n_curls][2][1][0] =
550 -monoval_j[0][1] * monoval_i[1][2] * monoval_plus[2][0];
551 grad_grads[start + n_curls][2][1][1] =
552 -monoval_j[0][0] * monoval_i[1][3] * monoval_plus[2][0];
553 grad_grads[start + n_curls][2][1][2] =
554 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][1];
555 grad_grads[start + n_curls][2][2][0] =
556 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][1];
557 grad_grads[start + n_curls][2][2][1] =
558 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][1];
559 grad_grads[start + n_curls][2][2][2] =
560 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][2];
562 grad_grads[start + 2 * n_curls][0][0][0] =
563 -monoval_jplus[0][2] * monoval[1][0] * monoval_i[2][1];
564 grad_grads[start + 2 * n_curls][0][0][1] =
565 -monoval_jplus[0][1] * monoval[1][1] * monoval_i[2][1];
566 grad_grads[start + 2 * n_curls][0][0][2] =
567 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][2];
568 grad_grads[start + 2 * n_curls][0][1][0] =
569 -monoval_jplus[0][1] * monoval[1][1] * monoval_i[2][1];
570 grad_grads[start + 2 * n_curls][0][1][1] =
571 -monoval_jplus[0][0] * monoval[1][2] * monoval_i[2][1];
572 grad_grads[start + 2 * n_curls][0][1][2] =
573 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][2];
574 grad_grads[start + 2 * n_curls][0][2][0] =
575 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][2];
576 grad_grads[start + 2 * n_curls][0][2][1] =
577 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][2];
578 grad_grads[start + 2 * n_curls][0][2][2] =
579 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][3];
580 grad_grads[start + 2 * n_curls][1][0][0] =
581 -monoval_j[0][2] * monoval_plus[1][0] * monoval_i[2][1];
582 grad_grads[start + 2 * n_curls][1][0][1] =
583 -monoval_j[0][1] * monoval_plus[1][1] * monoval_i[2][1];
584 grad_grads[start + 2 * n_curls][1][0][2] =
585 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][2];
586 grad_grads[start + 2 * n_curls][1][1][0] =
587 -monoval_j[0][1] * monoval_plus[1][1] * monoval_i[2][1];
588 grad_grads[start + 2 * n_curls][1][1][1] =
589 -monoval_j[0][0] * monoval_plus[1][2] * monoval_i[2][1];
590 grad_grads[start + 2 * n_curls][1][1][2] =
591 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][2];
592 grad_grads[start + 2 * n_curls][1][2][0] =
593 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][2];
594 grad_grads[start + 2 * n_curls][1][2][1] =
595 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][2];
596 grad_grads[start + 2 * n_curls][1][2][2] =
597 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][3];
598 grad_grads[start + 2 * n_curls][2][0][0] =
599 monoval_j[0][2] * monoval[1][0] * monoval_i[2][0] *
600 static_cast<double>(j + my_degree + 2);
601 grad_grads[start + 2 * n_curls][2][0][1] =
602 monoval_j[0][1] * monoval[1][1] * monoval_i[2][0] *
603 static_cast<double>(j + my_degree + 2);
604 grad_grads[start + 2 * n_curls][2][0][2] =
605 monoval_j[0][1] * monoval[1][0] * monoval_i[2][1] *
606 static_cast<double>(j + my_degree + 2);
607 grad_grads[start + 2 * n_curls][2][1][0] =
608 monoval_j[0][1] * monoval[1][1] * monoval_i[2][0] *
609 static_cast<double>(j + my_degree + 2);
610 grad_grads[start + 2 * n_curls][2][1][1] =
611 monoval_j[0][0] * monoval[1][2] * monoval_i[2][0] *
612 static_cast<double>(j + my_degree + 2);
613 grad_grads[start + 2 * n_curls][2][1][2] =
614 monoval_j[0][0] * monoval[1][1] * monoval_i[2][1] *
615 static_cast<double>(j + my_degree + 2);
616 grad_grads[start + 2 * n_curls][2][2][0] =
617 monoval_j[0][1] * monoval[1][0] * monoval_i[2][1] *
618 static_cast<double>(j + my_degree + 2);
619 grad_grads[start + 2 * n_curls][2][2][1] =
620 monoval_j[0][0] * monoval[1][1] * monoval_i[2][1] *
621 static_cast<double>(j + my_degree + 2);
622 grad_grads[start + 2 * n_curls][2][2][2] =
623 monoval_j[0][0] * monoval[1][0] * monoval_i[2][2] *
624 static_cast<double>(j + my_degree + 2);
628 grad_grads[start + 1][0][0][0] =
629 monoval_i[0][2] * monoval[1][0] * monoval_j[2][0] *
630 static_cast<double>(j + my_degree + 2);
631 grad_grads[start + 1][0][0][1] =
632 monoval_i[0][1] * monoval[1][1] * monoval_j[2][0] *
633 static_cast<double>(j + my_degree + 2);
634 grad_grads[start + 1][0][0][2] =
635 monoval_i[0][1] * monoval[1][0] * monoval_j[2][1] *
636 static_cast<double>(j + my_degree + 2);
637 grad_grads[start + 1][0][1][0] =
638 monoval_i[0][1] * monoval[1][1] * monoval_j[2][0] *
639 static_cast<double>(j + my_degree + 2);
640 grad_grads[start + 1][0][1][1] =
641 monoval_i[0][0] * monoval[1][2] * monoval_j[2][0] *
642 static_cast<double>(j + my_degree + 2);
643 grad_grads[start + 1][0][1][2] =
644 monoval_i[0][0] * monoval[1][1] * monoval_j[2][1] *
645 static_cast<double>(j + my_degree + 2);
646 grad_grads[start + 1][0][2][0] =
647 monoval_i[0][1] * monoval[1][0] * monoval_j[2][1] *
648 static_cast<double>(j + my_degree + 2);
649 grad_grads[start + 1][0][2][1] =
650 monoval_i[0][0] * monoval[1][1] * monoval_j[2][1] *
651 static_cast<double>(j + my_degree + 2);
652 grad_grads[start + 1][0][2][2] =
653 monoval_i[0][0] * monoval[1][0] * monoval_j[2][2] *
654 static_cast<double>(j + my_degree + 2);
655 grad_grads[start + 1][1][0][0] =
656 -monoval_i[0][3] * monoval_plus[1][0] * monoval_j[2][0];
657 grad_grads[start + 1][1][0][1] =
658 -monoval_i[0][2] * monoval_plus[1][1] * monoval_j[2][0];
659 grad_grads[start + 1][1][0][2] =
660 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][1];
661 grad_grads[start + 1][1][1][0] =
662 -monoval_i[0][2] * monoval_plus[1][1] * monoval_j[2][0];
663 grad_grads[start + 1][1][1][1] =
664 -monoval_i[0][1] * monoval_plus[1][2] * monoval_j[2][0];
665 grad_grads[start + 1][1][1][2] =
666 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][1];
667 grad_grads[start + 1][1][2][0] =
668 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][1];
669 grad_grads[start + 1][1][2][1] =
670 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][1];
671 grad_grads[start + 1][1][2][2] =
672 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][2];
673 grad_grads[start + 1][2][0][0] =
674 -monoval_i[0][3] * monoval[1][0] * monoval_jplus[2][0];
675 grad_grads[start + 1][2][0][1] =
676 -monoval_i[0][2] * monoval[1][1] * monoval_jplus[2][0];
677 grad_grads[start + 1][2][0][2] =
678 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][1];
679 grad_grads[start + 1][2][1][0] =
680 -monoval_i[0][2] * monoval[1][1] * monoval_jplus[2][0];
681 grad_grads[start + 1][2][1][1] =
682 -monoval_i[0][1] * monoval[1][2] * monoval_jplus[2][0];
683 grad_grads[start + 1][2][1][2] =
684 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][1];
685 grad_grads[start + 1][2][2][0] =
686 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][1];
687 grad_grads[start + 1][2][2][1] =
688 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][1];
689 grad_grads[start + 1][2][2][2] =
690 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][2];
692 grad_grads[start + n_curls + 1][0][0][0] =
693 -monoval_plus[0][2] * monoval_i[1][1] * monoval_j[2][0];
694 grad_grads[start + n_curls + 1][0][0][1] =
695 -monoval_plus[0][1] * monoval_i[1][2] * monoval_j[2][0];
696 grad_grads[start + n_curls + 1][0][0][2] =
697 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][1];
698 grad_grads[start + n_curls + 1][0][1][0] =
699 -monoval_plus[0][1] * monoval_i[1][2] * monoval_j[2][0];
700 grad_grads[start + n_curls + 1][0][1][1] =
701 -monoval_plus[0][0] * monoval_i[1][3] * monoval_j[2][0];
702 grad_grads[start + n_curls + 1][0][1][2] =
703 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][1];
704 grad_grads[start + n_curls + 1][0][2][0] =
705 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][1];
706 grad_grads[start + n_curls + 1][0][2][1] =
707 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][1];
708 grad_grads[start + n_curls + 1][0][2][2] =
709 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][2];
710 grad_grads[start + n_curls + 1][1][0][0] =
711 monoval[0][2] * monoval_i[1][0] * monoval_j[2][0] *
712 static_cast<double>(j + my_degree + 2);
713 grad_grads[start + n_curls + 1][1][0][1] =
714 monoval[0][1] * monoval_i[1][1] * monoval_j[2][0] *
715 static_cast<double>(j + my_degree + 2);
716 grad_grads[start + n_curls + 1][1][0][2] =
717 monoval[0][1] * monoval_i[1][0] * monoval_j[2][1] *
718 static_cast<double>(j + my_degree + 2);
719 grad_grads[start + n_curls + 1][1][1][0] =
720 monoval[0][1] * monoval_i[1][1] * monoval_j[2][0] *
721 static_cast<double>(j + my_degree + 2);
722 grad_grads[start + n_curls + 1][1][1][1] =
723 monoval[0][0] * monoval_i[1][2] * monoval_j[2][0] *
724 static_cast<double>(j + my_degree + 2);
725 grad_grads[start + n_curls + 1][1][1][2] =
726 monoval[0][0] * monoval_i[1][1] * monoval_j[2][1] *
727 static_cast<double>(j + my_degree + 2);
728 grad_grads[start + n_curls + 1][1][2][0] =
729 monoval[0][1] * monoval_i[1][0] * monoval_j[2][1] *
730 static_cast<double>(j + my_degree + 2);
731 grad_grads[start + n_curls + 1][1][2][1] =
732 monoval[0][0] * monoval_i[1][1] * monoval_j[2][1] *
733 static_cast<double>(j + my_degree + 2);
734 grad_grads[start + n_curls + 1][1][2][2] =
735 monoval[0][0] * monoval_i[1][0] * monoval_j[2][2] *
736 static_cast<double>(j + my_degree + 2);
737 grad_grads[start + n_curls + 1][2][0][0] =
738 -monoval[0][2] * monoval_i[1][1] * monoval_jplus[2][0];
739 grad_grads[start + n_curls + 1][2][0][1] =
740 -monoval[0][1] * monoval_i[1][2] * monoval_jplus[2][0];
741 grad_grads[start + n_curls + 1][2][0][2] =
742 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][1];
743 grad_grads[start + n_curls + 1][2][1][0] =
744 -monoval[0][1] * monoval_i[1][2] * monoval_jplus[2][0];
745 grad_grads[start + n_curls + 1][2][1][1] =
746 -monoval[0][0] * monoval_i[1][3] * monoval_jplus[2][0];
747 grad_grads[start + n_curls + 1][2][1][2] =
748 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][1];
749 grad_grads[start + n_curls + 1][2][2][0] =
750 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][1];
751 grad_grads[start + n_curls + 1][2][2][1] =
752 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][1];
753 grad_grads[start + n_curls + 1][2][2][2] =
754 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][2];
756 grad_grads[start + 2 * n_curls + 1][0][0][0] =
757 -monoval_plus[0][2] * monoval_j[1][0] * monoval_i[2][1];
758 grad_grads[start + 2 * n_curls + 1][0][0][1] =
759 -monoval_plus[0][1] * monoval_j[1][1] * monoval_i[2][1];
760 grad_grads[start + 2 * n_curls + 1][0][0][2] =
761 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][2];
762 grad_grads[start + 2 * n_curls + 1][0][1][0] =
763 -monoval_plus[0][1] * monoval_j[1][1] * monoval_i[2][1];
764 grad_grads[start + 2 * n_curls + 1][0][1][1] =
765 -monoval_plus[0][0] * monoval_j[1][2] * monoval_i[2][1];
766 grad_grads[start + 2 * n_curls + 1][0][1][2] =
767 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][2];
768 grad_grads[start + 2 * n_curls + 1][0][2][0] =
769 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][2];
770 grad_grads[start + 2 * n_curls + 1][0][2][1] =
771 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][2];
772 grad_grads[start + 2 * n_curls + 1][0][2][2] =
773 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][3];
774 grad_grads[start + 2 * n_curls + 1][1][0][0] =
775 -monoval[0][2] * monoval_jplus[1][0] * monoval_i[2][1];
776 grad_grads[start + 2 * n_curls + 1][1][0][1] =
777 -monoval[0][1] * monoval_jplus[1][1] * monoval_i[2][1];
778 grad_grads[start + 2 * n_curls + 1][1][0][2] =
779 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][2];
780 grad_grads[start + 2 * n_curls + 1][1][1][0] =
781 -monoval[0][1] * monoval_jplus[1][1] * monoval_i[2][1];
782 grad_grads[start + 2 * n_curls + 1][1][1][1] =
783 -monoval[0][0] * monoval_jplus[1][2] * monoval_i[2][1];
784 grad_grads[start + 2 * n_curls + 1][1][1][2] =
785 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][2];
786 grad_grads[start + 2 * n_curls + 1][1][2][0] =
787 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][2];
788 grad_grads[start + 2 * n_curls + 1][1][2][1] =
789 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][2];
790 grad_grads[start + 2 * n_curls + 1][1][2][2] =
791 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][3];
792 grad_grads[start + 2 * n_curls + 1][2][0][0] =
793 monoval[0][2] * monoval_j[1][0] * monoval_i[2][0] *
794 static_cast<double>(j + my_degree + 2);
795 grad_grads[start + 2 * n_curls + 1][2][0][1] =
796 monoval[0][1] * monoval_j[1][1] * monoval_i[2][0] *
797 static_cast<double>(j + my_degree + 2);
798 grad_grads[start + 2 * n_curls + 1][2][0][2] =
799 monoval[0][1] * monoval_j[1][0] * monoval_i[2][1] *
800 static_cast<double>(j + my_degree + 2);
801 grad_grads[start + 2 * n_curls + 1][2][1][0] =
802 monoval[0][1] * monoval_j[1][1] * monoval_i[2][0] *
803 static_cast<double>(j + my_degree + 2);
804 grad_grads[start + 2 * n_curls + 1][2][1][1] =
805 monoval[0][0] * monoval_j[1][2] * monoval_i[2][0] *
806 static_cast<double>(j + my_degree + 2);
807 grad_grads[start + 2 * n_curls + 1][2][1][2] =
808 monoval[0][0] * monoval_j[1][1] * monoval_i[2][1] *
809 static_cast<double>(j + my_degree + 2);
810 grad_grads[start + 2 * n_curls + 1][2][2][0] =
811 monoval[0][1] * monoval_j[1][0] * monoval_i[2][1] *
812 static_cast<double>(j + my_degree + 2);
813 grad_grads[start + 2 * n_curls + 1][2][2][1] =
814 monoval[0][0] * monoval_j[1][1] * monoval_i[2][1] *
815 static_cast<double>(j + my_degree + 2);
816 grad_grads[start + 2 * n_curls + 1][2][2][2] =
817 monoval[0][0] * monoval_j[1][0] * monoval_i[2][2] *
818 static_cast<double>(j + my_degree + 2);
838 if (dim == 1 || dim == 2 || dim == 3)
839 return dim * Utilities::fixed_power<dim>(k + 1);
851 DEAL_II_NAMESPACE_CLOSE
void compute(const Point< dim > &unit_point, std::vector< Tensor< 1, dim >> &values, std::vector< Tensor< 2, dim >> &grads, std::vector< Tensor< 3, dim >> &grad_grads, std::vector< Tensor< 4, dim >> &third_derivatives, std::vector< Tensor< 5, dim >> &fourth_derivatives) const
static unsigned int compute_n_pols(const unsigned int degree)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
PolynomialsRT_Bubbles(const unsigned int k)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotImplemented()
std::vector< Polynomials::Polynomial< double > > monomials
static ::ExceptionBase & ExcInternalError()