5 double *cmax,
Grid *grid)
26 double *uL, *uR, *flux, cL, cR;
27 static double **fL, *pL, *a2L, *hL, *cmin_L, *cmax_L;
28 static double **fR, *pR, *a2R, *hR, *cmin_R, *cmax_R;
29 static double **VL, **VR, **UL, **UR;
58 GLM_Solve (state, VL, VR, beg, end, grid);
62 VL = state->
vL; UL = state->
uL;
63 VR = state->
vR; UR = state->
uR;
73 Flux (UL, VL, hL, fL, pL, beg, end);
74 Flux (UR, VR, hR, fR, pR, beg, end);
83 for (i = beg; i <= end; i++) {
87 cL =
MAX(fabs(cmax_L[i]), fabs(cmin_L[i]));
88 cR =
MAX(fabs(cmax_R[i]), fabs(cmin_R[i]));
89 cmax[
i] =
MAX(cL, cR);
90 state->
SL[
i] = -cmax[
i];
91 state->
SR[
i] = cmax[
i];
97 flux = state->
flux[
i];
98 for (nv =
NFLX; nv--; ) {
99 flux[nv] = 0.5*(fL[
i][nv] + fR[
i][nv] - cmax[
i]*(uR[nv] - uL[nv]));
101 state->
press[
i] = 0.5*(pL[
i] + pR[
i]);
108 #if DIVB_CONTROL == EIGHT_WAVES
void GLM_Solve(const State_1D *state, double **VL, double **VR, int beg, int end, Grid *grid)
double ** flux
upwind flux computed with the Riemann solver
void Flux(double **u, double **w, double *a2, double **fx, double *p, int beg, int end)
double * SR
Rightmost velocity in the Riemann fan at i+1/2.
void LF_Solver(const State_1D *state, int beg, int end, double *cmax, Grid *grid)
double ** vR
Primitive variables to the right of the interface, .
void SoundSpeed2(double **v, double *cs2, double *h, int beg, int end, int pos, Grid *grid)
double * SL
Leftmost velocity in the Riemann fan at i+1/2.
double ** uR
same as vR, in conservative vars
#define ARRAY_1D(nx, type)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
void PrimToCons(double **uprim, double **ucons, int ibeg, int iend)
double ** vL
Primitive variables to the left of the interface, .
double * press
Upwind pressure term computed with the Riemann solver.
void MaxSignalSpeed(double **v, double *cs2, double *cmin, double *cmax, int beg, int end)
#define ARRAY_2D(nx, ny, type)
void POWELL_DIVB_SOURCE(const State_1D *, int, int, Grid *)
double ** uL
same as vL, in conservative vars