aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianhin <ianhin@a2659f00-0f4f-0410-9214-a4596bbb8a4f>2010-03-17 01:29:48 +0000
committerianhin <ianhin@a2659f00-0f4f-0410-9214-a4596bbb8a4f>2010-03-17 01:29:48 +0000
commit0bef41999e3ee36242f5d638bbcdfe1a0bb00914 (patch)
tree39c0f32d7082042ffce64013423d1c86720440bd
parent91c82a73ede619c23ca682193e10e93a34cd15c4 (diff)
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
-rw-r--r--param.ccl4
-rw-r--r--src/puncture_tracker.c20
2 files changed, 24 insertions, 0 deletions
diff --git a/param.ccl b/param.ccl
index 89ac90e..fd1fe5f 100644
--- a/param.ccl
+++ b/param.ccl
@@ -45,6 +45,10 @@ INT which_surface_to_store_info[10] "A spherical surface index where we can stor
0:* :: "any spherical surface index"
} -1
+REAL shift_limit "Shift components must be less than this in magnitude"
+{
+ 0.0:* :: "zero or positive"
+} 1.0e10
PRIVATE:
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