Cartesian with MPI¶
Cartesian grids with MPI¶
- shift.cart.mpi_grid1D(boxsize, ngrid, MPI, origin=0.0)[source]¶
Returns the x coordinates of a cartesian grid.
- shift.cart.mpi_grid2D(boxsize, ngrid, MPI, origin=0.0)[source]¶
Returns the x, y coordinates of a cartesian grid.
- Parameters:
boxsize (float) – Box size or list of length along each axis.
ngrid (int) – Grid division along one axis or a list of the grid divisions along each axis.
MPI (object) – MPIutils MPI object.
origin (float, optional) – Origin of the grid. If all axes begin at the same origin this can be a scalar, if you instead wish to specify different origins for each axis this should be added as a list.
- Returns:
x2D (array) – X coordinates on a 2D cartesian grid.
y2D (array) – Y coordinates on a 2D cartesian grid.
- shift.cart.mpi_grid3D(boxsize, ngrid, MPI, origin=0.0)[source]¶
Returns the x, y, z coordinates of a cartesian grid.
- Parameters:
boxsize (float) – Box size or list of length along each axis.
ngrid (int) – Grid division along one axis or a list of the grid divisions along each axis.
MPI (object) – MPIutils MPI object.
origin (float, optional) – Origin of the grid. If all axes begin at the same origin this can be a scalar, if you instead wish to specify different origins for each axis this should be added as a list.
- Returns:
x3D (array) – X coordinates on a 3D cartesian grid.
y3D (array) – Y coordinates on a 3D cartesian grid.
z3D (array) – Z coordinates on a 3D cartesian grid.
FFT with MPI¶
Fourier grids¶
- shift.cart.mpi_kgrid1D(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Fast Fourier Transform on a 1D cartesian grid.
- shift.cart.mpi_kgrid2D(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Fast Fourier Transform on a 2D cartesian grid.
Forward/Backward Transforms¶
- shift.cart.mpi_fft2D(f_real, boxsize, ngrid, MPI)[source]¶
Performs MPI forward FFT on real space data.
- Parameters:
- Returns:
f_fourier – Fourier modes.
- Return type:
ndarray
- shift.cart.mpi_ifft2D(f_fourier, boxsize, ngrid, MPI)[source]¶
Performs MPI backward FFT on Fourier modes.
- Parameters:
- Returns:
f_real – Real space data.
- Return type:
1darray or ndarray
- shift.cart.mpi_fft3D(f_real, boxsize, ngrid, MPI)[source]¶
Performs MPI forward FFT on real space data.
DCT with MPI¶
Fourier grids¶
- shift.cart.mpi_kgrid1D_dct(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Discrete Cosine Transform on a 1D cartesian grid.
- shift.cart.mpi_kgrid2D_dct(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Discrete Cosine Transform on a 2D cartesian grid.
Forward/Backward Transforms¶
- shift.cart.mpi_dct2D(f_real, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI forward DCT on real space data.
- Parameters:
- Returns:
f_fourier – Fourier modes.
- Return type:
ndarray
- shift.cart.mpi_idct2D(f_fourier, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI backward DCT on Fourier modes.
- Parameters:
- Returns:
f_real – Real space data.
- Return type:
1darray or ndarray
- shift.cart.mpi_dct3D(f_real, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI forward DCT on real space data.
- Parameters:
- Returns:
f_fourier – Fourier modes.
- Return type:
ndarray
DST with MPI¶
Fourier grids¶
- shift.cart.mpi_kgrid1D_dst(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Discrete Sine Transform on a 1D cartesian grid.
- shift.cart.mpi_kgrid2D_dst(boxsize, ngrid, MPI)[source]¶
Returns the Fourier modes for the Discrete Sine Transform on a 2D cartesian grid.
Forward/Backward Transforms¶
- shift.cart.mpi_dst2D(f_real, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI forward DST on real space data.
- Parameters:
- Returns:
f_fourier – Fourier modes.
- Return type:
ndarray
- shift.cart.mpi_idst2D(f_fourier, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI backward DST on Fourier modes.
- Parameters:
- Returns:
f_real – Real space data.
- Return type:
1darray or ndarray
- shift.cart.mpi_dst3D(f_real, boxsize, ngrid, MPI, type=2)[source]¶
Performs MPI forward DST on real space data.
- Parameters:
- Returns:
f_fourier – Fourier modes.
- Return type:
ndarray