4#ifndef IPPL_QUADRATURE_H
5#define IPPL_QUADRATURE_H
11#include "Utility/IpplException.h"
13#include "FEM/Elements/Element.h"
17constexpr T power(T base,
unsigned exponent) {
18 return exponent == 0 ? 1 : base * power(base, exponent - 1);
21inline constexpr unsigned getNumElementNodes(
unsigned NumNodes1D,
unsigned Dim) {
22 return static_cast<unsigned>(power(
static_cast<int>(NumNodes1D),
static_cast<int>(Dim)));
34 template <
typename T,
unsigned NumNodes1D,
typename ElementType>
38 static constexpr unsigned numNodes1D = NumNodes1D;
41 static constexpr unsigned dim = ElementType::dim;
44 static constexpr unsigned numElementNodes =
45 getNumElementNodes(NumNodes1D, ElementType::dim);
112 const ElementType& ref_element_m;
124#include "FEM/Quadrature/Quadrature.hpp"
This is the base class for all quadrature rules.
Definition Quadrature.h:35
virtual void computeNodesAndWeights()=0
Pure virtual function that computes the local quadrature nodes and weights. (Needs to be implemented ...
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,...
Definition Quadrature.hpp:81
Vector< Vector< T, dim >, numElementNodes > getIntegrationNodesForRefElement() const
Get the integration (quadrature) nodes for the reference element.
Definition Quadrature.hpp:47
size_t getDegree() const
Returns the degree of exactness of the quadrature rule.
Definition Quadrature.hpp:13
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])
Definition Quadrature.hpp:72
size_t getOrder() const
Returns the order of the quadrature rule. (order = degree + 1)
Definition Quadrature.hpp:8
Vector< T, numElementNodes > getWeightsForRefElement() const
Get the quadrature weights for the reference element.
Definition Quadrature.hpp:19