aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-13 20:34:11 +0000
committerjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-13 20:34:11 +0000
commit930a1c7fd435b3ac9227a1658180d5159cac4be5 (patch)
treed538854552169b57177ab06bcc0babd95005c23e
parenteb53f06ee68436a7f537e8f12cea070f0c0daba5 (diff)
+= assert(various intermediate quantities are finite)
git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@38 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef
-rw-r--r--src/molecule_posn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/molecule_posn.c b/src/molecule_posn.c
index cfd0642..5343795 100644
--- a/src/molecule_posn.c
+++ b/src/molecule_posn.c
@@ -7,9 +7,10 @@
@version $Id$
@@*/
-#include <math.h>
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
+#include <math.h>
#ifndef AEILOCALINTERP_STANDALONE_TEST
#include "cctk.h"
@@ -256,6 +257,7 @@ const fp fp_centered_max_possible_i = grid_i_max - mr_plus
/* integer coordinate i of interpolation point, as a floating-point number */
const fp fp_i = (x - grid_origin) / grid_delta;
+assert(finite(fp_i));
if (debug > 8)
then {
@@ -289,6 +291,7 @@ if (fp_i > fp_centered_max_possible_i + boundary_off_centering_tolerance_max)
fp fp_i_center = IS_EVEN(molecule_size)
? floor(fp_i)
: ROUND_TO_INTEGER__RESULT_IS_FP(fp_i);
+assert(finite(fp_i_center));
int int_i_center = (int) fp_i_center; /* convert to integer */
if (debug > 8)
then printf(" initial: fp_i_center=%g int_i_center=%d\n",