diff options
Diffstat (limited to 'src/puncture_tracker.c')
-rw-r--r-- | src/puncture_tracker.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/puncture_tracker.c b/src/puncture_tracker.c index 8c3341b..f973d49 100644 --- a/src/puncture_tracker.c +++ b/src/puncture_tracker.c @@ -202,6 +202,26 @@ PunctureTracker_Track (CCTK_ARGUMENTS) } } } + + // Check for NaNs and large shift components + if (CCTK_MyProc(cctkGH) == 0) { + for (int n = 0; n < max_num_tracked; ++ n) { + if (track[n]) { + CCTK_REAL norm = sqrt(pow((double) pt_betax[n],2) + + pow((double) pt_betay[n],2) + + pow((double) pt_betaz[n],2)); + + if (!isfinite(norm) || norm > shift_limit) { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Shift at puncture #%d is (%g,%g,%g). This likely indicates an error in the simulation.", + n, + (double) pt_betax[n], + (double) pt_betay[n], + (double) pt_betaz[n]); + } + } + } + } // Time evolution |