55 libmesh_assert(dim==2 || dim==3);
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)
88 for (std::size_t p=0; p<permutations.size(); ++p)
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 =
108 for (
unsigned int j=1; j<weight_loop_index; ++j)
119 if (j <= degree+dim-i)
124 for (std::size_t j=0; j<permutations.size(); ++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);
virtual void init_1D(const ElemType, unsigned int=0) override
virtual QuadratureType type() const override
const std::vector< Real > & get_weights() const
std::vector< Point > _points
long double max(long double a, double b)
std::vector< Real > _weights
void gm_rule(unsigned int s, unsigned int dim)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< Point > & get_points() const
Implements 1, 2, and 3D "Gaussian" quadrature rules.
void compose_all(unsigned int s, unsigned int p, std::vector< std::vector< unsigned int >> &result)