Functions

gravity/prototypes.h File Reference

Go to the source code of this file.

Functions

void bvals_grav_init (MeshS *pM)
 Sets function pointers for physical boundaries during initialization, allocates memory for send/receive buffers with MPI.
void bvals_grav_fun (DomainS *pD, enum BCDirection dir, VGFun_t prob_bc)
 Sets function pointers for user-defined BCs in problem.
void bvals_grav (DomainS *pDomain)
 Calls appropriate functions to set ghost zones.
VDFun_t selfg_init (MeshS *pM)
 Initialize pointer to appropriate self-gravity f'n, allocates memory for dPhi array used for flux correction.
void selfg_flux_correction (GridS *pG)
void selfg_multig_1d (DomainS *pD)
 1-D multigrid gravity
void selfg_multig_2d (DomainS *pD)
 2-D multigrid gravity
void selfg_multig_3d (DomainS *pD)
 Do not use with periodic BCs, uses multipole expansion to compute potential at boundary.
void selfg_multig_3d_init (MeshS *pM)
 Initialize send/receive buffers needed to swap iterates during Jacobi iterations.
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.
void selfg_fft_obc_3d (DomainS *pD)
 Only works for uniform grid, periodic boundary conditions.
void selfg_fft_obc_3d_init (MeshS *pM)

Function Documentation

void bvals_grav ( DomainS pD  ) 

Calls appropriate functions to set ghost zones.

The function pointers (*_GBCFun) are set during initialization by bvals_grav_init() to be one of the functions corresponding to reflecting or periodic. If the left- or right-Grid ID numbers are >= 1 (neighboring grids exist), then MPI calls are used.

Order for updating boundary conditions must always be x1-x2-x3 in order to fill the corner cells properly

Definition at line 95 of file bvals_grav.c.

References ath_2d_fft_plan::cnt, DomainS::Comm_Domain, get_myGridIndex(), DomainS::Grid, ix1_GBCFun, ix2_GBCFun, ix3_GBCFun, GridS::lx1_id, GridS::lx2_id, GridS::lx3_id, my_iproc, myID_Comm_world, GridS::Nx, ox1_GBCFun, ox2_GBCFun, ox3_GBCFun, pack_ix1(), pack_ix2(), pack_ix3(), pack_ox1(), pack_ox2(), pack_ox3(), recv_buf, recv_rq, GridS::rx1_id, GridS::rx2_id, GridS::rx3_id, send_buf, send_rq, unpack_ix1(), unpack_ix2(), unpack_ix3(), unpack_ox1(), unpack_ox2(), and unpack_ox3().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void bvals_grav_fun ( DomainS pD,
enum BCDirection  dir,
VGFun_t  prob_bc 
)

Sets function pointers for user-defined BCs in problem.

Definition at line 774 of file bvals_grav.c.

References ath_perr(), ix1_GBCFun, ix2_GBCFun, ix3_GBCFun, left_x1, left_x2, left_x3, ox1_GBCFun, ox2_GBCFun, ox3_GBCFun, right_x1, right_x2, and right_x3.

Here is the call graph for this function:

void bvals_grav_init ( MeshS pM  ) 
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.

Referenced by selfg_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void selfg_fft_obc_3d ( DomainS pD  ) 

Only works for uniform grid, periodic boundary conditions.

Definition at line 50 of file selfg_fft_obc.c.

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

Here is the call graph for this function:

void selfg_fft_obc_3d_init ( MeshS pM  ) 

Referenced by selfg_init().

Here is the caller graph for this function:

void selfg_flux_correction ( GridS pG  ) 
VDFun_t selfg_init ( MeshS pM  ) 

Initialize pointer to appropriate self-gravity f'n, allocates memory for dPhi array used for flux correction.

Definition at line 507 of file selfg.c.

References ath_error(), dim, four_pi_G, grav_mean_rho, MeshS::Nx, selfg_fft_2d_init(), selfg_fft_3d_init(), selfg_fft_obc_3d_init(), and selfg_multig_3d_init().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void selfg_multig_1d ( DomainS pD  ) 

1-D multigrid gravity

Definition at line 87 of file selfg_multigrid.c.

References ath_error().

Here is the call graph for this function:

void selfg_multig_2d ( DomainS pD  ) 

2-D multigrid gravity

Definition at line 98 of file selfg_multigrid.c.

References ath_error().

Here is the call graph for this function:

void selfg_multig_3d ( DomainS pD  ) 
void selfg_multig_3d_init ( MeshS pM  ) 

Initialize send/receive buffers needed to swap iterates during Jacobi iterations.

Definition at line 1043 of file selfg_multigrid.c.

References ath_error(), calloc_3d_array(), MeshS::Domain, MeshS::DomainsPerLevel, error, DomainS::Grid, MeshS::NLevels, GridS::Nx, par_geti(), recv_buf, and send_buf.

Referenced by selfg_init().

Here is the call graph for this function:

Here is the caller graph for this function: