Reference documentation for deal.II version Git adf7f9fdfe 2021-01-28 13:54:50 +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\}}\)
tensor_polynomials_base.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2019 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 #ifndef dealii_tensor_polynomials_base_h
17 #define dealii_tensor_polynomials_base_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/tensor.h>
25 
26 #include <vector>
27 
29 
59 template <int dim>
61 {
62 public:
67  TensorPolynomialsBase(const unsigned int deg,
68  const unsigned int n_polynomials);
69 
73  TensorPolynomialsBase(TensorPolynomialsBase<dim> &&) = default; // NOLINT
74 
79 
84  virtual ~TensorPolynomialsBase() = default;
85 
98  virtual void
99  evaluate(const Point<dim> & unit_point,
100  std::vector<Tensor<1, dim>> &values,
101  std::vector<Tensor<2, dim>> &grads,
102  std::vector<Tensor<3, dim>> &grad_grads,
103  std::vector<Tensor<4, dim>> &third_derivatives,
104  std::vector<Tensor<5, dim>> &fourth_derivatives) const = 0;
105 
109  unsigned int
110  n() const;
111 
117  unsigned int
118  degree() const;
119 
130  virtual std::unique_ptr<TensorPolynomialsBase<dim>>
131  clone() const = 0;
132 
136  virtual std::string
137  name() const = 0;
138 
139 private:
143  const unsigned int polynomial_degree;
144 
148  const unsigned int n_pols;
149 };
150 
151 
152 
153 template <int dim>
154 inline unsigned int
156 {
157  return n_pols;
158 }
159 
160 
161 
162 template <int dim>
163 inline unsigned int
165 {
166  return polynomial_degree;
167 }
168 
169 
170 
172 
173 #endif
unsigned int degree() const
virtual std::string name() const =0
virtual ~TensorPolynomialsBase()=default
virtual void evaluate(const Point< dim > &unit_point, std::vector< Tensor< 1, dim >> &values, std::vector< Tensor< 2, dim >> &grads, std::vector< Tensor< 3, dim >> &grad_grads, std::vector< Tensor< 4, dim >> &third_derivatives, std::vector< Tensor< 5, dim >> &fourth_derivatives) const =0
TensorPolynomialsBase(const unsigned int deg, const unsigned int n_polynomials)
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:380
const unsigned int polynomial_degree
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:379
virtual std::unique_ptr< TensorPolynomialsBase< dim > > clone() const =0