27 template <
int n,
int dim>
44 template <mfem::Geometry::Type g,
int Q>
47 auto x = GaussLegendreNodes<Q, mfem::Geometry::SEGMENT>();
48 auto w = GaussLegendreWeights<Q, mfem::Geometry::SEGMENT>();
50 if constexpr (g == mfem::Geometry::SEGMENT) {
54 if constexpr (g == mfem::Geometry::SQUARE) {
57 for (
int j = 0; j < Q; j++) {
58 for (
int i = 0; i < Q; i++) {
59 rule.
points[count] = {x[i], x[j]};
60 rule.weights[count++] = w[i] * w[j];
66 if constexpr (g == mfem::Geometry::CUBE) {
69 for (
int k = 0; k < Q; k++) {
70 for (
int j = 0; j < Q; j++) {
71 for (
int i = 0; i < Q; i++) {
72 rule.
points[count] = {x[i], x[j], x[k]};
73 rule.weights[count++] = w[i] * w[j] * w[k];
#define SERAC_HOST_DEVICE
Macro that evaluates to __host__ __device__ when compiling with nvcc and does nothing on a host compi...
This file contains helper traits and enumerations for classifying finite elements.
Accelerator functionality.
constexpr SERAC_HOST_DEVICE auto GaussQuadratureRule()
Returns the Gauss-Legendre quadrature rule for an element and order.
Definitions of 1D quadrature weights and node locations and polynomial basis functions.
A rule for numerical quadrature (set of points and weights) Can be thought of as a compile-time analo...
tensor< double, n > weights
The scalar weights of each point.
constexpr SERAC_HOST_DEVICE std::size_t size() const
Returns the number of points in the rule.
tensor< double, n, dim > points
The coordinates in reference space for each quadrature point.
Implementation of the tensor class used by Functional.