diff options
author | schnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787> | 2010-03-23 23:37:07 +0000 |
---|---|---|
committer | schnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787> | 2010-03-23 23:37:07 +0000 |
commit | f93f800a924d0fdd051b8c09ac41982c1bdf5640 (patch) | |
tree | a99510c8d7aff28ec721f4b4b5a3e3dbcf61dcbe /src/rotatingsymmetry180.c | |
parent | 260f27175bffd6d16de06315fb628e452dcb0fbf (diff) |
When looking for poison, look also for nans and other non-finite numbers
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@51 20f44201-0f4f-0410-9130-e5fc2714a787
Diffstat (limited to 'src/rotatingsymmetry180.c')
-rw-r--r-- | src/rotatingsymmetry180.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index 0862fc1..084732b 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -538,6 +538,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, break; case CCTK_VARIABLE_REAL: { int poison_found = 0; + int nonfinite_found = 0; CCTK_REAL const * restrict const varptr = varptrs[var]; CCTK_REAL poison; memset (&poison, poison_value, sizeof poison); @@ -546,14 +547,25 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); if (memcmp (&varptr[ind], &poison, sizeof poison) == 0) { - printf (" ijk=[%d,%d,%d]\n", i, j, k); + printf (" poison ijk=[%d,%d,%d] val=%g\n", + i, j, k, (double)varptr[ind]); poison_found = 1; } + if (! isfinite(varptr[ind])) { + printf (" nonfinite ijk=[%d,%d,%d] val=%g\n", + i, j, k, (double)varptr[ind]); + nonfinite_found = 1; + } } } } - if (poison_found) { - printf ("Poison found:\n"); + if (poison_found || nonfinite_found) { + if (poison_found) { + printf ("Poison found:\n"); + } + if (nonfinite_found) { + printf ("Non-finite number found:\n"); + } printf (" levfac=[%d,%d,%d]\n", cctk_levfac[0], cctk_levfac[1], cctk_levfac[2]); printf (" origin_space=[%g,%g,%g]\n", cctk_origin_space[0], cctk_origin_space[1], cctk_origin_space[2]); printf (" delta_space=[%g,%g,%g]\n", cctk_delta_space[0], cctk_delta_space[1], cctk_delta_space[2]); @@ -561,7 +573,12 @@ int BndRot180VI (cGH const * restrict const cctkGH, printf (" lsh=[%d,%d,%d]\n", cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]); printf (" gsh=[%d,%d,%d]\n", cctk_gsh[0], cctk_gsh[1], cctk_gsh[2]); printf (" bbox=[%d,%d,%d,%d,%d,%d]\n", cctk_bbox[0], cctk_bbox[1], cctk_bbox[2], cctk_bbox[3], cctk_bbox[4], cctk_bbox[5]); - CCTK_WARN (CCTK_WARN_ABORT, "Poison found in symmetry regions -- there is an error in this thorn"); + if (poison_found) { + CCTK_WARN (CCTK_WARN_ABORT, "Poison found in symmetry regions -- there is an error in this thorn"); + } + if (nonfinite_found) { + CCTK_WARN (CCTK_WARN_ALERT, "Non-finite number found in symmetry regions"); + } } break; } |