template<size_t K>
Rodin::Variational::DubinerTriangle class

Dubiner orthogonal modal basis on the reference triangle.

Template parameters
K Maximum polynomial degree.

This class provides evaluation of the Dubiner basis functions $ \psi_{p,q}(r,s) $ on the collapsed coordinate system $ (r,s) \in [-1,1]^2 $ , which maps from the reference triangle with vertices $ (0,0), (1,0), (0,1) $ .

The Dubiner basis is constructed as a product of Jacobi polynomials:

\[ \psi_{p,q}(r,s) = P_p^{(0,0)}(a) \cdot P_q^{(2p+1,0)}(b) \cdot \left(\frac{1-b}{2}\right)^p \]

where $ (a,b) $ are collapsed coordinates derived from $ (r,s) $ .

This basis is L2-orthogonal on the reference triangle, making it numerically stable for high-order polynomial approximations.

Public static functions

template<size_t P, size_t Q>
static void getBasis(Real& basis, Real r, Real s) constexpr
Evaluates the Dubiner basis function $ \psi_{P,Q}(r,s) $ .
template<size_t P, size_t Q>
static void getGradient(Real& dpsi_dr, Real& dpsi_ds, Real r, Real s) constexpr
Computes the gradient of $ \psi_{P,Q} $ w.r.t. collapsed coordinates.
static void getCollapsed(Real& r, Real& s, Real x, Real y) constexpr
Converts reference triangle coordinates to collapsed coordinates.

Function documentation

template<size_t K> template<size_t P, size_t Q>
static void Rodin::Variational::DubinerTriangle<K>::getBasis(Real& basis, Real r, Real s) constexpr

Evaluates the Dubiner basis function $ \psi_{P,Q}(r,s) $ .

Template parameters
P First modal index (0 ≤ P).
Q Second modal index (0 ≤ Q, P + Q ≤ K).
Parameters
basis out The computed basis function value.
r First collapsed coordinate in [-1,1].
s Second collapsed coordinate in [-1,1].

template<size_t K> template<size_t P, size_t Q>
static void Rodin::Variational::DubinerTriangle<K>::getGradient(Real& dpsi_dr, Real& dpsi_ds, Real r, Real s) constexpr

Computes the gradient of $ \psi_{P,Q} $ w.r.t. collapsed coordinates.

Template parameters
P First modal index.
Q Second modal index.
Parameters
dpsi_dr out Derivative w.r.t. r.
dpsi_ds out Derivative w.r.t. s.
r First collapsed coordinate.
s Second collapsed coordinate.

Uses the chain rule to compute:

\[ \frac{\partial \psi}{\partial r}, \quad \frac{\partial \psi}{\partial s} \]

template<size_t K>
static void Rodin::Variational::DubinerTriangle<K>::getCollapsed(Real& r, Real& s, Real x, Real y) constexpr

Converts reference triangle coordinates to collapsed coordinates.

Parameters
out First collapsed coordinate.
out Second collapsed coordinate.
x First reference coordinate.
y Second reference coordinate.

Maps $ (x,y) $ from the reference triangle to $ (r,s) \in [-1,1]^2 $ :

\[ s = 2y - 1, \quad r = \frac{2x}{1-y} - 1 \]

with singularity handling at $ y = 1 $ (top vertex).