Skip to content

Commit ae7a80d

Browse files
committed
PunctureTracker: add READS to workaround poison for position arrrays
1 parent 9b006e6 commit ae7a80d

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

PunctureTracker/schedule.ccl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SCHEDULE PunctureTracker_Setup IN PunctureTracker_SetupGroup
2323
OPTIONS: GLOBAL
2424
READS: pt_loc
2525
READS: pt_vel
26+
READS: BoxInBox::positions
2627
WRITES: BoxInBox::positions
2728
} "Calculate initial location of punctures"
2829

@@ -31,6 +32,7 @@ SCHEDULE PunctureTracker_Track AT evol AFTER ODESolvers_Solve
3132
LANG: C
3233
OPTIONS: GLOBAL
3334
READS: ADMBaseX::shift(everywhere)
35+
READS: BoxInBox::positions
3436
WRITES: pt_loc
3537
WRITES: pt_vel
3638
WRITES: BoxInBox::positions

PunctureTracker/src/puncture_tracker.cxx

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,11 @@ extern "C" void PunctureTracker_Setup(CCTK_ARGUMENTS) {
8383
if (track_boxes) {
8484
const std::array<std::vector<CCTK_REAL>, Loop::dim> &location =
8585
g_punctures->getLocation();
86-
for (int n = 0; n < 3; ++n) { // BoxInBox currently hardcodes position[3]
87-
if (n < nPunctures) {
88-
CCTK_VINFO("Writing punc coords to box %d.", n);
89-
position_x[n] = location[0][n];
90-
position_y[n] = location[1][n];
91-
position_z[n] = location[2][n];
92-
} else {
93-
position_x[n] = 0.0;
94-
position_y[n] = 0.0;
95-
position_z[n] = 0.0;
96-
}
86+
for (int n = 0; n < nPunctures; ++n) {
87+
CCTK_VINFO("Writing punc coords to box %d.", n);
88+
position_x[n] = location[0][n];
89+
position_y[n] = location[1][n];
90+
position_z[n] = location[2][n];
9791
}
9892
}
9993
}
@@ -193,16 +187,10 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) {
193187
}
194188

195189
if (track_boxes) {
196-
for (int i = 0; i < 3; ++i) { // BoxInBox currently hardcodes position[3]
197-
if (i < nPunctures) {
198-
position_x[i] = location[0][i];
199-
position_y[i] = location[1][i];
200-
position_z[i] = location[2][i];
201-
} else {
202-
position_x[i] = 0.0;
203-
position_y[i] = 0.0;
204-
position_z[i] = 0.0;
205-
}
190+
for (int i = 0; i < nPunctures; ++i) {
191+
position_x[i] = location[0][i];
192+
position_y[i] = location[1][i];
193+
position_z[i] = location[2][i];
206194
}
207195
}
208196
}

0 commit comments

Comments
 (0)