Factory class for constructing a pseudo-spectral polynomial chaos approximation using a fixed quadrature rule. More...
#include <PCEFactory.h>
Factory class for constructing a pseudo-spectral polynomial chaos approximation using a fixed quadrature rule.
Definition at line 22 of file PCEFactory.h.
Public Member Functions | |
PCEFactory (std::vector< std::shared_ptr< Quadrature >> const &quadTypesIn, std::vector< std::shared_ptr< IndexedScalarBasis >> const &polyTypesIn) | |
PCEFactory (std::vector< std::shared_ptr< Quadrature >> const &quadTypesIn, std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders, std::vector< std::shared_ptr< IndexedScalarBasis >> const &polyTypesIn) | |
PCEFactory (std::vector< std::shared_ptr< Quadrature >> const &quadTypesIn, std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders, std::vector< std::shared_ptr< IndexedScalarBasis >> const &polyTypesIn, std::shared_ptr< muq::Utilities::MultiIndexSet > const &polyMultisIn) | |
std::shared_ptr< PolynomialChaosExpansion > | Compute (std::shared_ptr< muq::Modeling::ModPiece > const &model) |
std::shared_ptr< PolynomialChaosExpansion > | Compute (std::vector< Eigen::VectorXd > const &quadEvals) |
std::shared_ptr< PolynomialChaosExpansion > | Compute (std::vector< std::reference_wrapper< const Eigen::VectorXd >> const &quadEvals) |
std::shared_ptr< PolynomialChaosExpansion > | Compute (std::vector< Eigen::VectorXd > const &quadEvals, std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders) |
std::shared_ptr< PolynomialChaosExpansion > | Compute (std::vector< std::reference_wrapper< const Eigen::VectorXd >> const &quadEvals, std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders) |
std::vector< Eigen::VectorXd > const & | QuadPts () const |
std::vector< Eigen::VectorXd > const & | QuadPts (std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders) |
PCEFactory::PCEFactory | ( | std::vector< std::shared_ptr< Quadrature >> const & | quadTypesIn, |
std::vector< std::shared_ptr< IndexedScalarBasis >> const & | polyTypesIn | ||
) |
Definition at line 9 of file PCEFactory.cpp.
References quadTypes.
PCEFactory::PCEFactory | ( | std::vector< std::shared_ptr< Quadrature >> const & | quadTypesIn, |
std::shared_ptr< muq::Utilities::MultiIndex > const & | quadOrders, | ||
std::vector< std::shared_ptr< IndexedScalarBasis >> const & | polyTypesIn | ||
) |
Constructs a factory using a prespecified tensor product quadrature rule. The terms in the polynomial expansion are chosen from the quadrature rule. Polynomial terms that can be integrated exactly are used.
[in] | quadTypesIn | A vector of one dimensional quadrature rules for each input dimension. |
[in] | quadOrders | A multiindex holding the quadrature order in each direction. |
[in] | polyTypesIn | A vector of one dimensional polynomial families used to define the multivariate polynomials used in a PCE expansion. |
Definition at line 19 of file PCEFactory.cpp.
References Setup().
PCEFactory::PCEFactory | ( | std::vector< std::shared_ptr< Quadrature >> const & | quadTypesIn, |
std::shared_ptr< muq::Utilities::MultiIndex > const & | quadOrders, | ||
std::vector< std::shared_ptr< IndexedScalarBasis >> const & | polyTypesIn, | ||
std::shared_ptr< muq::Utilities::MultiIndexSet > const & | polyMultisIn | ||
) |
Constructs a factory using a tensor product quadrature rule and independently specified polynomial terms. This allows users to employ the "classic" pseudo-spectral approach for computing polynomial chaos expansion. Coefficients for each terms defined in polyTypesIn will be computed using the quadrature rule defined by the tensor product quadrature rule defined by quadTypesIn and quadOrders. Note that you should carefully choose polyMultisIn and quadTypesIn because significant approximation errors can arise if terms in the polynomial approximation cannot be integrated exactly by the quadrature rule.
[in] | quadTypesIn | A vector of one dimensional quadrature rules for each input dimension. |
[in] | quadOrders | A multiindex holding the quadrature order in each direction. |
[in] | polyTypesIn | A vector of one dimensional polynomial families used to define the multivariate polynomials used in a PCE expansion. |
[in] | polyMultisIn | A multindex set defining the polynomial expansion this factory should generate. |
Definition at line 56 of file PCEFactory.cpp.
References polyMultis, and Setup().
std::shared_ptr< PolynomialChaosExpansion > PCEFactory::Compute | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | model | ) |
Computes a polynomial chaos approximation to the given model.
[in] | model | A ModPiece implementing the model we wish to approximate. |
Definition at line 65 of file PCEFactory.cpp.
References nlohmann::detail::dtoa_impl::k, and quadPts.
Referenced by Compute(), and muq::Approximation::AdaptiveSmolyakPCE::ComputeOneTerm().
std::shared_ptr< PolynomialChaosExpansion > PCEFactory::Compute | ( | std::vector< Eigen::VectorXd > const & | quadEvals | ) |
Computes a polynomial chaos approximation using evaluations of the model at the quadrature points returned by PCEFactory::QuadPts. In most cases, it is preferrable to call the Compute function with ModPiece argument, which will help avoid potential issues matching the model evaluation points with the quadrature points. However, in some cases (e.g., when parallel model evaluations used) it is advantageous to manually compute the model evaluations and compute the expansion with this function. This function is typically used in a workflow like the following code snippet:
Definition at line 93 of file PCEFactory.cpp.
References Compute().
std::shared_ptr< PolynomialChaosExpansion > PCEFactory::Compute | ( | std::vector< Eigen::VectorXd > const & | quadEvals, |
std::shared_ptr< muq::Utilities::MultiIndex > const & | quadOrders | ||
) |
Definition at line 79 of file PCEFactory.cpp.
std::shared_ptr< PolynomialChaosExpansion > PCEFactory::Compute | ( | std::vector< std::reference_wrapper< const Eigen::VectorXd >> const & | quadEvals | ) |
Definition at line 102 of file PCEFactory.cpp.
References nlohmann::detail::dtoa_impl::k, polyMultis, polyTypes, quadPts, and quadWts.
std::shared_ptr< PolynomialChaosExpansion > PCEFactory::Compute | ( | std::vector< std::reference_wrapper< const Eigen::VectorXd >> const & | quadEvals, |
std::shared_ptr< muq::Utilities::MultiIndex > const & | quadOrders | ||
) |
Definition at line 86 of file PCEFactory.cpp.
|
inline |
Returns the quadrature points in the tensor product quadrature rule.
Definition at line 107 of file PCEFactory.h.
References quadPts.
Referenced by muq::Approximation::AdaptiveSmolyakPCE::OneTermPoints(), and QuadPts().
std::vector< Eigen::VectorXd > const & PCEFactory::QuadPts | ( | std::shared_ptr< muq::Utilities::MultiIndex > const & | quadOrders | ) |
Definition at line 125 of file PCEFactory.cpp.
|
protected |
Sets up the tensor product quadrature and polynomial expansions based on the specified quadrature order.
Definition at line 30 of file PCEFactory.cpp.
References muq::Approximation::FullTensorQuadrature::Compute(), muq::Approximation::Quadrature::Points(), polyMultis, quadOrdersCache, quadPts, quadTypes, quadWts, tensQuad, and muq::Approximation::Quadrature::Weights().
Referenced by Compute(), PCEFactory(), and QuadPts().
|
protected |
Definition at line 126 of file PCEFactory.h.
Referenced by Compute(), PCEFactory(), and Setup().
|
protected |
Definition at line 123 of file PCEFactory.h.
Referenced by Compute().
|
protected |
Definition at line 119 of file PCEFactory.h.
Referenced by Setup().
|
protected |
Definition at line 128 of file PCEFactory.h.
|
protected |
Definition at line 122 of file PCEFactory.h.
Referenced by PCEFactory(), and Setup().
|
protected |
Definition at line 129 of file PCEFactory.h.
|
protected |
Definition at line 124 of file PCEFactory.h.
Referenced by Setup().