fluiddyn.calcul.easypyfft

Fast Fourier transforms (fluiddyn.calcul.easypyfft)

fluiddyn.calcul.easypyfft.fftw_grid_size(nk, bases=[2, 3, 5, 7, 11, 13], debug=False)[source]

Find the closest multiple of prime powers greater than or equal to nk using Mixed Integer Linear Programming (MILP). Useful while setting the grid-size to be compatible with FFTW.

Parameters:
nkint

Lower bound for the spectral grid size.

basesarray-like, optional

List of bases, typically prime numbers.

debugbool, optional

Print useful messages.

Returns:
int

Provides classes for performing fft in 1, 2, and 3 dimensions:

class fluiddyn.calcul.easypyfft.FFTP2D(nx, ny)[source]

Bases: BaseFFT

A class to use fftp

class fluiddyn.calcul.easypyfft.FFTW2DReal2Complex(nx, ny)[source]

Bases: BasePyFFT

A class to use fftw

get_x_adim_loc()[source]

Get the coordinates of the points stored locally.

Returns:
x0locnp.ndarray
x1locnp.ndarray
The indices correspond to the index of the dimension in real space.
get_k_adim_loc()[source]

Get the non-dimensional wavenumbers stored locally.

Returns:
k0_adim_locnp.ndarray
k1_adim_locnp.ndarray
The indices correspond to the index of the dimension in spectral space.
class fluiddyn.calcul.easypyfft.FFTW3DReal2Complex(nx, ny, nz)[source]

Bases: BasePyFFT

A class to use fftw

get_seq_indices_first_X()[source]

Get the “sequential” indices of the first number in Real space.

get_seq_indices_first_K()[source]

Get the “sequential” indices of the first number in Fourier space.

get_k_adim_loc()[source]

Get the non-dimensional wavenumbers stored locally.

Returns:
k0_adim_locnp.ndarray
k1_adim_locnp.ndarray
k2_adim_locnp.ndarray
The indices correspond to the index of the dimension in spectral space.
class fluiddyn.calcul.easypyfft.FFTW1D(n)[source]

Bases: BasePyFFT

A class to use fftw 1D

class fluiddyn.calcul.easypyfft.FFTW1DReal2Complex(shapeX)[source]

Bases: BasePyFFT

A class to use fftw 1D

Functions

compute_k_adim_seq_3d(nk, axis)

Compute the adimensional wavenumber for an axis.

fftw_grid_size(nk[, bases, debug])

Find the closest multiple of prime powers greater than or equal to nk using Mixed Integer Linear Programming (MILP).

Classes

BaseFFT()

BasePyFFT(shapeX)

FFTP2D(nx, ny)

A class to use fftp

FFTW1D(n)

A class to use fftw 1D

FFTW1DReal2Complex(shapeX)

A class to use fftw 1D

FFTW2DReal2Complex(nx, ny)

A class to use fftw

FFTW3DReal2Complex(nx, ny, nz)

A class to use fftw