19 #include "libmesh/quadrature_gm.h"
20 #include "libmesh/quadrature_gauss.h"
21 #include "libmesh/enum_quadrature_type.h"
22 #include "libmesh/int_range.h"
58 const unsigned int degree = 2*s+1;
64 const unsigned int n_pts =
dim==2 ? (s+3)*(s+2)*(s+1) / 6 : (s+4)*(s+3)*(s+2)*(s+1) / 24;
75 std::vector<std::vector<unsigned int>> permutations;
81 for (
unsigned int i=0; i<=s; ++i)
92 for (
unsigned int j=0; j<
dim; ++j)
94 static_cast<Real>(2.*permutations[p][j] + 1.) /
95 static_cast<Real>( degree +
dim - 2.*i );
105 const unsigned int weight_loop_index =
106 std::max(
dim, std::max(degree, degree+
dim-i))+1;
108 for (
unsigned int j=1; j<weight_loop_index; ++j)
111 weight *= static_cast<Real>(degree+
dim-2*i);
117 weight /= static_cast<Real>(j);
119 if (j <= degree+
dim-i)
120 weight /= static_cast<Real>(j);
131 offset += permutations.size();
152 std::vector<std::vector<unsigned int>> & result)
159 std::vector<unsigned int> workspace(p);
163 result.push_back(workspace);
166 unsigned int head_value=s;
175 while (workspace.back() != s)
187 head_value = workspace[head_index];
191 workspace[head_index] = 0;
196 libmesh_assert_greater (head_value, 0);
197 workspace[0] = head_value - 1;
200 workspace[head_index+1] += 1;
203 result.push_back(workspace);