51template <
typename ordinal_type,
typename value_type>
52Teuchos::RCP<const typename Stokhos::PseudoSpectralOperatorFactory<ordinal_type, value_type>::psop_type>
54create(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;
73 std::string type = psopParams.get(
"Type",
"Tensor Product");
75 if (type ==
"Tensor Product") {
76 bool use_pst = psopParams.get(
"Use PST",
false);
77 Teuchos::RCP<const ProductBasis<ordinal_type,value_type> > product_basis = Teuchos::rcp_dynamic_cast<const ProductBasis<ordinal_type,value_type> >(basis,
true);
82 else if (type ==
"Smolyak") {
83 bool use_pst = psopParams.get(
"Use PST",
true);
84 bool use_smolyak = psopParams.get(
"Use Smolyak Apply",
true);
85 Teuchos::RCP<const SmolyakBasis<ordinal_type,value_type> > smolyak_basis = Teuchos::rcp_dynamic_cast<const SmolyakBasis<ordinal_type,value_type> >(basis,
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);
Factory for building multivariate orthogonal polynomial bases.
Abstract base class for multivariate orthogonal polynomials.
static Teuchos::RCP< const psop_type > create(Teuchos::ParameterList &sgParams)
Generate pseudospectral operator object.
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.
Abstract base class for quadrature methods.
An operator for building pseudo-spectral coefficients using a sparse Smolyak construction.
An operator for building pseudo-spectral coefficients using tensor-product quadrature.