47 int flatten(
int nmin,
int nmax,
double *pre_1D,
double *vx_1D,
double *steep,
double *flat) {
50 double temp1, temp2, temp3;
51 double delp1, delp2, shock;
52 double epsilon, omega1, omega2;
65 for (i = nmin - 4; i <= nmax + 4; i++) {
67 delp1 = pre_1D[i + 1] - pre_1D[i - 1];
68 delp2 = pre_1D[i + 2] - pre_1D[i - 2];
72 shock = fabs(delp1) /
min_flatten(pre_1D[i + 1], pre_1D[i - 1]) - epsilon;
74 if (shock > 0.0) shock = 1.0;
75 if (vx_1D[i - 1] < vx_1D[i + 1]) shock = 0.0;
76 temp1 = (delp1 / delp2 - omega1) * omega2;
84 steep[nmin - 5] = steep[nmin - 4];
85 steep[nmax + 5] = steep[nmax + 4];
88 for (i = nmin - 4; i <= nmax + 4; i++) {