18 int advect(
int nmin,
int nmax,
int flag,
double *dx,
double *vx_1D,
double *marker_1D) {
23 if (flag == 0) spacing = 2.0 *
xmax / (double)
x;
24 if (flag == 1) spacing = 2.0 *
ymax / (double)
y;
25 if (flag == 2) spacing = 2.0 *
zmax / (double)
z;
28 for (n = nmin; n <= nmax; n++) {
30 marker_1D[n] = marker_1D[n]-(
dt * vx_1D[n]*(3 * marker_1D[n] - 4 * marker_1D[n - 1] + marker_1D[n - 2])) /
spacing;
32 marker_1D[n] = marker_1D[n]-(
dt * vx_1D[n]*(-1 * marker_1D[n + 2] + 4 * marker_1D[n + 1] - 3 * marker_1D[n])) /
spacing;
34 if (marker_1D[n] < 0.0) marker_1D[n] = 0.0;
38 for (n = 1; n <= 6; n++) marker_1D[nmin - n] = 0.0;
39 for (n = 1; n <= 6; n++) marker_1D[nmax + n] = 0.0;