Loading [MathJax]/extensions/TeX/newcommand.js
 deal.II version GIT relicensing-3075-gc235bd4825 2025-04-15 08:10:00+00:00
\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}} \newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=} \newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]} \newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
polynomials_wedge.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2021 - 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_base_polynomials_wedge_h
17#define dealii_base_polynomials_wedge_h
18
19#include <deal.II/base/config.h>
20
24
26
27
28namespace internal
29{
35 constexpr ::ndarray<unsigned int, 6, 2> wedge_table_1{
36 {{{0, 0}}, {{1, 0}}, {{2, 0}}, {{0, 1}}, {{1, 1}}, {{2, 1}}}};
37
43 constexpr ::ndarray<unsigned int, 18, 2> wedge_table_2{{{{0, 0}},
44 {{1, 0}},
45 {{2, 0}},
46 {{0, 1}},
47 {{1, 1}},
48 {{2, 1}},
49 {{3, 0}},
50 {{4, 0}},
51 {{5, 0}},
52 {{3, 1}},
53 {{4, 1}},
54 {{5, 1}},
55 {{0, 2}},
56 {{1, 2}},
57 {{2, 2}},
58 {{3, 2}},
59 {{4, 2}},
60 {{5, 2}}}};
61} // namespace internal
62
63
73template <int dim>
75{
76public:
80 static constexpr unsigned int dimension = dim;
81
82 /*
83 * Constructor taking the polynomial @p degree as input.
84 *
85 * @note Currently, only linear (degree=1) and quadratic polynomials
86 * (degree=2) are implemented.
87 */
88 ScalarLagrangePolynomialWedge(const unsigned int degree);
89
95 void
96 evaluate(const Point<dim> &unit_point,
97 std::vector<double> &values,
98 std::vector<Tensor<1, dim>> &grads,
99 std::vector<Tensor<2, dim>> &grad_grads,
100 std::vector<Tensor<3, dim>> &third_derivatives,
101 std::vector<Tensor<4, dim>> &fourth_derivatives) const override;
102
103 double
104 compute_value(const unsigned int i, const Point<dim> &p) const override;
105
111 template <int order>
113 compute_derivative(const unsigned int i, const Point<dim> &p) const;
114
116 compute_1st_derivative(const unsigned int i,
117 const Point<dim> &p) const override;
118
125 compute_2nd_derivative(const unsigned int i,
126 const Point<dim> &p) const override;
127
134 compute_3rd_derivative(const unsigned int i,
135 const Point<dim> &p) const override;
136
143 compute_4th_derivative(const unsigned int i,
144 const Point<dim> &p) const override;
145
152 compute_grad(const unsigned int i, const Point<dim> &p) const override;
153
160 compute_grad_grad(const unsigned int i, const Point<dim> &p) const override;
161
162 std::string
163 name() const override;
164
165 virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
166 clone() const override;
167
168private:
173
178};
179
180
181
182template <int dim>
183template <int order>
186 const unsigned int i,
187 const Point<dim> &p) const
188{
190
191 AssertDimension(order, 1);
192 const auto grad = compute_grad(i, p);
193
194 for (unsigned int i = 0; i < dim; ++i)
195 der[i] = grad[i];
196
197 return der;
198}
199
201
202#endif
Definition point.h:113
void evaluate(const Point< dim > &unit_point, std::vector< double > &values, std::vector< Tensor< 1, dim > > &grads, std::vector< Tensor< 2, dim > > &grad_grads, std::vector< Tensor< 3, dim > > &third_derivatives, std::vector< Tensor< 4, dim > > &fourth_derivatives) const override
Tensor< 1, dim > compute_grad(const unsigned int i, const Point< dim > &p) const override
Tensor< 1, dim > compute_1st_derivative(const unsigned int i, const Point< dim > &p) const override
Tensor< 4, dim > compute_4th_derivative(const unsigned int i, const Point< dim > &p) const override
std::string name() const override
Tensor< 3, dim > compute_3rd_derivative(const unsigned int i, const Point< dim > &p) const override
Tensor< 2, dim > compute_2nd_derivative(const unsigned int i, const Point< dim > &p) const override
Tensor< order, dim > compute_derivative(const unsigned int i, const Point< dim > &p) const
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const override
static constexpr unsigned int dimension
double compute_value(const unsigned int i, const Point< dim > &p) const override
const BarycentricPolynomials< 1 > poly_line
const BarycentricPolynomials< 2 > poly_tri
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) const override
virtual unsigned int degree() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:35
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:36
#define AssertDimension(dim1, dim2)
constexpr ::ndarray< unsigned int, 6, 2 > wedge_table_1
constexpr ::ndarray< unsigned int, 18, 2 > wedge_table_2