22 template <
typename ordinal_type,
typename value_type>
37 basis = basisParams.template get< Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type,value_type> > >(
"Stochastic Galerkin Basis");
40 basisParams.
set(
"Stochastic Galerkin Basis", basis);
46 Cijk = sgParams.template get<Teuchos::RCP<const Stokhos::Sparse3Tensor<ordinal_type,value_type> > >(
"Triple Product Tensor");
48 std::string tp_type = sgParams.
get(
"Triple Product Size",
"Full");
50 tp_type !=
"Full" && tp_type !=
"Linear",
52 std::endl <<
"Invalid triple product expansion type " << tp_type <<
55 if (tp_type ==
"Full")
56 Cijk = basis->computeTripleProductTensor();
58 Cijk = basis->computeLinearTripleProductTensor();
60 sgParams.
set(
"Triple Product Tensor", Cijk);
64 std::string exp_type = expParams.
get(
"Type",
"Algebraic");
65 if (exp_type ==
"Algebraic")
69 else if (exp_type ==
"Quadrature") {
73 quad = quadParams.template get<Teuchos::RCP<const Stokhos::Quadrature<ordinal_type,value_type> > >(
"Stochastic Galerkin Quadrature");
77 quadParams.
set(
"Stochastic Galerkin Quadrature", quad);
83 else if (exp_type ==
"For UQTK") {
84 #ifdef HAVE_STOKHOS_FORUQTK
85 typename Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>::EXPANSION_METHOD method =
86 expParams.
get(
"ForUQTK Expansion Method",
87 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>::TAYLOR);
90 Teuchos::rcp(
new Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>(basis, Cijk, method, rtol));
94 "Error! Stokhos::ExpansionFactory::create(): " <<
95 "ForUQTK expansion requires ForUQTK!" << std::endl);
123 else if (exp_type ==
"Pseudospectral") {
126 sgParams.
sublist(
"Pseudospectral Operator");
129 "Stochastic Galerkin Pseudospectral Operator"))
130 psop = psopParams.template get<Teuchos::RCP<const psop_type> >(
131 "Stochastic Galerkin Pseudospectral Operator");
135 psopParams.
set(
"Stochastic Galerkin Pseudospectral Operator", psop);
144 "Error! Stokhos::ExpansionFactory::create(): " <<
145 "Invalid expansion type " << exp_type << std::endl);
147 expParams.
set(
"Stochastic Galerkin Expansion", expansion);
static Teuchos::RCP< const psop_type > create(Teuchos::ParameterList &sgParams)
Generate pseudospectral operator object.
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
T & get(ParameterList &l, const std::string &name)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
An operator interface for building pseudo-spectral approximations.
RCP< ParameterList > sublist(const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Orthogonal polynomial expansions limited to algebraic operations.
static Teuchos::RCP< Stokhos::OrthogPolyExpansion< ordinal_type, value_type > > create(Teuchos::ParameterList &sgParams)
Generate multivariate expansion.
Abstract base class for multivariate orthogonal polynomials.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Abstract base class for quadrature methods.
static Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > create(Teuchos::ParameterList &sgParams)
Generate multivariate basis.
static Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > create(Teuchos::ParameterList &sgParams)
Generate quadrature object.
Orthogonal polynomial expansions based on numerical quadrature.
Orthogonal polynomial expansions based on numerical quadrature.