10 std::shared_ptr<Quadrature>
const& rule,
12 order*Eigen::RowVectorXi::Ones(dim)){};
19 Eigen::RowVectorXi orders) :
Quadrature(rulesIn.size()),
22 for(
int i=0; i<
rules.size(); ++i)
23 assert(
rules.at(i)->Dim()==1);
27 assert(rulesIn.size()==orders.size());
39 assert(orders.size()==
dim);
41 Eigen::RowVectorXi tensorOrders(
dim);
44 std::vector<Eigen::MatrixXd> allPts(
dim);
45 std::vector<Eigen::VectorXd> allWts(
dim);
46 for(
int i = 0; i<
dim; ++i){
47 rules.at(i)->Compute(orders(i));
48 allPts.at(i) =
rules.at(i)->Points();
49 allWts.at(i) =
rules.at(i)->Weights();
51 tensorOrders(i) = allPts.at(i).cols()-1;
55 auto multis = MultiIndexFactory::CreateFullTensor(tensorOrders);
58 pts.resize(
dim,multis->Size());
59 wts = Eigen::VectorXd::Ones(multis->Size());
61 for(
int i=0; i<multis->Size(); ++i){
62 auto& multi = multis->IndexToMulti(i);
64 for(
int d=0; d<
dim; ++d){
65 wts(i) *= allWts.at(d)(multi->GetValue(d));
66 pts(d,i) = allPts.at(d)(0,multi->GetValue(d));
74 unsigned int maxOrder = 0;
75 for(
auto& rule :
rules)
76 maxOrder = std::max(maxOrder, rule->Exactness(quadOrder));
Multivariate quadrature rule defined by the tensor product of 1d rules.
virtual unsigned int Exactness(unsigned int quadOrder) const override
std::vector< std::shared_ptr< Quadrature > > rules
FullTensorQuadrature(unsigned int dim, std::shared_ptr< Quadrature > const &rules)
virtual void Compute(unsigned int order) override
Base class for multivariate quadrature rules. @detail An abstract class for computing nodes and weigh...