10 #include "../types.hpp" 16 namespace innerproducts {
24 template <
class... RULES>
27 static const dim_t D =
sizeof...(RULES);
29 using NodeMatrix = Eigen::Matrix<real_t,D,Eigen::Dynamic>;
41 for(
auto n_nodes : { RULES::number_nodes() ... })
70 static std::tuple<NodeMatrix,WeightVector>
99 cached_nodes.resize(dim, n_nodes);
100 cached_weights.resize(1, n_nodes);
101 cached_weights.setOnes();
103 const dim_t sizes[
D] = { RULES::number_nodes() ...};
106 for(
dim_t d = D-2; d >= 0; --d)
108 cycles[d] = cycles[d+1] * sizes[d+1];
114 for(
auto nw : { RULES::nodes_and_weights() ... })
116 for(
dim_t n = 0; n < n_nodes; ++n)
118 const dim_t base_idx = (n / cycles[d]) % sizes[d];
131 template <
class... RULES>
134 template <
class... RULES>
138 template <
class... RULES>
Definition: coefficients_file_parser.cpp:10
static dim_t number_nodes()
Return the number of nodes for the given order.
Definition: tensor_product_qr.hpp:38
static void clear_cache()
Free the precalculated nodes and weights.
Definition: tensor_product_qr.hpp:80
static bool cached
Definition: tensor_product_qr.hpp:88
static const dim_t D
Definition: tensor_product_qr.hpp:27
static WeightVector cached_weights
Definition: tensor_product_qr.hpp:90
static std::tuple< NodeMatrix, WeightVector > nodes_and_weights()
Return the quadrature nodes and weights.
Definition: tensor_product_qr.hpp:71
static NodeMatrix cached_nodes
Definition: tensor_product_qr.hpp:89
static void calculate_nodes_and_weights()
Precalculate nodes and weights.
Definition: tensor_product_qr.hpp:95
static NodeMatrix nodes()
Return the quadrature nodes.
Definition: tensor_product_qr.hpp:51
static WeightVector weights()
Return the quadrature weights.
Definition: tensor_product_qr.hpp:61
Eigen::Matrix< real_t, 1, Eigen::Dynamic > WeightVector
Definition: tensor_product_qr.hpp:30
int dim_t
Definition: types.hpp:16
Structure providing weighted nodes for Tensor Product quadrature.
Definition: tensor_product_qr.hpp:25
Eigen::Matrix< real_t, D, Eigen::Dynamic > NodeMatrix
Definition: tensor_product_qr.hpp:29