Elliptic API¶
Spectral Fourier–Helmholtz elliptic solve.
Solves a separable elliptic problem of Helmholtz type on a periodic z axis
and a bounded x axis by Fourier-transforming in z (turning the periodic
Laplacian into a per-mode -k_z^2 multiplier) and solving the remaining
tridiagonal system in x for every Fourier mode at once. This is the
lap phi = rhs inversion used by reduced drift-plane / vorticity models,
where the operator is d/dx(g11 d/dx) + g33 d^2/dz^2 with metric weights
g11(x), g33(x).
All routines are pure JAX (jit/grad/vmap transparent). Build the
operator once for a fixed geometry with build_fourier_helmholtz_operator()
and reuse it across right-hand sides with solve_fourier_helmholtz().
- class solvax.elliptic.FourierHelmholtzOperator(lower_diagonals, diagonals, upper_diagonals, rhs_scale, nz, zlength)¶
Per-mode complex tridiagonal factors of the Fourier–Helmholtz operator.
- solvax.elliptic.build_fourier_helmholtz_operator(*, dx, dz, g11, g33, rhs_scale, nz)¶
Assemble the per-mode tridiagonal operator for a fixed
(g11, g33)geometry.dx,g11,g33,rhs_scaleare length-nxarrays along the boundedxaxis;dzsets the periodiczspacing andnzits length. Thexboundaries use a reflected (homogeneous-Neumann-like) closure consistent with the reduced drift-plane potential solve.
- solvax.elliptic.solve_fourier_helmholtz(rhs, *, operator, method='thomas')¶
Solve
operator @ solution = rhsfor a real(nx, nz)right-hand side.Each Fourier mode is a complex tridiagonal system in the bounded
xaxis; all modes are solved in one call viasolvax.tridiagonal.tridiagonal_solve()with thexaxis leading and the mode index batched.methodselects the tridiagonal backend and defaults to"thomas"(purelax.scan), which is complex-safe on every supported JAX version; pass"auto"/"lax"to use the fused kernel where the JAX build supports complex tridiagonal solves.- Parameters:
rhs (Array)
operator (FourierHelmholtzOperator)
method (str)
- Return type: