aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-17 14:02:09 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-17 14:02:09 +0000
commita3facde932b8aec7d3cc60ff5162dbb4e08c8148 (patch)
tree6580d3fe281de4dab81e3c2ad4550bec30723e22
parent419faedc4536da9660dc4fb00ab13a9b27c66b5f (diff)
add new functions partial_{mu,nu,phi}_wrt_{x,y,z}
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@527 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--src/patch/coords.cc43
-rw-r--r--src/patch/coords.hh11
2 files changed, 37 insertions, 17 deletions
diff --git a/src/patch/coords.cc b/src/patch/coords.cc
index d906345..b33a6af 100644
--- a/src/patch/coords.cc
+++ b/src/patch/coords.cc
@@ -7,6 +7,7 @@
//
// (r,(mu,nu,phi)) <--> (x,y,z)
// ((mu,nu,phi)) --> the 3rd
+//
// usual polar spherical (r,theta,phi) <--> (x,y,z)
// ((mu,nu,phi)) <--> usual polar spherical (theta,phi)
//
@@ -241,26 +242,34 @@ return mu_of_yz(y, z);
namespace local_coords
{
-fp r_of_xyz(fp x, fp y, fp z)
-{
-return hypot3(x, y, z);
-}
+fp r_of_xyz(fp x, fp y, fp z) { return hypot3(x, y, z); }
+fp mu_of_yz(fp y, fp z) { return arctan_xy(z,y); }
+fp nu_of_xz(fp x, fp z) { return arctan_xy(z,x); }
+fp phi_of_xy(fp x, fp y) { return arctan_xy(x,y); }
+ }
-fp mu_of_yz(fp y, fp z)
-{
-return arctan_xy(z,y);
-}
+//******************************************************************************
-fp nu_of_xz(fp x, fp z)
-{
-return arctan_xy(z,x);
-}
+//
+// these functions compute the partial derivatives
+// partial {mu,nu,phi} / partial {x,y,z}
+// as per the formulas on p.5 of my apparent horizon finding notes
+//
+fp partial_mu_wrt_x(fp x, fp y, fp z) { return 0.0; }
+fp partial_mu_wrt_y(fp x, fp y, fp z) { return z / (y*y + z*z); }
+fp partial_mu_wrt_z(fp x, fp y, fp z) { return -y / (y*y + z*z); }
-fp phi_of_xy(fp x, fp y)
-{
-return arctan_xy(x,y);
-}
- }
+//**************************************
+
+fp partial_nu_wrt_x(fp x, fp y, fp z) { return z / (x*x + z*z); }
+fp partial_nu_wrt_y(fp x, fp y, fp z) { return 0.0; }
+fp partial_nu_wrt_z(fp x, fp y, fp z) { return -x / (x*x + z*z); }
+
+//**************************************
+
+fp partial_phi_wrt_x(fp x, fp y, fp z) { return -y / (x*x + y*y); }
+fp partial_phi_wrt_y(fp x, fp y, fp z) { return x / (x*x + y*y); }
+fp partial_phi_wrt_z(fp x, fp y, fp z) { return 0.0; }
//******************************************************************************
diff --git a/src/patch/coords.hh b/src/patch/coords.hh
index 7a0b624..ecf1124 100644
--- a/src/patch/coords.hh
+++ b/src/patch/coords.hh
@@ -137,6 +137,17 @@ fp phi_of_mu_nu(fp mu, fp nu );
fp nu_of_mu_phi(fp mu, fp phi);
fp mu_of_nu_phi(fp nu, fp phi);
+// partial {mu,nu,phi} / partial {x,y,z}
+fp partial_mu_wrt_x(fp x, fp y, fp z);
+fp partial_mu_wrt_y(fp x, fp y, fp z);
+fp partial_mu_wrt_z(fp x, fp y, fp z);
+fp partial_nu_wrt_x(fp x, fp y, fp z);
+fp partial_nu_wrt_y(fp x, fp y, fp z);
+fp partial_nu_wrt_z(fp x, fp y, fp z);
+fp partial_phi_wrt_x(fp x, fp y, fp z);
+fp partial_phi_wrt_y(fp x, fp y, fp z);
+fp partial_phi_wrt_z(fp x, fp y, fp z);
+
// usual polar spherical (r,theta,phi) <--> (x,y,z)
void xyz_of_r_theta_phi(fp r, fp theta, fp phi, fp& x, fp& y, fp& z);
// ... already have r_of_xyz()