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) |
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().
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.
void bvals_grav_init | ( | MeshS * | pM | ) |
Sets function pointers for physical boundaries during initialization, allocates memory for send/receive buffers with MPI.
Definition at line 418 of file bvals_grav.c.
References ath_error(), MeshS::BCFlag_ix1, MeshS::BCFlag_ix2, MeshS::BCFlag_ix3, MeshS::BCFlag_ox1, MeshS::BCFlag_ox2, MeshS::BCFlag_ox3, calloc_1d_array(), calloc_2d_array(), DomainS::Disp, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::GData, get_myGridIndex(), DomainS::Grid, GridsDataS::ID_Comm_Domain, DomainS::ix1_BCFun, ix1_GBCFun, DomainS::ix2_BCFun, ix2_GBCFun, DomainS::ix3_BCFun, ix3_GBCFun, GridS::lx1_id, GridS::lx2_id, GridS::lx3_id, myID_Comm_world, n, DomainS::NGrid, MeshS::NLevels, GridsDataS::Nx, MeshS::Nx, DomainS::Nx, GridS::Nx, DomainS::ox1_BCFun, ox1_GBCFun, DomainS::ox2_BCFun, ox2_GBCFun, DomainS::ox3_BCFun, ox3_GBCFun, recv_buf, recv_rq, GridS::rx1_id, GridS::rx2_id, GridS::rx3_id, send_buf, and send_rq.
Referenced by main().
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.
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().
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.
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().
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.
void selfg_fft_obc_3d_init | ( | MeshS * | pM | ) |
void selfg_flux_correction | ( | GridS * | pG | ) |
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().
void selfg_multig_1d | ( | DomainS * | pD | ) |
1-D multigrid gravity
Definition at line 87 of file selfg_multigrid.c.
References ath_error().
void selfg_multig_2d | ( | DomainS * | pD | ) |
2-D multigrid gravity
Definition at line 98 of file selfg_multigrid.c.
References ath_error().
void selfg_multig_3d | ( | DomainS * | pD | ) |
Do not use with periodic BCs, uses multipole expansion to compute potential at boundary.
Definition at line 110 of file selfg_multigrid.c.
References ath_error(), calloc_3d_array(), cc_pos(), ConsS::d, MGrid::dx1, GridS::dx1, MGrid::dx2, GridS::dx2, MGrid::dx3, GridS::dx3, four_pi_G, free_3d_array(), DomainS::Grid, MGrid::ie, GridS::ie, MGrid::is, GridS::is, MGrid::je, GridS::je, MGrid::js, GridS::js, MGrid::ke, GridS::ke, MGrid::ks, GridS::ks, MGrid::lx1_id, GridS::lx1_id, MGrid::lx2_id, GridS::lx2_id, MGrid::lx3_id, GridS::lx3_id, multig_3d(), GridS::Nx, MGrid::Nx1, MGrid::Nx2, MGrid::Nx3, MGrid::Phi, GridS::Phi, GridS::Phi_old, rad, MGrid::rhs, MGrid::rx1_id, GridS::rx1_id, MGrid::rx2_id, GridS::rx2_id, MGrid::rx3_id, GridS::rx3_id, set_mg_bvals(), and GridS::U.
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().