Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::qrule::QuadratureLibrary< Dim, FloatType > Class Template Reference

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.

Detailed Description

template<std::size_t Dim, typename FloatType>
class vulpes::qrule::QuadratureLibrary< Dim, FloatType >

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:

Template Parameters
DimThe spatial dimension of the quadrature rules (1, 2, or 3).

Member Typedef Documentation

◆ float_t

template<std::size_t Dim, typename FloatType>
using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::float_t = FloatType

Floating-point type used for quadrature computations.

◆ QRule

template<std::size_t Dim, typename FloatType>
using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::QRule = QuadratureRule<float_t, Dim>

Type alias for a quadrature rule in the given dimension.

◆ QRuleRef

template<std::size_t Dim, typename FloatType>
using vulpes::qrule::QuadratureLibrary< Dim, FloatType >::QRuleRef = std::shared_ptr<QRule>

Type alias for a shared pointer to a quadrature rule.

◆ QuadratureKey

template<std::size_t Dim, typename FloatType>
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.

Member Function Documentation

◆ getRule()

template<std::size_t Dim, typename FloatType>
QuadratureLibrary< Dim, FloatType >::QRuleRef vulpes::qrule::QuadratureLibrary< Dim, FloatType >::getRule ( QuadratureElemType elem_type,
std::size_t 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.

Parameters
elem_typeThe type of quadrature element (e.g., Simplex, TensorLegendre, TensorLobatto).
orderFor Simplex, the polynomial degree integrated exactly. For TensorLegendre and TensorLobatto, the number of points per direction.
Returns
A shared pointer to the quadrature rule.

◆ makeRule()

template<std::size_t Dim, typename FloatType>
QuadratureLibrary< Dim, FloatType >::QRuleRef vulpes::qrule::QuadratureLibrary< Dim, FloatType >::makeRule ( QuadratureElemType elem_type,
std::size_t order )
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.

Parameters
elem_typeThe type of quadrature element.
orderAs in getRule().
Returns
A shared pointer to the generated quadrature rule.

Member Data Documentation

◆ s_gmp_precision

template<std::size_t Dim, typename FloatType>
int vulpes::qrule::QuadratureLibrary< Dim, FloatType >::s_gmp_precision = 256
staticconstexprprotected

GMP precision used for high-accuracy floating-point computations.


The documentation for this class was generated from the following file: