Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
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]

Public Member Functions

 CompletePolynomialBasis (const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const value_type &sparse_tol=1.0e-12, bool use_old_cijk_alg=false, const Teuchos::RCP< Teuchos::Array< value_type > > &deriv_coeffs=Teuchos::null)
 Constructor. More...
 
virtual ~CompletePolynomialBasis ()
 Destructor. More...
 
- Public Member Functions inherited from Stokhos::ProductBasis< ordinal_type, value_type >
 ProductBasis ()
 Constructor. More...
 
virtual ~ProductBasis ()
 Destructor. More...
 
- Public Member Functions inherited from Stokhos::OrthogPolyBasis< ordinal_type, value_type >
 OrthogPolyBasis ()
 Constructor. More...
 
virtual ~OrthogPolyBasis ()
 Destructor. More...
 
- Public Member Functions inherited from Stokhos::DerivBasis< ordinal_type, value_type >
 DerivBasis ()
 Constructor. More...
 
virtual ~DerivBasis ()
 Destructor. More...
 

Protected Types

typedef
Stokhos::CompletePolynomialBasisUtils
< ordinal_type, value_type > 
CPBUtils
 
typedef Stokhos::Sparse3Tensor
< ordinal_type, value_type > 
Cijk_type
 Short-hand for Cijk. More...
 

Protected Member Functions

virtual Teuchos::RCP
< Stokhos::Sparse3Tensor
< ordinal_type, value_type > > 
computeTripleProductTensorOld (ordinal_type order) const
 Compute triple product tensor using old algorithm. More...
 
virtual Teuchos::RCP
< Stokhos::Sparse3Tensor
< ordinal_type, value_type > > 
computeTripleProductTensorNew (ordinal_type order) const
 Compute triple product tensor using new algorithm. More...
 

Protected Attributes

std::string name
 Name of basis. More...
 
ordinal_type p
 Total order of basis. More...
 
ordinal_type d
 Total dimension of basis. More...
 
ordinal_type sz
 Total size of basis. More...
 
Teuchos::Array< Teuchos::RCP
< const OneDOrthogPolyBasis
< ordinal_type, value_type > > > 
bases
 Array of bases. More...
 
Teuchos::Array< ordinal_type > basis_orders
 Array storing order of each basis. More...
 
value_type sparse_tol
 Tolerance for computing sparse Cijk. More...
 
bool use_old_cijk_alg
 Use old algorithm for computing Cijk. More...
 
Teuchos::RCP< Teuchos::Array
< value_type > > 
deriv_coeffs
 Coefficients for derivative. More...
 
Teuchos::Array< value_type > norms
 Norms. More...
 
Teuchos::Array< MultiIndex
< ordinal_type > > 
terms
 2-D array of basis terms More...
 
Teuchos::Array< ordinal_type > num_terms
 Number of terms up to each order. More...
 
Teuchos::Array< Teuchos::Array
< value_type > > 
basis_eval_tmp
 Temporary array used in basis evaluation. More...
 

Private Member Functions

 CompletePolynomialBasis (const CompletePolynomialBasis &)
 
CompletePolynomialBasisoperator= (const CompletePolynomialBasis &b)
 

Implementation of Stokhos::OrthogPolyBasis methods

ordinal_type order () const
 Return order of basis. More...
 
ordinal_type dimension () const
 Return dimension of basis. More...
 
virtual ordinal_type size () const
 Return total size of basis. More...
 
virtual const Teuchos::Array
< value_type > & 
norm_squared () const
 Return array storing norm-squared of each basis polynomial. More...
 
virtual const value_type & norm_squared (ordinal_type i) const
 Return norm squared of basis polynomial i. More...
 
virtual Teuchos::RCP
< Stokhos::Sparse3Tensor
< ordinal_type, value_type > > 
computeTripleProductTensor () const
 Compute triple product tensor. More...
 
virtual Teuchos::RCP
< Stokhos::Sparse3Tensor
< ordinal_type, value_type > > 
computeLinearTripleProductTensor () const
 Compute linear triple product tensor where k = 0,1,..,d. More...
 
virtual value_type evaluateZero (ordinal_type i) const
 Evaluate basis polynomial i at zero. More...
 
virtual void evaluateBases (const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
 Evaluate basis polynomials at given point point. More...
 
virtual void print (std::ostream &os) const
 Print basis to stream os. More...
 
virtual const std::string & getName () const
 Return string name of basis. More...
 

Implementation of Stokhos::ProductBasis methods

virtual const MultiIndex
< ordinal_type > & 
term (ordinal_type i) const
 Get orders of each coordinate polynomial given an index i. More...
 
virtual ordinal_type index (const MultiIndex< ordinal_type > &term) const
 Get index of the multivariate polynomial given orders of each coordinate. More...
 
Teuchos::Array< Teuchos::RCP
< const OneDOrthogPolyBasis
< ordinal_type, value_type > > > 
getCoordinateBases () const
 Return coordinate bases. More...
 
virtual MultiIndex< ordinal_type > getMaxOrders () const
 Return maximum order allowable for each coordinate basis. More...
 

Implementation of Stokhos::DerivBasis methods

virtual Teuchos::RCP
< Stokhos::Dense3Tensor
< ordinal_type, value_type > > 
computeDerivTripleProductTensor (const Teuchos::RCP< const Teuchos::SerialDenseMatrix< ordinal_type, value_type > > &Bij, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk) 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$. More...
 
virtual Teuchos::RCP
< Teuchos::SerialDenseMatrix
< ordinal_type, value_type > > 
computeDerivDoubleProductTensor () 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$. More...
 

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$.

Definition at line 72 of file Stokhos_CompletePolynomialBasis.hpp.

Member Typedef Documentation

template<typename ordinal_type, typename value_type>
typedef Stokhos::CompletePolynomialBasisUtils<ordinal_type,value_type> Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::CPBUtils
protected

Definition at line 245 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
typedef Stokhos::Sparse3Tensor<ordinal_type, value_type> Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::Cijk_type
protected

Short-hand for Cijk.

Definition at line 287 of file Stokhos_CompletePolynomialBasis.hpp.

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-12,
bool  use_old_cijk_alg = false,
const Teuchos::RCP< Teuchos::Array< value_type > > &  deriv_coeffs = Teuchos::null 
)

Constructor.

Parameters
basesarray of 1-D coordinate bases
sparse_toltolerance used to drop terms in sparse triple-product tensors
use_old_cijk_alguse old algorithm for computing the sparse triple product tensor (significantly slower, but simpler)
deriv_coeffsdirection used to define derivatives for derivative product tensors. Defaults to all one's if not supplied.

Definition at line 45 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::~CompletePolynomialBasis ( )
virtual

Destructor.

Definition at line 103 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type>
Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::CompletePolynomialBasis ( const CompletePolynomialBasis< ordinal_type, value_type > &  )
private

Member Function Documentation

template<typename ordinal_type , typename value_type >
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::order ( ) const
virtual

Return order of basis.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 110 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::dimension ( ) const
virtual

Return dimension of basis.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 118 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::size ( ) const
virtual

Return total size of basis.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 126 of file Stokhos_CompletePolynomialBasisImp.hpp.

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 >.

Definition at line 134 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
const value_type & Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::norm_squared ( ordinal_type  i) const
virtual

Return norm squared of basis polynomial i.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 142 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::computeTripleProductTensor ( ) 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.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 150 of file Stokhos_CompletePolynomialBasisImp.hpp.

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

Compute linear triple product tensor where k = 0,1,..,d.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 164 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
value_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::evaluateZero ( ordinal_type  i) const
virtual

Evaluate basis polynomial i at zero.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 451 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type>
void Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::evaluateBases ( const Teuchos::ArrayView< const 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 >.

Definition at line 465 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
void Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::print ( std::ostream &  os) const
virtual

Print basis to stream os.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 483 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
const std::string & Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getName ( ) const
virtual

Return string name of basis.

Implements Stokhos::OrthogPolyBasis< ordinal_type, value_type >.

Definition at line 514 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
const Stokhos::MultiIndex< ordinal_type > & Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::term ( 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 >.

Definition at line 498 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::index ( const MultiIndex< 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 >.

Definition at line 506 of file Stokhos_CompletePolynomialBasisImp.hpp.

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 >.

Definition at line 522 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
Stokhos::MultiIndex< ordinal_type > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::getMaxOrders ( ) const
virtual

Return maximum order allowable for each coordinate basis.

Implements Stokhos::ProductBasis< ordinal_type, value_type >.

Definition at line 530 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< Stokhos::Dense3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::computeDerivTripleProductTensor ( const Teuchos::RCP< const Teuchos::SerialDenseMatrix< ordinal_type, value_type > > &  Bij,
const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &  Cijk 
) 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 >.

Definition at line 377 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type , typename value_type >
Teuchos::RCP< Teuchos::SerialDenseMatrix< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::computeDerivDoubleProductTensor ( ) 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 >.

Definition at line 414 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::computeTripleProductTensorOld ( ordinal_type  order) const
protectedvirtual

Compute triple product tensor using old algorithm.

Definition at line 178 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type >
Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::computeTripleProductTensorNew ( ordinal_type  order) const
protectedvirtual

Compute triple product tensor using new algorithm.

Definition at line 209 of file Stokhos_CompletePolynomialBasisImp.hpp.

template<typename ordinal_type, typename value_type>
CompletePolynomialBasis& Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::operator= ( const CompletePolynomialBasis< ordinal_type, value_type > &  b)
private

Member Data Documentation

template<typename ordinal_type, typename value_type>
std::string Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::name
protected

Name of basis.

Definition at line 248 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::p
protected

Total order of basis.

Definition at line 251 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::d
protected

Total dimension of basis.

Definition at line 254 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
ordinal_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::sz
protected

Total size of basis.

Definition at line 257 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array< Teuchos::RCP<const OneDOrthogPolyBasis<ordinal_type, value_type> > > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::bases
protected

Array of bases.

Definition at line 260 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array<ordinal_type> Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::basis_orders
protected

Array storing order of each basis.

Definition at line 263 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
value_type Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::sparse_tol
protected

Tolerance for computing sparse Cijk.

Definition at line 266 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
bool Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::use_old_cijk_alg
protected

Use old algorithm for computing Cijk.

Definition at line 269 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::RCP< Teuchos::Array<value_type> > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::deriv_coeffs
protected

Coefficients for derivative.

Definition at line 272 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array<value_type> Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::norms
protected

Norms.

Definition at line 275 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array< MultiIndex<ordinal_type> > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::terms
protected

2-D array of basis terms

Definition at line 278 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array<ordinal_type> Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::num_terms
protected

Number of terms up to each order.

Definition at line 281 of file Stokhos_CompletePolynomialBasis.hpp.

template<typename ordinal_type, typename value_type>
Teuchos::Array< Teuchos::Array<value_type> > Stokhos::CompletePolynomialBasis< ordinal_type, value_type >::basis_eval_tmp
mutableprotected

Temporary array used in basis evaluation.

Definition at line 284 of file Stokhos_CompletePolynomialBasis.hpp.


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