44#ifndef STOKHOS_PSEUDOSPECTRAL_ORTHOG_POLY_EXPANSION_HPP
45#define STOKHOS_PSEUDOSPECTRAL_ORTHOG_POLY_EXPANSION_HPP
50#include "Teuchos_RCP.hpp"
51#include "Teuchos_Array.hpp"
52#include "Teuchos_SerialDenseVector.hpp"
58 typename point_compare_type =
71 const Teuchos::RCP<Teuchos::ParameterList>&
params = Teuchos::null);
108 const value_type& b);
128 const value_type& b);
155 const value_type& b);
163 template <
typename FuncT>
164 void nary_op(
const FuncT& func,
168 template <
typename ExprT1,
typename ExprT2>
170 const ExprT2& b)
const;
172 template <
typename ExprT1,
typename ExprT2>
174 const ExprT2& b)
const;
190 Teuchos::RCP<const PseudoSpectralOperator<ordinal_type, value_type, point_compare_type> >
ps_op;
205 typedef Teuchos::SerialDenseVector<ordinal_type,value_type>
SDV;
214 Teuchos::Array< Teuchos::Array< SDV > >
navals;
222 template <
typename FuncT>
229 template <
typename FuncT>
237 template <
typename FuncT>
245 template <
typename FuncT>
250 const value_type& b);
255 value_type
operator() (
const value_type& a,
const value_type& b)
const {
261 value_type
operator() (
const value_type& a,
const value_type& b)
const {
280 return std::log10(a);
297 value_type
operator() (
const value_type& a,
const value_type& b)
const {
298 return std::pow(a,b);
357 value_type
operator() (
const value_type& a,
const value_type& b)
const {
358 return std::atan2(a,b);
364 return std::log(a+std::sqrt(a*a-value_type(1.0)));
370 return std::log(a+std::sqrt(a*a+value_type(1.0)));
376 return 0.5*std::log((value_type(1.0)+a)/(value_type(1.0)-a));
Class to store coefficients of a projection onto an orthogonal polynomial basis.
Abstract base class for multivariate orthogonal polynomials.
Base class for consolidating common expansion implementations.
Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > Cijk
Triple-product tensor.
Teuchos::RCP< Teuchos::ParameterList > params
Parameter list.
Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > basis
Basis.
An operator interface for building pseudo-spectral approximations.
Orthogonal polynomial expansions based on numerical quadrature.
SDV bvals
Temporary array for values of second argument at quad points.
Teuchos::Array< Teuchos::Array< SDV > > navals
Temporary array for values of n-ary arguments at quad points.
PseudoSpectralOrthogPolyExpansion & operator=(const PseudoSpectralOrthogPolyExpansion &b)
PseudoSpectralOrthogPolyExpansion(const PseudoSpectralOrthogPolyExpansion &)
void binary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
Nonlinear binary function.
value_type fast_compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
value_type compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
Teuchos::RCP< const PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > > ps_op
Pseudospectral operator.
SDV fvals
Temporary array for values of operation at quad points.
SDV avals
Temporary array for values of first argument at quad points.
void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
OrthogPolyExpansionBase< ordinal_type, value_type, node_type >::Cijk_type Cijk_type
Short-hand for Cijk.
bool use_quad_for_division
Use quadrature for division functions.
void unary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Nonlinear unary function.
void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void nary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > **a)
void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
ordinal_type sz
Expansions size.
Teuchos::SerialDenseVector< ordinal_type, value_type > SDV
Short-hand for SerialDenseVector.
virtual ~PseudoSpectralOrthogPolyExpansion()
Destructor.
bool use_quad_for_times
Use quadrature for times functions.
PseudoSpectralOrthogPolyExpansion(const Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > &basis, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk, const Teuchos::RCP< const PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > > &ps_op, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor.
ordinal_type nqp
Number of Quad points.
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
Top-level namespace for Stokhos classes and functions.
LexographicLess< TensorProductElement< ordinal_type, value_type >, FloatingPointLess< value_type > > type
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a, const value_type &b) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a, const value_type &b) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a, const value_type &b) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a) const
value_type operator()(const value_type &a, const value_type &b) const