Reference documentation for deal.II version GIT relicensing-750-gcfa4c29382 2024-05-25 07:20:02+00:00
Searching...
No Matches
polynomials_rt_bubbles.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
4// Copyright (C) 2018 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15
19
20#include <iomanip>
21#include <iostream>
22#include <memory>
23
25
26
27template <int dim>
29 : TensorPolynomialsBase<dim>(k, n_polynomials(k))
30 , raviart_thomas_space(k - 1)
31 , monomials(k + 2)
32{
33 Assert(dim >= 2, ExcImpossibleInDim(dim));
34
35 for (unsigned int i = 0; i < monomials.size(); ++i)
37}
38
39
40
41template <int dim>
42void
44 const Point<dim> &unit_point,
45 std::vector<Tensor<1, dim>> &values,
48 std::vector<Tensor<4, dim>> &third_derivatives,
49 std::vector<Tensor<5, dim>> &fourth_derivatives) const
50{
51 Assert(values.size() == this->n() || values.empty(),
52 ExcDimensionMismatch(values.size(), this->n()));
57 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
58 ExcDimensionMismatch(third_derivatives.size(), this->n()));
59 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
60 ExcDimensionMismatch(fourth_derivatives.size(), this->n()));
61
62 // Third and fourth derivatives are not implemented
63 (void)third_derivatives;
64 Assert(third_derivatives.empty(), ExcNotImplemented());
65 (void)fourth_derivatives;
66 Assert(fourth_derivatives.empty(), ExcNotImplemented());
67
68 const unsigned int n_sub = raviart_thomas_space.n();
69 const unsigned int my_degree = this->degree();
70
71 // Guard access to the scratch arrays in the following block
72 // using a mutex to make sure they are not used by multiple threads
73 // at once
74 {
75 static std::mutex mutex;
76 std::lock_guard<std::mutex> lock(mutex);
77
78 static std::vector<Tensor<1, dim>> p_values;
81 static std::vector<Tensor<4, dim>> p_third_derivatives;
82 static std::vector<Tensor<5, dim>> p_fourth_derivatives;
83
84 p_values.resize((values.empty()) ? 0 : n_sub);
87
88 // This is the Raviart-Thomas part of the space
89 raviart_thomas_space.evaluate(unit_point,
90 p_values,
93 p_third_derivatives,
94 p_fourth_derivatives);
95 for (unsigned int i = 0; i < p_values.size(); ++i)
96 values[i] = p_values[i];
97 for (unsigned int i = 0; i < p_grads.size(); ++i)
101 }
102
103 // Next we compute the polynomials and derivatives
104 // of the curl part of the space
105 const unsigned int n_derivatives = 3;
106 double monoval_plus[dim][n_derivatives + 1];
107 double monoval_i[dim][n_derivatives + 1];
108
109
110 if constexpr (dim <= 1)
111 {
112 (void)monoval_plus;
113 (void)monoval_i;
114 }
115
116 unsigned int start = n_sub;
117 if constexpr (dim == 2)
118 {
119 // In 2d the curl part of the space is spanned by the vectors
120 // of two types. The first one is
121 // [ x^i * [y^(k+1)]' ]
122 // [ -[x^i]' * y^(k+1) ]
123 // The second one can be obtained from the first by a cyclic
124 // rotation of the coordinates.
125 // monoval_i = x^i,
126 // monoval_plus = x^(k+1)
127 for (unsigned int d = 0; d < dim; ++d)
128 monomials[my_degree + 1].value(unit_point[d],
129 n_derivatives,
130 monoval_plus[d]);
131
132 for (unsigned int i = 0; i <= my_degree; ++i, ++start)
133 {
134 for (unsigned int d = 0; d < dim; ++d)
135 monomials[i].value(unit_point[d], n_derivatives, monoval_i[d]);
136
137 if (values.size() != 0)
138 {
139 values[start][0] = monoval_i[0][0] * monoval_plus[1][1];
140 values[start][1] = -monoval_i[0][1] * monoval_plus[1][0];
141
142 values[start + my_degree + 1][0] =
143 -monoval_plus[0][0] * monoval_i[1][1];
144 values[start + my_degree + 1][1] =
145 monoval_plus[0][1] * monoval_i[1][0];
146 }
147
149 {
150 grads[start][0][0] = monoval_i[0][1] * monoval_plus[1][1];
151 grads[start][0][1] = monoval_i[0][0] * monoval_plus[1][2];
152 grads[start][1][0] = -monoval_i[0][2] * monoval_plus[1][0];
153 grads[start][1][1] = -monoval_i[0][1] * monoval_plus[1][1];
154
155 grads[start + my_degree + 1][0][0] =
156 -monoval_plus[0][1] * monoval_i[1][1];
157 grads[start + my_degree + 1][0][1] =
158 -monoval_plus[0][0] * monoval_i[1][2];
159 grads[start + my_degree + 1][1][0] =
160 monoval_plus[0][2] * monoval_i[1][0];
161 grads[start + my_degree + 1][1][1] =
162 monoval_plus[0][1] * monoval_i[1][1];
163 }
164
166 {
172 -monoval_i[0][3] * monoval_plus[1][0];
174 -monoval_i[0][2] * monoval_plus[1][1];
176 -monoval_i[0][2] * monoval_plus[1][1];
178 -monoval_i[0][1] * monoval_plus[1][2];
179
181 -monoval_plus[0][2] * monoval_i[1][1];
183 -monoval_plus[0][1] * monoval_i[1][2];
185 -monoval_plus[0][1] * monoval_i[1][2];
187 -monoval_plus[0][0] * monoval_i[1][3];
189 monoval_plus[0][3] * monoval_i[1][0];
191 monoval_plus[0][2] * monoval_i[1][1];
193 monoval_plus[0][2] * monoval_i[1][1];
195 monoval_plus[0][1] * monoval_i[1][2];
196 }
197 }
198 Assert(start == this->n() - my_degree - 1, ExcInternalError());
199 }
200 else if constexpr (dim == 3)
201 {
202 double monoval[dim][n_derivatives + 1];
203 double monoval_j[dim][n_derivatives + 1];
204 double monoval_jplus[dim][n_derivatives + 1];
205
206 // In 3d the first type of basis vector is
207 // [ x^i * y^j * z^k * (j+k+2) ]
208 // [ -[x^i]' * y^(j+1) * z^k ]
209 // [ -[x^i]' * y^j * z^(k+1) ],
210 // For the second type of basis vector y and z
211 // are swapped. Then for each of these,
212 // two more are obtained by the cyclic rotation
213 // of the coordinates.
214 // monoval = x^k, monoval_plus = x^(k+1)
215 // monoval_* = x^*, monoval_jplus = x^(j+1)
216 for (unsigned int d = 0; d < dim; ++d)
217 {
218 monomials[my_degree + 1].value(unit_point[d],
219 n_derivatives,
220 monoval_plus[d]);
221 monomials[my_degree].value(unit_point[d], n_derivatives, monoval[d]);
222 }
223
224 const unsigned int n_curls = (my_degree + 1) * (2 * my_degree + 1);
225 // Span of @f$\tilde{B}@f$
226 for (unsigned int i = 0; i <= my_degree; ++i)
227 {
228 for (unsigned int d = 0; d < dim; ++d)
229 monomials[i].value(unit_point[d], n_derivatives, monoval_i[d]);
230
231 for (unsigned int j = 0; j <= my_degree; ++j)
232 {
233 for (unsigned int d = 0; d < dim; ++d)
234 {
235 monomials[j].value(unit_point[d],
236 n_derivatives,
237 monoval_j[d]);
238 monomials[j + 1].value(unit_point[d],
239 n_derivatives,
240 monoval_jplus[d]);
241 }
242
243 if (values.size() != 0)
244 {
245 values[start][0] = monoval_i[0][0] * monoval_j[1][0] *
246 monoval[2][0] *
247 static_cast<double>(j + my_degree + 2);
248 values[start][1] =
249 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][0];
250 values[start][2] =
251 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][0];
252
253 values[start + n_curls][0] =
254 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][0];
255 values[start + n_curls][1] =
256 monoval_j[0][0] * monoval_i[1][0] * monoval[2][0] *
257 static_cast<double>(j + my_degree + 2);
258 values[start + n_curls][2] =
259 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][0];
260
261 values[start + 2 * n_curls][0] =
262 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][1];
263 values[start + 2 * n_curls][1] =
264 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][1];
265 values[start + 2 * n_curls][2] =
266 monoval_j[0][0] * monoval[1][0] * monoval_i[2][0] *
267 static_cast<double>(j + my_degree + 2);
268
269 // Only unique triples of powers (i j k)
270 // and (i k j) are allowed, 0 <= i,j <= k
271 if (j != my_degree)
272 {
273 values[start + 1][0] =
274 monoval_i[0][0] * monoval[1][0] * monoval_j[2][0] *
275 static_cast<double>(j + my_degree + 2);
276 values[start + 1][1] =
277 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][0];
278 values[start + 1][2] =
279 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][0];
280
281 values[start + n_curls + 1][0] =
282 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][0];
283 values[start + n_curls + 1][1] =
284 monoval[0][0] * monoval_i[1][0] * monoval_j[2][0] *
285 static_cast<double>(j + my_degree + 2);
286 values[start + n_curls + 1][2] =
287 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][0];
288
289 values[start + 2 * n_curls + 1][0] =
290 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][1];
291 values[start + 2 * n_curls + 1][1] =
292 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][1];
293 values[start + 2 * n_curls + 1][2] =
294 monoval[0][0] * monoval_j[1][0] * monoval_i[2][0] *
295 static_cast<double>(j + my_degree + 2);
296 }
297 }
298
300 {
301 grads[start][0][0] = monoval_i[0][1] * monoval_j[1][0] *
302 monoval[2][0] *
303 static_cast<double>(j + my_degree + 2);
304 grads[start][0][1] = monoval_i[0][0] * monoval_j[1][1] *
305 monoval[2][0] *
306 static_cast<double>(j + my_degree + 2);
307 grads[start][0][2] = monoval_i[0][0] * monoval_j[1][0] *
308 monoval[2][1] *
309 static_cast<double>(j + my_degree + 2);
311 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][0];
313 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][0];
315 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][1];
317 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][0];
319 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][0];
321 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][1];
322
324 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][0];
326 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][0];
328 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][1];
330 monoval_j[0][1] * monoval_i[1][0] * monoval[2][0] *
331 static_cast<double>(j + my_degree + 2);
333 monoval_j[0][0] * monoval_i[1][1] * monoval[2][0] *
334 static_cast<double>(j + my_degree + 2);
336 monoval_j[0][0] * monoval_i[1][0] * monoval[2][1] *
337 static_cast<double>(j + my_degree + 2);
339 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][0];
341 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][0];
343 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][1];
344
345 grads[start + 2 * n_curls][0][0] =
346 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][1];
347 grads[start + 2 * n_curls][0][1] =
348 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][1];
349 grads[start + 2 * n_curls][0][2] =
350 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][2];
351 grads[start + 2 * n_curls][1][0] =
352 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][1];
353 grads[start + 2 * n_curls][1][1] =
354 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][1];
355 grads[start + 2 * n_curls][1][2] =
356 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][2];
357 grads[start + 2 * n_curls][2][0] =
358 monoval_j[0][1] * monoval[1][0] * monoval_i[2][0] *
359 static_cast<double>(j + my_degree + 2);
360 grads[start + 2 * n_curls][2][1] =
361 monoval_j[0][0] * monoval[1][1] * monoval_i[2][0] *
362 static_cast<double>(j + my_degree + 2);
363 grads[start + 2 * n_curls][2][2] =
364 monoval_j[0][0] * monoval[1][0] * monoval_i[2][1] *
365 static_cast<double>(j + my_degree + 2);
366
367 if (j != my_degree)
368 {
370 monoval_i[0][1] * monoval[1][0] * monoval_j[2][0] *
371 static_cast<double>(j + my_degree + 2);
373 monoval_i[0][0] * monoval[1][1] * monoval_j[2][0] *
374 static_cast<double>(j + my_degree + 2);
376 monoval_i[0][0] * monoval[1][0] * monoval_j[2][1] *
377 static_cast<double>(j + my_degree + 2);
379 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][0];
381 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][0];
383 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][1];
385 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][0];
387 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][0];
389 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][1];
390
391 grads[start + n_curls + 1][0][0] =
392 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][0];
393 grads[start + n_curls + 1][0][1] =
394 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][0];
395 grads[start + n_curls + 1][0][2] =
396 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][1];
397 grads[start + n_curls + 1][1][0] =
398 monoval[0][1] * monoval_i[1][0] * monoval_j[2][0] *
399 static_cast<double>(j + my_degree + 2);
400 grads[start + n_curls + 1][1][1] =
401 monoval[0][0] * monoval_i[1][1] * monoval_j[2][0] *
402 static_cast<double>(j + my_degree + 2);
403 grads[start + n_curls + 1][1][2] =
404 monoval[0][0] * monoval_i[1][0] * monoval_j[2][1] *
405 static_cast<double>(j + my_degree + 2);
406 grads[start + n_curls + 1][2][0] =
407 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][0];
408 grads[start + n_curls + 1][2][1] =
409 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][0];
410 grads[start + n_curls + 1][2][2] =
411 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][1];
412
413 grads[start + 2 * n_curls + 1][0][0] =
414 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][1];
415 grads[start + 2 * n_curls + 1][0][1] =
416 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][1];
417 grads[start + 2 * n_curls + 1][0][2] =
418 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][2];
419 grads[start + 2 * n_curls + 1][1][0] =
420 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][1];
421 grads[start + 2 * n_curls + 1][1][1] =
422 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][1];
423 grads[start + 2 * n_curls + 1][1][2] =
424 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][2];
425 grads[start + 2 * n_curls + 1][2][0] =
426 monoval[0][1] * monoval_j[1][0] * monoval_i[2][0] *
427 static_cast<double>(j + my_degree + 2);
428 grads[start + 2 * n_curls + 1][2][1] =
429 monoval[0][0] * monoval_j[1][1] * monoval_i[2][0] *
430 static_cast<double>(j + my_degree + 2);
431 grads[start + 2 * n_curls + 1][2][2] =
432 monoval[0][0] * monoval_j[1][0] * monoval_i[2][1] *
433 static_cast<double>(j + my_degree + 2);
434 }
435 }
436
438 {
440 monoval_i[0][2] * monoval_j[1][0] * monoval[2][0] *
441 static_cast<double>(j + my_degree + 2);
443 monoval_i[0][1] * monoval_j[1][1] * monoval[2][0] *
444 static_cast<double>(j + my_degree + 2);
446 monoval_i[0][1] * monoval_j[1][0] * monoval[2][1] *
447 static_cast<double>(j + my_degree + 2);
449 monoval_i[0][1] * monoval_j[1][1] * monoval[2][0] *
450 static_cast<double>(j + my_degree + 2);
452 monoval_i[0][0] * monoval_j[1][2] * monoval[2][0] *
453 static_cast<double>(j + my_degree + 2);
455 monoval_i[0][0] * monoval_j[1][1] * monoval[2][1] *
456 static_cast<double>(j + my_degree + 2);
458 monoval_i[0][1] * monoval_j[1][0] * monoval[2][1] *
459 static_cast<double>(j + my_degree + 2);
461 monoval_i[0][0] * monoval_j[1][1] * monoval[2][1] *
462 static_cast<double>(j + my_degree + 2);
464 monoval_i[0][0] * monoval_j[1][0] * monoval[2][2] *
465 static_cast<double>(j + my_degree + 2);
467 -monoval_i[0][3] * monoval_jplus[1][0] * monoval[2][0];
469 -monoval_i[0][2] * monoval_jplus[1][1] * monoval[2][0];
471 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][1];
473 -monoval_i[0][2] * monoval_jplus[1][1] * monoval[2][0];
475 -monoval_i[0][1] * monoval_jplus[1][2] * monoval[2][0];
477 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][1];
479 -monoval_i[0][2] * monoval_jplus[1][0] * monoval[2][1];
481 -monoval_i[0][1] * monoval_jplus[1][1] * monoval[2][1];
483 -monoval_i[0][1] * monoval_jplus[1][0] * monoval[2][2];
485 -monoval_i[0][3] * monoval_j[1][0] * monoval_plus[2][0];
487 -monoval_i[0][2] * monoval_j[1][1] * monoval_plus[2][0];
489 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][1];
491 -monoval_i[0][2] * monoval_j[1][1] * monoval_plus[2][0];
493 -monoval_i[0][1] * monoval_j[1][2] * monoval_plus[2][0];
495 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][1];
497 -monoval_i[0][2] * monoval_j[1][0] * monoval_plus[2][1];
499 -monoval_i[0][1] * monoval_j[1][1] * monoval_plus[2][1];
501 -monoval_i[0][1] * monoval_j[1][0] * monoval_plus[2][2];
502
504 -monoval_jplus[0][2] * monoval_i[1][1] * monoval[2][0];
506 -monoval_jplus[0][1] * monoval_i[1][2] * monoval[2][0];
508 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][1];
510 -monoval_jplus[0][1] * monoval_i[1][2] * monoval[2][0];
512 -monoval_jplus[0][0] * monoval_i[1][3] * monoval[2][0];
514 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][1];
516 -monoval_jplus[0][1] * monoval_i[1][1] * monoval[2][1];
518 -monoval_jplus[0][0] * monoval_i[1][2] * monoval[2][1];
520 -monoval_jplus[0][0] * monoval_i[1][1] * monoval[2][2];
522 monoval_j[0][2] * monoval_i[1][0] * monoval[2][0] *
523 static_cast<double>(j + my_degree + 2);
525 monoval_j[0][1] * monoval_i[1][1] * monoval[2][0] *
526 static_cast<double>(j + my_degree + 2);
528 monoval_j[0][1] * monoval_i[1][0] * monoval[2][1] *
529 static_cast<double>(j + my_degree + 2);
531 monoval_j[0][1] * monoval_i[1][1] * monoval[2][0] *
532 static_cast<double>(j + my_degree + 2);
534 monoval_j[0][0] * monoval_i[1][2] * monoval[2][0] *
535 static_cast<double>(j + my_degree + 2);
537 monoval_j[0][0] * monoval_i[1][1] * monoval[2][1] *
538 static_cast<double>(j + my_degree + 2);
540 monoval_j[0][1] * monoval_i[1][0] * monoval[2][1] *
541 static_cast<double>(j + my_degree + 2);
543 monoval_j[0][0] * monoval_i[1][1] * monoval[2][1] *
544 static_cast<double>(j + my_degree + 2);
546 monoval_j[0][0] * monoval_i[1][0] * monoval[2][2] *
547 static_cast<double>(j + my_degree + 2);
549 -monoval_j[0][2] * monoval_i[1][1] * monoval_plus[2][0];
551 -monoval_j[0][1] * monoval_i[1][2] * monoval_plus[2][0];
553 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][1];
555 -monoval_j[0][1] * monoval_i[1][2] * monoval_plus[2][0];
557 -monoval_j[0][0] * monoval_i[1][3] * monoval_plus[2][0];
559 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][1];
561 -monoval_j[0][1] * monoval_i[1][1] * monoval_plus[2][1];
563 -monoval_j[0][0] * monoval_i[1][2] * monoval_plus[2][1];
565 -monoval_j[0][0] * monoval_i[1][1] * monoval_plus[2][2];
566
568 -monoval_jplus[0][2] * monoval[1][0] * monoval_i[2][1];
570 -monoval_jplus[0][1] * monoval[1][1] * monoval_i[2][1];
572 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][2];
574 -monoval_jplus[0][1] * monoval[1][1] * monoval_i[2][1];
576 -monoval_jplus[0][0] * monoval[1][2] * monoval_i[2][1];
578 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][2];
580 -monoval_jplus[0][1] * monoval[1][0] * monoval_i[2][2];
582 -monoval_jplus[0][0] * monoval[1][1] * monoval_i[2][2];
584 -monoval_jplus[0][0] * monoval[1][0] * monoval_i[2][3];
586 -monoval_j[0][2] * monoval_plus[1][0] * monoval_i[2][1];
588 -monoval_j[0][1] * monoval_plus[1][1] * monoval_i[2][1];
590 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][2];
592 -monoval_j[0][1] * monoval_plus[1][1] * monoval_i[2][1];
594 -monoval_j[0][0] * monoval_plus[1][2] * monoval_i[2][1];
596 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][2];
598 -monoval_j[0][1] * monoval_plus[1][0] * monoval_i[2][2];
600 -monoval_j[0][0] * monoval_plus[1][1] * monoval_i[2][2];
602 -monoval_j[0][0] * monoval_plus[1][0] * monoval_i[2][3];
604 monoval_j[0][2] * monoval[1][0] * monoval_i[2][0] *
605 static_cast<double>(j + my_degree + 2);
607 monoval_j[0][1] * monoval[1][1] * monoval_i[2][0] *
608 static_cast<double>(j + my_degree + 2);
610 monoval_j[0][1] * monoval[1][0] * monoval_i[2][1] *
611 static_cast<double>(j + my_degree + 2);
613 monoval_j[0][1] * monoval[1][1] * monoval_i[2][0] *
614 static_cast<double>(j + my_degree + 2);
616 monoval_j[0][0] * monoval[1][2] * monoval_i[2][0] *
617 static_cast<double>(j + my_degree + 2);
619 monoval_j[0][0] * monoval[1][1] * monoval_i[2][1] *
620 static_cast<double>(j + my_degree + 2);
622 monoval_j[0][1] * monoval[1][0] * monoval_i[2][1] *
623 static_cast<double>(j + my_degree + 2);
625 monoval_j[0][0] * monoval[1][1] * monoval_i[2][1] *
626 static_cast<double>(j + my_degree + 2);
628 monoval_j[0][0] * monoval[1][0] * monoval_i[2][2] *
629 static_cast<double>(j + my_degree + 2);
630
631 if (j != my_degree)
632 {
634 monoval_i[0][2] * monoval[1][0] * monoval_j[2][0] *
635 static_cast<double>(j + my_degree + 2);
637 monoval_i[0][1] * monoval[1][1] * monoval_j[2][0] *
638 static_cast<double>(j + my_degree + 2);
640 monoval_i[0][1] * monoval[1][0] * monoval_j[2][1] *
641 static_cast<double>(j + my_degree + 2);
643 monoval_i[0][1] * monoval[1][1] * monoval_j[2][0] *
644 static_cast<double>(j + my_degree + 2);
646 monoval_i[0][0] * monoval[1][2] * monoval_j[2][0] *
647 static_cast<double>(j + my_degree + 2);
649 monoval_i[0][0] * monoval[1][1] * monoval_j[2][1] *
650 static_cast<double>(j + my_degree + 2);
652 monoval_i[0][1] * monoval[1][0] * monoval_j[2][1] *
653 static_cast<double>(j + my_degree + 2);
655 monoval_i[0][0] * monoval[1][1] * monoval_j[2][1] *
656 static_cast<double>(j + my_degree + 2);
658 monoval_i[0][0] * monoval[1][0] * monoval_j[2][2] *
659 static_cast<double>(j + my_degree + 2);
661 -monoval_i[0][3] * monoval_plus[1][0] * monoval_j[2][0];
663 -monoval_i[0][2] * monoval_plus[1][1] * monoval_j[2][0];
665 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][1];
667 -monoval_i[0][2] * monoval_plus[1][1] * monoval_j[2][0];
669 -monoval_i[0][1] * monoval_plus[1][2] * monoval_j[2][0];
671 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][1];
673 -monoval_i[0][2] * monoval_plus[1][0] * monoval_j[2][1];
675 -monoval_i[0][1] * monoval_plus[1][1] * monoval_j[2][1];
677 -monoval_i[0][1] * monoval_plus[1][0] * monoval_j[2][2];
679 -monoval_i[0][3] * monoval[1][0] * monoval_jplus[2][0];
681 -monoval_i[0][2] * monoval[1][1] * monoval_jplus[2][0];
683 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][1];
685 -monoval_i[0][2] * monoval[1][1] * monoval_jplus[2][0];
687 -monoval_i[0][1] * monoval[1][2] * monoval_jplus[2][0];
689 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][1];
691 -monoval_i[0][2] * monoval[1][0] * monoval_jplus[2][1];
693 -monoval_i[0][1] * monoval[1][1] * monoval_jplus[2][1];
695 -monoval_i[0][1] * monoval[1][0] * monoval_jplus[2][2];
696
698 -monoval_plus[0][2] * monoval_i[1][1] * monoval_j[2][0];
700 -monoval_plus[0][1] * monoval_i[1][2] * monoval_j[2][0];
702 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][1];
704 -monoval_plus[0][1] * monoval_i[1][2] * monoval_j[2][0];
706 -monoval_plus[0][0] * monoval_i[1][3] * monoval_j[2][0];
708 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][1];
710 -monoval_plus[0][1] * monoval_i[1][1] * monoval_j[2][1];
712 -monoval_plus[0][0] * monoval_i[1][2] * monoval_j[2][1];
714 -monoval_plus[0][0] * monoval_i[1][1] * monoval_j[2][2];
716 monoval[0][2] * monoval_i[1][0] * monoval_j[2][0] *
717 static_cast<double>(j + my_degree + 2);
719 monoval[0][1] * monoval_i[1][1] * monoval_j[2][0] *
720 static_cast<double>(j + my_degree + 2);
722 monoval[0][1] * monoval_i[1][0] * monoval_j[2][1] *
723 static_cast<double>(j + my_degree + 2);
725 monoval[0][1] * monoval_i[1][1] * monoval_j[2][0] *
726 static_cast<double>(j + my_degree + 2);
728 monoval[0][0] * monoval_i[1][2] * monoval_j[2][0] *
729 static_cast<double>(j + my_degree + 2);
731 monoval[0][0] * monoval_i[1][1] * monoval_j[2][1] *
732 static_cast<double>(j + my_degree + 2);
734 monoval[0][1] * monoval_i[1][0] * monoval_j[2][1] *
735 static_cast<double>(j + my_degree + 2);
737 monoval[0][0] * monoval_i[1][1] * monoval_j[2][1] *
738 static_cast<double>(j + my_degree + 2);
740 monoval[0][0] * monoval_i[1][0] * monoval_j[2][2] *
741 static_cast<double>(j + my_degree + 2);
743 -monoval[0][2] * monoval_i[1][1] * monoval_jplus[2][0];
745 -monoval[0][1] * monoval_i[1][2] * monoval_jplus[2][0];
747 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][1];
749 -monoval[0][1] * monoval_i[1][2] * monoval_jplus[2][0];
751 -monoval[0][0] * monoval_i[1][3] * monoval_jplus[2][0];
753 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][1];
755 -monoval[0][1] * monoval_i[1][1] * monoval_jplus[2][1];
757 -monoval[0][0] * monoval_i[1][2] * monoval_jplus[2][1];
759 -monoval[0][0] * monoval_i[1][1] * monoval_jplus[2][2];
760
762 -monoval_plus[0][2] * monoval_j[1][0] * monoval_i[2][1];
764 -monoval_plus[0][1] * monoval_j[1][1] * monoval_i[2][1];
766 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][2];
768 -monoval_plus[0][1] * monoval_j[1][1] * monoval_i[2][1];
770 -monoval_plus[0][0] * monoval_j[1][2] * monoval_i[2][1];
772 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][2];
774 -monoval_plus[0][1] * monoval_j[1][0] * monoval_i[2][2];
776 -monoval_plus[0][0] * monoval_j[1][1] * monoval_i[2][2];
778 -monoval_plus[0][0] * monoval_j[1][0] * monoval_i[2][3];
780 -monoval[0][2] * monoval_jplus[1][0] * monoval_i[2][1];
782 -monoval[0][1] * monoval_jplus[1][1] * monoval_i[2][1];
784 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][2];
786 -monoval[0][1] * monoval_jplus[1][1] * monoval_i[2][1];
788 -monoval[0][0] * monoval_jplus[1][2] * monoval_i[2][1];
790 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][2];
792 -monoval[0][1] * monoval_jplus[1][0] * monoval_i[2][2];
794 -monoval[0][0] * monoval_jplus[1][1] * monoval_i[2][2];
796 -monoval[0][0] * monoval_jplus[1][0] * monoval_i[2][3];
798 monoval[0][2] * monoval_j[1][0] * monoval_i[2][0] *
799 static_cast<double>(j + my_degree + 2);
801 monoval[0][1] * monoval_j[1][1] * monoval_i[2][0] *
802 static_cast<double>(j + my_degree + 2);
804 monoval[0][1] * monoval_j[1][0] * monoval_i[2][1] *
805 static_cast<double>(j + my_degree + 2);
807 monoval[0][1] * monoval_j[1][1] * monoval_i[2][0] *
808 static_cast<double>(j + my_degree + 2);
810 monoval[0][0] * monoval_j[1][2] * monoval_i[2][0] *
811 static_cast<double>(j + my_degree + 2);
813 monoval[0][0] * monoval_j[1][1] * monoval_i[2][1] *
814 static_cast<double>(j + my_degree + 2);
816 monoval[0][1] * monoval_j[1][0] * monoval_i[2][1] *
817 static_cast<double>(j + my_degree + 2);
819 monoval[0][0] * monoval_j[1][1] * monoval_i[2][1] *
820 static_cast<double>(j + my_degree + 2);
822 monoval[0][0] * monoval_j[1][0] * monoval_i[2][2] *
823 static_cast<double>(j + my_degree + 2);
824 }
825 }
826
827 if (j == my_degree)
828 start += 1;
829 else
830 start += 2;
831 }
832 }
833 Assert(start == this->n() - 2 * n_curls, ExcInternalError());
834 }
835}
836
837
838
839template <int dim>
840unsigned int
842{
843 if (dim == 1 || dim == 2 || dim == 3)
844 return dim * Utilities::fixed_power<dim>(k + 1);
845
847 return 0;
848}
849
850
851template <int dim>
852std::unique_ptr<TensorPolynomialsBase<dim>>
854{
855 return std::make_unique<PolynomialsRT_Bubbles<dim>>(*this);
856}
857
858
859template class PolynomialsRT_Bubbles<1>;
860template class PolynomialsRT_Bubbles<2>;
861template class PolynomialsRT_Bubbles<3>;
862
863
Definition point.h:111
virtual std::unique_ptr< TensorPolynomialsBase< dim > > clone() const override
PolynomialsRT_Bubbles(const unsigned int k)
void evaluate(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 override
static unsigned int n_polynomials(const unsigned int degree)
std::vector< Polynomials::Polynomial< double > > monomials
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define DEAL_II_NOT_IMPLEMENTED()