DubinerTetrahedron

Dubiner orthogonal modal basis on the reference tetrahedron.

Defined in Rodin/Variational/H1/Dubiner.h

template <
  size_t K>
class DubinerTetrahedron;
Template parameters
K Maximum polynomial degree.

Provides evaluation of the Dubiner basis functions $ \psi_{p,q,r}(a,b,c) $ on collapsed coordinates $ (a,b,c) \in [-1,1]^3 $ , mapped from the reference tetrahedron with vertices $ (0,0,0), (1,0,0), (0,1,0), (0,0,1) $ .

The basis uses a Duffy-type collapse and is constructed as:

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

Public types

struct Values
Selects the value column of caller-owned modal rows.
struct Gradients
Selects the three derivative columns of caller-owned modal rows.
using Tabulation = std::array<std::array<Real, 4>,(K+1)*(K+2)*(K+3)/6>
Fixed modal rows containing a value followed by three derivatives.

Public static functions

static void tabulate(Tabulation& output, const Math::SpatialPoint& rc)
Tabulates all four modal columns with shared point-local work.
static void tabulate(Values values, const Math::SpatialPoint& rc)
Tabulates modal values at one point.
static void tabulate(Gradients gradients, const Math::SpatialPoint& rc)
Tabulates modal reference gradients at one point.
template<size_t P, size_t Q, size_t R>
static void getBasis(Real& basis, Real a, Real b, Real c) constexpr
Evaluates the Dubiner basis function $ \psi_{P,Q,R}(a,b,c) $ .
getGradient
Gets the gradient of the basis function.
See declaration
template<size_t P, size_t Q, size_t R>
static void getGradient(Real& dpsi_da, Real& dpsi_db, Real& dpsi_dc, Real a, Real b, Real c) constexpr
getReferenceGradient
Computes the gradient of $\psi_{P,Q,R}$ in reference coordinates.
See declaration
template<size_t P, size_t Q, size_t R>
static void getReferenceGradient(Real& dpsi_dx, Real& dpsi_dy, Real& dpsi_dz, Real x, Real y, Real z) constexpr
getReferenceGradientFromCollapsed
Computes the gradient of $\psi_{P,Q,R}$ from precomputed collapsed coordinates.
See declaration
template<size_t P, size_t Q, size_t R>
static void getReferenceGradientFromCollapsed(Real& dpsi_dx, Real& dpsi_dy, Real& dpsi_dz, Real a, Real b, Real c, Real s1, Real s2) constexpr
static void getCollapsed(Real& a, Real& b, Real& c, Real x, Real y, Real z) constexpr
Maps reference coordinates to collapsed coordinates.

Typedef documentation

using Tabulation = std::array<std::array<Real, 4>,(K+1)*(K+2)*(K+3)/6>

Fixed modal rows containing a value followed by three derivatives.

Row $m$ contains $(\psi_m,\partial_0\psi_m, \partial_1\psi_m,\partial_2\psi_m)$ . Its compile-time layout retains the original point-local modal workspace.

Function documentation

static void tabulate(Tabulation& output, const Math::SpatialPoint& rc)

Tabulates all four modal columns with shared point-local work.

Parameters
output Caller-owned fixed-layout modal rows.
rc Three reference coordinates, with optional trailing padding.
Exceptions
Alert::Exception If coordinates are invalid.

static void tabulate(Values values, const Math::SpatialPoint& rc)

Tabulates modal values at one point.

Parameters
values Mode-indexed output.
rc Reference coordinates.
Exceptions
Alert::Exception If coordinates are invalid.

static void tabulate(Gradients gradients, const Math::SpatialPoint& rc)

Tabulates modal reference gradients at one point.

Parameters
gradients Mode-major output.
rc Reference coordinates.
Exceptions
Alert::Exception If coordinates are invalid.

template<size_t K> template<size_t P, size_t Q, size_t R>
static void getBasis(Real& basis, Real a, Real b, Real c) constexpr

Evaluates the Dubiner basis function $ \psi_{P,Q,R}(a,b,c) $ .

Template parameters
P First modal index.
Q Second modal index.
R Third modal index (P + Q + R ≤ K).
Parameters
basis out The computed basis function value.
a First collapsed coordinate.
b Second collapsed coordinate.
c Third collapsed coordinate.

template<size_t K> template<size_t P, size_t Q, size_t R>
static void getGradient(Real& dpsi_da, Real& dpsi_db, Real& dpsi_dc, Real a, Real b, Real c) constexpr

Gets the gradient of the basis function.

Parameters
dpsi_da Storage for the derivative in the first collapsed coordinate.
dpsi_db Storage for the derivative in the second collapsed coordinate.
dpsi_dc Storage for the derivative in the third collapsed coordinate.
a Coordinate at which the basis is evaluated.
b Coordinate at which the basis is evaluated.
c Coordinate at which the basis is evaluated.

template<size_t K> template<size_t P, size_t Q, size_t R>
static void getReferenceGradient(Real& dpsi_dx, Real& dpsi_dy, Real& dpsi_dz, Real x, Real y, Real z) constexpr

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

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

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

template<size_t K> template<size_t P, size_t Q, size_t R>
static void getReferenceGradientFromCollapsed(Real& dpsi_dx, Real& dpsi_dy, Real& dpsi_dz, Real a, Real b, Real c, Real s1, Real s2) constexpr

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

Parameters
dpsi_dx out Derivative with respect to $x$ .
dpsi_dy out Derivative with respect to $y$ .
dpsi_dz out Derivative with respect to $z$ .
a First collapsed coordinate.
b Second collapsed coordinate.
c Third collapsed coordinate.
s1 Value of $1-y-z$ .
s2 Value of $1-z$ .

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

static void getCollapsed(Real& a, Real& b, Real& c, Real x, Real y, Real z) constexpr

Maps reference coordinates to collapsed coordinates.

Parameters
a Storage for the first collapsed coordinate.
b Storage for the second collapsed coordinate.
c Storage for the third collapsed coordinate.
x Coordinate at which the basis is evaluated.
y Coordinate at which the basis is evaluated.
z Coordinate at which the basis is evaluated.