6 #ifndef QUADRATURERULE_HPP
7 #define QUADRATURERULE_HPP
45 template<
typename CellType>
requires(CellType::cell_dim == 1)
46 QuadratureRule<CellType::cell_dim> generate_quadrature_rule(const CellType &f , const
int doe )
48 auto const &T = f.get_reference_elem();
50 for (
auto const & trig : T) {
51 double v = trig[1](0) - trig[0](0);
52 double x0 = trig[0](0);
54 for (
size_t iqn = 0; iqn < rule.npts(); ++iqn) {
55 Eigen::Vector<double,1> vect = Eigen::Vector<double,1>{rule.tq(iqn)*v + x0};
56 quad.push_back({vect,rule.wq(iqn)});
64 template<
typename CellType>
requires(CellType::cell_dim == 2)
65 QuadratureRule<CellType::cell_dim> generate_quadrature_rule(const CellType &f , const
int doe )
67 QuadRuleTriangle quadCell(std::max(doe,0));
68 QuadratureRule<2> quad;
70 auto const &T = f.get_reference_elem();
71 for (
auto const & trig : T) {
72 double xTt[] = {trig[0](0),trig[1](0),trig[2](0)};
73 double yTt[] = {trig[0](1),trig[1](1),trig[2](1)};
74 quadCell.setup(xTt, yTt);
75 for (
size_t iqn = 0; iqn < quadCell.nq(); iqn++) {
76 quad.push_back({Eigen::Vector2d{quadCell.xq(iqn), quadCell.yq(iqn)}, quadCell.wq(iqn)});
Compute the number of node, their location and the associated weight for a given degree of exactness.
Definition: legendregauss.hpp:17
Store the geometrical description of each cell and their topological relations.
requires(d > 0 &&d<=dimension) struct dCell_mass
Compute the mass matrices of a d-cell.
Definition: dcell_integral.hpp:17
std::vector< QuadratureNode< d > > QuadratureRule
Vector of locations and weights.
Definition: quadraturerule.hpp:41
constexpr int QuadratureMaxDegree[]
Maximum degree of quadrature implemented for each dimension (start with dimension 1)
Definition: quadraturerule.hpp:27
Definition: maxwell.hpp:23
Description of one node and one weight from a quadrature rule.
Definition: quadraturerule.hpp:33
Eigen::Vector< double, d > vector
Definition: quadraturerule.hpp:34
double w
Definition: quadraturerule.hpp:35