FFTPadding#

class fridom.framework.grid.fft_padding.FFTPadding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Zero padding options for the FFT.

Options:#

  • NOPADDING: No padding.

  • TRIM: Also known as the 2/3 rule.

  • EXTEND: Also known as the 3/2 rule.

Description:#

Let \(k_{\text{max}}\) be the maximum wavenumber in the original grid and \(u(k)\) be the field to be fourier transformed. The FFTPadding options modifies the field as follows:

Spectral -> Physical: - NOPADDING: no modification - TRIM: all wavenumbers \(k > 2/3 k_{\text{max}}\) are set to zero. - EXTEND: extend the field to include all wavenumbers \(k < 3/2 k_{\text{max}}\) by adding zeros.

Physical -> Spectral: - NOPADDING: no modification - TRIM: no modification - EXTEND: remove all frequencies \(k > k_{\text{max}}\) to restore the original shape.

__init__(*args, **kwds)#

Attributes

NOPADDING = 1#
TRIM = 2#
EXTEND = 3#