Reference documentation for deal.II version 9.1.0-pre
polynomials_bdm.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2004 - 2017 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/table.h>
27 #include <deal.II/base/tensor.h>
28 #include <deal.II/base/thread_management.h>
29 
30 #include <vector>
31 
32 DEAL_II_NAMESPACE_OPEN
33 
100 template <int dim>
102 {
103 public:
112  PolynomialsBDM(const unsigned int k);
113 
126  void
127  compute(const Point<dim> & unit_point,
128  std::vector<Tensor<1, dim>> &values,
129  std::vector<Tensor<2, dim>> &grads,
130  std::vector<Tensor<3, dim>> &grad_grads,
131  std::vector<Tensor<4, dim>> &third_derivatives,
132  std::vector<Tensor<5, dim>> &fourth_derivatives) const;
133 
137  unsigned int
138  n() const;
139 
144  unsigned int
145  degree() const;
146 
150  std::string
151  name() const;
152 
158  static unsigned int
159  compute_n_pols(unsigned int degree);
160 
161 private:
167 
172  std::vector<Polynomials::Polynomial<double>> monomials;
173 
177  unsigned int n_pols;
178 
183 
187  mutable std::vector<double> p_values;
188 
192  mutable std::vector<Tensor<1, dim>> p_grads;
193 
197  mutable std::vector<Tensor<2, dim>> p_grad_grads;
198 
202  mutable std::vector<Tensor<3, dim>> p_third_derivatives;
203 
207  mutable std::vector<Tensor<4, dim>> p_fourth_derivatives;
208 };
209 
210 
211 template <int dim>
212 inline unsigned int
214 {
215  return n_pols;
216 }
217 
218 
219 template <int dim>
220 inline unsigned int
222 {
223  return polynomial_space.degree() - 1;
224 }
225 
226 
227 template <int dim>
228 inline std::string
230 {
231  return "BDM";
232 }
233 
234 
235 DEAL_II_NAMESPACE_CLOSE
236 
237 #endif
PolynomialsBDM(const unsigned int k)
unsigned int n() const
std::vector< Polynomials::Polynomial< double > > monomials
unsigned int degree() const
std::vector< Tensor< 3, dim > > p_third_derivatives
std::string name() const
std::vector< double > p_values
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< 1, dim > > p_grads
static unsigned int compute_n_pols(unsigned int degree)
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