4#ifndef IPPL_QUADRATURE_H
5#define IPPL_QUADRATURE_H
17constexpr T power(
T base,
unsigned exponent) {
18 return exponent == 0 ? 1 : base *
power(base, exponent - 1);
22 return static_cast<unsigned>(
power(
static_cast<int>(NumNodes1D),
static_cast<int>(
Dim)));
34 template <
typename T,
unsigned NumNodes1D,
typename ElementType>
41 static constexpr unsigned dim = ElementType::dim;
constexpr unsigned getNumElementNodes(unsigned NumNodes1D, unsigned Dim)
constexpr T power(T base, unsigned exponent)
const ElementType & ref_element_m
Vector< T, NumNodes1D > integration_nodes_m
static constexpr unsigned dim
virtual void computeNodesAndWeights()=0
Pure virtual function that computes the local quadrature nodes and weights. (Needs to be implemented ...
Vector< T, NumNodes1D > weights_m
static constexpr unsigned numElementNodes
static constexpr unsigned numNodes1D
Vector< T, NumNodes1D > getWeights1D(const T &a, const T &b) const
Get the quadrature weights for one dimension. (With respect to the given domain [a,...
Vector< Vector< T, dim >, numElementNodes > getIntegrationNodesForRefElement() const
Get the integration (quadrature) nodes for the reference element.
size_t getDegree() const
Returns the degree of exactness of the quadrature rule.
Vector< T, NumNodes1D > getIntegrationNodes1D(const T &a, const T &b) const
Get the quadrature nodes for one dimension. (With respect to the given domain [a, b]).
size_t getOrder() const
Returns the order of the quadrature rule. (order = degree + 1).
Quadrature(const ElementType &ref_element)
Construct a new Quadrature object.
Vector< T, numElementNodes > getWeightsForRefElement() const
Get the quadrature weights for the reference element.