![]() |
Reference documentation for deal.II version 8.1.0
|
#include <tensor_product_polynomials.h>
Public Member Functions | |
AnisotropicPolynomials (const std::vector< std::vector< Polynomials::Polynomial< double > > > &pols) | |
void | compute (const Point< dim > &unit_point, std::vector< double > &values, std::vector< Tensor< 1, dim > > &grads, std::vector< Tensor< 2, dim > > &grad_grads) const |
double | compute_value (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 |
Private Member Functions | |
void | compute_index (const unsigned int i, unsigned int(&indices)[dim]) const |
Static Private Member Functions | |
static unsigned int | get_n_tensor_pols (const std::vector< std::vector< Polynomials::Polynomial< double > > > &pols) |
Private Attributes | |
std::vector< std::vector < Polynomials::Polynomial < double > > > | polynomials |
unsigned int | n_tensor_pols |
Anisotropic tensor product of given polynomials.
Given one-dimensional polynomials Px1
, Px2
, ... in x-direction, Py1
, Py2
, ... in y-direction, and so on, this class generates polynomials of the form Qijk(x,y,z) = Pxi(x)Pyj(y)Pzk(z). If the base polynomials are mutually orthogonal on the interval or
, then the tensor product polynomials are orthogonal on
or
, 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 Px1(x)Py1(y)
, Px2(x)Py1(y)
, Px3(x)Py1(y)
, ..., Px1(x)Py2(y)
, Px2(x)Py2(y)
, Px3(x)Py2(y)
, ..., and likewise in 3d.
Definition at line 229 of file tensor_product_polynomials.h.
AnisotropicPolynomials< dim >::AnisotropicPolynomials | ( | const std::vector< std::vector< Polynomials::Polynomial< double > > > & | pols | ) |
Constructor. pols
is a table of one-dimensional polynomials. The number of rows in this table should be equal to the space dimension, with the elements of each row giving the polynomials that shall be used in this particular coordinate direction. These polynomials may vary between coordinates, as well as their number.
void AnisotropicPolynomials< dim >::compute | ( | const Point< dim > & | unit_point, |
std::vector< double > & | values, | ||
std::vector< Tensor< 1, dim > > & | grads, | ||
std::vector< Tensor< 2, dim > > & | grad_grads | ||
) | const |
Computes 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_tensor_pols
. 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.
double AnisotropicPolynomials< dim >::compute_value | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Computes 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 compute
function, see above, with values.size()==n_tensor_pols
to get the point values of all tensor polynomials all at once and in a much more efficient way.
Tensor<1,dim> AnisotropicPolynomials< dim >::compute_grad | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Computes 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 compute
function, see above, with grads.size()==n_tensor_pols
to get the point value of all tensor polynomials all at once and in a much more efficient way.
Tensor<2,dim> AnisotropicPolynomials< dim >::compute_grad_grad | ( | const unsigned int | i, |
const Point< dim > & | p | ||
) | const |
Computes 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 compute
function, see above, with grad_grads.size()==n_tensor_pols
to get the point value of all tensor polynomials all at once and in a much more efficient way.
unsigned int AnisotropicPolynomials< dim >::n | ( | ) | const |
Returns the number of tensor product polynomials. It is the product of the number of polynomials in each coordinate direction.
|
private |
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
.
|
staticprivate |
Given the input to the constructor, compute n_tensor_pols
.
|
private |
Copy of the vector pols
of polynomials given to the constructor.
Definition at line 314 of file tensor_product_polynomials.h.
|
private |
Number of tensor product polynomials. This is Nx*Ny*Nz
, or with terms dropped if the number of space dimensions is less than 3.
Definition at line 320 of file tensor_product_polynomials.h.