Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
polynomials_bdm.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2004 - 2018 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_polynomials_BDM_h
17 #define dealii_polynomials_BDM_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/polynomial.h>
25 #include <deal.II/base/polynomial_space.h>
26 #include <deal.II/base/tensor.h>
27 #include <deal.II/base/thread_management.h>
28 
29 #include <vector>
30 
31 DEAL_II_NAMESPACE_OPEN
32 
99 template <int dim>
101 {
102 public:
111  PolynomialsBDM(const unsigned int k);
112 
125  void
126  compute(const Point<dim> & unit_point,
127  std::vector<Tensor<1, dim>> &values,
128  std::vector<Tensor<2, dim>> &grads,
129  std::vector<Tensor<3, dim>> &grad_grads,
130  std::vector<Tensor<4, dim>> &third_derivatives,
131  std::vector<Tensor<5, dim>> &fourth_derivatives) const;
132 
136  unsigned int
137  n() const;
138 
143  unsigned int
144  degree() const;
145 
149  std::string
150  name() const;
151 
157  static unsigned int
158  compute_n_pols(unsigned int degree);
159 
160 private:
166 
171  std::vector<Polynomials::Polynomial<double>> monomials;
172 
176  unsigned int n_pols;
177 
182 
186  mutable std::vector<double> p_values;
187 
191  mutable std::vector<Tensor<1, dim>> p_grads;
192 
196  mutable std::vector<Tensor<2, dim>> p_grad_grads;
197 
201  mutable std::vector<Tensor<3, dim>> p_third_derivatives;
202 
206  mutable std::vector<Tensor<4, dim>> p_fourth_derivatives;
207 };
208 
209 
210 template <int dim>
211 inline unsigned int
213 {
214  return n_pols;
215 }
216 
217 
218 template <int dim>
219 inline unsigned int
221 {
222  return polynomial_space.degree() - 1;
223 }
224 
225 
226 template <int dim>
227 inline std::string
229 {
230  return "BDM";
231 }
232 
233 
234 DEAL_II_NAMESPACE_CLOSE
235 
236 #endif
PolynomialsBDM(const unsigned int k)
unsigned int n() const
std::string name() const
std::vector< Polynomials::Polynomial< double > > monomials
void compute(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
std::vector< Tensor< 3, dim > > p_third_derivatives
std::vector< double > p_values
std::vector< Tensor< 1, dim > > p_grads
static unsigned int compute_n_pols(unsigned int degree)
unsigned int degree() const
std::vector< Tensor< 4, dim > > p_fourth_derivatives
std::vector< Tensor< 2, dim > > p_grad_grads
unsigned int n_pols
Threads::Mutex mutex
const PolynomialSpace< dim > polynomial_space