aboutsummaryrefslogtreecommitdiff
path: root/src/patch/test_coords2.cc
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2001-08-16 16:00:09 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2001-08-16 16:00:09 +0000
commitcfd14ea2798386fdefb4fd40615ab04a0139722a (patch)
treeac7fa568074b07f3edf604d52ad818d2e01f77c7 /src/patch/test_coords2.cc
parent8c47ae4cc27dab94d330fe9d8394817626a5bda0 (diff)
change to use/test new coords:: conversions
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@270 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/test_coords2.cc')
-rw-r--r--src/patch/test_coords2.cc114
1 files changed, 46 insertions, 68 deletions
diff --git a/src/patch/test_coords2.cc b/src/patch/test_coords2.cc
index 0ce20ba..3cd7d05 100644
--- a/src/patch/test_coords2.cc
+++ b/src/patch/test_coords2.cc
@@ -18,9 +18,7 @@ using namespace local_coords;
// prototypes
namespace {
-void test_r_mu_nu (fp x, fp y, fp z);
-void test_r_mu_phi(fp x, fp y, fp z);
-void test_r_nu_phi(fp x, fp y, fp z);
+void test_r_mu_nu_phi(fp x, fp y, fp z);
void test_r_theta_phi(fp x, fp y, fp z);
};
@@ -55,10 +53,7 @@ const fp xyz_delta = 0.1;
if (verbose_flag)
printf("testing x=%g y=%g z=%g\n", x,y,z);
- test_r_mu_nu (x, y, z);
- test_r_mu_phi(x, y, z);
- test_r_nu_phi(x, y, z);
-
+ test_r_mu_nu_phi(x, y, z);
test_r_theta_phi(x, y, z);
}
}
@@ -71,69 +66,38 @@ return 0;
//******************************************************************************
namespace {
-void test_r_mu_nu(fp x, fp y, fp z)
+void test_r_mu_nu_phi(fp x, fp y, fp z)
{
-fp r, mu, nu;
-r_mu_nu_of_xyz(x,y,z, r,mu,nu);
-
-const fp phi = phi_of_mu_nu(mu,nu);
-const fp mu2 = mu_of_nu_phi(nu,phi);
-const fp nu2 = nu_of_mu_phi(mu,phi);
-assert( fuzzy<fp>::EQ(mu, mu2) );
-assert( fuzzy<fp>::EQ(nu, nu2) );
-
-fp x2, y2, z2;
-xyz_of_r_mu_nu(r,mu,nu, x2,y2,z2);
+const fp r = r_of_xyz(x, y, z);
+const fp mu = mu_of_yz(y, z);
+const fp nu = nu_of_xz(x, z);
+const fp phi = phi_of_xy(x, y);
-assert( fuzzy<fp>::EQ(x, x2) );
-assert( fuzzy<fp>::EQ(y, y2) );
-assert( fuzzy<fp>::EQ(z, z2) );
-}
- }
-
-//**************************************
-
-namespace {
-void test_r_mu_phi(fp x, fp y, fp z)
-{
-fp r, mu, phi;
-r_mu_phi_of_xyz(x,y,z, r,mu,phi);
-
-const fp nu = nu_of_mu_phi(mu,phi);
-const fp mu2 = mu_of_nu_phi(nu,phi);
+const fp mu2 = mu_of_nu_phi(nu,phi);
+const fp nu2 = nu_of_mu_phi(mu,phi);
const fp phi2 = phi_of_mu_nu(mu,nu );
assert( fuzzy<fp>::EQ(mu , mu2 ) );
+assert( fuzzy<fp>::EQ(nu , nu2 ) );
assert( fuzzy<fp>::EQ(phi, phi2) );
fp x2, y2, z2;
-xyz_of_r_mu_phi(r,mu,phi, x2,y2,z2);
-
+xyz_of_r_mu_nu(r,mu,nu, x2,y2,z2);
assert( fuzzy<fp>::EQ(x, x2) );
assert( fuzzy<fp>::EQ(y, y2) );
assert( fuzzy<fp>::EQ(z, z2) );
-}
- }
-//**************************************
+fp x3, y3, z3;
+xyz_of_r_mu_phi(r,mu,phi, x3,y3,z3);
+assert( fuzzy<fp>::EQ(x, x3) );
+assert( fuzzy<fp>::EQ(y, y3) );
+assert( fuzzy<fp>::EQ(z, z3) );
-namespace {
-void test_r_nu_phi(fp x, fp y, fp z)
-{
-fp r, nu, phi;
-r_nu_phi_of_xyz(x,y,z, r,nu,phi);
-
-const fp mu = mu_of_nu_phi(nu,phi);
-const fp nu2 = nu_of_mu_phi(mu,phi);
-const fp phi2 = phi_of_mu_nu(mu,nu );
-assert( fuzzy<fp>::EQ(nu , nu2 ) );
-assert( fuzzy<fp>::EQ(phi, phi2) );
+fp x4, y4, z4;
+xyz_of_r_nu_phi(r,nu,phi, x4,y4,z4);
+assert( fuzzy<fp>::EQ(x, x4) );
+assert( fuzzy<fp>::EQ(y, y4) );
+assert( fuzzy<fp>::EQ(z, z4) );
-fp x2, y2, z2;
-xyz_of_r_nu_phi(r,nu,phi, x2,y2,z2);
-
-assert( fuzzy<fp>::EQ(x, x2) );
-assert( fuzzy<fp>::EQ(y, y2) );
-assert( fuzzy<fp>::EQ(z, z2) );
}
}
@@ -142,21 +106,35 @@ assert( fuzzy<fp>::EQ(z, z2) );
namespace {
void test_r_theta_phi(fp x, fp y, fp z)
{
-fp r, theta, phi;
-r_theta_phi_of_xyz(x,y,z, r,theta,phi);
-
-fp mu, nu;
-mu_nu_of_theta_phi(theta,phi, mu,nu);
-fp theta2, phi2;
-theta_phi_of_mu_nu(mu,nu, theta2,phi2);
-assert( fuzzy<fp>::EQ(theta, theta2) );
-assert( fuzzy<fp>::EQ(phi , phi2 ) );
+const fp r = r_of_xyz(x, y, z);
+const fp ps_theta = theta_of_xyz(x, y, z);
+const fp ps_phi = phi_of_xy (x, y);
fp x2, y2, z2;
-xyz_of_r_theta_phi(r,theta,phi, x2,y2,z2);
-
+xyz_of_r_theta_phi(r,ps_theta,ps_phi, x2,y2,z2);
assert( fuzzy<fp>::EQ(x, x2) );
assert( fuzzy<fp>::EQ(y, y2) );
assert( fuzzy<fp>::EQ(z, z2) );
+
+fp mu3, nu3;
+mu_nu_of_theta_phi(ps_theta,ps_phi, mu3,nu3);
+fp ps_theta3, ps_phi3;
+theta_phi_of_mu_nu(mu3,nu3, ps_theta3,ps_phi3);
+assert( fuzzy<fp>::EQ(ps_theta3, ps_theta) );
+assert( fuzzy<fp>::EQ(ps_phi3 , ps_phi ) );
+
+fp mu4, phi4;
+mu_phi_of_theta_phi(ps_theta,ps_phi, mu4,phi4);
+fp ps_theta4, ps_phi4;
+theta_phi_of_mu_phi(mu4,phi4, ps_theta4,ps_phi4);
+assert( fuzzy<fp>::EQ(ps_theta4, ps_theta) );
+assert( fuzzy<fp>::EQ(ps_phi4 , ps_phi ) );
+
+fp nu5, phi5;
+nu_phi_of_theta_phi(ps_theta,ps_phi, nu5,phi5);
+fp ps_theta5, ps_phi5;
+theta_phi_of_nu_phi(nu5,phi5, ps_theta5,ps_phi5);
+assert( fuzzy<fp>::EQ(ps_theta5, ps_theta) );
+assert( fuzzy<fp>::EQ(ps_phi5 , ps_phi ) );
}
}