Reference documentation for deal.II version 9.3.2
\(\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 
36 template <int dim>
38 {
39 public:
43  static const unsigned int dimension = dim;
44 
45  /*
46  * Constructor taking the polynomial @p degree as input.
47  *
48  * @note Currently, only linear polynomials (degree=1) are implemented.
49  */
50  ScalarLagrangePolynomialPyramid(const unsigned int degree);
51 
57  void
58  evaluate(const Point<dim> & unit_point,
59  std::vector<double> & values,
60  std::vector<Tensor<1, dim>> &grads,
61  std::vector<Tensor<2, dim>> &grad_grads,
62  std::vector<Tensor<3, dim>> &third_derivatives,
63  std::vector<Tensor<4, dim>> &fourth_derivatives) const override;
64 
65  double
66  compute_value(const unsigned int i, const Point<dim> &p) const override;
67 
73  template <int order>
75  compute_derivative(const unsigned int i, const Point<dim> &p) const;
76 
78  compute_1st_derivative(const unsigned int i,
79  const Point<dim> & p) const override;
80 
82  compute_2nd_derivative(const unsigned int i,
83  const Point<dim> & p) const override;
84 
91  compute_3rd_derivative(const unsigned int i,
92  const Point<dim> & p) const override;
93 
100  compute_4th_derivative(const unsigned int i,
101  const Point<dim> & p) const override;
102 
109  compute_grad(const unsigned int i, const Point<dim> &p) const override;
110 
117  compute_grad_grad(const unsigned int i, const Point<dim> &p) const override;
118 
119  std::string
120  name() const override;
121 
122  virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
123  clone() const override;
124 };
125 
126 
127 
128 template <int dim>
129 template <int order>
132  const unsigned int i,
133  const Point<dim> & p) const
134 {
135  Tensor<order, dim> der;
136 
137  Assert(order == 1, ExcNotImplemented());
138  const auto grad = compute_grad(i, p);
139 
140  for (unsigned int i = 0; i < dim; i++)
141  der[i] = grad[i];
142 
143  return der;
144 }
145 
147 
148 #endif
Definition: point.h:111
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) const override
ScalarLagrangePolynomialPyramid(const unsigned int degree)
Tensor< 4, dim > compute_4th_derivative(const unsigned int i, const Point< dim > &p) 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
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
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
static const unsigned int dimension
virtual unsigned int degree() const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:396
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:397
#define Assert(cond, exc)
Definition: exceptions.h:1465
static ::ExceptionBase & ExcNotImplemented()