diff options
author | eschnett <eschnett@c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5> | 2012-10-21 03:38:34 +0000 |
---|---|---|
committer | eschnett <eschnett@c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5> | 2012-10-21 03:38:34 +0000 |
commit | 1aff405781ecb77263477a3009bdab5439760319 (patch) | |
tree | f957b0217d01b559b0d4a194cc2d42148a3072cc | |
parent | 45e572de30bd4f85ff361ee4a83fced32ce2f9fe (diff) |
Introduce new parameter check_boundaries
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry90/trunk@76 c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5
-rw-r--r-- | param.ccl | 6 | ||||
-rw-r--r-- | src/rotatingsymmetry90.c | 29 |
2 files changed, 28 insertions, 7 deletions
@@ -6,7 +6,7 @@ BOOLEAN verbose "Produce screen output while applying boundary conditions" -BOOLEAN poison_boundaries "Fill the symmetry boundary with a poison value before the symmetry is applied, and check afterwards whether it has been overwritten" +BOOLEAN poison_boundaries "Fill the symmetry boundary with a poison value before the symmetry is applied" STEERABLE=always { } "no" @@ -14,3 +14,7 @@ CCTK_INT poison_value "Integer value (0..255) used to poison new timelevels (wit { 0:255 :: "Must fit into a byte. Use 0 for zero, 255 for nan, and e.g. 113 for a large value." } 254 + +BOOLEAN check_boundaries "Check the boundaries for poison" STEERABLE=always +{ +} "no" diff --git a/src/rotatingsymmetry90.c b/src/rotatingsymmetry90.c index 750b435..79ce5e6 100644 --- a/src/rotatingsymmetry90.c +++ b/src/rotatingsymmetry90.c @@ -646,7 +646,7 @@ int BndRot90VI (cGH const * restrict const cctkGH, ierr = Util_TableDestroy (options); assert (!ierr); - if (poison_boundaries) { + if (check_boundaries) { /* check destination grid points for poison */ int have_bnd = 1; for (q=0; q<ndirs; ++q) { @@ -673,6 +673,7 @@ int BndRot90VI (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); @@ -681,14 +682,25 @@ int BndRot90VI (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]); @@ -696,7 +708,12 @@ int BndRot90VI (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; } @@ -707,7 +724,7 @@ int BndRot90VI (cGH const * restrict const cctkGH, assert (0); } /* switch grouptype */ } /* if bbox */ - } /* if poison_boundaries */ + } /* if check_boundaries */ /* take parity into account */ have_local_bbox = 1; |