56 template <
typename ordinal_type,
typename value_type>
71 basis = basisParams.template get< Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type,value_type> > >(
"Stochastic Galerkin Basis");
74 basisParams.
set(
"Stochastic Galerkin Basis", basis);
80 Cijk = sgParams.template get<Teuchos::RCP<const Stokhos::Sparse3Tensor<ordinal_type,value_type> > >(
"Triple Product Tensor");
82 std::string tp_type = sgParams.
get(
"Triple Product Size",
"Full");
84 tp_type !=
"Full" && tp_type !=
"Linear",
86 std::endl <<
"Invalid triple product expansion type " << tp_type <<
89 if (tp_type ==
"Full")
90 Cijk = basis->computeTripleProductTensor();
92 Cijk = basis->computeLinearTripleProductTensor();
94 sgParams.
set(
"Triple Product Tensor", Cijk);
98 std::string exp_type = expParams.
get(
"Type",
"Algebraic");
99 if (exp_type ==
"Algebraic")
103 else if (exp_type ==
"Quadrature") {
107 quad = quadParams.template get<Teuchos::RCP<const Stokhos::Quadrature<ordinal_type,value_type> > >(
"Stochastic Galerkin Quadrature");
111 quadParams.
set(
"Stochastic Galerkin Quadrature", quad);
117 else if (exp_type ==
"For UQTK") {
118 #ifdef HAVE_STOKHOS_FORUQTK
119 typename Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>::EXPANSION_METHOD method =
120 expParams.
get(
"ForUQTK Expansion Method",
121 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>::TAYLOR);
124 Teuchos::rcp(
new Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type,value_type>(basis, Cijk, method, rtol));
128 "Error! Stokhos::ExpansionFactory::create(): " <<
129 "ForUQTK expansion requires ForUQTK!" << std::endl);
157 else if (exp_type ==
"Pseudospectral") {
160 sgParams.
sublist(
"Pseudospectral Operator");
163 "Stochastic Galerkin Pseudospectral Operator"))
164 psop = psopParams.template get<Teuchos::RCP<const psop_type> >(
165 "Stochastic Galerkin Pseudospectral Operator");
169 psopParams.
set(
"Stochastic Galerkin Pseudospectral Operator", psop);
178 "Error! Stokhos::ExpansionFactory::create(): " <<
179 "Invalid expansion type " << exp_type << std::endl);
181 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)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#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="")
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.