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).
template<size_t P, size_t Q>
static void getReferenceGradient(Real& dpsi_dx, Real& dpsi_dy, Real x, Real y) constexpr
Computes the gradient of $\psi_{P,Q}$ in reference coordinates.
template<size_t P, size_t Q>
static void getReferenceGradientFromCollapsed(Real& dpsi_dx, Real& dpsi_dy, Real a, Real b, Real s) constexpr
Computes the gradient of $\psi_{P,Q}$ from precomputed collapsed coordinates.
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> template<size_t P, size_t Q>
static void Rodin::Variational::DubinerTriangle<K>::getReferenceGradient(Real& dpsi_dx, Real& dpsi_dy, Real x, Real y) constexpr

Computes the gradient of $\psi_{P,Q}$ in reference coordinates.

Template parameters
P First modal index.
Q Second modal index.
Parameters
dpsi_dx out Derivative with respect to $x$ .
dpsi_dy out Derivative with respect to $y$ .
x First reference coordinate.
y Second reference coordinate.

The Duffy-coordinate factors cancel analytically before differentiation, so the returned derivative has a finite value at the collapsed vertex.

template<size_t K> template<size_t P, size_t Q>
static void Rodin::Variational::DubinerTriangle<K>::getReferenceGradientFromCollapsed(Real& dpsi_dx, Real& dpsi_dy, Real a, Real b, Real s) constexpr

Computes the gradient of $\psi_{P,Q}$ from precomputed collapsed coordinates.

Parameters
dpsi_dx out Derivative with respect to $x$ .
dpsi_dy out Derivative with respect to $y$ .
a First collapsed coordinate.
b Second collapsed coordinate.
s Value of $1-y$ .

This overload avoids repeated Duffy-coordinate transformations while tabulating all modes at the same reference point.

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
a out First collapsed coordinate.
b 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 y != 1 a = -1 at the collapsed vertex y=1