diff options
Diffstat (limited to 'src/patch/coords.cc')
-rw-r--r-- | src/patch/coords.cc | 80 |
1 files changed, 36 insertions, 44 deletions
diff --git a/src/patch/coords.cc b/src/patch/coords.cc index 828553a..1b229c2 100644 --- a/src/patch/coords.cc +++ b/src/patch/coords.cc @@ -33,22 +33,17 @@ #include "config.h" #include "stdc.h" #include "../jtutil/util.hh" +using jtutil::error_exit; +using jtutil::arctan_xy; +using jtutil::signum; +using jtutil::pow2; +using jtutil::hypot3; #include "coords.hh" -// FIXME: sometimes we get assertion failures in these checks, -// but I've never been able to track down just what's wrong -// ==> for now, just disable them :( :( -#undef XYZ_OF_RMNP_SIGN_CHECKS - // all the code in this file is inside this namespace namespace AHFinderDirect { -using jtutil::error_exit; -using jtutil::arctan_xy; -using jtutil::signum; -using jtutil::pow2; -using jtutil::hypot3; //****************************************************************************** //****************************************************************************** @@ -134,15 +129,13 @@ z = sign_z * r * temp; x = x_over_z * z; y = y_over_z * z; -#ifdef XYZ_OF_RMNP_SIGN_CHECKS -if (jtutil::fuzzy<fp>::NE(r, 0.0)) - then { - if (jtutil::fuzzy<fp>::NE(x, 0.0)) - then assert( signum(x) == sign_x ); - if (jtutil::fuzzy<fp>::NE(y, 0.0)) - then assert( signum(y) == sign_y ); - } -#endif +// if (jtutil::fuzzy<fp>::NE(r, 0.0)) +// then { +// if (jtutil::fuzzy<fp>::NE(x, 0.0)) +// then assert( signum(x) == sign_x ); +// if (jtutil::fuzzy<fp>::NE(y, 0.0)) +// then assert( signum(y) == sign_y ); +// } } } @@ -179,15 +172,13 @@ y = sign_y * r * temp; z = z_over_y * y; x = x_over_y * y; -#ifdef XYZ_OF_RMNP_SIGN_CHECKS -if (jtutil::fuzzy<fp>::NE(r, 0.0)) - then { - if (jtutil::fuzzy<fp>::NE(z, 0.0)) - then assert( signum(z) == sign_z ); - if (jtutil::fuzzy<fp>::NE(x, 0.0)) - then assert( signum(x) == sign_x ); - } -#endif +// if (jtutil::fuzzy<fp>::NE(r, 0.0)) +// then { +// if (jtutil::fuzzy<fp>::NE(z, 0.0)) +// then assert( signum(z) == sign_z ); +// if (jtutil::fuzzy<fp>::NE(x, 0.0)) +// then assert( signum(x) == sign_x ); +// } } } @@ -223,15 +214,13 @@ x = sign_x * r * temp; z = z_over_x * x; y = y_over_x * x; -#ifdef XYZ_OF_RMNP_SIGN_CHECKS -if (jtutil::fuzzy<fp>::NE(r, 0.0)) - then { - if (jtutil::fuzzy<fp>::NE(z, 0.0)) - then assert( signum(z) == sign_z ); - if (jtutil::fuzzy<fp>::NE(y, 0.0)) - then assert( signum(y) == sign_y ); - } -#endif +// if (jtutil::fuzzy<fp>::NE(r, 0.0)) +// then { +// if (jtutil::fuzzy<fp>::NE(z, 0.0)) +// then assert( signum(z) == sign_z ); +// if (jtutil::fuzzy<fp>::NE(y, 0.0)) +// then assert( signum(y) == sign_y ); +// } } } @@ -321,7 +310,8 @@ const fp tan2_nu = pow2(tan_nu); fp x, y, z; xyz_of_r_mu_nu(r,mu,nu, x,y,z); -assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); +// Comment this out, accept a nan instead +// assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); const fp rinv = 1.0/r; partial_x_wrt_r = x*rinv; partial_y_wrt_r = y*rinv; @@ -363,7 +353,8 @@ const fp tan2_phi_bar = pow2(tan_phi_bar); fp x, y, z; xyz_of_r_mu_phi(r,mu,phi, x,y,z); -assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); +// Comment this out, accept a nan instead +// assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); const fp rinv = 1.0/r; partial_x_wrt_r = x*rinv; partial_y_wrt_r = y*rinv; @@ -404,7 +395,8 @@ const fp tan2_phi = pow2(tan_phi); fp x, y, z; xyz_of_r_nu_phi(r,nu,phi, x,y,z); -assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); +// Comment this out, accept a nan instead +// assert( jtutil::fuzzy<fp>::NE(r, 0.0) ); const fp rinv = 1.0/r; partial_x_wrt_r = x*rinv; partial_y_wrt_r = y*rinv; @@ -659,13 +651,13 @@ else if (S == coords_set_nu) then return "nu"; else if (S == coords_set_phi) then return "phi"; -else if (S == coords_set_mu|coords_set_nu) +else if (S == (coords_set_mu|coords_set_nu)) then return "{mu,nu}"; -else if (S == coords_set_mu|coords_set_phi) +else if (S == (coords_set_mu|coords_set_phi)) then return "{mu,phi}"; -else if (S == coords_set_nu|coords_set_phi) +else if (S == (coords_set_nu|coords_set_phi)) then return "{nu,phi}"; -else if (S == coords_set_mu|coords_set_nu|coords_set_phi) +else if (S == (coords_set_mu|coords_set_nu|coords_set_phi)) then return "{mu,nu,phi}"; else error_exit(PANIC_EXIT, "***** local_coords::mu_nu_phi::name_of_coords_set:\n" |