53                     double **dcoeff, 
int beg, 
int end, 
Grid *grid)
 
   70   double *x1, *x2, *x3, 
scrh;
 
   73   double ***Jx1, ***Jx2, ***Jx3;
 
   74   double ***eta_x1, ***eta_x2, ***eta_x3;
 
   77    etas = GetStaggeredEta();
 
   78    Jx1 = curlB[
IDIR]; eta_x1 = etas[
IDIR];
 
   79    Jx2 = curlB[
JDIR]; eta_x2 = etas[
JDIR];
 
   80    Jx3 = curlB[
KDIR]; eta_x3 = etas[
KDIR];
 
   96     for (i = beg; i <= end; i++){
 
  100       for (nv = 0; nv < 
NVAR; nv++){
 
  101         vp[nv] = 0.5*(V[nv][
k][
j][
i] + V[nv][
k][
j][i + 1]);
 
  113        for (nv = 0; nv < 3; nv++) Jp[nv] = curlB[nv][k][j][i];
 
  122        res_flux[i][ENG] = EXPAND(0.0, + vp[
BX2]*res_flux[i][
BX2], 
 
  123                                       + vp[
BX3]*res_flux[i][
BX3]);
 
  128       EXPAND(dcoeff[i][
BX1] = 0.0;        ,
 
  137     for (j = beg; j <= end; j++){
 
  141       for (nv = 0; nv < 
NVAR; nv++) {
 
  142         vp[nv] = 0.5*(V[nv][
k][
j][
i] + V[nv][
k][j + 1][
i]);
 
  154        for (nv = 0; nv < 3; nv++) Jp[nv] = curlB[nv][k][j][i];
 
  163        res_flux[j][ENG] = EXPAND(  vp[
BX1]*res_flux[j][
BX1],
 
  165                                  + vp[BX3]*res_flux[j][BX3]);
 
  170       EXPAND(dcoeff[j][BX1] = eta[
KDIR];   ,
 
  171              dcoeff[
j][
BX2] = 0.0;         ,
 
  179     for (k = beg; k <= end; k++){
 
  183       for (nv = 0; nv < 
NVAR; nv++) {
 
  184         vp[nv] = 0.5*(V[nv][
k][
j][
i] + V[nv][k + 1][
j][
i]);
 
  194        for (nv = 0; nv < 3; nv++) Jp[nv] = curlB[nv][k][j][i];
 
  201       #if EOS != ISOTHERMAL 
  202        res_flux[
k][ENG] = vp[
BX1]*res_flux[
k][
BX1] + vp[
BX2]*res_flux[
k][
BX2];
 
  207       EXPAND(dcoeff[k][BX1] = eta[
JDIR];  ,
 
  209              dcoeff[
k][
BX3] = 0.0;)
 
#define AVERAGE_Z(q, k, j, i)  
 
#define AVERAGE_Y(q, k, j, i)  
 
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 AVERAGE_X(q, k, j, i)  
 
int g_k
x3 grid index when sweeping along the x1 or x2 direction. 
 
void Resistive_eta(double *v, double x1, double x2, double x3, double *J, double *eta)
 
void ResistiveFlux(Data_Arr V, Data_Arr curlB, double **res_flux, double **dcoeff, int beg, int end, Grid *grid)