Stokhos::CompletePolynomialBasis< ordinal_type, value_type > Class Template Reference

Multivariate orthogonal polynomial basis generated from a total-order complete-polynomial tensor product of univariate polynomials. More...

#include <Stokhos_CompletePolynomialBasis.hpp>

Inheritance diagram for Stokhos::CompletePolynomialBasis< ordinal_type, value_type >:

Inheritance graph
[legend]
Collaboration diagram for Stokhos::CompletePolynomialBasis< ordinal_type, value_type >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CompletePolynomialBasis (const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const value_type &sparse_tol=1.0e-15, const Teuchos::RCP< Teuchos::Array< value_type > > &deriv_coeffs=Teuchos::null)
 Constructor.
virtual ~CompletePolynomialBasis ()
 Destructor.
Implementation of Stokhos::OrthogPolyBasis methods
ordinal_type order () const
 Return order of basis.
ordinal_type dimension () const
 Return dimension of basis.
virtual ordinal_type size () const
 Return total size of basis.
virtual const Teuchos::Array<
value_type > & 
norm_squared () const
 Return array storing norm-squared of each basis polynomial.
virtual const value_type & norm_squared (ordinal_type i) const
 Return norm squared of basis polynomial i.
virtual Teuchos::RCP< const
Stokhos::Sparse3Tensor< ordinal_type,
value_type > > 
getTripleProductTensor () const
 Compute triple product tensor.
virtual Teuchos::RCP< const
Stokhos::Sparse3Tensor< ordinal_type,
value_type > > 
getLowOrderTripleProductTensor (ordinal_type order) const
virtual value_type evaluateZero (ordinal_type i) const
 Evaluate basis polynomial i at zero.
virtual void evaluateBases (const Teuchos::Array< value_type > &point, Teuchos::Array< value_type > &basis_vals) const
 Evaluate basis polynomials at given point point.
virtual void print (std::ostream &os) const
 Print basis to stream os.
virtual const std::string & getName () const
 Return string name of basis.
Implementation of Stokhos::ProductBasis methods
virtual Teuchos::Array< ordinal_type > getTerm (ordinal_type i) const
 Get orders of each coordinate polynomial given an index i.
virtual ordinal_type getIndex (const Teuchos::Array< ordinal_type > &term) const
 Get index of the multivariate polynomial given orders of each coordinate.
Teuchos::Array< Teuchos::RCP<
const OneDOrthogPolyBasis<
ordinal_type, value_type > > > 
getCoordinateBases () const
 Return coordinate bases.
Implementation of Stokhos::DerivBasis methods
virtual Teuchos::RCP< const
Stokhos::Dense3Tensor< ordinal_type,
value_type > > 
getDerivTripleProductTensor () const
 Compute triple product tensor $D_{ijk} = \langle\Psi_i\Psi_j D_v\Psi_k\rangle$ where $D_v\Psi_k$ represents the derivative of $\Psi_k$ in the direction $v$.
virtual Teuchos::RCP< const
Teuchos::SerialDenseMatrix<
ordinal_type, value_type > > 
getDerivDoubleProductTensor () const
 Compute double product tensor $B_{ij} = \langle \Psi_i D_v\Psi_j\rangle$ where $D_v\Psi_j$ represents the derivative of $\Psi_j$ in the direction $v$.

Protected Member Functions

ordinal_type compute_num_terms (ordinal_type dim, ordinal_type order) const
 Computes the number of terms in an expansion of dimension dim and order order.
void compute_terms ()
 Compute the 2-D array of basis terms which maps a basis index into the orders for each basis dimension.
ordinal_type compute_index (const Teuchos::Array< ordinal_type > &terms) const
 Compute basis index given the orders for each basis dimension.

Protected Attributes

std::string name
 Name of basis.
ordinal_type p
 Total order of basis.
ordinal_type d
 Total dimension of basis.
ordinal_type sz
 Total size of basis.
Teuchos::Array< Teuchos::RCP<
const OneDOrthogPolyBasis<
ordinal_type, value_type > > > 
bases
 Array of bases.
value_type sparse_tol
 Tolerance for computing sparse Cijk.
Teuchos::RCP< Teuchos::Array<
value_type > > 
deriv_coeffs
 Coefficients for derivative.
Teuchos::Array< value_type > norms
 Norms.
Teuchos::Array< Teuchos::Array<
ordinal_type > > 
terms
 2-D array of basis terms
Teuchos::Array< Teuchos::RCP<
const Dense3Tensor< ordinal_type,
value_type > > > 
Cijk_1d
 Array of Triple products for computing product projections.
Teuchos::Array< Teuchos::RCP<
const Teuchos::SerialDenseMatrix<
ordinal_type, value_type > > > 
Bij_1d
 Array of double products for computing derivative projections.
Teuchos::RCP< Stokhos::Sparse3Tensor<
ordinal_type, value_type > > 
Cijk
 Triple product 3 tensor.
Teuchos::RCP< Stokhos::Dense3Tensor<
ordinal_type, value_type > > 
Dijk
 Derivative triple product 3 tensor.
Teuchos::RCP< Teuchos::SerialDenseMatrix<
ordinal_type, value_type > > 
Bij
 Derivative double product 2 tensor.
Teuchos::Array< Teuchos::Array<
value_type > > 
basis_eval_tmp
 Temporary array used in basis evaluation.

Detailed Description

template<typename ordinal_type, typename value_type>
class Stokhos::CompletePolynomialBasis< ordinal_type, value_type >

Multivariate orthogonal polynomial basis generated from a total-order complete-polynomial tensor product of univariate polynomials.

The multivariate polynomials are given by

\[ \Psi_i(x) = \psi_{i_1}(x_1)\dots\psi_{i_d}(x_d) \]

where $d$ is the dimension of the basis and $i_1+\dots+ i_d\leq p$, where $p$ is the order of the basis. The size of the basis is given by $(d+p)!/(d!p!)$.

NOTE: Currently all coordinate bases must be of the samer order $p$.


Constructor & Destructor Documentation

template<typename ordinal_type, typename value_type>
Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::CompletePolynomialBasis ( const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &  bases,
const value_type &  sparse_tol = 1.0e-15,
const Teuchos::RCP< Teuchos::Array< value_type > > &  deriv_coeffs = Teuchos::null 
)

Constructor.

Parameters:
bases array of 1-D coordinate bases
sparse_tol tolerance used to drop terms in sparse triple-product tensors
deriv_coeffs direction used to define derivatives for derivative product tensors. Defaults to all one's if not supplied.


Member Function Documentation

template<typename ordinal_type, typename value_type>
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::compute_num_terms ( ordinal_type  dim,
ordinal_type  order 
) const [protected]

Computes the number of terms in an expansion of dimension dim and order order.

Returns (order+dim)!/(order!*dim!)

template<typename ordinal_type, typename value_type>
void Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::evaluateBases ( const Teuchos::Array< value_type > &  point,
Teuchos::Array< value_type > &  basis_vals 
) const [virtual]

Evaluate basis polynomials at given point point.

Size of returned array is given by size(), and coefficients are ordered from order 0 up to size size()-1.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::Array< Teuchos::RCP< const Stokhos::OneDOrthogPolyBasis< ordinal_type, value_type > > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getCoordinateBases (  )  const [virtual]

Return coordinate bases.

Array is of size dimension().

Implements Stokhos::ProductBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< const Teuchos::SerialDenseMatrix< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getDerivDoubleProductTensor (  )  const [virtual]

Compute double product tensor $B_{ij} = \langle \Psi_i D_v\Psi_j\rangle$ where $D_v\Psi_j$ represents the derivative of $\Psi_j$ in the direction $v$.

The definition of $v$ is defined by the deriv_coeffs constructor argument.

Implements Stokhos::DerivBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< const Stokhos::Dense3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getDerivTripleProductTensor (  )  const [virtual]

Compute triple product tensor $D_{ijk} = \langle\Psi_i\Psi_j D_v\Psi_k\rangle$ where $D_v\Psi_k$ represents the derivative of $\Psi_k$ in the direction $v$.

The definition of $v$ is defined by the deriv_coeffs constructor argument.

Implements Stokhos::DerivBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getIndex ( const Teuchos::Array< ordinal_type > &  term  )  const [virtual]

Get index of the multivariate polynomial given orders of each coordinate.

Given the array term storing $i_1,\dots,\i_d$, returns the index $i$ such that $\Psi_i(x) = \psi_{i_1}(x_1)\dots\psi_{i_d}(x_d)$.

Implements Stokhos::ProductBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getLowOrderTripleProductTensor ( ordinal_type  order  )  const [virtual]

The $(i,j,k)$ entry of the tensor $C_{ijk}$ is given by $C_{ijk} = \langle\Psi_i\Psi_j\Psi_k\rangle$ where $\Psi_l$ represents basis polynomial $l$ and $i,j=0,\dots,P$ where $P$ is size()-1 and $k=0,\dots,p$ where $p$ is the supplied order.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::Array< ordinal_type > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getTerm ( ordinal_type  i  )  const [virtual]

Get orders of each coordinate polynomial given an index i.

The returned array is of size $d$, where $d$ is the dimension of the basis, and entry $l$ is given by $i_l$ where $\Psi_i(x) = \psi_{i_1}(x_1)\dots\psi_{i_d}(x_d)$.

Implements Stokhos::ProductBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getTripleProductTensor (  )  const [virtual]

Compute triple product tensor.

The $(i,j,k)$ entry of the tensor $C_{ijk}$ is given by $C_{ijk} = \langle\Psi_i\Psi_j\Psi_k\rangle$ where $\Psi_l$ represents basis polynomial $l$ and $i,j,k=0,\dots,P$ where $P$ is size()-1 of the basis.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

template<typename ordinal_type, typename value_type>
const Teuchos::Array< value_type > & Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::norm_squared (  )  const [virtual]

Return array storing norm-squared of each basis polynomial.

Entry $l$ of returned array is given by $\langle\Psi_l^2\rangle$ for $l=0,\dots,P$ where $P$ is size()-1.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:25:04 2010 for Stokhos by  doxygen 1.4.7