Debian Codegraph @

include/deal.II/base/polynomials_nedelec.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2010 - 2023 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
16 #ifndef dealii_polynomials_nedelec_h
17 #define dealii_polynomials_nedelec_h
18
19
20 #include <deal.II/base/config.h>
21
22 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/polynomial.h>
25 #include <deal.II/base/polynomial_space.h>
26 #include <deal.II/base/tensor.h>
27 #include <deal.II/base/tensor_polynomials_base.h>
28 #include <deal.II/base/tensor_product_polynomials.h>
29
30 #include <vector>
31
32 DEAL_II_NAMESPACE_OPEN
33
34 /**
35 * This class implements the first family <i>H<sup>curl</sup></i>-conforming,
36 * vector-valued polynomials, proposed by J.-C. Nédélec in 1980 (Numer.
37 * Math. 35).
38 *
39 * The Nédélec polynomials are constructed such that the curl is in the
40 * tensor product polynomial space <i>Q<sub>k</sub></i>. Therefore, the
41 * polynomial order of each component must be one order higher in the
42 * corresponding two directions, yielding the polynomial spaces
43 * <i>(Q<sub>k,k+1</sub>, Q<sub>k+1,k</sub>)</i> and
44 * <i>(Q<sub>k,k+1,k+1</sub>, Q<sub>k+1,k,k+1</sub>,
45 * Q<sub>k+1,k+1,k</sub>)</i> in 2d and 3d, resp.
46 *
47 * @ingroup Polynomials
48 */
49 template <int dim>
50 class PolynomialsNedelec : public TensorPolynomialsBase<dim>
51 {
52 public:
53 /**
54 * Constructor. Creates all basis functions for Nédélec polynomials of
55 * given degree.
56 *
57 * @arg k: the degree of the Nédélec space, which is the degree of the
58 * largest tensor product polynomial space <i>Q<sub>k</sub></i> contained.
59 */
60 PolynomialsNedelec(const unsigned int k);
61
62 /**
63 * Compute the value and the first and second derivatives of each Nédélec
64 * polynomial at @p unit_point.
65 *
66 * The size of the vectors must either be zero or equal <tt>n()</tt>. In
67 * the first case, the function will not compute these values.
68 */
69 void
70 evaluate(const Point<dim> &unit_point,
71 std::vector<Tensor<1, dim>> &values,
72 std::vector<Tensor<2, dim>> &grads,
73 std::vector<Tensor<3, dim>> &grad_grads,
74 std::vector<Tensor<4, dim>> &third_derivatives,
75 std::vector<Tensor<5, dim>> &fourth_derivatives) const override;
76
77 /**
78 * Return the name of the space, which is <tt>Nedelec</tt>.
79 */
80 std::string
81 name() const override;
82
83 /**
84 * Return the number of polynomials in the space <tt>N(degree)</tt> without
85 * requiring to build an object of PolynomialsNedelec. This is required by
86 * the FiniteElement classes.
87 */
88 static unsigned int
89 n_polynomials(const unsigned int degree);
90
91 /**
92 * @copydoc TensorPolynomialsBase::clone()
93 */
94 virtual std::unique_ptr<TensorPolynomialsBase<dim>>
95 clone() const override;
96
97 private:
98 /**
99 * An object representing the polynomial space for a single component. We
100 * can re-use it by rotating the coordinates of the evaluation point.
101 */
102 const AnisotropicPolynomials<dim> polynomial_space;
103
104 /**
105 * A static member function that creates the polynomial space we use to
106 * initialize the #polynomial_space member variable.
107 */
108 static std::vector<std::vector<Polynomials::Polynomial<double>>>
109 create_polynomials(const unsigned int k);
110 };
111
112
113 template <int dim>
114 inline std::string
115 PolynomialsNedelec<dim>::name() const
116 {
117 return "Nedelec";
118 }
119
120
121 DEAL_II_NAMESPACE_CLOSE
122
123 #endif