70 double vc[
NVAR], *A, *src, *vm;
72 static double *
divB, *vp;
88 for (i = beg - 1; i <= end; i++) {
98 #if GEOMETRY == CARTESIAN
100 for (i = beg; i <= end; i++) {
101 divB[
i] = (vp[
i] - vm[
i])/GG->
dx[i];
104 #elif GEOMETRY == CYLINDRICAL
107 for (i = beg; i <= end; i++) {
108 divB[
i] = (vp[
i]*A[
i] - vm[
i]*A[i - 1])/GG->
dV[i];
110 }
else if (g_dir ==
JDIR){
111 for (i = beg; i <= end; i++) {
112 divB[
i] = (vp[
i] - vm[
i])/GG->
dx[i];
116 #elif GEOMETRY == POLAR
120 for (i = beg; i <= end; i++) {
121 divB[
i] = (vp[
i]*A[
i] - vm[
i]*A[i - 1])/GG->
dV[i];
123 }
else if (g_dir ==
JDIR){
125 for (i = beg; i <= end; i++) {
126 divB[
i] = (vp[
i] - vm[
i])/(r*GG->
dx[i]);
128 }
else if (g_dir ==
KDIR){
129 for (i = beg; i <= end; i++) {
130 divB[
i] = (vp[
i] - vm[
i])/GG->
dx[i];
134 #elif GEOMETRY == SPHERICAL
137 for (i = beg; i <= end; i++) {
138 divB[
i] = (vp[
i]*A[
i] - vm[
i]*A[i - 1])/GG->
dV[i];
140 }
else if (g_dir ==
JDIR){
142 for (i = beg; i <= end; i++) {
143 divB[
i] = (vp[
i]*A[
i] - vm[
i]*A[i - 1])/(r*GG->
dV[i]);
145 }
else if (g_dir ==
KDIR){
148 for (i = beg; i <= end; i++) {
149 divB[
i] = (vp[
i] - vm[
i])/(r*s*GG->
dx[i]);
159 for (i = beg; i <= end; i++) {
162 for (nv =
NFLX; nv--; ) vc[nv] = state->
vh[i][nv];
166 EXPAND(src[
MX1] = 0.0; ,
170 EXPAND(src[BX1] = -vc[
VX1]*divB[i]; ,
double ** vh
Primitive state at n+1/2 (only for one step method)
double ** flux
upwind flux computed with the Riemann solver
double ** vR
Primitive variables to the right of the interface, .
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
int g_dir
Specifies the current sweep or direction of integration.
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
#define ARRAY_1D(nx, type)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
double ** vL
Primitive variables to the left of the interface, .
double * A
Right interface area, A[i] = .