![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
A library for managing and generating quadrature rules for numerical integration. More...
#include <qlibrary.hpp>
Public Types | |
| using | float_t = FloatType |
| Floating-point type used for quadrature computations. | |
| using | QRule = QuadratureRule<float_t, Dim> |
| Type alias for a quadrature rule in the given dimension. | |
| using | QRuleRef = std::shared_ptr<QRule> |
| Type alias for a shared pointer to a quadrature rule. | |
| using | QuadratureKey = std::pair<QuadratureElemType, std::size_t> |
| Key type for identifying quadrature rules, based on element type and order. | |
Static Public Member Functions | |
| static QRuleRef | getRule (QuadratureElemType elem_type, std::size_t order) |
| Retrieves a quadrature rule for a given element type and order. | |
Static Protected Member Functions | |
| static QRuleRef | makeRule (QuadratureElemType elem_type, std::size_t order) |
| Generates a quadrature rule for the specified element type and order. | |
Static Protected Attributes | |
| static constexpr int | s_gmp_precision = 256 |
| GMP precision used for high-accuracy floating-point computations. | |
A library for managing and generating quadrature rules for numerical integration.
The QuadratureLibrary class provides a mechanism to lazily generate and cache quadrature rules for various element types and integration orders. The rules are generated for a specific spatial dimension and can be accessed using a key consisting of the element type and order.
The coefficient of the polynomials are computed exactly by using mpq_class (a class that represent a fraction in arbitrary precision implemented in GNU GMP) using the recursive formula of Legendre polynomials (Bonnet's recursion formula). Evaluation of the polynomials is done using the mpf_class to handle floating point in arbitrary precision. Nodes and points are computed using Newton's iterations
For the n-dimensional simplex we employ the following strategy:
| Dim | The spatial dimension of the quadrature rules (1, 2, or 3). |
| using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::float_t = FloatType |
Floating-point type used for quadrature computations.
| using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::QRule = QuadratureRule<float_t, Dim> |
Type alias for a quadrature rule in the given dimension.
| using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::QRuleRef = std::shared_ptr<QRule> |
Type alias for a shared pointer to a quadrature rule.
| using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::QuadratureKey = std::pair<QuadratureElemType, std::size_t> |
Key type for identifying quadrature rules, based on element type and order.
|
static |
Retrieves a quadrature rule for a given element type and order.
If the requested rule does not exist in the library, it will be generated and cached.
| elem_type | The type of quadrature element (e.g., Simplex, TensorLegendre, TensorLobatto). |
| order | For Simplex, the polynomial degree integrated exactly. For TensorLegendre and TensorLobatto, the number of points per direction. |
|
staticprotected |
Generates a quadrature rule for the specified element type and order.
This method performs the actual computation of the quadrature rule, which includes scaling and potentially converting between representations.
| elem_type | The type of quadrature element. |
| order | As in getRule(). |
|
staticconstexprprotected |
GMP precision used for high-accuracy floating-point computations.