template<size_t K>
LegendrePolynomial class
Compile-time degree Legendre polynomial evaluator.
| Template parameters | |
|---|---|
| K | Polynomial degree of the Legendre polynomial . |
This class provides an efficient and numerically stable evaluation of the Legendre polynomial and its derivative on the interval , using the standard three-term recurrence relation and its differentiated form.
The polynomial degree is encoded as a template parameter, which allows the compiler to optimize and possibly unroll the recurrence for fixed degrees typically used in high-order finite element methods.
This evaluator is intended for internal use in the construction of modal bases and Gauss–Lobatto–Legendre nodes for H1-conforming elements.
Public static functions
Function documentation
template<size_t K>
static void Rodin:: Variational:: LegendrePolynomial<K>:: getValue(Real& P,
Real& dP,
Real x) constexpr
Computes and using the three-term recurrence relation.
| Parameters | |
|---|---|
| P out | Value of . |
| dP out | Value of . |
| x | Evaluation point (assumed in ). |
For and , explicit closed forms are used: , . For , the standard recurrence
and its derivative are used to advance from up to .
The evaluation is intended for arguments .