Skip to content

Commit

Permalink
CarpetX: Correct some loop bounds in fallback prolongation operators
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Mar 7, 2024
1 parent 33d76b5 commit dbbe58d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions CarpetX/src/prolongate_3d_rf2_impl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ void prolongate_3d_rf2<
crse(icrse[0] + di, icrse[1] + dj, icrse[2] + 0) -
2 * crse(icrse[0] + di, icrse[1] + dj, icrse[2] + 1) +
crse(icrse[0] + di, icrse[1] + dj, icrse[2] + 2);
for (int dk = sradk[0] + 2; dk <= sradk[1]; ++dk) {
for (int dk = sradk[0] + 3; dk <= sradk[1]; ++dk) {
const CCTK_REAL c =
crse(icrse[0] + di, icrse[1] + dj,
icrse[2] + dk - 2) -
Expand Down Expand Up @@ -1893,9 +1893,9 @@ void prolongate_3d_rf2<
icrse[2] + dk, comp);
for (int di = sradi[0] + 2; di <= sradi[1]; ++di) {
const CCTK_REAL s =
crse(icrse[0] + di, icrse[1] + dj, icrse[2] + dk,
comp) -
crse(icrse[0] + (di - 1), icrse[1] + dj,
crse(icrse[0] + di - 0, icrse[1] + dj,
icrse[2] + dk, comp) -
crse(icrse[0] + di - 1, icrse[1] + dj,
icrse[2] + dk, comp);
need_fallback |= s * s0 < 0;
}
Expand Down Expand Up @@ -1939,9 +1939,9 @@ void prolongate_3d_rf2<
icrse[2] + dk, comp);
for (int dj = sradj[0] + 2; dj <= sradj[1]; ++dj) {
const CCTK_REAL s =
crse(icrse[0] + di, icrse[1] + dj, icrse[2] + dk,
comp) -
crse(icrse[0] + di, icrse[1] + (dj - 1),
crse(icrse[0] + di, icrse[1] + dj - 0,
icrse[2] + dk, comp) -
crse(icrse[0] + di, icrse[1] + dj - 1,
icrse[2] + dk, comp);
need_fallback |= s * s0 < 0;
}
Expand Down Expand Up @@ -1985,9 +1985,9 @@ void prolongate_3d_rf2<
icrse[2] + 0, comp);
for (int dk = sradk[0] + 2; dk <= sradk[1]; ++dk) {
const CCTK_REAL s = crse(icrse[0] + di, icrse[1] + dj,
icrse[2] + dk, comp) -
icrse[2] + dk - 0, comp) -
crse(icrse[0] + di, icrse[1] + dj,
icrse[2] + (dk - 1), comp);
icrse[2] + dk - 1, comp);
need_fallback |= s * s0 < 0;
}
}
Expand All @@ -2003,7 +2003,7 @@ void prolongate_3d_rf2<
2 * crse(icrse[0] + di, icrse[1] + dj, icrse[2] + 1,
comp) +
crse(icrse[0] + di, icrse[1] + dj, icrse[2] + 2, comp);
for (int dk = sradk[0] + 2; dk <= sradk[1]; ++dk) {
for (int dk = sradk[0] + 3; dk <= sradk[1]; ++dk) {
const CCTK_REAL c = crse(icrse[0] + di, icrse[1] + dj,
icrse[2] + dk - 2, comp) -
2 * crse(icrse[0] + di, icrse[1] + dj,
Expand Down

0 comments on commit dbbe58d

Please sign in to comment.