Functions | Variables

particles/feedback.c File Reference

Exchange particle feedback between boundary cells. More...

Go to the source code of this file.

Functions

static void reflect_ix1_feedback (Grid *pG)
 REFLECTING boundary conditions, Inner x1 boundary (ibc_x1=1,5).
static void reflect_ox1_feedback (Grid *pG)
 REFLECTING boundary conditions, Outer x1 boundary (obc_x1=1,5).
static void reflect_ix2_feedback (Grid *pG)
 REFLECTING boundary conditions, Inner x2 boundary (ibc_x2=1,5).
static void reflect_ox2_feedback (Grid *pG)
 REFLECTING boundary conditions, Outer x2 boundary (obc_x2=1,5).
static void reflect_ix3_feedback (Grid *pG)
 REFLECTING boundary conditions, Inner x3 boundary (ibc_x3=1,5).
static void reflect_ox3_feedback (Grid *pG)
 REFLECTING boundary conditions, Outer x3 boundary (obc_x3=1,5).
static void outflow_feedback (Grid *pG)
 OUTFLOW boundary conditions (ibc=1,5), essentially do nothing.
static void periodic_ix1_feedback (Grid *pG)
 PERIODIC boundary conditions, Inner x1 boundary (ibc_x1=4).
static void periodic_ox1_feedback (Grid *pG)
 PERIODIC boundary conditions, Outer x1 boundary (obc_x1=4).
static void periodic_ix2_feedback (Grid *pG)
 PERIODIC boundary conditions, Inner x2 boundary (ibc_x2=4).
static void periodic_ox2_feedback (Grid *pG)
 PERIODIC boundary conditions,Outer x2 boundary (obc_x2=4).
static void periodic_ix3_feedback (Grid *pG)
 PERIODIC boundary conditions, Inner x3 boundary (ibc_x3=4).
static void periodic_ox3_feedback (Grid *pG)
 PERIODIC boundary conditions, Outer x3 boundary (obc_x3=4).
static void send_ix1_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Inner x1 boundary -- send left.
static void send_ox1_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Outer x1 boundary -- send right.
static void send_ix2_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Inner x2 boundary -- send left.
static void send_ox2_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Outer x2 boundary -- send right.
static void send_ix3_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Inner x3 boundary -- send left.
static void send_ox3_feedback (Grid *pG)
 MPI_SEND of boundary conditions, Outer x3 boundary -- send right.
static void recv_ix1_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Inner x1 boundary -- listen left.
static void recv_ox1_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Outer x1 boundary -- listen right.
static void recv_ix2_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Inner x2 boundary -- listen left.
static void recv_ox2_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Outer x2 boundary -- listen right.
static void recv_ix3_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Inner x3 boundary -- listen left.
static void recv_ox3_feedback (Grid *pG, MPI_Request *prq)
 MPI_RECEIVE of boundary conditions, Outer x3 boundary -- listen right.
static void shearingbox_ix1_feedback (Grid *pG, Domain *pD)
 Exchange feedback for 3D shearing box, Inner x1.
static void shearingbox_ox1_feedback (Grid *pG, Domain *pD)
 Exchange feedback for 3D shearing box, Outer x1.
void exchange_feedback (Grid *pG, Domain *pD)
 Calls appropriate functions to copy feedback in the ghost zones back to the grid.
void exchange_feedback_init (Grid *pG, Domain *pD)
 Sets function pointers for feedback exchange during initialization, allocates memory for send/receive buffers with MPI.
void exchange_feedback_fun (enum Direction dir, VBCFun_t prob_bc)
 Sets function pointers for user-defined feedback exchange in problem file.
void exchange_feedback_destruct (Grid *pG, Domain *pD)
 Finalize feedback exchange.

Variables

static double * send_buf = NULL
static double * recv_buf = NULL
static int my_iproc
static int my_jproc
static int my_kproc
static int il
static int iu
static int jl
static int ju
static int kl
static int ku
static Real x1min
static Real x1max
static Real x2min
static Real x2max
static Real x3min
static Real x3max
static Real Lx1
static Real Lx2
static Real Lx3
static VBCFun_t apply_ix1 = NULL
static VBCFun_t apply_ox1 = NULL
static VBCFun_t apply_ix2 = NULL
static VBCFun_t apply_ox2 = NULL
static VBCFun_t apply_ix3 = NULL
static VBCFun_t apply_ox3 = NULL

Detailed Description

Exchange particle feedback between boundary cells.

PURPOSE: Exchange particle feedback between boundary cells. The procedure is opposite to setting boundary conditions. Extra feedback forces are exterted to cells outside the grid boundary, by feedback exchange, these forces are properly added to cells inside the grid boundary, according to various boundary conditions.

Currently, for shearing box simulation in 3D, FARGO must be enabled.

CONTAINS PUBLIC FUNCTIONS:

PRIVATE FUNCTIONS:

History:

Definition in file feedback.c.


Function Documentation

void exchange_feedback ( Grid *  pG,
Domain *  pD 
)

Calls appropriate functions to copy feedback in the ghost zones back to the grid.

The function pointers (*apply_???) are set during initialization by exchange_feedback_init() to be either a user-defined function, or one of the functions corresponding to reflecting, periodic, or outflow. 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 x3-x2-x1 in order to fill the corner cells properly (opposite to setting MHD B.C.!)

Definition at line 137 of file feedback.c.

References ath_error(), my_iproc, recv_buf, recv_ix1_feedback(), recv_ix2_feedback(), recv_ix3_feedback(), recv_ox1_feedback(), recv_ox2_feedback(), recv_ox3_feedback(), send_ix1_feedback(), send_ix2_feedback(), send_ix3_feedback(), send_ox1_feedback(), send_ox2_feedback(), send_ox3_feedback(), shearingbox_ix1_feedback(), and shearingbox_ox1_feedback().

Referenced by integrate_1d_ctu(), integrate_2d_ctu(), and integrate_3d_ctu().

Here is the call graph for this function:

Here is the caller graph for this function:

void exchange_feedback_destruct ( Grid *  pG,
Domain *  pD 
)

Finalize feedback exchange.

Definition at line 660 of file feedback.c.

References apply_ix1, apply_ix2, apply_ix3, apply_ox1, apply_ox2, apply_ox3, recv_buf, and send_buf.

void exchange_feedback_fun ( enum Direction  dir,
VBCFun_t  prob_bc 
)

Sets function pointers for user-defined feedback exchange in problem file.

Definition at line 630 of file feedback.c.

References apply_ix1, apply_ix2, apply_ix3, apply_ox1, apply_ox2, apply_ox3, ath_perr(), left_x1, left_x2, left_x3, right_x1, right_x2, and right_x3.

Here is the call graph for this function:

void exchange_feedback_init ( Grid *  pG,
Domain *  pD 
)

Sets function pointers for feedback exchange during initialization, allocates memory for send/receive buffers with MPI.

Definition at line 354 of file feedback.c.

References apply_ix1, apply_ix2, apply_ix3, apply_ox1, apply_ox2, apply_ox3, ath_error(), ath_perr(), get_myGridIndex(), il, iu, jl, ju, kl, ku, Lx1, Lx2, Lx3, my_iproc, my_jproc, my_kproc, par_getd(), par_geti(), recv_buf, send_buf, x1max, x1min, x2max, x2min, x3max, and x3min.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void outflow_feedback ( Grid *  pG  )  [static]

OUTFLOW boundary conditions (ibc=1,5), essentially do nothing.

Definition at line 845 of file feedback.c.

static void periodic_ix1_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions, Inner x1 boundary (ibc_x1=4).

Definition at line 954 of file feedback.c.

static void periodic_ix2_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions, Inner x2 boundary (ibc_x2=4).

Definition at line 904 of file feedback.c.

References il, and iu.

static void periodic_ix3_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions, Inner x3 boundary (ibc_x3=4).

Definition at line 854 of file feedback.c.

References il, iu, jl, and ju.

static void periodic_ox1_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions, Outer x1 boundary (obc_x1=4).

Definition at line 979 of file feedback.c.

static void periodic_ox2_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions,Outer x2 boundary (obc_x2=4).

Definition at line 929 of file feedback.c.

References il, and iu.

static void periodic_ox3_feedback ( Grid *  pG  )  [static]

PERIODIC boundary conditions, Outer x3 boundary (obc_x3=4).

Definition at line 879 of file feedback.c.

References il, iu, jl, and ju.

static void recv_ix1_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Inner x1 boundary -- listen left.

Definition at line 1368 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void recv_ix2_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Inner x2 boundary -- listen left.

Definition at line 1298 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void recv_ix3_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Inner x3 boundary -- listen left.

Definition at line 1228 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, jl, ju, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void recv_ox1_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Outer x1 boundary -- listen right.

Definition at line 1403 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void recv_ox2_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Outer x2 boundary -- listen right.

Definition at line 1333 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void recv_ox3_feedback ( Grid *  pG,
MPI_Request *  prq 
) [static]

MPI_RECEIVE of boundary conditions, Outer x3 boundary -- listen right.

Definition at line 1263 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, jl, ju, and recv_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void reflect_ix1_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Inner x1 boundary (ibc_x1=1,5).

Definition at line 793 of file feedback.c.

static void reflect_ix2_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Inner x2 boundary (ibc_x2=1,5).

Definition at line 741 of file feedback.c.

References il, and iu.

static void reflect_ix3_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Inner x3 boundary (ibc_x3=1,5).

Definition at line 690 of file feedback.c.

References il, iu, jl, and ju.

static void reflect_ox1_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Outer x1 boundary (obc_x1=1,5).

Definition at line 819 of file feedback.c.

static void reflect_ox2_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Outer x2 boundary (obc_x2=1,5).

Definition at line 767 of file feedback.c.

References il, and iu.

static void reflect_ox3_feedback ( Grid *  pG  )  [static]

REFLECTING boundary conditions, Outer x3 boundary (obc_x3=1,5).

Definition at line 716 of file feedback.c.

References il, iu, jl, and ju.

static void send_ix1_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Inner x1 boundary -- send left.

Definition at line 1154 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void send_ix2_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Inner x2 boundary -- send left.

Definition at line 1080 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void send_ix3_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Inner x3 boundary -- send left.

Definition at line 1006 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, jl, ju, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void send_ox1_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Outer x1 boundary -- send right.

Definition at line 1191 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void send_ox2_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Outer x2 boundary -- send right.

Definition at line 1117 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void send_ox3_feedback ( Grid *  pG  )  [static]

MPI_SEND of boundary conditions, Outer x3 boundary -- send right.

Definition at line 1043 of file feedback.c.

References ath_error(), GPCouple::Eloss, GPCouple::fb1, GPCouple::fb2, GPCouple::fb3, il, iu, jl, ju, and send_buf.

Referenced by exchange_feedback().

Here is the call graph for this function:

Here is the caller graph for this function:

static void shearingbox_ix1_feedback ( Grid *  pG,
Domain *  pD 
) [static]

Exchange feedback for 3D shearing box, Inner x1.

Note that here we only need to shear the feedback array by an integer number of cells.

Definition at line 1444 of file feedback.c.

Referenced by exchange_feedback().

Here is the caller graph for this function:

static void shearingbox_ox1_feedback ( Grid *  pG,
Domain *  pD 
) [static]

Exchange feedback for 3D shearing box, Outer x1.

Note that here we only need to shear the feedback array by an integer number of cells.

Definition at line 1456 of file feedback.c.

Referenced by exchange_feedback().

Here is the caller graph for this function:


Variable Documentation

VBCFun_t apply_ix1 = NULL [static]
VBCFun_t apply_ix2 = NULL [static]
VBCFun_t apply_ix3 = NULL [static]
VBCFun_t apply_ox1 = NULL [static]
VBCFun_t apply_ox2 = NULL [static]
VBCFun_t apply_ox3 = NULL [static]
int il [static]
int iu [static]
int jl [static]
int ju [static]
int kl [static]
int ku [static]
Real Lx1 [static]

Definition at line 64 of file feedback.c.

Referenced by exchange_feedback_init().

Real Lx2 [static]

Definition at line 64 of file feedback.c.

Referenced by exchange_feedback_init().

Real Lx3 [static]

Definition at line 64 of file feedback.c.

Referenced by exchange_feedback_init().

int my_iproc [static]

Definition at line 58 of file feedback.c.

Referenced by exchange_feedback(), and exchange_feedback_init().

int my_jproc [static]

Definition at line 58 of file feedback.c.

Referenced by exchange_feedback_init().

int my_kproc [static]

Definition at line 58 of file feedback.c.

Referenced by exchange_feedback_init().

double * recv_buf = NULL [static]
double* send_buf = NULL [static]
Real x1max [static]

Definition at line 62 of file feedback.c.

Real x1min [static]

Definition at line 62 of file feedback.c.

Real x2max [static]

Definition at line 62 of file feedback.c.

Real x2min [static]

Definition at line 62 of file feedback.c.

Real x3max [static]

Definition at line 62 of file feedback.c.

Real x3min [static]

Definition at line 62 of file feedback.c.