Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::polynomial Namespace Reference

Classes

class  SparsePolynomial
 Template class to represent and operate on polynomials in nD. More...
class  PolynomialBase
 Base template class for a general polynomial. More...
class  Polynomial
 Template class to represent and operate on polynomials. More...
class  Polynomial2D
 Template class to represent and operate on polynomials in 2D. More...
class  Polynomial3D
 Template class to represent and operate on polynomials in 3D. More...

Typedefs

template<typename T, std::size_t Dim, bool IsSpaceP = true, typename = std::enable_if_t<(Dim < 4)>>
using NdPolynomial
 wrapper for dense polynomials in 1D, 2D and 3D

Functions

template<typename T>
std::vector< Polynomial< T > > buildLegendrePolynomials (std::size_t deg)
 Builds a set of Legendre polynomials up to a given degree.

Typedef Documentation

◆ NdPolynomial

template<typename T, std::size_t Dim, bool IsSpaceP = true, typename = std::enable_if_t<(Dim < 4)>>
using vulpes::polynomial::NdPolynomial
Initial value:
std::conditional_t<
Dim == 1,
std::conditional_t<
Dim == 2,
Template class to represent and operate on polynomials in 2D.
Definition polynomial2d.hpp:53
Template class to represent and operate on polynomials in 3D.
Definition polynomial3d.hpp:52
Template class to represent and operate on polynomials.
Definition polynomial1d.hpp:44

wrapper for dense polynomials in 1D, 2D and 3D

Function Documentation

◆ buildLegendrePolynomials()

template<typename T>
std::vector< Polynomial< T > > vulpes::polynomial::buildLegendrePolynomials ( std::size_t deg)

Builds a set of Legendre polynomials up to a given degree.

The Legendre polynomials \( P_n(x) \) are generated using the recurrence relation (Bonnet formula):

\[P_{n+1}(x) = \frac{(2n+1) \cdot x \cdot P_n(x) - n \cdot P_{n-1}(x)}{n+1} \]

with the initial conditions:

\[P_0(x) = 1, \quad P_1(x) = x \]

Template Parameters
TThe type of the coefficients in the polynomials.
Parameters
degThe degree up to which Legendre polynomials should be built.
Returns
A vector containing the Legendre polynomials from degree 0 to deg.