Reference documentation for deal.II version 9.1.0-pre
polynomials_p.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_P_h
17 #define dealii_polynomials_P_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 
29 #include <vector>
30 
31 DEAL_II_NAMESPACE_OPEN
48 template <int dim>
49 class PolynomialsP : public PolynomialSpace<dim>
50 {
51 public:
56  static const unsigned int dimension = dim;
57 
62  PolynomialsP(const unsigned int p);
63 
70  unsigned int
71  degree() const;
72 
79  std::array<unsigned int, dim>
80  directional_degrees(unsigned int n) const;
81 
82 private:
86  void
87  create_polynomial_ordering(std::vector<unsigned int> &index_map) const;
88 
93  const unsigned int p;
94 };
95 
98 template <int dim>
99 inline unsigned int
101 {
102  return p;
103 }
104 
105 
106 template <int dim>
107 inline std::array<unsigned int, dim>
109 {
110  return this->compute_index(n);
111 }
112 
113 DEAL_II_NAMESPACE_CLOSE
114 
115 #endif
std::array< unsigned int, dim > directional_degrees(unsigned int n) const
void create_polynomial_ordering(std::vector< unsigned int > &index_map) const
static const unsigned int dimension
Definition: polynomials_p.h:56
unsigned int n() const
unsigned int degree() const
std::array< unsigned int, dim > compute_index(const unsigned int n) const
const unsigned int p
Definition: polynomials_p.h:93
std::vector< unsigned int > index_map
PolynomialsP(const unsigned int p)