deal.II version GIT relicensing-2846-g6fb608615f 2025-03-15 04: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\}}\)
Loading...
Searching...
No Matches
polynomials_pyramid.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_polynomials_pyramid_h
17#define dealii_polynomials_pyramid_h
18
19#include <deal.II/base/config.h>
20
21#include <deal.II/base/point.h>
23#include <deal.II/base/tensor.h>
24
26
31template <int dim>
33{
34public:
38 static constexpr unsigned int dimension = dim;
39
40 /*
41 * Constructor taking the polynomial @p degree as input.
42 *
43 * @note Currently, only linear polynomials (degree=1) are implemented.
44 */
45 ScalarLagrangePolynomialPyramid(const unsigned int degree);
46
52 void
53 evaluate(const Point<dim> &unit_point,
54 std::vector<double> &values,
55 std::vector<Tensor<1, dim>> &grads,
56 std::vector<Tensor<2, dim>> &grad_grads,
57 std::vector<Tensor<3, dim>> &third_derivatives,
58 std::vector<Tensor<4, dim>> &fourth_derivatives) const override;
59
60 double
61 compute_value(const unsigned int i, const Point<dim> &p) const override;
62
68 template <int order>
70 compute_derivative(const unsigned int i, const Point<dim> &p) const;
71
73 compute_1st_derivative(const unsigned int i,
74 const Point<dim> &p) const override;
75
77 compute_2nd_derivative(const unsigned int i,
78 const Point<dim> &p) const override;
79
86 compute_3rd_derivative(const unsigned int i,
87 const Point<dim> &p) const override;
88
95 compute_4th_derivative(const unsigned int i,
96 const Point<dim> &p) const override;
97
104 compute_grad(const unsigned int i, const Point<dim> &p) const override;
105
112 compute_grad_grad(const unsigned int i, const Point<dim> &p) const override;
113
114 std::string
115 name() const override;
116
117 virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
118 clone() const override;
119};
120
121
122
123template <int dim>
124template <int order>
127 const unsigned int i,
128 const Point<dim> &p) const
129{
131
132 Assert(order == 1, ExcNotImplemented());
133 const auto grad = compute_grad(i, p);
134
135 for (unsigned int i = 0; i < dim; ++i)
136 der[i] = grad[i];
137
138 return der;
139}
140
142
143#endif
Definition point.h:113
Tensor< 2, dim > compute_grad_grad(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
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< order, dim > compute_derivative(const unsigned int i, const Point< dim > &p) const
Tensor< 3, dim > compute_3rd_derivative(const unsigned int i, const Point< dim > &p) const override
double compute_value(const unsigned int i, const Point< dim > &p) const override
static constexpr unsigned int dimension
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const override
Tensor< 2, dim > compute_2nd_derivative(const unsigned int i, const Point< dim > &p) const override
std::string name() const override
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
virtual unsigned int degree() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:40
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:41
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)