1. Lagrange — a coefficient is a point value
The nodal family: phi_i equals 1 at node i
and 0 at every other node of the cell, so
alpha_i = u_h(node i) directly. The
natural choice for FEM, where a node's value is exactly what gets
shared between cells.
from scimba_jax.linear_approximation.basis.analytic_bases import local_lagrange_basis
# NODAL: 1 at its own node, 0 at every other node of the cell -- a DOF IS
# a point value. The natural choice for FEM, and the default for DG too.
basis = AnalyticBasis(
nb_basis=(order + 1) ** 2, # Q_p tensor-product
out_dim=1,
mesh=mesh,
local_basis=lambda y, i, m: local_lagrange_basis(y, i, m, order=order, out_dim=1),
basis_type="scalar",
)
2. Taylor — a coefficient is a derivative
The modal family: basis functions are powers of the centred, rescaled coordinate. There is no node to share, so this one only makes sense on DG. The upside is that reading a coefficient off the vector already tells you something — the cell average, then its gradient, then its curvature.
from scimba_jax.linear_approximation.basis.analytic_bases import local_taylor_basis
# MODAL: powers of (x - x_center) / h -- no nodes, so DG only. The zeroth
# mode is the cell average, the first its gradient, and so on.
basis = AnalyticBasis(
nb_basis=(order + 1) ** 2,
out_dim=1,
mesh=mesh,
local_basis=lambda y, i, m: local_taylor_basis(y, i, m, order=order, out_dim=1),
basis_type="scalar",
)
# Never raise a vmapped exponent to a traced power (0**0 = nan under vmap):
# built by repeated multiplication instead.
3. B-spline — a coefficient is neither
Isogeometric analysis: a smooth spline of degree p and
continuity r across cell boundaries, read by a sliding
window of neighbouring cells rather than a single one. At
r = 0 the space is exactly Lagrange Q_p
again, written in a different basis — the two must give
bit-identical solutions, and that identity is exactly how this
basis is tested.
from scimba_jax.linear_approximation.basis.analytic_bases import local_bspline_basis
# B-SPLINE: degree p, continuity r across cells. r = 0 is Lagrange Q_p in
# another basis (tested for bit-identical solutions). A DOF is a spline
# coefficient, read by a sliding window of cells rather than a single one.
basis = AnalyticBasis(
nb_basis=(order + 1) ** 2,
out_dim=1,
mesh=mesh,
local_basis=lambda y, i, m: local_bspline_basis(
y, i, m, order=order, regularity=order - 1, out_dim=1
),
spline_regularity=order - 1,
basis_type="scalar",
)
None of this is specific to a mesh shape — the same three families plug into a FEM or DG scheme on a structured, unstructured or block-structured mesh alike. A different family entirely — kernels and random features, with no mesh at all — is on the Collocation-based methods page.