fluidfft.fft3d.operators
Operators 3d (fluidfft.fft3d.operators
)
- class fluidfft.fft3d.operators.OperatorsPseudoSpectral3D(nx, ny, nz, lx, ly, lz, fft=None, coef_dealiasing=1.0)[source]
Bases:
OperatorsBase
Perform 2D FFT and operations on data.
- Parameters:
- nxint
Global dimension over the x-axis (third dimension for the real arrays).
- nyint
Global dimension over the y-axis (second dimension for the real arrays).
- nzint
Global dimension over the y-axis (first dimension for the real arrays).
- lxfloat
Length of the domain along the x-axis.
- lyfloat
Length of the domain along the y-axis.
- lzfloat
Length of the domain along the z-axis.
- fftstr or FFT classes
Name of module or string characterizing a method. It has to correspond to a module of fluidfft. The first part “fluidfft.” of the module “path” can be omitted.
- coef_dealiasingfloat
- Ky: float64[:,:,:]
- Kx: float64[:,:,:]
- Kz: float64[:,:,:]
- inv_K_square_nozero: float64[:,:,:]
- create_arrayX_random(shape='loc', min_val=None, max_val=None)[source]
Return a random array in real space.
- create_arrayK_random(shape='loc', min_val=None, max_val=None)[source]
Return a random array in real space.
- sum_wavenumbers_versatile(field_fft)[source]
Compute the sum over all wavenumbers (versatile version).
This function should return the same result than
sum_wavenumbers()
.It is here mainly to check that the classes are well implemented.
- project_perpk3d_noloop(vx_fft: Array_TypeIfloat64_complex128I_3d, vy_fft: Array_TypeIfloat64_complex128I_3d, vz_fft: Array_TypeIfloat64_complex128I_3d)[source]
Project (inplace) a vector perpendicular to the wavevector.
The resulting vector is divergence-free.
- project_perpk3d(vx_fft: Array_TypeIfloat64_complex128I_3d, vy_fft: Array_TypeIfloat64_complex128I_3d, vz_fft: Array_TypeIfloat64_complex128I_3d)[source]
Project (inplace) a vector perpendicular to the wavevector.
The resulting vector is divergence-free.
- divfft_from_vecfft(vx_fft: complex128[:, :, :], vy_fft: complex128[:, :, :], vz_fft: complex128[:, :, :])[source]
Return the divergence of a vector in spectral space.
- rotfft_from_vecfft(vx_fft: complex128[:, :, :], vy_fft: complex128[:, :, :], vz_fft: complex128[:, :, :])[source]
Return the curl of a vector in spectral space.
- rotfft_from_vecfft_outin(vx_fft: complex128[:, :, :], vy_fft: complex128[:, :, :], vz_fft: complex128[:, :, :], rotxfft: complex128[:, :, :], rotyfft: complex128[:, :, :], rotzfft: complex128[:, :, :])[source]
Return the curl of a vector in spectral space.
- div_vb_fft_from_vb(vx, vy, vz, b)[source]
Compute \(\nabla \cdot (\boldsymbol{v} b)\) in spectral space.
- rotzfft_from_vxvyfft(vx_fft: complex128[:, :, :], vy_fft: complex128[:, :, :])[source]
Compute the z component of the curl in spectral space.
- compute_1dspectra(energy_fft)[source]
Compute the 1D spectra.
- Returns:
- spectrum_kx
- spectrum_ky
- spectrum_kz
- compute_3dspectrum(energy_fft)[source]
Compute the 3D spectrum.
The corresponding wavenumber array is
self.k_spectra3d
.
- compute_spectra_2vars(energy_fft)[source]
Compute spectra vs 2 variables.
Warning
Not implemented!
Todo
Implement the method
compute_spectra_2vars()
.- Returns:
- E_kx_kyz
- E_ky_kzx
- E_kz_kxy
Functions
|
Get a simple 3d parallel method |
|
Get a simple 3d sequential method |
|
Compute the 3d spectrum. |
|
Compute the kz-kh spectrum. |
|
Compute the vector product. |
Classes
|
Perform 2D FFT and operations on data. |