aboutsummaryrefslogtreecommitdiff
path: root/src/patch
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-04-10 18:19:37 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-04-10 18:19:37 +0000
commit7bc33ebb01c3785128c0475c6ec1a0bd62dbe584 (patch)
tree66fd69d93bf611cc631810151117f900008075ee /src/patch
parentcd4cc1c601a8280469c92ac5e0769bcb4c85239e (diff)
change (r,(mu,nu,phi)) --> (x,y,z) coordinate conversion functions so
they'll work properly for r=0 -- before they (incorrectly) got an assertion failure in some of the sanity checks git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1038 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r--src/patch/coords.cc39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/patch/coords.cc b/src/patch/coords.cc
index 795929a..8bc48ef 100644
--- a/src/patch/coords.cc
+++ b/src/patch/coords.cc
@@ -99,6 +99,7 @@ return jtutil::modulo_reduce(dang, 360.0, min_dang, max_dang);
// valid in +/- z patch
// not valid in xy plane (z == 0, i.e. (cos(mu) == 0 || cos(nu) == 0))
+// unless r == 0 (x == y == z == 0)
// c.f. page 9.2 of my mpe notes
namespace local_coords
{
@@ -124,11 +125,13 @@ z = sign_z * r * temp;
x = x_over_z * z;
y = y_over_z * z;
-assert( jtutil::fuzzy<fp>::NE(z, 0.0) );
-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 );
+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 );
+ }
}
}
@@ -136,6 +139,7 @@ if (jtutil::fuzzy<fp>::NE(y, 0.0))
// valid in +/- y patch
// not valid in xz plane (y == 0, i.e. (sin(mu) == 0 || sin(phi) == 0)
+// unless r == 0 (x == y == z == 0)
// c.f. page 9.3 of my mpe notes
namespace local_coords
{
@@ -164,11 +168,13 @@ y = sign_y * r * temp;
z = z_over_y * y;
x = x_over_y * y;
-assert( jtutil::fuzzy<fp>::NE(y, 0.0) );
-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 );
+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 );
+ }
}
}
@@ -176,6 +182,7 @@ if (jtutil::fuzzy<fp>::NE(x, 0.0))
// valid in +/- x patch
// not valid in yz plane (x == 0, i.e. (sin(nu) == 0 || cos(phi) == 0))
+// unless r == 0 (x == y == z == 0)
// c.f. page 9.4 of my mpe notes
namespace local_coords
{
@@ -203,11 +210,13 @@ x = sign_x * r * temp;
z = z_over_x * x;
y = y_over_x * x;
-assert( jtutil::fuzzy<fp>::NE(x, 0.0) );
-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 );
+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 );
+ }
}
}