torus_solver.spectral

torus_solver.spectral.make_wavenumbers(n, period=6.283185307179586)[source]

Return Fourier wavenumbers (rad⁻¹) for a periodic grid of length period.

Return type:

Array

Parameters:
  • n (int)

  • period (float)

torus_solver.spectral.spectral_derivative(f, k, *, axis)[source]

Compute ∂f/∂x for a periodic coordinate using FFTs.

Return type:

Array

Parameters:
  • f (Array)

  • k (Array)

  • axis (int)

torus_solver.spectral.spectral_second_derivative(f, k, *, axis)[source]

Compute ∂²f/∂x² for a periodic coordinate using FFTs.

Return type:

Array

Parameters:
  • f (Array)

  • k (Array)

  • axis (int)