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 a, Real b) constexpr
Evaluates the Dubiner basis function ψ_{P,Q} on the collapsed coordinates (a,b).
template<size_t P, size_t Q>
static void getGradient(Real& dpsi_da, Real& dpsi_db, Real a, Real b) constexpr
Computes the gradient of ψ_{P,Q} with respect to the collapsed coordinates (a,b).
static void getCollapsed(Real& a, Real& b, Real x, Real y) constexpr
Converts (x,y) on the reference triangle to collapsed coordinates (a,b) ∈ [-1,1]^2.

Function documentation

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

Evaluates the Dubiner basis function ψ_{P,Q} on the collapsed coordinates (a,b).

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.
a First collapsed coordinate in [-1,1].
b 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_da, Real& dpsi_db, Real a, Real b) constexpr

Computes the gradient of ψ_{P,Q} with respect to the collapsed coordinates (a,b).

Template parameters
P First modal index.
Q Second modal index.
Parameters
dpsi_da out Derivative w.r.t. a.
dpsi_db out Derivative w.r.t. b.
a First collapsed coordinate in [-1,1].
b Second collapsed coordinate in [-1,1].

Computes: dψ/da, dψ/db

a = 2x/(1-y) - 1, b = 2y - 1 da/dx = 2/(1-y), da/dy = 2x/(1-y)^2 db/dx = 0, db/dy = 2

so: dψ/dx = dψ/da * da/dx + dψ/db * db/dx dψ/dy = dψ/da * da/dy + dψ/db * db/dy

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

Converts (x,y) on the reference triangle to collapsed coordinates (a,b) ∈ [-1,1]^2.

Parameters
out First collapsed coordinate.
out Second collapsed coordinate.
x First reference coordinate in [0,1].
y Second reference coordinate in [0,1], with x+y ≤ 1.

Reference triangle vertices: (0,0), (1,0), (0,1).

Mapping: b = 2y - 1 a = 2x/(1-y) - 1 if 1-y > tol a = -1 otherwise (collapse at the top edge/vertex y=1)