Reference documentation for deal.II version Git 4e8af90f34 2022-01-22 18:32:44 +0100
\(\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\}}\)
polynomials_pyramid.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2020 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_polynomials_pyramid_h
18 #define dealii_polynomials_pyramid_h
19 
20 #include <deal.II/base/config.h>
21 
23 
25 
30 template <int dim>
32 {
33 public:
37  static const unsigned int dimension = dim;
38 
39  /*
40  * Constructor taking the polynomial @p degree as input.
41  *
42  * @note Currently, only linear polynomials (degree=1) are implemented.
43  */
44  ScalarLagrangePolynomialPyramid(const unsigned int degree);
45 
51  void
52  evaluate(const Point<dim> & unit_point,
53  std::vector<double> & values,
54  std::vector<Tensor<1, dim>> &grads,
55  std::vector<Tensor<2, dim>> &grad_grads,
56  std::vector<Tensor<3, dim>> &third_derivatives,
57  std::vector<Tensor<4, dim>> &fourth_derivatives) const override;
58 
59  double
60  compute_value(const unsigned int i, const Point<dim> &p) const override;
61 
67  template <int order>
69  compute_derivative(const unsigned int i, const Point<dim> &p) const;
70 
72  compute_1st_derivative(const unsigned int i,
73  const Point<dim> & p) const override;
74 
76  compute_2nd_derivative(const unsigned int i,
77  const Point<dim> & p) const override;
78 
85  compute_3rd_derivative(const unsigned int i,
86  const Point<dim> & p) const override;
87 
94  compute_4th_derivative(const unsigned int i,
95  const Point<dim> & p) const override;
96 
103  compute_grad(const unsigned int i, const Point<dim> &p) const override;
104 
111  compute_grad_grad(const unsigned int i, const Point<dim> &p) const override;
112 
113  std::string
114  name() const override;
115 
116  virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
117  clone() const override;
118 };
119 
120 
121 
122 template <int dim>
123 template <int order>
126  const unsigned int i,
127  const Point<dim> & p) const
128 {
129  Tensor<order, dim> der;
130 
131  Assert(order == 1, ExcNotImplemented());
132  const auto grad = compute_grad(i, p);
133 
134  for (unsigned int i = 0; i < dim; ++i)
135  der[i] = grad[i];
136 
137  return der;
138 }
139 
141 
142 #endif
Tensor< 4, dim > compute_4th_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
ScalarLagrangePolynomialPyramid(const unsigned int degree)
Tensor< 1, dim > compute_1st_derivative(const unsigned int i, const Point< dim > &p) const override
double compute_value(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
#define Assert(cond, exc)
Definition: exceptions.h:1461
Tensor< order, dim > compute_derivative(const unsigned int i, const Point< dim > &p) const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:407
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) const override
Tensor< 3, dim > compute_3rd_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
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:406
static ::ExceptionBase & ExcNotImplemented()
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const override
static const unsigned int dimension