From 0bef41999e3ee36242f5d638bbcdfe1a0bb00914 Mon Sep 17 00:00:00 2001 From: ianhin Date: Wed, 17 Mar 2010 01:29:48 +0000 Subject: PunctureTracker: Abort with sensible error message on NaNs or excessively large values of interpolated beta git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/PunctureTracker/trunk@17 a2659f00-0f4f-0410-9214-a4596bbb8a4f --- src/puncture_tracker.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') 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 -- cgit v1.2.3