Simple wrappers for 2D and 3D FFT functions. More...
Go to the source code of this file.
Functions | |
struct ath_3d_fft_plan * | ath_3d_fft_quick_plan (DomainS *pD, ath_fft_data *data, ath_fft_direction dir) |
Sets up an FFT plan for the entire 3D grid, using ath_3d_fft_create_plan(). | |
struct ath_3d_fft_plan * | ath_3d_fft_create_plan (int gnx3, int gnx2, int gnx1, int gks, int gke, int gjs, int gje, int gis, int gie, ath_fft_data *data, int al, ath_fft_direction dir) |
Sets up a 3D FFT plan. | |
ath_fft_data * | ath_3d_fft_malloc (struct ath_3d_fft_plan *ath_plan) |
Easy allocation of data array needed for particular 3D plan. | |
void | ath_3d_fft (struct ath_3d_fft_plan *ath_plan, ath_fft_data *data) |
Performs a 3D FFT in place. | |
void | ath_3d_fft_free (ath_fft_data *data) |
Frees memory used to hold data for 3D FFT. | |
void | ath_3d_fft_destroy_plan (struct ath_3d_fft_plan *ath_plan) |
Frees a 3D FFT plan. | |
struct ath_2d_fft_plan * | ath_2d_fft_quick_plan (DomainS *pD, ath_fft_data *data, ath_fft_direction dir) |
Sets up an FFT plan for the entire 2D grid, assuming NX3=1, using ath_2d_fft_create_plan(). | |
struct ath_2d_fft_plan * | ath_2d_fft_create_plan (int gnx2, int gnx1, int gjs, int gje, int gis, int gie, ath_fft_data *data, int al, ath_fft_direction dir) |
Sets up a 2D FFT plan. | |
ath_fft_data * | ath_2d_fft_malloc (struct ath_2d_fft_plan *ath_plan) |
Easy allocation of data array needed for particular 2D plan. | |
void | ath_2d_fft (struct ath_2d_fft_plan *ath_plan, fftw_complex *data) |
Performs a 2D FFT in place. | |
void | ath_2d_fft_free (ath_fft_data *data) |
Frees memory used to hold data for 2D FFT. | |
void | ath_2d_fft_destroy_plan (struct ath_2d_fft_plan *ath_plan) |
Frees a 2D FFT plan. |
Simple wrappers for 2D and 3D FFT functions.
PURPOSE: Simple wrappers for 2D and 3D FFT functions. These exist to hide the differences in function calls needed for single processor vs MPI FFT calls. If you're concerned about performance, or want additional functionality, use these functions as examples to either write your own wrappers or to use the FFTW and/or block decomposition libraries directly.
CONTAINS PUBLIC FUNCTIONS:
Definition in file ath_fft.c.
void ath_2d_fft | ( | struct ath_2d_fft_plan * | ath_plan, | |
fftw_complex * | data | |||
) |
Performs a 2D FFT in place.
Definition at line 318 of file ath_fft.c.
References ath_2d_fft_plan::dir, and ath_2d_fft_plan::plan.
Referenced by selfg_fft_2d().
struct ath_2d_fft_plan * ath_2d_fft_create_plan | ( | int | gnx2, | |
int | gnx1, | |||
int | gjs, | |||
int | gje, | |||
int | gis, | |||
int | gie, | |||
ath_fft_data * | data, | |||
int | al, | |||
ath_fft_direction | dir | |||
) | [read] |
Sets up a 2D FFT plan.
Definition at line 251 of file ath_fft.c.
References ath_2d_fft_free(), ath_2d_fft_malloc(), ath_error(), ATH_FFT_BACKWARD, ATH_FFT_FORWARD, ath_2d_fft_plan::cnt, ath_2d_fft_plan::dir, ath_2d_fft_plan::gcnt, and ath_2d_fft_plan::plan.
Referenced by ath_2d_fft_quick_plan().
void ath_2d_fft_destroy_plan | ( | struct ath_2d_fft_plan * | ath_plan | ) |
void ath_2d_fft_free | ( | ath_fft_data * | data | ) |
Frees memory used to hold data for 2D FFT.
Definition at line 334 of file ath_fft.c.
Referenced by ath_2d_fft_create_plan().
ath_fft_data * ath_2d_fft_malloc | ( | struct ath_2d_fft_plan * | ath_plan | ) |
Easy allocation of data array needed for particular 2D plan.
Definition at line 308 of file ath_fft.c.
References ath_2d_fft_plan::cnt.
Referenced by ath_2d_fft_create_plan(), and selfg_fft_2d_init().
struct ath_2d_fft_plan * ath_2d_fft_quick_plan | ( | DomainS * | pD, | |
ath_fft_data * | data, | |||
ath_fft_direction | dir | |||
) | [read] |
Sets up an FFT plan for the entire 2D grid, assuming NX3=1, using ath_2d_fft_create_plan().
Definition at line 215 of file ath_fft.c.
References ath_2d_fft_create_plan(), ath_error(), DomainS::Disp, gie, gis, gje, gjs, gnx1, gnx2, DomainS::Grid, DomainS::Nx, and GridS::Nx.
Referenced by selfg_fft_2d_init().
void ath_3d_fft | ( | struct ath_3d_fft_plan * | ath_plan, | |
ath_fft_data * | data | |||
) |
Performs a 3D FFT in place.
Definition at line 162 of file ath_fft.c.
References ath_3d_fft_plan::dir, and ath_3d_fft_plan::plan.
Referenced by selfg_fft_3d(), selfg_fft_obc_3d(), and transform().
struct ath_3d_fft_plan * ath_3d_fft_create_plan | ( | int | gnx3, | |
int | gnx2, | |||
int | gnx1, | |||
int | gks, | |||
int | gke, | |||
int | gjs, | |||
int | gje, | |||
int | gis, | |||
int | gie, | |||
ath_fft_data * | data, | |||
int | al, | |||
ath_fft_direction | dir | |||
) | [read] |
Sets up a 3D FFT plan.
Definition at line 95 of file ath_fft.c.
References ath_3d_fft_free(), ath_3d_fft_malloc(), ath_error(), ATH_FFT_BACKWARD, ATH_FFT_FORWARD, ath_3d_fft_plan::cnt, ath_3d_fft_plan::dir, ath_3d_fft_plan::gcnt, and ath_3d_fft_plan::plan.
Referenced by ath_3d_fft_quick_plan().
void ath_3d_fft_destroy_plan | ( | struct ath_3d_fft_plan * | ath_plan | ) |
void ath_3d_fft_free | ( | ath_fft_data * | data | ) |
Frees memory used to hold data for 3D FFT.
Definition at line 178 of file ath_fft.c.
Referenced by ath_3d_fft_create_plan(), and problem().
ath_fft_data * ath_3d_fft_malloc | ( | struct ath_3d_fft_plan * | ath_plan | ) |
Easy allocation of data array needed for particular 3D plan.
Definition at line 153 of file ath_fft.c.
References ath_3d_fft_plan::cnt.
Referenced by ath_3d_fft_create_plan(), initialize(), and selfg_fft_3d_init().
struct ath_3d_fft_plan * ath_3d_fft_quick_plan | ( | DomainS * | pD, | |
ath_fft_data * | data, | |||
ath_fft_direction | dir | |||
) | [read] |
Sets up an FFT plan for the entire 3D grid, using ath_3d_fft_create_plan().
Definition at line 56 of file ath_fft.c.
References ath_3d_fft_create_plan(), DomainS::Disp, gie, gis, gje, gjs, gke, gks, gnx1, gnx2, gnx3, DomainS::Grid, GridS::Nx, and DomainS::Nx.
Referenced by initialize(), and selfg_fft_3d_init().