Reference documentation for deal.II version 9.2.0
\(\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\}}\)
scalar_polynomials_base.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2020 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 
23 #include <deal.II/base/point.h>
24 #include <deal.II/base/tensor.h>
25 
26 #include <vector>
27 
29 
62 template <int dim>
64 {
65 public:
70  ScalarPolynomialsBase(const unsigned int deg,
71  const unsigned int n_polynomials);
72 
76  ScalarPolynomialsBase(ScalarPolynomialsBase<dim> &&) = default; // NOLINT
77 
82 
87  virtual ~ScalarPolynomialsBase() = default;
88 
101  virtual void
102  evaluate(const Point<dim> & unit_point,
103  std::vector<double> & values,
104  std::vector<Tensor<1, dim>> &grads,
105  std::vector<Tensor<2, dim>> &grad_grads,
106  std::vector<Tensor<3, dim>> &third_derivatives,
107  std::vector<Tensor<4, dim>> &fourth_derivatives) const = 0;
108 
112  unsigned int
113  n() const;
114 
120  unsigned int
121  degree() const;
122 
133  virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
134  clone() const = 0;
135 
139  virtual std::string
140  name() const = 0;
141 
145  virtual std::size_t
146  memory_consumption() const;
147 
148 private:
152  const unsigned int polynomial_degree;
153 
157  const unsigned int n_pols;
158 };
159 
160 
161 
162 template <int dim>
163 inline unsigned int
165 {
166  return n_pols;
167 }
168 
169 
170 
171 template <int dim>
172 inline unsigned int
174 {
175  return polynomial_degree;
176 }
177 
178 
179 
181 
182 #endif
ScalarPolynomialsBase::memory_consumption
virtual std::size_t memory_consumption() const
Definition: scalar_polynomials_base.cc:39
ScalarPolynomialsBase::polynomial_degree
const unsigned int polynomial_degree
Definition: scalar_polynomials_base.h:152
ScalarPolynomialsBase::clone
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const =0
ScalarPolynomialsBase::n
unsigned int n() const
Definition: scalar_polynomials_base.h:164
tensor.h
ScalarPolynomialsBase::degree
unsigned int degree() const
Definition: scalar_polynomials_base.h:173
Tensor< 1, dim >
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
exceptions.h
ScalarPolynomialsBase::~ScalarPolynomialsBase
virtual ~ScalarPolynomialsBase()=default
ScalarPolynomialsBase::name
virtual std::string name() const =0
ScalarPolynomialsBase::n_pols
const unsigned int n_pols
Definition: scalar_polynomials_base.h:157
ScalarPolynomialsBase::evaluate
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
Point< dim >
config.h
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
ScalarPolynomialsBase
Definition: scalar_polynomials_base.h:63
ScalarPolynomialsBase::ScalarPolynomialsBase
ScalarPolynomialsBase(const unsigned int deg, const unsigned int n_polynomials)
Definition: scalar_polynomials_base.cc:26
point.h