Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions PunctureTracker/schedule.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SCHEDULE PunctureTracker_Setup IN PunctureTracker_SetupGroup
OPTIONS: GLOBAL
READS: pt_loc
READS: pt_vel
READS: BoxInBox::positions
WRITES: BoxInBox::positions
} "Calculate initial location of punctures"

Expand All @@ -31,6 +32,7 @@ SCHEDULE PunctureTracker_Track AT evol AFTER ODESolvers_Solve
LANG: C
OPTIONS: GLOBAL
READS: ADMBaseX::shift(everywhere)
READS: BoxInBox::positions
WRITES: pt_loc
WRITES: pt_vel
WRITES: BoxInBox::positions
Expand Down
30 changes: 21 additions & 9 deletions PunctureTracker/src/puncture_tracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ extern "C" void PunctureTracker_Setup(CCTK_ARGUMENTS) {

// enabled if refinement regions should follow the punctures
if (track_boxes) {
assert(nPunctures <= 3); // BoxInBox currently hardcodes position[3]
const std::array<std::vector<CCTK_REAL>, Loop::dim> &location =
g_punctures->getLocation();
for (int n = 0; n < nPunctures; ++n) {
Expand Down Expand Up @@ -164,15 +165,26 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) {
g_punctures->broadcast(CCTK_PASS_CTOC);

// Write to pt_loc_foo and pt_vel_foo
for (int i = 0; i < nPunctures; ++i) {
pt_loc_t[i] = time[i];
pt_loc_x[i] = location[0][i];
pt_loc_y[i] = location[1][i];
pt_loc_z[i] = location[2][i];
pt_vel_t[i] = time[i];
pt_vel_x[i] = velocity[0][i];
pt_vel_y[i] = velocity[1][i];
pt_vel_z[i] = velocity[2][i];
for (int i = 0; i < max_num_tracked; ++i) {
if (i < nPunctures) {
pt_loc_t[i] = time[i];
pt_loc_x[i] = location[0][i];
pt_loc_y[i] = location[1][i];
pt_loc_z[i] = location[2][i];
pt_vel_t[i] = time[i];
pt_vel_x[i] = velocity[0][i];
pt_vel_y[i] = velocity[1][i];
pt_vel_z[i] = velocity[2][i];
} else {
pt_loc_t[i] = 0.0;
pt_loc_x[i] = 0.0;
pt_loc_y[i] = 0.0;
pt_loc_z[i] = 0.0;
pt_vel_t[i] = 0.0;
pt_vel_x[i] = 0.0;
pt_vel_y[i] = 0.0;
pt_vel_z[i] = 0.0;
}
}

if (track_boxes) {
Expand Down