Functions | Variables

gravity/selfg_fft.c File Reference

Contains functions to solve Poisson's equation for self-gravity in 1D, 2D and 3D using FFTs (actually, the 1D algorithm uses Forward Elimination followed by Back Substitution: FEBS). More...

Go to the source code of this file.

Functions

void selfg_fft_1d (DomainS *pD)
 This algorithm taken from pp.35-38 of Hockney & Eastwood.
void selfg_fft_2d (DomainS *pD)
 Only works for uniform grid, periodic boundary conditions.
void selfg_fft_3d (DomainS *pD)
 Only works for uniform grid, periodic boundary conditions.
void selfg_fft_2d_init (MeshS *pM)
 Initializes plans for forward/backward FFTs, and allocates memory needed by FFTW.
void selfg_fft_3d_init (MeshS *pM)
 Initializes plans for forward/backward FFTs, and allocates memory needed by FFTW.

Variables

static struct ath_2d_fft_planfplan2d
static struct ath_2d_fft_planbplan2d
static struct ath_3d_fft_planfplan3d
static struct ath_3d_fft_planbplan3d
static ath_fft_data * work = NULL

Detailed Description

Contains functions to solve Poisson's equation for self-gravity in 1D, 2D and 3D using FFTs (actually, the 1D algorithm uses Forward Elimination followed by Back Substitution: FEBS).

These functions require PERIODIC BCs and use the Jeans swindle.

The 2D and 3D f'ns use FFTW3.x, and for MPI parallel use Steve Plimpton's block decomposition routines added by N. Lemaster to /athena/fftsrc. This means to use these fns the code must be

For NON-PERIODIC BCs, use selfg_multig() functions.

CONTAINS PUBLIC FUNCTIONS:

Definition in file selfg_fft.c.


Function Documentation

void selfg_fft_1d ( DomainS pD  ) 

This algorithm taken from pp.35-38 of Hockney & Eastwood.

Actually uses forward elimination - back substituion!! Only works for uniform grid, periodic boundary conditions

Definition at line 57 of file selfg_fft.c.

References ConsS::d, GridS::dx1, four_pi_G, grav_mean_rho, DomainS::Grid, GridS::ie, GridS::is, GridS::js, GridS::ks, GridS::Nx, GridS::Phi, GridS::Phi_old, and GridS::U.

void selfg_fft_2d ( DomainS pD  ) 

Only works for uniform grid, periodic boundary conditions.

Definition at line 105 of file selfg_fft.c.

References ath_2d_fft(), ConsS::d, GridS::Disp, dkx, GridS::dx1, GridS::dx2, four_pi_G, ath_2d_fft_plan::gcnt, grav_mean_rho, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ks, DomainS::Nx, GridS::Nx, GridS::Phi, GridS::Phi_old, GridS::U, and work.

Here is the call graph for this function:

void selfg_fft_2d_init ( MeshS pM  ) 

Initializes plans for forward/backward FFTs, and allocates memory needed by FFTW.

Definition at line 289 of file selfg_fft.c.

References ath_2d_fft_malloc(), ath_2d_fft_quick_plan(), ATH_FFT_BACKWARD, ATH_FFT_FORWARD, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, MeshS::NLevels, and work.

Referenced by selfg_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void selfg_fft_3d ( DomainS pD  ) 

Only works for uniform grid, periodic boundary conditions.

Definition at line 186 of file selfg_fft.c.

References ath_3d_fft(), ConsS::d, GridS::Disp, dkx, GridS::dx1, GridS::dx2, GridS::dx3, four_pi_G, ath_3d_fft_plan::gcnt, grav_mean_rho, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, DomainS::Nx, GridS::Nx, GridS::Phi, GridS::Phi_old, GridS::U, and work.

Here is the call graph for this function:

void selfg_fft_3d_init ( MeshS pM  ) 

Initializes plans for forward/backward FFTs, and allocates memory needed by FFTW.

NOTE: for SMR, allocation of memory for Poisson kernel arrays Geee, Gooo, Goee, Geoo, Geoe, Goeo, Geeo, Gooe could also be done here

Definition at line 311 of file selfg_fft.c.

References ath_3d_fft_malloc(), ath_3d_fft_quick_plan(), ATH_FFT_BACKWARD, ATH_FFT_FORWARD, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, MeshS::NLevels, and work.

Here is the call graph for this function:


Variable Documentation

struct ath_2d_fft_plan * bplan2d [static]

Definition at line 41 of file selfg_fft.c.

struct ath_3d_fft_plan * bplan3d [static]

Definition at line 42 of file selfg_fft.c.

struct ath_2d_fft_plan* fplan2d [static]

Definition at line 41 of file selfg_fft.c.

struct ath_3d_fft_plan* fplan3d [static]

Definition at line 42 of file selfg_fft.c.

ath_fft_data* work = NULL [static]

Definition at line 43 of file selfg_fft.c.

Referenced by selfg_fft_2d(), selfg_fft_2d_init(), selfg_fft_3d(), and selfg_fft_3d_init().