Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
teno Namespace Reference

Classes

struct  PackedStencils
 Per-cell stencils of different sizes, stored without padding to the largest one in the mesh. Slot s of a cell's stencil holds the stencil cell, its mirror boundary face (or -1) and width pseudo-inverse entries. Consecutive cells form slices of 2^shift cells; a slice is padded to its largest stencil and interleaves its cells' slots. With single, pinv holds the pseudo-inverse entries as floats, two to an element, at the same indices. More...
 
struct  SmoothnessTerms
 The terms of the smoothness-indicator matrix (3D): entry e (upper_index(l, m)) is sum_t weight(t) moments(cell, moment(t)) over t in [start(e), start(e + 1)), with products of D^beta factors (whole numbers below 2^16) as weights; term(t) holds weight(t) << 16 | moment(t). More...
 

Typedefs

using Moments = Kokkos::View< double **, Kokkos::LayoutRight >
 (cell, k): central moments of each cell, mean of ((x - x_c) / h_c)^a ... (3D).
 

Functions

KOKKOS_INLINE_FUNCTION constexpr uint8_t n_dof (const uint8_t r)
 Number of non-constant N_DIM-variate monomials of total degree <= r.
 
KOKKOS_INLINE_FUNCTION constexpr uint16_t upper_index (const uint8_t l, const uint8_t m, const uint8_t n)
 Index of entry (l, m), l <= m, of a symmetric n x n matrix stored as its upper triangle, row by row.
 
KOKKOS_INLINE_FUNCTION void exponents (const uint8_t l, uint8_t &a, uint8_t &b)
 Exponents (a, b) of the l-th monomial xi^a eta^b, ordered by total degree: (1,0), (0,1), (2,0), (1,1), (0,2), (3,0), ...
 
KOKKOS_INLINE_FUNCTION void exponents (const uint8_t l, uint8_t &a, uint8_t &b, uint8_t &c)
 Exponents (a, b, c) of the l-th trivariate monomial xi^a eta^b zeta^c, ordered by total degree, then by decreasing a, then decreasing b: (1,0,0), (0,1,0), (0,0,1), (2,0,0), (1,1,0), (1,0,1), (0,2,0), ...
 
template<typename T >
KOKKOS_INLINE_FUNCTION T ipow (const T x, const uint8_t n)
 
template<typename T >
KOKKOS_INLINE_FUNCTION void monomials (const uint8_t r, const T xi, const T eta, T *phi)
 Evaluate all monomials of degree 1..r at (xi, eta).
 
template<typename T >
KOKKOS_INLINE_FUNCTION void monomial_gradients (const uint8_t r, const T xi, const T eta, T *d_xi, T *d_eta)
 Derivatives with respect to xi and eta of all monomials of degree 1..r at (xi, eta).
 
template<typename T >
KOKKOS_INLINE_FUNCTION void monomials (const uint8_t r, const T xi, const T eta, const T zeta, T *phi)
 Evaluate all trivariate monomials of degree 1..r at (xi, eta, zeta).
 
template<typename T >
KOKKOS_INLINE_FUNCTION void monomials (const uint8_t r, const T *x, T *phi)
 Monomials at a point x (N_DIM coordinates, already scaled).
 
KOKKOS_INLINE_FUNCTION void eigenvectors (const rtype *W, const rtype *n, const rtype gamma, rtype L[N_CONSERVATIVE][N_CONSERVATIVE], rtype R[N_CONSERVATIVE][N_CONSERVATIVE])
 Left (L) and right (R) eigenvectors of the Euler flux Jacobian in direction n for conservative variables, at state W = [rho, u, p]. Characteristic order: u_n - a, u_n (entropy), u_n + a, then one u_n (shear) wave per tangent of tangent_basis(n).
 
KOKKOS_INLINE_FUNCTION void primitive_eigenvectors (const rtype *W, const rtype a, const rtype *n, rtype L[N_CONSERVATIVE][N_CONSERVATIVE], rtype R[N_CONSERVATIVE][N_CONSERVATIVE])
 Left (L) and right (R) eigenvectors of the Euler equations in primitive variables W = [rho, u, p] in direction n, for sound speed a: valid for any equation of state. Same characteristic order as eigenvectors(): u_n - a, u_n (entropy, here the density at fixed p and u), u_n + a, then the shear waves.
 
KOKKOS_INLINE_FUNCTION rtype adaptive_CT (const rtype sigma, const rtype sigma_L, const rtype sigma_U)
 Adaptive cutoff C_T from the troubled-cell measure sigma (Liang, Shyy & Fu 2025): 1e-10 near sigma_L, 1e-6 above sigma_U.
 

Variables

constexpr uint8_t MAX_DEGREE = 5
 
constexpr uint8_t MAX_NK = n_dof(MAX_DEGREE)
 
constexpr uint8_t NK_SMALL = n_dof(2)
 
constexpr uint8_t MAX_FACES = (N_DIM == 2) ? 4 : 6
 
constexpr uint8_t MAX_FACE_QUAD = (N_DIM == 2) ? 4 : 9
 
constexpr uint8_t SLICE_SHIFT
 log2 of the cells per slice of PackedStencils: 32 on GPUs, so that a warp reads consecutive words, and 1 on the host, where each cell's stencil is then contiguous.
 

Typedef Documentation

◆ Moments

using teno::Moments = typedef Kokkos::View<double **, Kokkos::LayoutRight>

(cell, k): central moments of each cell, mean of ((x - x_c) / h_c)^a ... (3D).

Function Documentation

◆ adaptive_CT()

KOKKOS_INLINE_FUNCTION rtype teno::adaptive_CT ( const rtype  sigma,
const rtype  sigma_L,
const rtype  sigma_U 
)

Adaptive cutoff C_T from the troubled-cell measure sigma (Liang, Shyy & Fu 2025): 1e-10 near sigma_L, 1e-6 above sigma_U.

◆ eigenvectors()

KOKKOS_INLINE_FUNCTION void teno::eigenvectors ( const rtype *  W,
const rtype *  n,
const rtype  gamma,
rtype  L[N_CONSERVATIVE][N_CONSERVATIVE],
rtype  R[N_CONSERVATIVE][N_CONSERVATIVE] 
)

Left (L) and right (R) eigenvectors of the Euler flux Jacobian in direction n for conservative variables, at state W = [rho, u, p]. Characteristic order: u_n - a, u_n (entropy), u_n + a, then one u_n (shear) wave per tangent of tangent_basis(n).

◆ exponents() [1/2]

KOKKOS_INLINE_FUNCTION void teno::exponents ( const uint8_t  l,
uint8_t &  a,
uint8_t &  b 
)

Exponents (a, b) of the l-th monomial xi^a eta^b, ordered by total degree: (1,0), (0,1), (2,0), (1,1), (0,2), (3,0), ...

◆ exponents() [2/2]

KOKKOS_INLINE_FUNCTION void teno::exponents ( const uint8_t  l,
uint8_t &  a,
uint8_t &  b,
uint8_t &  c 
)

Exponents (a, b, c) of the l-th trivariate monomial xi^a eta^b zeta^c, ordered by total degree, then by decreasing a, then decreasing b: (1,0,0), (0,1,0), (0,0,1), (2,0,0), (1,1,0), (1,0,1), (0,2,0), ...

◆ ipow()

template<typename T >
KOKKOS_INLINE_FUNCTION T teno::ipow ( const T  x,
const uint8_t  n 
)

◆ monomial_gradients()

template<typename T >
KOKKOS_INLINE_FUNCTION void teno::monomial_gradients ( const uint8_t  r,
const T  xi,
const T  eta,
T *  d_xi,
T *  d_eta 
)

Derivatives with respect to xi and eta of all monomials of degree 1..r at (xi, eta).

◆ monomials() [1/3]

template<typename T >
KOKKOS_INLINE_FUNCTION void teno::monomials ( const uint8_t  r,
const T *  x,
T *  phi 
)

Monomials at a point x (N_DIM coordinates, already scaled).

◆ monomials() [2/3]

template<typename T >
KOKKOS_INLINE_FUNCTION void teno::monomials ( const uint8_t  r,
const T  xi,
const T  eta,
const T  zeta,
T *  phi 
)

Evaluate all trivariate monomials of degree 1..r at (xi, eta, zeta).

◆ monomials() [3/3]

template<typename T >
KOKKOS_INLINE_FUNCTION void teno::monomials ( const uint8_t  r,
const T  xi,
const T  eta,
T *  phi 
)

Evaluate all monomials of degree 1..r at (xi, eta).

◆ n_dof()

KOKKOS_INLINE_FUNCTION constexpr uint8_t teno::n_dof ( const uint8_t  r)
constexpr

Number of non-constant N_DIM-variate monomials of total degree <= r.

◆ primitive_eigenvectors()

KOKKOS_INLINE_FUNCTION void teno::primitive_eigenvectors ( const rtype *  W,
const rtype  a,
const rtype *  n,
rtype  L[N_CONSERVATIVE][N_CONSERVATIVE],
rtype  R[N_CONSERVATIVE][N_CONSERVATIVE] 
)

Left (L) and right (R) eigenvectors of the Euler equations in primitive variables W = [rho, u, p] in direction n, for sound speed a: valid for any equation of state. Same characteristic order as eigenvectors(): u_n - a, u_n (entropy, here the density at fixed p and u), u_n + a, then the shear waves.

◆ upper_index()

KOKKOS_INLINE_FUNCTION constexpr uint16_t teno::upper_index ( const uint8_t  l,
const uint8_t  m,
const uint8_t  n 
)
constexpr

Index of entry (l, m), l <= m, of a symmetric n x n matrix stored as its upper triangle, row by row.

Variable Documentation

◆ MAX_DEGREE

constexpr uint8_t teno::MAX_DEGREE = 5
constexpr

◆ MAX_FACE_QUAD

constexpr uint8_t teno::MAX_FACE_QUAD = (N_DIM == 2) ? 4 : 9
constexpr

◆ MAX_FACES

constexpr uint8_t teno::MAX_FACES = (N_DIM == 2) ? 4 : 6
constexpr

◆ MAX_NK

constexpr uint8_t teno::MAX_NK = n_dof(MAX_DEGREE)
constexpr

◆ NK_SMALL

constexpr uint8_t teno::NK_SMALL = n_dof(2)
constexpr

◆ SLICE_SHIFT

constexpr uint8_t teno::SLICE_SHIFT
constexpr
Initial value:
=
Kokkos::SpaceAccessibility<Kokkos::DefaultExecutionSpace, Kokkos::HostSpace>::accessible ? 0 : 5

log2 of the cells per slice of PackedStencils: 32 on GPUs, so that a warp reads consecutive words, and 1 on the host, where each cell's stencil is then contiguous.