Reference documentation for deal.II version Git fff2869c79 2020-01-20 12:00:24 -0500
\(\newcommand{\vcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\vcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
scalar_polynomials_base.h
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_scalar_polynomials_base_h
17 #define dealii_scalar_polynomials_base_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/tensor.h>
25 
26 #include <vector>
27 
28 DEAL_II_NAMESPACE_OPEN
29 
61 template <int dim>
63 {
64 public:
69  ScalarPolynomialsBase(const unsigned int deg,
70  const unsigned int n_polynomials);
71 
75  ScalarPolynomialsBase(ScalarPolynomialsBase<dim> &&) = default; // NOLINT
76 
81 
86  virtual ~ScalarPolynomialsBase() = default;
87 
100  virtual void
101  evaluate(const Point<dim> & unit_point,
102  std::vector<double> & values,
103  std::vector<Tensor<1, dim>> &grads,
104  std::vector<Tensor<2, dim>> &grad_grads,
105  std::vector<Tensor<3, dim>> &third_derivatives,
106  std::vector<Tensor<4, dim>> &fourth_derivatives) const = 0;
107 
111  unsigned int
112  n() const;
113 
119  unsigned int
120  degree() const;
121 
132  virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
133  clone() const = 0;
134 
138  virtual std::string
139  name() const = 0;
140 
144  virtual std::size_t
145  memory_consumption() const;
146 
147 private:
151  const unsigned int polynomial_degree;
152 
156  const unsigned int n_pols;
157 };
158 
159 
160 
161 template <int dim>
162 inline unsigned int
164 {
165  return n_pols;
166 }
167 
168 
169 
170 template <int dim>
171 inline unsigned int
173 {
174  return polynomial_degree;
175 }
176 
177 
178 
179 DEAL_II_NAMESPACE_CLOSE
180 
181 #endif
virtual ~ScalarPolynomialsBase()=default
virtual std::string name() const =0
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const =0
unsigned int degree() const
ScalarPolynomialsBase(const unsigned int deg, const unsigned int n_polynomials)
virtual 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 =0
const unsigned int polynomial_degree
virtual std::size_t memory_consumption() const