Spherical Harmonic Solvers¶
SphericalPoissonSolver
¶
Bases: Module
Spectral Poisson solver on the sphere.
Solves: nabla^2 phi = f
In spectral space (SHT coefficients): phi_hat(l, m) = -f_hat(l, m) / [l*(l+1)/R^2]
The l=0 mode is set to zero (mean of phi is undetermined for Poisson).
Attributes:¶
grid : SphericalGrid2D or SphericalGrid1D The spherical grid.
Source code in spectraldiffx/_src/spherical/solvers.py
Functions¶
solve(f, zero_mean=True, spectral=False)
¶
Solve nabla^2 phi = f on the sphere.
Parameters:¶
f : Array Source field (physical space or spectral if spectral=True). Shape (Ny,) for 1D or (Ny, Nx) for 2D. zero_mean : bool If True, set the l=0 (global mean) mode to zero. spectral : bool If True, treat f as SHT/DLT coefficients.
Returns:¶
phi : Array Solution field in physical space.
Source code in spectraldiffx/_src/spherical/solvers.py
SphericalHelmholtzSolver
¶
Bases: Module
Spectral Helmholtz solver on the sphere.
Solves: (nabla^2 - alpha) phi = f
In spectral space
phi_hat(l, m) = -f_hat(l, m) / [l*(l+1)/R^2 + alpha]
Attributes:¶
grid : SphericalGrid2D or SphericalGrid1D The spherical grid.
Source code in spectraldiffx/_src/spherical/solvers.py
Functions¶
solve(f, alpha=0.0, zero_mean=True, spectral=False)
¶
Solve (nabla^2 - alpha) phi = f on the sphere.
Parameters:¶
f : Array Source field (physical or spectral). alpha : float Helmholtz parameter (>= 0). alpha=0 reduces to Poisson. zero_mean : bool If True, force l=0 (mean) mode to zero. Relevant when alpha=0. spectral : bool If True, treat f as SHT/DLT coefficients.
Returns:¶
phi : Array Solution field in physical space.