Reference documentation for deal.II version 9.2.0
|
#include <deal.II/base/tensor_product_polynomials.h>
Public Member Functions | |
template<class Pol > | |
TensorProductPolynomials (const std::vector< Pol > &pols) | |
void | output_indices (std::ostream &out) const |
void | set_numbering (const std::vector< unsigned int > &renumber) |
const std::vector< unsigned int > & | get_numbering () const |
const std::vector< unsigned int > & | get_numbering_inverse () const |
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 |
template<int order> | |
Tensor< order, dim > | compute_derivative (const unsigned int i, const Point< dim > &p) const |
Tensor< 1, dim > | compute_grad (const unsigned int i, const Point< dim > &p) const |
Tensor< 2, dim > | compute_grad_grad (const unsigned int i, const Point< dim > &p) const |
std::string | name () const override |
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > | clone () const override |
virtual std::size_t | memory_consumption () const override |
double | compute_value (const unsigned int, const Point< 0 > &) const |
Tensor< 1, 0 > | compute_grad (const unsigned int, const Point< 0 > &) const |
Tensor< 2, 0 > | compute_grad_grad (const unsigned int, const Point< 0 > &) const |
Public Member Functions inherited from ScalarPolynomialsBase< dim > | |
ScalarPolynomialsBase (const unsigned int deg, const unsigned int n_polynomials) | |
ScalarPolynomialsBase (ScalarPolynomialsBase< dim > &&)=default | |
ScalarPolynomialsBase (const ScalarPolynomialsBase< dim > &)=default | |
virtual | ~ScalarPolynomialsBase ()=default |
unsigned int | n () const |
unsigned int | degree () const |
Static Public Attributes | |
static const unsigned int | dimension = dim |
Protected Member Functions | |
void | compute_index (const unsigned int i, std::array< unsigned int, dim > &indices) const |
Protected Attributes | |
std::vector< PolynomialType > | polynomials |
std::vector< unsigned int > | index_map |
std::vector< unsigned int > | index_map_inverse |
Friends | |
class | TensorProductPolynomialsBubbles< dim > |
class | TensorProductPolynomialsConst< dim > |
Tensor product of given polynomials.
Given a vector of n one-dimensional polynomials P1 to Pn, this class generates ndim polynomials of the form Qijk(x,y,z) = Pi(x)Pj(y)Pk(z). If the base polynomials are mutually orthogonal on the interval [-1,1] or [0,1], then the tensor product polynomials are orthogonal on [-1,1]dim or [0,1]dim, respectively.
Indexing is as follows: the order of dim-dimensional polynomials is x-coordinates running fastest, then y-coordinate, etc. The first few polynomials are thus P1(x)P1(y), P2(x)P1(y), P3(x)P1(y), ..., P1(x)P2(y), P2(x)P2(y), P3(x)P2(y), ... and likewise in 3d.
The output_indices() function prints the ordering of the dim-dimensional polynomials, i.e. for each polynomial in the polynomial space it gives the indices i,j,k of the one-dimensional polynomials in x,y and z direction. The ordering of the dim-dimensional polynomials can be changed by using the set_numbering() function.
Definition at line 74 of file tensor_product_polynomials.h.
TensorProductPolynomials< dim, PolynomialType >::TensorProductPolynomials | ( | const std::vector< Pol > & | pols | ) |
Constructor. pols
is a vector of objects that should be derived or otherwise convertible to one-dimensional polynomial objects of type PolynomialType
(template argument of class). It will be copied element by element into a private variable.
void TensorProductPolynomials< dim, PolynomialType >::output_indices | ( | std::ostream & | out | ) | const |
Print the list of the indices to out
.
Definition at line 99 of file tensor_product_polynomials.cc.
void TensorProductPolynomials< dim, PolynomialType >::set_numbering | ( | const std::vector< unsigned int > & | renumber | ) |
Set the ordering of the polynomials. Requires renumber.size()==n()
. Stores a copy of renumber
.
Definition at line 117 of file tensor_product_polynomials.cc.
const std::vector<unsigned int>& TensorProductPolynomials< dim, PolynomialType >::get_numbering | ( | ) | const |
Give read access to the renumber vector.
const std::vector<unsigned int>& TensorProductPolynomials< dim, PolynomialType >::get_numbering_inverse | ( | ) | const |
Give read access to the inverse renumber vector.
|
overridevirtual |
Compute the value and the first and second derivatives of each tensor product polynomial at unit_point
.
The size of the vectors must either be equal 0 or equal n(). In the first case, the function will not compute these values.
If you need values or derivatives of all tensor product polynomials then use this function, rather than using any of the compute_value(), compute_grad() or compute_grad_grad() functions, see below, in a loop over all tensor product polynomials.
Implements ScalarPolynomialsBase< dim >.
Definition at line 268 of file tensor_product_polynomials.cc.
double TensorProductPolynomials< dim, PolynomialType >::compute_value | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Compute the value of the i
th tensor product polynomial at unit_point
. Here i
is given in tensor product numbering.
Note, that using this function within a loop over all tensor product polynomials is not efficient, because then each point value of the underlying (one-dimensional) polynomials is (unnecessarily) computed several times. Instead use the evaluate() function with values.size()==
n() to get the point values of all tensor polynomials all at once and in a much more efficient way.
Definition at line 144 of file tensor_product_polynomials.cc.
Tensor<order, dim> TensorProductPolynomials< dim, PolynomialType >::compute_derivative | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Compute the order
th derivative of the i
th tensor product polynomial at unit_point
. Here i
is given in tensor product numbering.
Note, that using this function within a loop over all tensor product polynomials is not efficient, because then each derivative value of the underlying (one-dimensional) polynomials is (unnecessarily) computed several times. Instead use the evaluate() function, see above, with the size of the appropriate parameter set to n() to get the point value of all tensor polynomials all at once and in a much more efficient way.
order | The derivative order. |
Tensor< 1, dim > TensorProductPolynomials< dim, PolynomialType >::compute_grad | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Compute the grad of the i
th tensor product polynomial at unit_point
. Here i
is given in tensor product numbering.
Note, that using this function within a loop over all tensor product polynomials is not efficient, because then each derivative value of the underlying (one-dimensional) polynomials is (unnecessarily) computed several times. Instead use the evaluate() function, see above, with grads.size()==
n() to get the point value of all tensor polynomials all at once and in a much more efficient way.
Definition at line 164 of file tensor_product_polynomials.cc.
Tensor< 2, dim > TensorProductPolynomials< dim, PolynomialType >::compute_grad_grad | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Compute the second derivative (grad_grad) of the i
th tensor product polynomial at unit_point
. Here i
is given in tensor product numbering.
Note, that using this function within a loop over all tensor product polynomials is not efficient, because then each derivative value of the underlying (one-dimensional) polynomials is (unnecessarily) computed several times. Instead use the evaluate() function, see above, with grad_grads.size()==
n() to get the point value of all tensor polynomials all at once and in a much more efficient way.
Definition at line 212 of file tensor_product_polynomials.cc.
|
overridevirtual |
Return the name of the space, which is TensorProductPolynomials
.
Implements ScalarPolynomialsBase< dim >.
|
overridevirtual |
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.
Implements ScalarPolynomialsBase< dim >.
Definition at line 431 of file tensor_product_polynomials.cc.
|
overridevirtual |
Return an estimate (in bytes) for the memory consumption of this object.
Reimplemented from ScalarPolynomialsBase< dim >.
Definition at line 441 of file tensor_product_polynomials.cc.
|
inlineprotected |
Each tensor product polynomial i is a product of one-dimensional polynomials in each space direction. Compute the indices of these one- dimensional polynomials for each space direction, given the index i.
Definition at line 83 of file tensor_product_polynomials.cc.
double TensorProductPolynomials< 0, Polynomials::Polynomial< double > >::compute_value | ( | const unsigned int | , |
const Point< 0 > & | |||
) | const |
Definition at line 132 of file tensor_product_polynomials.cc.
Tensor< 1, 0 > TensorProductPolynomials< 0, Polynomials::Polynomial< double > >::compute_grad | ( | const unsigned int | , |
const Point< 0 > & | |||
) | const |
Definition at line 201 of file tensor_product_polynomials.cc.
Tensor< 2, 0 > TensorProductPolynomials< 0, Polynomials::Polynomial< double > >::compute_grad_grad | ( | const unsigned int | , |
const Point< 0 > & | |||
) | const |
Definition at line 257 of file tensor_product_polynomials.cc.
|
friend |
TensorProductPolynomialsBubbles has a TensorProductPolynomials class so we declare it as a friend class.
Definition at line 248 of file tensor_product_polynomials.h.
|
friend |
TensorProductPolynomialsConst has a TensorProductPolynomials class so we declare it as a friend class.
Definition at line 254 of file tensor_product_polynomials.h.
|
static |
Access to the dimension of this object, for checking and automatic setting of dimension in other classes.
Definition at line 81 of file tensor_product_polynomials.h.
|
protected |
Copy of the vector pols
of polynomials given to the constructor.
Definition at line 222 of file tensor_product_polynomials.h.
|
protected |
Index map for reordering the polynomials.
Definition at line 227 of file tensor_product_polynomials.h.
|
protected |
Index map for reordering the polynomials.
Definition at line 232 of file tensor_product_polynomials.h.