HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
bounds.tools.c File Reference

General or frequenty-used Boundary condition routines. More...

#include "decs.h"
Include dependency graph for bounds.tools.c:

Go to the source code of this file.

Macros

#define XFRAC1   (0.1)
 
#define YFRAC1   (0.0)
 
#define XFRAC2   (0.2)
 
#define YFRAC2   (1.0)
 
#define YFRAC12(frac)   (YFRAC1 + (YFRAC2-YFRAC1)/(XFRAC2-XFRAC1)*(frac-XFRAC1))
 
#define XDQFRAC1   (0.1)
 
#define YDQFRAC1   (0.0)
 
#define XDQFRAC2   (0.2)
 
#define YDQFRAC2   (1.0)
 
#define YDQFRAC12(frac)   (YDQFRAC1 + (YDQFRAC2-YDQFRAC1)/(XDQFRAC2-XDQFRAC1)*(frac-XDQFRAC1))
 
#define POWEREXTRAFRAC   (0.1)
 
#define POWERRATIO   (1.0+POWEREXTRAFRAC)
 
#define EXTRAPBD3   0
 
#define UTHETAPOLEDEATH   ((PRIMTOINTERP_3VELREL_GAMMAREL_DXDXP==VARTOINTERP)?(1):(0))
 
#define RADIUSOUTERDEATHMORE   (BIG)
 
#define DEATHLOOP2(whichx2)   for (j = (whichx2==X2UP ? MIN(deathstagjs,deathjs) : MAX(deathstagje,deathje)) ; (whichx2==X2UP ? (j <= MAX(deathstagje,deathje)) : (j >= MIN(deathstagjs,deathjs)) ) ; (whichx2==X2UP ? j++ : j--) )
 
#define DEBUGPOLESMOOTH   0
 
#define MAPFULLPR(i, fakej, k, pl)   ( (fakej)*(N3BND+N3+N3BND)*(N1BND+N1+N1BND)*NPR + ((k)+N3BND)*(N1BND+N1+N1BND)*NPR + ((i)+N1BND)*NPR + (pl) )
 
#define N1TOTFULLPR   (N1BND+N1+N1BND)
 
#define N2TOTFULLPR   (ncpux3>1&&USEMPI&&N3>1 ? 1 : 2)
 
#define N3TOTFULLPR   (N3BND+totalsize[3]+N3BND)
 
#define AVOIDCS   0
 
#define DAMPECOV   0
 
#define DAMPGAMMA   0
 
#define OUTERDEATHDAMP   0
 
#define BEGINDEATHTRANSITION   (OUTERDEATHRADIUS*0.8)
 
#define cr(x)   (exp(-1.0/(x)))
 
#define tr(x)   (cr(x)/(cr(x) + cr(1.0-(x))))
 
#define trans(x, L, R)   ((x)<=(L) ? 0.0 : ((x)>=(R) ? 1.0 : tr(((x)-(L))/((R)-(L)))) )
 
#define FACTORNEXTSWTICH   (2.0)
 

Functions

int bound_x1dn_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X1DN FIXEDUSINGPANALYTIC. More...
 
int bound_x1up_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X1UP FIXEDUSINGPANALYTIC. More...
 
int bound_x2dn_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X2DN FIXEDUSINGPANALYTIC. More...
 
int bound_x2up_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X2UP FIXEDUSINGPANALYTIC. More...
 
int bound_x3dn_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X3DN FIXEDUSINGPANALYTIC. More...
 
int bound_x3up_analytic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR])
 X3UP FIXEDUSINGPANALYTIC. More...
 
int bound_x1dn_outflow (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X1 inner OUTFLOW/FIXEDOUTFLOW. More...
 
int bound_x1up_outflow (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X1 outer OUTFLOW/FIXEDOUTFLOW. More...
 
int bound_x1dn_sym (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X1 inner R0SING. More...
 
int bound_x2dn_polaraxis_full3d (int whichcall, int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X2 inner POLARAXIS with full3d, flip sign of both B2 and B3 Flip B2 because ghost cells will then be same sign if pointing in same physical location, and opposite sign if pointing opposite physical location across the pole. More...
 
int bound_x2dn_polaraxis (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X2 inner POLARAXIS. More...
 
int bound_x2up_polaraxis_full3d (int whichcall, int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X2 outer POLARAXIS full3d. More...
 
int bound_x2up_polaraxis (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X2 outer POLARAXIS. More...
 
int bound_x1_periodic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X1 periodic. More...
 
int bound_x2_periodic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X2 inner periodic. More...
 
int bound_x3_periodic (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X3 inner periodic. More...
 
int bound_x1dn_r0singfixinterior (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 X1 inner R0SING. More...
 
int bound_checks1 (int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 Check that boundary conditions were set properly. More...
 
int extrapfunc (int boundary, int j, int k, int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 OPTMARK: all get_geometries, etc. More...
 
static FTYPE MACP0A1mod (FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int ri, int rj, int rk, int pl)
 average u^=u^2*dxdxp22 as opposed to u^2 More...
 
int poledeath (int whichx2, int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 interpolate across pole to remove numerical errors there Note that this function is done over all zones More...
 
int polesmooth (int whichx2, int boundstage, int finalstep, SFTYPE boundtime, int whichdir, int boundvartype, int *dirprim, int ispstag, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *inboundloop, int *outboundloop, int *innormalloop, int *outnormalloop, int(*inoutlohi)[NUMUPDOWN][NDIM], int riin, int riout, int rjin, int rjout, int rkin, int rkout, int *dosetbc, int enerregion, int *localenerpos)
 Average quasi-Cartesian components around the polar axis Note that if special3dspc==1, then bound_x2dn/x2up_polaraxis_full3d() [that calls poledeath() and/or polesmooth()] is called after MPI call in bound_prim_user_after_mpi_dir() If special3dspc==0, then not accurately handling polar axis so can't expect polesmooth() to be as effective. More...
 
void user1_adjust_fluxctstag_emfs (SFTYPE time, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *Nvec, FTYPE(*fluxvec[NDIM])[NSTORE2][NSTORE3][NPR+NSPECIAL])
 NOTEMARK: Sasha's 289ddfa614ac0d10c30b2badff2964aa65853fd6 corrects some bugs. More...
 
void user1_adjust_final_fluxes (SFTYPE time, FTYPE(*prim)[NSTORE2][NSTORE3][NPR], int *Nvec, FTYPE(*fluxvec[NDIM])[NSTORE2][NSTORE3][NPR+NSPECIAL])
 adjust final fluxes NOT USED More...
 

Detailed Description

General or frequenty-used Boundary condition routines.

Typically these are only called by user code bounds.c

Definition in file bounds.tools.c.

Macro Definition Documentation

#define AVOIDCS   0
#define BEGINDEATHTRANSITION   (OUTERDEATHRADIUS*0.8)
#define cr (   x)    (exp(-1.0/(x)))
#define DAMPECOV   0
#define DAMPGAMMA   0
#define DEATHLOOP2 (   whichx2)    for (j = (whichx2==X2UP ? MIN(deathstagjs,deathjs) : MAX(deathstagje,deathje)) ; (whichx2==X2UP ? (j <= MAX(deathstagje,deathje)) : (j >= MIN(deathstagjs,deathjs)) ) ; (whichx2==X2UP ? j++ : j--) )
#define DEBUGPOLESMOOTH   0

Definition at line 4672 of file bounds.tools.c.

#define EXTRAPBD3   0
#define FACTORNEXTSWTICH   (2.0)
#define MAPFULLPR (   i,
  fakej,
  k,
  pl 
)    ( (fakej)*(N3BND+N3+N3BND)*(N1BND+N1+N1BND)*NPR + ((k)+N3BND)*(N1BND+N1+N1BND)*NPR + ((i)+N1BND)*NPR + (pl) )
#define N1TOTFULLPR   (N1BND+N1+N1BND)
#define N2TOTFULLPR   (ncpux3>1&&USEMPI&&N3>1 ? 1 : 2)
#define N3TOTFULLPR   (N3BND+totalsize[3]+N3BND)
#define OUTERDEATHDAMP   0
#define POWEREXTRAFRAC   (0.1)
#define POWERRATIO   (1.0+POWEREXTRAFRAC)
#define RADIUSOUTERDEATHMORE   (BIG)
#define tr (   x)    (cr(x)/(cr(x) + cr(1.0-(x))))
#define trans (   x,
  L,
  R 
)    ((x)<=(L) ? 0.0 : ((x)>=(R) ? 1.0 : tr(((x)-(L))/((R)-(L)))) )
#define UTHETAPOLEDEATH   ((PRIMTOINTERP_3VELREL_GAMMAREL_DXDXP==VARTOINTERP)?(1):(0))

Definition at line 3291 of file bounds.tools.c.

#define XDQFRAC1   (0.1)
#define XDQFRAC2   (0.2)
#define XFRAC1   (0.1)
#define XFRAC2   (0.2)
#define YDQFRAC1   (0.0)
#define YDQFRAC12 (   frac)    (YDQFRAC1 + (YDQFRAC2-YDQFRAC1)/(XDQFRAC2-XDQFRAC1)*(frac-XDQFRAC1))
#define YDQFRAC2   (1.0)
#define YFRAC1   (0.0)
#define YFRAC12 (   frac)    (YFRAC1 + (YFRAC2-YFRAC1)/(XFRAC2-XFRAC1)*(frac-XFRAC1))
#define YFRAC2   (1.0)

Function Documentation

int bound_checks1 ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

Check that boundary conditions were set properly.

Definition at line 2531 of file bounds.tools.c.

int bound_x1_periodic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X1 periodic.

Definition at line 1849 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x1dn_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X1DN FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 24 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x1dn_outflow ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X1 inner OUTFLOW/FIXEDOUTFLOW.

Definition at line 578 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x1dn_r0singfixinterior ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X1 inner R0SING.

Definition at line 2400 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x1dn_sym ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X1 inner R0SING.

Definition at line 927 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x1up_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X1UP FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 73 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x1up_outflow ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X1 outer OUTFLOW/FIXEDOUTFLOW.

Definition at line 758 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x2_periodic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X2 inner periodic.

Definition at line 1941 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x2dn_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X2DN FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 121 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x2dn_polaraxis ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X2 inner POLARAXIS.

Definition at line 1450 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x2dn_polaraxis_full3d ( int  whichcall,
int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X2 inner POLARAXIS with full3d, flip sign of both B2 and B3 Flip B2 because ghost cells will then be same sign if pointing in same physical location, and opposite sign if pointing opposite physical location across the pole.

Flip B3 because RBhat3 (as growing enclosed current from pole) gives Bhat3 constant near pole and so Bhat3 B3 and so B3 1/. So can either interpolation (e.g.) B3 and v3 and obtain higher-order accuracy near pole. Or can flip sign of B3 and v3 and keep more stable but still no diffusive term that otherwise B3 and v3 would have due to their sign change across the pole.

Definition at line 1305 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x2up_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X2UP FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 171 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x2up_polaraxis ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X2 outer POLARAXIS.

Definition at line 1718 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x2up_polaraxis_full3d ( int  whichcall,
int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X2 outer POLARAXIS full3d.

Definition at line 1581 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int bound_x3_periodic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

X3 inner periodic.

Definition at line 2305 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x3dn_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X3DN FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 220 of file bounds.tools.c.

Here is the caller graph for this function:

int bound_x3up_analytic ( int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR] 
)

X3UP FIXEDUSINGPANALYTIC.

Currently assume completely general situation where only triggers on BCs, but across all CPUs. Use grid sectioning to enforce per-CPU dependence if desired. Any other CPUs that have BCs set will have BCs overwritten by MPI routines SUPERGODMARK: Should be able to use set_boundloop()'s result if included FIXED version, but currently it only handles OUTFLOW types for grid sectioning

Definition at line 270 of file bounds.tools.c.

Here is the caller graph for this function:

int extrapfunc ( int  boundary,
int  j,
int  k,
int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

OPTMARK: all get_geometries, etc.

could be simplified if take advantage of fact that only really 2 cases: all CENT or CENT for all except B's. otherwise extrapfunc() and poledeath()'s get_geometry() dominates CPU time when few active cells or many boundary cells boundary = X1DN or X1UP assume if ispstag==1 then only doing field part – otherwise logic would get more complicated

did assume densities roughly constant (good for disk, not as good for polar region of mostly radial Bondi-like flow)

Definition at line 2605 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static FTYPE MACP0A1mod ( FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int  ri,
int  rj,
int  rk,
int  pl 
)
static

average u^=u^2*dxdxp22 as opposed to u^2

Definition at line 3299 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int poledeath ( int  whichx2,
int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

interpolate across pole to remove numerical errors there Note that this function is done over all zones

Definition at line 3330 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int polesmooth ( int  whichx2,
int  boundstage,
int  finalstep,
SFTYPE  boundtime,
int  whichdir,
int  boundvartype,
int *  dirprim,
int  ispstag,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  inboundloop,
int *  outboundloop,
int *  innormalloop,
int *  outnormalloop,
int(*)  inoutlohi[NUMUPDOWN][NDIM],
int  riin,
int  riout,
int  rjin,
int  rjout,
int  rkin,
int  rkout,
int *  dosetbc,
int  enerregion,
int *  localenerpos 
)

Average quasi-Cartesian components around the polar axis Note that if special3dspc==1, then bound_x2dn/x2up_polaraxis_full3d() [that calls poledeath() and/or polesmooth()] is called after MPI call in bound_prim_user_after_mpi_dir() If special3dspc==0, then not accurately handling polar axis so can't expect polesmooth() to be as effective.

Definition at line 4677 of file bounds.tools.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void user1_adjust_final_fluxes ( SFTYPE  time,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  Nvec,
FTYPE(*[])  NDIM[NSTORE2][NSTORE3][NPR+NSPECIAL] 
)

adjust final fluxes NOT USED

Definition at line 5370 of file bounds.tools.c.

void user1_adjust_fluxctstag_emfs ( SFTYPE  time,
FTYPE(*)  prim[NSTORE2][NSTORE3][NPR],
int *  Nvec,
FTYPE(*[])  NDIM[NSTORE2][NSTORE3][NPR+NSPECIAL] 
)

NOTEMARK: Sasha's 289ddfa614ac0d10c30b2badff2964aa65853fd6 corrects some bugs.

STAG version (different because emf vs. flux, where emf has extra zone – otherwise same! reset emf's (E_3) at the boundaries in x1-x2 plane to zero

Definition at line 5285 of file bounds.tools.c.