Reference documentation for deal.II version 9.2.0
|
#include <deal.II/base/tensor_product_polynomials.h>
Public Member Functions | |
template<class Pol > | |
TensorProductPolynomialsConst (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 |
unsigned int | n () const |
std::string | name () const override |
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > | clone () const override |
double | compute_value (const unsigned int, const Point< 0 > &) const |
Static Public Attributes | |
static const unsigned int | dimension = dim |
Private Attributes | |
TensorProductPolynomials< dim > | tensor_polys |
std::vector< unsigned int > | index_map |
std::vector< unsigned int > | index_map_inverse |
Tensor product of given polynomials and a locally constant function. This class inherits most of its functionality from TensorProductPolynomials. It works similarly to that class but adds a constant function for the last index.
Definition at line 39 of file tensor_product_polynomials.h.
TensorProductPolynomialsConst< dim >::TensorProductPolynomialsConst | ( | const std::vector< Pol > & | pols | ) |
Constructor. pols
is a vector of objects that should be derived or otherwise convertible to one-dimensional polynomial objects. It will be copied element by element into a private variable.
void TensorProductPolynomialsConst< dim >::output_indices | ( | std::ostream & | out | ) | const |
Print the list of tensor_polys
indices to out
.
Definition at line 31 of file tensor_product_polynomials_const.cc.
void TensorProductPolynomialsConst< dim >::set_numbering | ( | const std::vector< unsigned int > & | renumber | ) |
Set the ordering of the polynomials. Requires renumber.size()==tensor_polys.n()
. Stores a copy of renumber
.
Definition at line 48 of file tensor_product_polynomials_const.cc.
const std::vector<unsigned int>& TensorProductPolynomialsConst< dim >::get_numbering | ( | ) | const |
Give read access to the renumber vector.
const std::vector<unsigned int>& TensorProductPolynomialsConst< dim >::get_numbering_inverse | ( | ) | const |
Give read access to the inverse renumber vector.
|
override |
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.
Definition at line 128 of file tensor_product_polynomials_const.cc.
double TensorProductPolynomialsConst< dim >::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 68 of file tensor_product_polynomials_const.cc.
Tensor<order, dim> TensorProductPolynomialsConst< dim >::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 > TensorProductPolynomialsConst< dim >::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 96 of file tensor_product_polynomials_const.cc.
Tensor< 2, dim > TensorProductPolynomialsConst< dim >::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 112 of file tensor_product_polynomials_const.cc.
unsigned int TensorProductPolynomialsConst< dim >::n | ( | ) | const |
Return the number of tensor product polynomials plus the constant function. For n 1d polynomials this is ndim+1.
|
override |
Return the name of the space, which is TensorProductPolynomialsConst
.
|
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.
Definition at line 204 of file tensor_product_polynomials_const.cc.
double TensorProductPolynomialsConst< 0 >::compute_value | ( | const unsigned int | , |
const Point< 0 > & | |||
) | const |
Definition at line 86 of file tensor_product_polynomials_const.cc.
|
static |
Access to the dimension of this object, for checking and automatic setting of dimension in other classes.
Definition at line 55 of file tensor_product_polynomials_const.h.
|
private |
The TensorProductPolynomials object
Definition at line 198 of file tensor_product_polynomials_const.h.
|
private |
Index map for reordering the polynomials.
Definition at line 203 of file tensor_product_polynomials_const.h.
|
private |
Index map for reordering the polynomials.
Definition at line 208 of file tensor_product_polynomials_const.h.