From 930a1c7fd435b3ac9227a1658180d5159cac4be5 Mon Sep 17 00:00:00 2001 From: jthorn Date: Sun, 13 Aug 2006 20:34:11 +0000 Subject: += assert(various intermediate quantities are finite) git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@38 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef --- src/molecule_posn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 #include #include +#include +#include #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", -- cgit v1.2.3