63 void Init (
double *v,
double x1,
double x2,
double x3)
69 double r, r0, r1,
Bx, f, omega;
77 #if GEOMETRY == CARTESIAN
78 r = sqrt(x1*x1 + x2*x2);
84 f = (r1 - r)/(r1 - r0);
91 v[
VX1] = -f*omega*x2*r0/r;
92 v[
VX2] = f*omega*x1*r0/r;
101 #elif GEOMETRY == POLAR
105 v[
BX2] = -Bx*sin(x2);
109 f = (r1 - r)/(r1 - r0);
114 v[
RHO] = 1.0 + 9.0*f;
122 v[
AX3] = - r*sin(x2)*
Bx;
125 #if BACKGROUND_FIELD == YES
151 #if GEOMETRY == CARTESIAN
155 #elif GEOMETRY == POLAR
157 B0[1] = - Bx*sin(x2);
#define X1_BEG
Boundary region at X1 beg.
double **** Vs
The main four-index data array used for face-centered staggered magnetic fields.
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
int vpos
Location of the variable inside the cell.
void BackgroundField(double x1, double x2, double x3, double *B0)
#define BOX_LOOP(B, k, j, i)
double **** Vc
The main four-index data array used for cell-centered primitive variables.
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
void Analysis(const Data *d, Grid *grid)
void Init(double *v, double x1, double x2, double x3)