Skip to content

Commit f03eabd

Browse files
committed
Use global Z index functions in test-communications
1 parent a058da4 commit f03eabd

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

tests/integrated/test-communications/test-communications.cxx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ int main(int argc, char** argv) {
1111

1212
// interior cells
1313
BOUT_FOR(i, f.getRegion("RGN_NOBNDRY")) {
14-
f[i] = mesh->GlobalNzNoBoundaries
15-
* (mesh->GlobalNyNoBoundaries * mesh->getGlobalXIndexNoBoundaries(i.x())
16-
+ mesh->getGlobalYIndexNoBoundaries(i.y()))
17-
+ i.z();
14+
f[i] = (mesh->GlobalNzNoBoundaries
15+
* (mesh->GlobalNyNoBoundaries * mesh->getGlobalXIndexNoBoundaries(i.x())
16+
+ mesh->getGlobalYIndexNoBoundaries(i.y())))
17+
+ mesh->getGlobalZIndexNoBoundaries(i.z());
1818
}
1919

2020
// lower x-boundary cells
@@ -25,10 +25,10 @@ int main(int argc, char** argv) {
2525
for (int y = mesh->ystart; y <= mesh->yend; y++) {
2626
for (int z = mesh->zstart; z <= mesh->zend; z++) {
2727
f(x, y, z) = startind
28-
+ mesh->GlobalNzNoBoundaries
29-
* (mesh->GlobalNyNoBoundaries * x
30-
+ mesh->getGlobalYIndexNoBoundaries(y))
31-
+ z;
28+
+ (mesh->GlobalNzNoBoundaries
29+
* (mesh->GlobalNyNoBoundaries * x
30+
+ mesh->getGlobalYIndexNoBoundaries(y)))
31+
+ mesh->getGlobalZIndexNoBoundaries(z);
3232
}
3333
}
3434
}
@@ -41,10 +41,10 @@ int main(int argc, char** argv) {
4141
for (int y = mesh->ystart; y <= mesh->yend; y++) {
4242
for (int z = mesh->zstart; z <= mesh->zend; z++) {
4343
f(mesh->xend + 1 + x, y, z) = startind
44-
+ mesh->GlobalNzNoBoundaries
45-
* (mesh->GlobalNyNoBoundaries * x
46-
+ mesh->getGlobalYIndexNoBoundaries(y))
47-
+ z;
44+
+ (mesh->GlobalNzNoBoundaries
45+
* (mesh->GlobalNyNoBoundaries * x
46+
+ mesh->getGlobalYIndexNoBoundaries(y)))
47+
+ mesh->getGlobalZIndexNoBoundaries(z);
4848
}
4949
}
5050
}
@@ -56,8 +56,9 @@ int main(int argc, char** argv) {
5656
int x = it.ind;
5757
for (int y = 0; y < mesh->ystart; y++) {
5858
for (int z = mesh->zstart; z <= mesh->zend; z++) {
59-
f(x, y, z) =
60-
startind + mesh->GlobalNzNoBoundaries * (mesh->getGlobalXIndex(x) + y) + z;
59+
f(x, y, z) = startind
60+
+ (mesh->GlobalNzNoBoundaries * (mesh->getGlobalXIndex(x) + y))
61+
+ mesh->getGlobalZIndexNoBoundaries(z);
6162
}
6263
}
6364
}
@@ -69,7 +70,8 @@ int main(int argc, char** argv) {
6970
for (int y = 0; y < mesh->ystart; y++) {
7071
for (int z = mesh->zstart; z <= mesh->zend; z++) {
7172
f(x, mesh->yend + 1 + y, z) =
72-
startind + mesh->GlobalNzNoBoundaries * (mesh->getGlobalXIndex(x) + y) + z;
73+
startind + (mesh->GlobalNzNoBoundaries * (mesh->getGlobalXIndex(x) + y))
74+
+ mesh->getGlobalZIndexNoBoundaries(z);
7375
}
7476
}
7577
}

0 commit comments

Comments
 (0)