Reference documentation for deal.II version Git 423cd11810 2020-05-28 01:07:25 +0200
\(\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\}}\)
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
PolynomialsP< dim > Class Template Reference

#include <deal.II/base/polynomials_p.h>

Inheritance diagram for PolynomialsP< dim >:
[legend]

Public Member Functions

 PolynomialsP (const unsigned int p)
 
virtual unsigned int degree () const override
 
std::array< unsigned int, dim > directional_degrees (unsigned int n) const
 
std::unique_ptr< ScalarPolynomialsBase< dim > > clone () const override
 
- Public Member Functions inherited from PolynomialSpace< dim >
template<class Pol >
 PolynomialSpace (const std::vector< Pol > &pols)
 
template<class StreamType >
void output_indices (StreamType &out) const
 
void set_numbering (const std::vector< unsigned int > &renumber)
 
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 override
 
double compute_value (const unsigned int i, const Point< dim > &p) const override
 
template<int order>
Tensor< order, dim > compute_derivative (const unsigned int i, const Point< dim > &p) const
 
virtual Tensor< 1, dim > compute_1st_derivative (const unsigned int i, const Point< dim > &p) const override
 
virtual Tensor< 2, dim > compute_2nd_derivative (const unsigned int i, const Point< dim > &p) const override
 
virtual Tensor< 3, dim > compute_3rd_derivative (const unsigned int i, const Point< dim > &p) const override
 
virtual Tensor< 4, dim > compute_4th_derivative (const unsigned int i, const Point< dim > &p) const override
 
Tensor< 1, dim > compute_grad (const unsigned int i, const Point< dim > &p) const override
 
Tensor< 2, dim > compute_grad_grad (const unsigned int i, const Point< dim > &p) const override
 
std::string name () const override
 
template<>
unsigned int n_polynomials (const unsigned int)
 

Static Public Attributes

static const unsigned int dimension = dim
 
- Static Public Attributes inherited from PolynomialSpace< dim >
static const unsigned int dimension = dim
 

Private Member Functions

void create_polynomial_ordering (std::vector< unsigned int > &index_map) const
 
template<>
void create_polynomial_ordering (std::vector< unsigned int > &index_map) const
 
template<>
void create_polynomial_ordering (std::vector< unsigned int > &index_map) const
 
template<>
void create_polynomial_ordering (std::vector< unsigned int > &index_map) const
 

Private Attributes

const unsigned int p
 

Additional Inherited Members

- Static Public Member Functions inherited from PolynomialSpace< dim >
static unsigned int n_polynomials (const unsigned int n)
 
- Protected Member Functions inherited from PolynomialSpace< dim >
std::array< unsigned int, dim > compute_index (const unsigned int n) const
 
template<>
std::array< unsigned int, 1 > compute_index (const unsigned int n) const
 
template<>
std::array< unsigned int, 2 > compute_index (const unsigned int n) const
 
template<>
std::array< unsigned int, 3 > compute_index (const unsigned int n) const
 
template<>
std::array< unsigned int, 1 > compute_index (const unsigned int i) const
 
template<>
std::array< unsigned int, 2 > compute_index (const unsigned int i) const
 
template<>
std::array< unsigned int, 3 > compute_index (const unsigned int i) const
 

Detailed Description

template<int dim>
class PolynomialsP< dim >

This class implements the polynomial space of degree p based on the monomials \({1,x,x^2,...}\). I.e. in d dimensions it constructs all polynomials of the form \(\prod_{i=1}^d x_i^{n_i}\), where \(\sum_i n_i\leq p\). The base polynomials are given a specific ordering, e.g. in 2 dimensions: \({1,x,y,xy,x^2,y^2,x^2y,xy^2,x^3,y^3,...}\). The ordering of the monomials in \(P_k1\) matches the ordering of the monomials in \(P_k2\) for \(k2>k1\).

Author
Ralf Hartmann, 2004

Definition at line 49 of file polynomials_p.h.

Constructor & Destructor Documentation

◆ PolynomialsP()

template<int dim>
PolynomialsP< dim >::PolynomialsP ( const unsigned int  p)

Constructor. Creates all basis functions of \(P_p\).

  • p: the degree of the polynomial space

Definition at line 23 of file polynomials_p.cc.

Member Function Documentation

◆ degree()

template<int dim>
unsigned int PolynomialsP< dim >::degree ( ) const
inlineoverridevirtual

Return the degree p of the polynomial space P_p.

Note, that this number is PolynomialSpace::degree()-1, compare definition in PolynomialSpace.

Definition at line 106 of file polynomials_p.h.

◆ directional_degrees()

template<int dim>
std::array< unsigned int, dim > PolynomialsP< dim >::directional_degrees ( unsigned int  n) const
inline

For the nth polynomial \(p_n(x,y,z)=x^i y^j z^k\) this function gives the degrees i,j,k in the x,y,z directions.

In 1d and 2d, obviously only i and i,j are returned.

Definition at line 114 of file polynomials_p.h.

◆ clone()

template<int dim>
std::unique_ptr<ScalarPolynomialsBase<dim> > PolynomialsP< dim >::clone ( ) const
inlineoverridevirtual

A sort of virtual copy constructor, this function returns a copy of the polynomial space object. Derived classes need to override the function here in this base class and return an object of the same type as the derived class.

Some places in the library, for example the constructors of FE_Poly, need to make copies of polynomial spaces without knowing their exact type. They do so through this function.

Reimplemented from PolynomialSpace< dim >.

Definition at line 83 of file polynomials_p.h.

◆ create_polynomial_ordering() [1/4]

template<int dim>
void PolynomialsP< dim >::create_polynomial_ordering ( std::vector< unsigned int > &  index_map) const
private

Fills the index_map.

◆ create_polynomial_ordering() [2/4]

template<>
void PolynomialsP< 1 >::create_polynomial_ordering ( std::vector< unsigned int > &  index_map) const
private

Definition at line 36 of file polynomials_p.cc.

◆ create_polynomial_ordering() [3/4]

template<>
void PolynomialsP< 2 >::create_polynomial_ordering ( std::vector< unsigned int > &  index_map) const
private

Definition at line 61 of file polynomials_p.cc.

◆ create_polynomial_ordering() [4/4]

template<>
void PolynomialsP< 3 >::create_polynomial_ordering ( std::vector< unsigned int > &  index_map) const
private

Definition at line 90 of file polynomials_p.cc.

Member Data Documentation

◆ dimension

template<int dim>
const unsigned int PolynomialsP< dim >::dimension = dim
static

Access to the dimension of this object, for checking and automatic setting of dimension in other classes.

Definition at line 56 of file polynomials_p.h.

◆ p

template<int dim>
const unsigned int PolynomialsP< dim >::p
private

Degree p of the polynomial space \(P_p\), i.e. the number p which was given to the constructor.

Definition at line 99 of file polynomials_p.h.


The documentation for this class was generated from the following files: