12 #ifndef MFEM_TEMPLATE_INTEGRATION_RULES
13 #define MFEM_TEMPLATE_INTEGRATION_RULES
15 #include "../config/tconfig.hpp"
16 #include "../linalg/ttensor.hpp"
24 template <Geometry::Type G,
int Q,
int Order,
typename real_t>
45 for (
int j = 0; j <
qpts; j++)
59 template <AssignOp::Type Op,
typename qpt_layout_t,
typename qpt_data_t>
61 qpt_data_t &qpt_data)
const
63 MFEM_STATIC_ASSERT(qpt_layout_t::rank > 1,
"invalid rank");
64 MFEM_STATIC_ASSERT(qpt_layout_t::dim_1 ==
qpts,
"invalid size");
65 for (
int j = 0; j <
qpts; j++)
67 TAssign<Op>(qpt_layout.ind1(j), qpt_data,
weights.
data[j]);
71 template <
typename qpt_data_t>
78 template <
int Dim,
int Q,
typename real_t>
81 template <
int Q,
typename real_t>
89 template <AssignOp::Type Op,
typename qpt_layout_t,
typename qpt_data_t>
91 qpt_data_t &qpt_data)
const
93 MFEM_STATIC_ASSERT(qpt_layout_t::rank > 1,
"invalid rank");
94 MFEM_STATIC_ASSERT(qpt_layout_t::dim_1 == Q,
"invalid size");
95 for (
int j = 0; j < Q; j++)
97 TAssign<Op>(qpt_layout.ind1(j), qpt_data, weights_1d.data[j]);
101 template <
typename qpt_data_t>
108 template <
int Q,
typename real_t>
116 template <AssignOp::Type Op,
typename qpt_layout_t,
typename qpt_data_t>
118 qpt_data_t &qpt_data)
const
120 MFEM_STATIC_ASSERT(qpt_layout_t::rank > 1,
"invalid rank");
121 MFEM_STATIC_ASSERT(qpt_layout_t::dim_1 == Q*Q,
"invalid size");
123 for (
int j2 = 0; j2 < Q; j2++)
125 for (
int j1 = 0; j1 < Q; j1++)
129 weights_1d.data[j1]*weights_1d.data[j2]);
134 template <
typename qpt_data_t>
141 template <
int Q,
typename real_t>
149 template <AssignOp::Type Op,
typename qpt_layout_t,
typename qpt_data_t>
151 qpt_data_t &qpt_data)
const
153 MFEM_STATIC_ASSERT(qpt_layout_t::rank > 1,
"invalid rank");
154 MFEM_STATIC_ASSERT(qpt_layout_t::dim_1 == Q*Q*Q,
"invalid size");
155 MFEM_FLOPS_ADD(2*Q*Q*Q);
156 for (
int j3 = 0; j3 < Q; j3++)
158 for (
int j2 = 0; j2 < Q; j2++)
160 for (
int j1 = 0; j1 < Q; j1++)
165 weights_1d.data[j1]*weights_1d.data[j2]*weights_1d.data[j3]);
171 template <
typename qpt_data_t>
178 template <
int Dim,
int Q,
int Order,
typename real_t>
186 static const int dim = Dim;
188 static const int qpts = (Dim == 1) ? Q : ((Dim == 2) ? (Q*Q) : (Q*Q*Q));
202 template <
int Dim,
int Q,
typename real_t>
214 using base_class::weights_1d;
221 for (
int j = 0; j <
qpts_1d; j++)
237 template <Geometry::Type G,
int Order,
typename real_t =
double>
240 template <
int Order,
typename real_t>
244 template <
int Order,
typename real_t>
248 template <
int Order,
typename real_t>
256 template <
typename real_t>
259 template <
typename real_t>
262 template <
typename real_t>
265 template <
typename real_t>
268 template <
typename real_t>
271 template <
typename real_t>
274 template <
typename real_t>
277 template <
typename real_t>
285 template <
typename real_t>
288 template <
typename real_t>
291 template <
typename real_t>
294 template <
typename real_t>
297 template <
typename real_t>
300 template <
typename real_t>
303 template <
typename real_t>
306 template <
typename real_t>
312 #endif // MFEM_TEMPLATE_INTEGRATION_RULES
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
void AssignWeights(const qpt_layout_t &qpt_layout, qpt_data_t &qpt_data) const
void AssignWeights(const qpt_layout_t &qpt_layout, qpt_data_t &qpt_data) const
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void AssignWeights(const qpt_layout_t &qpt_layout, qpt_data_t &qpt_data) const
static const Geometry::Type geom
static const bool tensor_prod
TProductIntegrationRule< Dim, Q, 2 *Q-1, real_t > base_class
static const bool tensor_prod
static const Geometry::Type geom
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void AssignWeights(const qpt_layout_t &qpt_layout, qpt_data_t &qpt_data) const
TVector< qpts, real_t > weights
TVector< Q, real_t > weights_1d
static const IntegrationRule & GetIntRule()
TVector< Q, real_t > weights_1d
void ApplyWeights(qpt_data_t &qpt_data) const
static const IntegrationRule & Get1DIntRule()
void ApplyWeights(qpt_data_t &qpt_data) const
data_t data[aligned_size >0?aligned_size:1]
TVector< Q, real_t > weights_1d
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
void ApplyWeights(qpt_data_t &qpt_data) const
void ApplyWeights(qpt_data_t &qpt_data) const
static const IntegrationRule & GetIntRule()