51 template <
typename ordinal_type,
typename value_type>
52 Teuchos::RCP<const typename Stokhos::PseudoSpectralOperatorFactory<ordinal_type, value_type>::psop_type>
54 create(Teuchos::ParameterList& sgParams)
57 Teuchos::ParameterList& psopParams =
58 sgParams.sublist(
"Pseudospectral Operator");
59 Teuchos::RCP<const psop_type> psop =
60 psopParams.template get< Teuchos::RCP<const psop_type> >(
"Stochastic Galerkin Pseudospectral Operator", Teuchos::null);
61 if (psop != Teuchos::null)
65 Teuchos::ParameterList& basisParams = sgParams.sublist(
"Basis");
66 Teuchos::RCP< const OrthogPolyBasis<ordinal_type,value_type> > basis;
68 basis = basisParams.template get< Teuchos::RCP<const OrthogPolyBasis<ordinal_type,value_type> > >(
"Stochastic Galerkin Basis");
73 std::string type = psopParams.get(
"Type",
"Tensor Product");
75 if (type ==
"Tensor Product") {
76 bool use_pst = psopParams.get(
"Use PST",
false);
82 else if (type ==
"Smolyak") {
83 bool use_pst = psopParams.get(
"Use PST",
true);
84 bool use_smolyak = psopParams.get(
"Use Smolyak Apply",
true);
88 *smolyak_basis, use_smolyak, use_pst));
91 else if (type ==
"Quadrature") {
92 Teuchos::ParameterList& quadParams = sgParams.sublist(
"Quadrature");
93 Teuchos::RCP<const Stokhos::Quadrature<ordinal_type,value_type> > quad;
95 quad = quadParams.template get<Teuchos::RCP<const Stokhos::Quadrature<ordinal_type,value_type> > >(
"Stochastic Galerkin Quadrature");
99 quadParams.set(
"Stochastic Galerkin Quadrature", quad);
106 TEUCHOS_TEST_FOR_EXCEPTION(
107 true, Teuchos::Exceptions::InvalidParameter,
109 "Invalid pseudospectral operator type " << type << std::endl);
111 psopParams.set(
"Stochastic Galerkin Pseudospectral Operator", psop);
static Teuchos::RCP< const psop_type > create(Teuchos::ParameterList &sgParams)
Generate pseudospectral operator object.
Abstract base class for multivariate orthogonal polynomials.
Abstract base class for quadrature methods.
An operator for building pseudo-spectral coefficients using a sparse Smolyak construction.
Abstract base class for multivariate orthogonal polynomials generated from tensor products of univari...
Multivariate orthogonal polynomial basis generated from a Smolyak sparse grid.
Factory for building multivariate orthogonal polynomial bases.
An operator for building pseudo-spectral coefficients using tensor-product quadrature.
static Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > create(Teuchos::ParameterList &sgParams)
Generate quadrature object.
An operator for building pseudo-spectral coefficients using an arbitrary quadrature rule...