TARANG.lib.global_fns.spectral_setup#

Attributes#

Functions#

SpectralInit(para)

xderiv(Ak)

Compute the x-derivative of the array in Fourier space.

yderiv(Ak)

Compute the y-derivative of the array in Fourier space.

zderiv(Ak)

Compute the z-derivative of the array in Fourier space.

forward_transform(para, A, Ak)

Compute the forward Fourier transform of the array.

inverse_transform(para, Ak, A)

Compute the inverse Fourier transform of the array.

dealias(Ak)

Apply dealiasing to the array in Fourier space.

dealias_old(para, Ak)

Apply old dealiasing method to the array in Fourier space.

reality_cond(para, Ak)

Apply reality condition to the array in Fourier space.

generate_spectrum2D(para, Ak, ek, Tk, nlin, temp)

Generate the 2D energy spectrum and transfer function.

generate_spectrum3D(para, Ak, ek, Tk, nlin, temp)

Generate the 3D energy spectrum and transfer function.

generate_specta_planar(para, Ak, ek, Tk, nlin, temp)

Generate the planar energy spectrum and transfer function.

resize(Ak_in, Ak, N)

Resize the array Ak_in to fit into the array Ak with the given dimensions N.

boundary_sin_cond(para, Ak)

Apply sine boundary condition to the array in Fourier space.

boundary_cos_cond(para, Ak)

Apply cosine boundary condition to the array in Fourier space.

Module Contents#

TARANG.lib.global_fns.spectral_setup.kx = None#
TARANG.lib.global_fns.spectral_setup.ky = None#
TARANG.lib.global_fns.spectral_setup.kz = None#
TARANG.lib.global_fns.spectral_setup.kfactor = None#
TARANG.lib.global_fns.spectral_setup.Ngrid = None#
TARANG.lib.global_fns.spectral_setup.NgridF = None#
TARANG.lib.global_fns.spectral_setup.kfactor = None#
TARANG.lib.global_fns.spectral_setup.kx_mesh = None#
TARANG.lib.global_fns.spectral_setup.ky_mesh = None#
TARANG.lib.global_fns.spectral_setup.NgridF = None#
TARANG.lib.global_fns.spectral_setup.kz_mesh = None#
TARANG.lib.global_fns.spectral_setup.ksqr = None#
TARANG.lib.global_fns.spectral_setup.dealiasing_index = None#
TARANG.lib.global_fns.spectral_setup.min_radius_outside = None#
TARANG.lib.global_fns.spectral_setup.k_array = None#
TARANG.lib.global_fns.spectral_setup.SpectralInit(para)#
TARANG.lib.global_fns.spectral_setup.xderiv(Ak)#

Compute the x-derivative of the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

x-derivative of the array in Fourier space.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.yderiv(Ak)#

Compute the y-derivative of the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

y-derivative of the array in Fourier space.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.zderiv(Ak)#

Compute the z-derivative of the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

z-derivative of the array in Fourier space.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.forward_transform(para, A, Ak)#

Compute the forward Fourier transform of the array.

Parameters:
  • A (array-like) – Array in real space.

  • Ak (array-like) – Array in Fourier space.

Returns:

Forward Fourier transform of the array.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.inverse_transform(para, Ak, A)#

Compute the inverse Fourier transform of the array.

Parameters:
  • Ak (array-like) – Array in Fourier space.

  • A (array-like) – Array in real space.

Returns:

Inverse Fourier transform of the array.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.dealias(Ak)#

Apply dealiasing to the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

Dealiased array in Fourier space.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.dealias_old(para, Ak)#

Apply old dealiasing method to the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

Dealiased array in Fourier space.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.reality_cond(para, Ak)#

Apply reality condition to the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

Array in Fourier space with reality condition applied.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.generate_spectrum2D(para, Ak, ek, Tk, nlin, temp)#

Generate the 2D energy spectrum and transfer function.

Parameters:
  • Ak (array-like) – Array in Fourier space.

  • ek (array-like) – Array for the energy spectrum.

  • Tk (array-like) – Array for the transfer function.

  • nlin (array-like) – Array for the nonlinear terms.

  • temp (array-like) – Temporary array for calculations.

Return type:

None

TARANG.lib.global_fns.spectral_setup.generate_spectrum3D(para, Ak, ek, Tk, nlin, temp)#

Generate the 3D energy spectrum and transfer function.

Parameters:
  • Ak (array-like) – Array in Fourier space.

  • ek (array-like) – Array for the energy spectrum.

  • Tk (array-like) – Array for the transfer function.

  • nlin (array-like) – Array for the nonlinear terms.

  • temp (array-like) – Temporary array for calculations.

Return type:

None

TARANG.lib.global_fns.spectral_setup.generate_specta_planar(para, Ak, ek, Tk, nlin, temp)#

Generate the planar energy spectrum and transfer function.

Parameters:
  • Ak (array-like) – Array in Fourier space.

  • ek (array-like) – Array for the energy spectrum.

  • Tk (array-like) – Array for the transfer function.

  • nlin (array-like) – Array for the nonlinear terms.

  • temp (array-like) – Temporary array for calculations.

Return type:

None

TARANG.lib.global_fns.spectral_setup.resize(Ak_in, Ak, N)#

Resize the array Ak_in to fit into the array Ak with the given dimensions N.

Parameters:
  • Ak (array-like) – Array to be resized.

  • Ak_in (array-like) – Input array to be resized.

  • N (list of int) – Dimensions of the output array.

Returns:

Resized array.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.boundary_sin_cond(para, Ak)#

Apply sine boundary condition to the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

Array in Fourier space with sine boundary condition applied.

Return type:

array-like

TARANG.lib.global_fns.spectral_setup.boundary_cos_cond(para, Ak)#

Apply cosine boundary condition to the array in Fourier space.

Parameters:

Ak (array-like) – Array in Fourier space.

Returns:

Array in Fourier space with cosine boundary condition applied.

Return type:

array-like