Debian Codegraph @

include/deal.II/fe/fe_q.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2001 - 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 #ifndef dealii_fe_q_h
16 #define dealii_fe_q_h
17
18 #include <deal.II/base/config.h>
19
20 #include <deal.II/base/tensor_product_polynomials.h>
21
22 #include <deal.II/fe/fe_q_base.h>
23
24 DEAL_II_NAMESPACE_OPEN
25
26
27 /**
28 * @addtogroup fe
29 * @{
30 */
31
32 /**
33 * This class provides an implementation of the scalar Lagrange $Q_p$ finite
34 * element on hypercube (line segments, quadrilaterals, or hexahedra) cells that
35 * yields the
36 * finite element space of continuous, piecewise polynomials of degree @p p in
37 * each coordinate direction. This class is realized using tensor product
38 * polynomials based on 1d Lagrange polynomials with equidistant (degree up to
39 * 2), Gauss-Lobatto (starting from degree 3), or given support points. The
40 * corresponding element on simplex (triangular or tetrahedral) cells is
41 * FE_SimplexP, whereas on other cell kinds it is FE_WedgeP and FE_PyramidP.
42 *
43 * The standard constructor of this class takes the degree @p p of this finite
44 * element. Alternatively, it can take a quadrature formula @p points defining
45 * the support points of the Lagrange interpolation in one coordinate
46 * direction.
47 *
48 * For more information about the <tt>spacedim</tt> template parameter check
49 * the documentation of FiniteElement or the one of Triangulation.
50 *
51 * <h3>Implementation</h3>
52 *
53 * The constructor creates a TensorProductPolynomials object that includes the
54 * tensor product of @p LagrangeEquidistant polynomials of degree @p p. This
55 * @p TensorProductPolynomials object provides all values and derivatives of
56 * the shape functions. In case a quadrature rule is given, the constructor
57 * creates a TensorProductPolynomials object that includes the tensor product
58 * of @p Lagrange polynomials with the support points from @p points.
59 *
60 * Furthermore the constructor fills the @p interface_constraints, the @p
61 * prolongation (embedding) and the @p restriction matrices. These are
62 * implemented only up to a certain degree and may not be available for very
63 * high polynomial degree.
64 *
65 * <h3>Unit support point distribution and conditioning of interpolation</h3>
66 *
67 * When constructing an FE_Q element at polynomial degrees one or two,
68 * equidistant support points at 0 and 1 (linear case) or 0, 0.5, and 1
69 * (quadratic case) are used. The unit support or nodal points
70 * <i>x<sub>i</sub></i> are those points where the <i>j</i>th Lagrange
71 * polynomial satisfies the $\delta_{ij}$ property, i.e., where one polynomial
72 * is one and all the others are zero. For higher polynomial degrees, the
73 * support points are non-equidistant by default, and chosen to be the support
74 * points of the <tt>(degree+1)</tt>-order Gauss-Lobatto quadrature rule. This
75 * point distribution yields well-conditioned Lagrange interpolation at
76 * arbitrary polynomial degrees. By contrast, polynomials based on equidistant
77 * points get increasingly ill-conditioned as the polynomial degree
78 * increases. In interpolation, this effect is known as the Runge
79 * phenomenon. For Galerkin methods, the Runge phenomenon is typically not
80 * visible in the solution quality but rather in the condition number of the
81 * associated system matrices. For example, the elemental @ref GlossMassMatrix "mass matrix" of
82 * equidistant points at degree 10 has condition number 2.6e6, whereas the
83 * condition number for Gauss-Lobatto points is around 400.
84 *
85 * The Gauss-Lobatto points in 1d include the end points 0 and +1 of the unit
86 * interval. The interior points are shifted towards the end points, which
87 * gives a denser point distribution close to the element boundary.
88 *
89 * If combined with Gauss-Lobatto quadrature, FE_Q based on the default
90 * support points gives diagonal mass matrices. This case is demonstrated in
91 * step-48. However, this element can be combined with arbitrary quadrature
92 * rules through the usual FEValues approach, including full Gauss
93 * quadrature. In the general case, the mass matrix is non-diagonal.
94 *
95 * <h3>Numbering of the degrees of freedom (DoFs)</h3>
96 *
97 * The original ordering of the shape functions represented by the
98 * TensorProductPolynomials is a tensor product numbering. However, the shape
99 * functions on a cell are renumbered beginning with the shape functions whose
100 * support points are at the vertices, then on the line, on the quads, and
101 * finally (for 3d) on the hexes. To be explicit, these numberings are listed
102 * in the following:
103 *
104 * <h4>Q1 elements</h4>
105 * <ul>
106 * <li> 1d case:
107 * @verbatim
108 * 0-------1
109 * @endverbatim
110 *
111 * <li> 2d case:
112 * @verbatim
113 * 2-------3
114 * | |
115 * | |
116 * | |
117 * 0-------1
118 * @endverbatim
119 *
120 * <li> 3d case:
121 * @verbatim
122 * 6-------7 6-------7
123 * /| | / /|
124 * / | | / / |
125 * / | | / / |
126 * 4 | | 4-------5 |
127 * | 2-------3 | | 3
128 * | / / | | /
129 * | / / | | /
130 * |/ / | |/
131 * 0-------1 0-------1
132 * @endverbatim
133 *
134 * The respective coordinate values of the support points of the shape
135 * functions are as follows:
136 * <ul>
137 * <li> Shape function 0: <tt>[0, 0, 0]</tt>;
138 * <li> Shape function 1: <tt>[1, 0, 0]</tt>;
139 * <li> Shape function 2: <tt>[0, 1, 0]</tt>;
140 * <li> Shape function 3: <tt>[1, 1, 0]</tt>;
141 * <li> Shape function 4: <tt>[0, 0, 1]</tt>;
142 * <li> Shape function 5: <tt>[1, 0, 1]</tt>;
143 * <li> Shape function 6: <tt>[0, 1, 1]</tt>;
144 * <li> Shape function 7: <tt>[1, 1, 1]</tt>;
145 * </ul>
146 * </ul>
147 *
148 * In 2d, these shape functions look as follows: <table> <tr> <td
149 * align="center">
150 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q1/Q1_shape0000.png
151 * </td>
152 *
153 * <td align="center">
154 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q1/Q1_shape0001.png
155 * </td> </tr> <tr> <td align="center"> $Q_1$ element, shape function 0 </td>
156 *
157 * <td align="center"> $Q_1$ element, shape function 1 </td> </tr>
158 *
159 * <tr> <td align="center">
160 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q1/Q1_shape0002.png
161 * </td>
162 *
163 * <td align="center">
164 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q1/Q1_shape0003.png
165 * </td> </tr> <tr> <td align="center"> $Q_1$ element, shape function 2 </td>
166 *
167 * <td align="center"> $Q_1$ element, shape function 3 </td> </tr> </table>
168 *
169 *
170 * <h4>Q2 elements</h4>
171 * <ul>
172 * <li> 1d case:
173 * @verbatim
174 * 0---2---1
175 * @endverbatim
176 *
177 * <li> 2d case:
178 * @verbatim
179 * 2---7---3
180 * | |
181 * 4 8 5
182 * | |
183 * 0---6---1
184 * @endverbatim
185 *
186 * <li> 3d case:
187 * @verbatim
188 * 6--15---7 6--15---7
189 * /| | / /|
190 * 12 | 19 12 1319
191 * / 18 | / / |
192 * 4 | | 4---14--5 |
193 * | 2---11--3 | | 3
194 * | / / | 17 /
195 * 16 8 9 16 | 9
196 * |/ / | |/
197 * 0---10--1 0---10--1
198 *
199 * *-------* *-------*
200 * /| | / /|
201 * / | 23 | / 25 / |
202 * / | | / / |
203 * * | | *-------* |
204 * |20 *-------* | |21 *
205 * | / / | 22 | /
206 * | / 24 / | | /
207 * |/ / | |/
208 * *-------* *-------*
209 * @endverbatim
210 * The center node has number 26.
211 *
212 * The respective coordinate values of the support points of the shape
213 * functions are as follows:
214 * <ul>
215 * <li> Shape function 0: <tt>[0, 0, 0]</tt>;
216 * <li> Shape function 1: <tt>[1, 0, 0]</tt>;
217 * <li> Shape function 2: <tt>[0, 1, 0]</tt>;
218 * <li> Shape function 3: <tt>[1, 1, 0]</tt>;
219 * <li> Shape function 4: <tt>[0, 0, 1]</tt>;
220 * <li> Shape function 5: <tt>[1, 0, 1]</tt>;
221 * <li> Shape function 6: <tt>[0, 1, 1]</tt>;
222 * <li> Shape function 7: <tt>[1, 1, 1]</tt>;
223 * <li> Shape function 8: <tt>[0, 1/2, 0]</tt>;
224 * <li> Shape function 9: <tt>[1, 1/2, 0]</tt>;
225 * <li> Shape function 10: <tt>[1/2, 0, 0]</tt>;
226 * <li> Shape function 11: <tt>[1/2, 1, 0]</tt>;
227 * <li> Shape function 12: <tt>[0, 1/2, 1]</tt>;
228 * <li> Shape function 13: <tt>[1, 1/2, 1]</tt>;
229 * <li> Shape function 14: <tt>[1/2, 0, 1]</tt>;
230 * <li> Shape function 15: <tt>[1/2, 1, 1]</tt>;
231 * <li> Shape function 16: <tt>[0, 0, 1/2]</tt>;
232 * <li> Shape function 17: <tt>[1, 0, 1/2]</tt>;
233 * <li> Shape function 18: <tt>[0, 1, 1/2]</tt>;
234 * <li> Shape function 19: <tt>[1, 1, 1/2]</tt>;
235 * <li> Shape function 20: <tt>[0, 1/2, 1/2]</tt>;
236 * <li> Shape function 21: <tt>[1, 1/2, 1/2]</tt>;
237 * <li> Shape function 22: <tt>[1/2, 0, 1/2]</tt>;
238 * <li> Shape function 23: <tt>[1/2, 1, 1/2]</tt>;
239 * <li> Shape function 24: <tt>[1/2, 1/2, 0]</tt>;
240 * <li> Shape function 25: <tt>[1/2, 1/2, 1]</tt>;
241 * <li> Shape function 26: <tt>[1/2, 1/2, 1/2]</tt>;
242 * </ul>
243 * </ul>
244 *
245 *
246 * In 2d, these shape functions look as follows (the black plane corresponds
247 * to zero; negative shape function values may not be visible): <table> <tr>
248 * <td align="center">
249 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0000.png
250 * </td>
251 *
252 * <td align="center">
253 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0001.png
254 * </td> </tr> <tr> <td align="center"> $Q_2$ element, shape function 0 </td>
255 *
256 * <td align="center"> $Q_2$ element, shape function 1 </td> </tr>
257 *
258 * <tr> <td align="center">
259 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0002.png
260 * </td>
261 *
262 * <td align="center">
263 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0003.png
264 * </td> </tr> <tr> <td align="center"> $Q_2$ element, shape function 2 </td>
265 *
266 * <td align="center"> $Q_2$ element, shape function 3 </td> </tr>
267 *
268 * <tr> <td align="center">
269 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0004.png
270 * </td>
271 *
272 * <td align="center">
273 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0005.png
274 * </td> </tr> <tr> <td align="center"> $Q_2$ element, shape function 4 </td>
275 *
276 * <td align="center"> $Q_2$ element, shape function 5 </td> </tr>
277 *
278 * <tr> <td align="center">
279 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0006.png
280 * </td>
281 *
282 * <td align="center">
283 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0007.png
284 * </td> </tr> <tr> <td align="center"> $Q_2$ element, shape function 6 </td>
285 *
286 * <td align="center"> $Q_2$ element, shape function 7 </td> </tr>
287 *
288 * <tr> <td align="center">
289 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q2/Q2_shape0008.png
290 * </td>
291 *
292 * <td align="center"> </td> </tr> <tr> <td align="center"> $Q_2$ element,
293 * shape function 8 </td>
294 *
295 * <td align="center"> </td> </tr> </table>
296 *
297 *
298 * <h4>Q3 elements</h4>
299 * <ul>
300 * <li> 1d case:
301 * @verbatim
302 * 0--2--3--1
303 * @endverbatim
304 *
305 * <li> 2d case:
306 * @verbatim
307 * 2--10-11-3
308 * | |
309 * 5 14 15 7
310 * | |
311 * 4 12 13 6
312 * | |
313 * 0--8--9--1
314 * @endverbatim
315 * </ul>
316 *
317 * In 2d, these shape functions look as follows (the black plane corresponds
318 * to zero; negative shape function values may not be visible): <table> <tr>
319 * <td align="center">
320 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0000.png
321 * </td>
322 *
323 * <td align="center">
324 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0001.png
325 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 0 </td>
326 *
327 * <td align="center"> $Q_3$ element, shape function 1 </td> </tr>
328 *
329 * <tr> <td align="center">
330 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0002.png
331 * </td>
332 *
333 * <td align="center">
334 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0003.png
335 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 2 </td>
336 *
337 * <td align="center"> $Q_3$ element, shape function 3 </td> </tr>
338 *
339 * <tr> <td align="center">
340 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0004.png
341 * </td>
342 *
343 * <td align="center">
344 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0005.png
345 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 4 </td>
346 *
347 * <td align="center"> $Q_3$ element, shape function 5 </td> </tr>
348 *
349 * <tr> <td align="center">
350 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0006.png
351 * </td>
352 *
353 * <td align="center">
354 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0007.png
355 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 6 </td>
356 *
357 * <td align="center"> $Q_3$ element, shape function 7 </td> </tr>
358 *
359 * <tr> <td align="center">
360 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0008.png
361 * </td>
362 *
363 * <td align="center">
364 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0009.png
365 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 8 </td>
366 *
367 * <td align="center"> $Q_3$ element, shape function 9 </td> </tr>
368 *
369 * <tr> <td align="center">
370 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0010.png
371 * </td>
372 *
373 * <td align="center">
374 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0011.png
375 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 10 </td>
376 *
377 * <td align="center"> $Q_3$ element, shape function 11 </td> </tr>
378 *
379 * <tr> <td align="center">
380 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0012.png
381 * </td>
382 *
383 * <td align="center">
384 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0013.png
385 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 12 </td>
386 *
387 * <td align="center"> $Q_3$ element, shape function 13 </td> </tr>
388 *
389 * <tr> <td align="center">
390 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0014.png
391 * </td>
392 *
393 * <td align="center">
394 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q3/Q3_shape0015.png
395 * </td> </tr> <tr> <td align="center"> $Q_3$ element, shape function 14 </td>
396 *
397 * <td align="center"> $Q_3$ element, shape function 15 </td> </tr> </table>
398 *
399 *
400 * <h4>Q4 elements</h4>
401 * <ul>
402 * <li> 1d case:
403 * @verbatim
404 * 0--2--3--4--1
405 * @endverbatim
406 *
407 * <li> 2d case:
408 * @verbatim
409 * 2--13-14-15-3
410 * | |
411 * 6 22 23 24 9
412 * | |
413 * 5 19 20 21 8
414 * | |
415 * 4 16 17 18 7
416 * | |
417 * 0--10-11-12-1
418 * @endverbatim
419 * </ul>
420 *
421 * In 2d, these shape functions look as follows (the black plane corresponds
422 * to zero; negative shape function values may not be visible): <table> <tr>
423 * <td align="center">
424 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0000.png
425 * </td>
426 *
427 * <td align="center">
428 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0001.png
429 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 0 </td>
430 *
431 * <td align="center"> $Q_4$ element, shape function 1 </td> </tr>
432 *
433 * <tr> <td align="center">
434 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0002.png
435 * </td>
436 *
437 * <td align="center">
438 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0003.png
439 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 2 </td>
440 *
441 * <td align="center"> $Q_4$ element, shape function 3 </td> </tr>
442 *
443 * <tr> <td align="center">
444 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0004.png
445 * </td>
446 *
447 * <td align="center">
448 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0005.png
449 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 4 </td>
450 *
451 * <td align="center"> $Q_4$ element, shape function 5 </td> </tr>
452 *
453 * <tr> <td align="center">
454 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0006.png
455 * </td>
456 *
457 * <td align="center">
458 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0007.png
459 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 6 </td>
460 *
461 * <td align="center"> $Q_4$ element, shape function 7 </td> </tr>
462 *
463 * <tr> <td align="center">
464 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0008.png
465 * </td>
466 *
467 * <td align="center">
468 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0009.png
469 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 8 </td>
470 *
471 * <td align="center"> $Q_4$ element, shape function 9 </td> </tr>
472 *
473 * <tr> <td align="center">
474 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0010.png
475 * </td>
476 *
477 * <td align="center">
478 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0011.png
479 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 10 </td>
480 *
481 * <td align="center"> $Q_4$ element, shape function 11 </td> </tr>
482 *
483 * <tr> <td align="center">
484 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0012.png
485 * </td>
486 *
487 * <td align="center">
488 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0013.png
489 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 12 </td>
490 *
491 * <td align="center"> $Q_4$ element, shape function 13 </td> </tr>
492 *
493 * <tr> <td align="center">
494 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0014.png
495 * </td>
496 *
497 * <td align="center">
498 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0015.png
499 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 14 </td>
500 *
501 * <td align="center"> $Q_4$ element, shape function 15 </td> </tr>
502 *
503 * <tr> <td align="center">
504 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0016.png
505 * </td>
506 *
507 * <td align="center">
508 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0017.png
509 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 16 </td>
510 *
511 * <td align="center"> $Q_4$ element, shape function 17 </td> </tr>
512 *
513 * <tr> <td align="center">
514 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0018.png
515 * </td>
516 *
517 * <td align="center">
518 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0019.png
519 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 18 </td>
520 *
521 * <td align="center"> $Q_4$ element, shape function 19 </td> </tr>
522 *
523 * <tr> <td align="center">
524 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0020.png
525 * </td>
526 *
527 * <td align="center">
528 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0021.png
529 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 20 </td>
530 *
531 * <td align="center"> $Q_4$ element, shape function 21 </td> </tr>
532 *
533 * <tr> <td align="center">
534 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0022.png
535 * </td>
536 *
537 * <td align="center">
538 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0023.png
539 * </td> </tr> <tr> <td align="center"> $Q_4$ element, shape function 22 </td>
540 *
541 * <td align="center"> $Q_4$ element, shape function 23 </td> </tr>
542 *
543 * <tr> <td align="center">
544 * @image html http://www.dealii.org/images/shape-functions/lagrange/Q4/Q4_shape0024.png
545 * </td>
546 *
547 * <td align="center"> </td> </tr> <tr> <td align="center"> $Q_4$ element,
548 * shape function 24 </td>
549 *
550 * <td align="center"> </td> </tr> </table>
551 */
552 template <int dim, int spacedim = dim>
553 class FE_Q : public FE_Q_Base<dim, spacedim>
554 {
555 public:
556 /**
557 * Constructor for tensor product polynomials of degree @p p based on
558 * Gauss-Lobatto support (node) points. For polynomial degrees of one and
559 * two, these are the usual equidistant points.
560 */
561 FE_Q(const unsigned int p);
562
563 /**
564 * Constructor for tensor product polynomials with support points @p points
565 * based on a one-dimensional quadrature formula. The degree of the finite
566 * element is <tt>points.size()-1</tt>. Note that the first point has to be
567 * 0 and the last one 1, to ensure that the resulting element is continuous.
568 * As a consequence, only *certain* quadrature formulas make sense as
569 * argument to this constructor. Specifically, constructing
570 * <tt>FE_Q<dim>(QGaussLobatto<1>(fe_degree+1))</tt> is equivalent to the
571 * constructor that specifies the polynomial degree only. For selecting
572 * equidistant nodes at <tt>fe_degree > 2</tt>, use
573 * <tt>FE_Q<dim>(QIterated<1>(QTrapezoid<1>(),fe_degree))</tt>, though the
574 * use of equidistant node points is known to lead to poorly conditioned
575 * linear systems with poor interpolation properties for high polynomial
576 * degrees (which is why the default uses the QGaussLobatto points).
577 *
578 * The *space* created by this constructor is the
579 * same as if you had called `FE_Q<dim>(points.size()-1)`, but what *is*
580 * different are the basis functions of this space. This is useful in
581 * contexts where one wants to achieve certain properties of the matrices
582 * that result from integrating bilinear forms of these shape functions.
583 * For example, when computing the @ref GlossMassMatrix "mass matrix" on cell $K$,
584 * @f[
585 * M_{ij}^K = \int_K \varphi_i(\mathbf x) \varphi_j(\mathbf x) \; dx
586 * @f]
587 * one generally applies a quadrature formula and approximates the real
588 * mass matrix by the following:
589 * @f[
590 * M_{ij}^K = \sum_q \varphi_i(\mathbf x_q) \varphi_j(\mathbf x_q) w_q,
591 * @f]
592 * where the locations of the quadrature points $\mathbf x_q$ and the
593 * weights $w_q$ depend on the cell $K$. If the quadrature formula used
594 * to define these points $\mathbf x_q$ is the same as the one passed
595 * to this constructor (or, in higher dimensions, is generated by a
596 * tensor product of the one used to the constructor), then
597 * $\varphi_i(\mathbf x_q) = \delta_{iq}$, and the matrix reduces to
598 * @f[
599 * M_{ij}^K = \sum_q \delta_{iq} \delta_{jq} w_q = \delta_{ij} w_i,
600 * @f]
601 * i.e., a diagonal matrix with the weights $w_i$ on the diagonal. Such
602 * constructions are quite useful when using explicit time stepping
603 * methods because, for example, one then only has to invert a diagonal
604 * mass matrix in each time step when solving the linear system.
605 */
606 FE_Q(const Quadrature<1> &points);
607
608 /**
609 * Return a string that uniquely identifies a finite element. This class
610 * returns <tt>FE_Q<dim>(degree)</tt>, with @p dim and @p degree replaced by
611 * appropriate values.
612 */
613 virtual std::string
614 get_name() const override;
615
616 virtual std::unique_ptr<FiniteElement<dim, spacedim>>
617 clone() const override;
618
619 /**
620 * Implementation of the corresponding function in the FiniteElement
621 * class. Since the current element is interpolatory, the nodal
622 * values are exactly the support point values. Furthermore, since
623 * the current element is scalar, the support point values need to
624 * be vectors of length 1.
625 */
626 virtual void
627 convert_generalized_support_point_values_to_dof_values(
628 const std::vector<Vector<double>> &support_point_values,
629 std::vector<double> &nodal_values) const override;
630
631 /**
632 * @copydoc FiniteElement::compare_for_domination()
633 */
634 virtual FiniteElementDomination::Domination
635 compare_for_domination(const FiniteElement<dim, spacedim> &fe_other,
636 const unsigned int codim = 0) const override final;
637 };
638
639
640
641 /** @} */
642
643 DEAL_II_NAMESPACE_CLOSE
644
645 #endif