Skip to content

Commit

Permalink
Loop: Correct loops over boundaries
Browse files Browse the repository at this point in the history
Include the corners, exclude the interior.
  • Loading branch information
eschnett committed Jul 23, 2024
1 parent 0126ae0 commit a8c262e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Loop/src/loop.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public:
domain_boxes<CI, CJ, CK>(group_nghostzones, all_min, all_max, int_min,
int_max);

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down Expand Up @@ -401,7 +401,7 @@ public:
const F &f) const {
constexpr vect<int, dim> offset{CI, CJ, CK};

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down Expand Up @@ -485,7 +485,7 @@ public:
domain_boxes<CI, CJ, CK>(group_nghostzones, all_min, all_max, int_min,
int_max);

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down Expand Up @@ -584,7 +584,7 @@ public:
// rank(face) = 2
// rank(edge) = 1
// rank(corner) = 0
for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

// Nested loops that determine {ni,nj,nk} components of the normal vector
for (int nk = -1; nk <= +1; ++nk) {
Expand Down
8 changes: 4 additions & 4 deletions Loop/src/loop_device.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public:
domain_boxes<CI, CJ, CK>(group_nghostzones, all_min, all_max, int_min,
int_max);

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down Expand Up @@ -318,7 +318,7 @@ public:
// rank(face) = 2
// rank(edge) = 1
// rank(corner) = 0
for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

// Nested loops that determine {ni,nj,nk} components of the normal vector
for (int nk = -1; nk <= +1; ++nk) {
Expand Down Expand Up @@ -381,7 +381,7 @@ public:
const F &f) const {
constexpr vect<int, dim> offset{CI, CJ, CK};

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down Expand Up @@ -447,7 +447,7 @@ public:
domain_boxes<CI, CJ, CK>(group_nghostzones, all_min, all_max, int_min,
int_max);

for (int rank = dim - 1; rank >= 0; --rank) {
for (int rank = dim; rank > 0; --rank) {

for (int nk = -1; nk <= +1; ++nk) {
for (int nj = -1; nj <= +1; ++nj) {
Expand Down

0 comments on commit a8c262e

Please sign in to comment.