MUQ  0.4.3
PCEFactory.h
Go to the documentation of this file.
1 #ifndef PCEFACTORY_H
2 #define PCEFACTORY_H
3 
7 
9 
10 #include "MUQ/Modeling/ModPiece.h"
11 
12 #include <boost/property_tree/ptree.hpp>
13 
14 namespace muq {
15 namespace Approximation {
16 
22  class PCEFactory {
23  public:
24 
25  PCEFactory(std::vector<std::shared_ptr<Quadrature>> const& quadTypesIn,
26  std::vector<std::shared_ptr<IndexedScalarBasis>> const& polyTypesIn);
27 
36  PCEFactory(std::vector<std::shared_ptr<Quadrature>> const& quadTypesIn,
37  std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders,
38  std::vector<std::shared_ptr<IndexedScalarBasis>> const& polyTypesIn);
39 
57  PCEFactory(std::vector<std::shared_ptr<Quadrature>> const& quadTypesIn,
58  std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders,
59  std::vector<std::shared_ptr<IndexedScalarBasis>> const& polyTypesIn,
60  std::shared_ptr<muq::Utilities::MultiIndexSet> const& polyMultisIn);
61 
62 
69  std::shared_ptr<PolynomialChaosExpansion> Compute(std::shared_ptr<muq::Modeling::ModPiece> const& model);
70 
71 
95  std::shared_ptr<PolynomialChaosExpansion> Compute(std::vector<Eigen::VectorXd> const& quadEvals);
96 
97  std::shared_ptr<PolynomialChaosExpansion> Compute(std::vector<std::reference_wrapper<const Eigen::VectorXd>> const& quadEvals);
98 
99  std::shared_ptr<PolynomialChaosExpansion> Compute(std::vector<Eigen::VectorXd> const& quadEvals,
100  std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders);
101 
102  std::shared_ptr<PolynomialChaosExpansion> Compute(std::vector<std::reference_wrapper<const Eigen::VectorXd>> const& quadEvals,
103  std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders);
107  std::vector<Eigen::VectorXd> const& QuadPts() const{return quadPts;};
108  std::vector<Eigen::VectorXd> const& QuadPts(std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders);
109 
110 
111  protected:
112 
113 
117  void Setup(std::shared_ptr<muq::Utilities::MultiIndex> const& quadOrders);
118 
119  std::shared_ptr<muq::Utilities::MultiIndex> quadOrdersCache;
120 
121 
122  std::vector<std::shared_ptr<Quadrature>> quadTypes;
123  std::vector<std::shared_ptr<IndexedScalarBasis>> polyTypes;
125 
126  std::shared_ptr<muq::Utilities::MultiIndexSet> polyMultis;
127 
128  std::vector<Eigen::VectorXd> quadPts;
129  Eigen::VectorXd quadWts;
130 
131  };
132 
133 }
134 }
135 
136 
137 
138 
139 #endif // PCEFACTORY_H
Multivariate quadrature rule defined by the tensor product of 1d rules.
Factory class for constructing a pseudo-spectral polynomial chaos approximation using a fixed quadrat...
Definition: PCEFactory.h:22
std::shared_ptr< muq::Utilities::MultiIndex > quadOrdersCache
Definition: PCEFactory.h:119
FullTensorQuadrature tensQuad
Definition: PCEFactory.h:124
PCEFactory(std::vector< std::shared_ptr< Quadrature >> const &quadTypesIn, std::vector< std::shared_ptr< IndexedScalarBasis >> const &polyTypesIn)
Definition: PCEFactory.cpp:9
std::vector< Eigen::VectorXd > const & QuadPts() const
Definition: PCEFactory.h:107
void Setup(std::shared_ptr< muq::Utilities::MultiIndex > const &quadOrders)
Definition: PCEFactory.cpp:30
std::vector< Eigen::VectorXd > quadPts
Definition: PCEFactory.h:128
std::shared_ptr< PolynomialChaosExpansion > Compute(std::shared_ptr< muq::Modeling::ModPiece > const &model)
Definition: PCEFactory.cpp:65
std::vector< std::shared_ptr< Quadrature > > quadTypes
Definition: PCEFactory.h:122
std::shared_ptr< muq::Utilities::MultiIndexSet > polyMultis
Definition: PCEFactory.h:126
std::vector< std::shared_ptr< IndexedScalarBasis > > polyTypes
Definition: PCEFactory.h:123