56 template <
typename ordinal_type,
typename value_type>
64 if (expansion != Teuchos::null)
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);