aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-10-26 16:52:56 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-10-26 16:52:56 +0000
commita2944e3f02a40de52fa7c4d3b79e39b634285c0e (patch)
tree914d945a01abf51d73f64053ad55b142dd9119c1
parent30690c8fb6f6a46b1316b75a4465b2381c83cc68 (diff)
store BH diagnostics (= centroid x,y,z, area, m_irreducible)
in Cactus arrays so they're accessible to other thorns and/or I/O methods git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@858 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--interface.ccl32
-rw-r--r--param.ccl2
-rw-r--r--src/driver/driver.hh2
-rw-r--r--src/driver/find_horizons.cc19
4 files changed, 50 insertions, 5 deletions
diff --git a/interface.ccl b/interface.ccl
index 87366ce..df8b800 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -3,3 +3,35 @@
implements: AHFinderDirect
inherits: Grid ADMBase StaticConformal
+
+################################################################################
+
+#
+# diagnostics computed by this thorn which other thorns may want to use,
+# and/or which we may want to output with Cactus I/O methods
+#
+protected:
+
+#
+# all the remaining diagnostics are arrays subscripted by the
+# (1-origin) horizon number hn ; subscript 0 is unused
+#
+int BH_diagnostics__int TYPE=array DIM=1 SIZE=N_horizons+1 DISTRIB=constant
+{
+# this is a Boolean flag: 0=false, 1=true
+AH_found # was this AH found the last time we searched for it?
+ # (if this thorn is active, we search at each time step)
+} "CCTK_INT diagnostics calculated for each apparent horizon found"
+
+#
+# these diagnostics are only defined for those apparent horizons
+# where AH_found[hn] is true
+#
+real BH_diagnostics__real TYPE=array DIM=1 SIZE=N_horizons+1 DISTRIB=constant
+{
+# FIXME: it would be nice to gather these together in some way
+centroid_x, centroid_y, centroid_z # centroid position
+
+area # area of apparent horizon
+m_irreducible # irreducible mass = sqrt(area/(16*pi))
+} "CCTK_REAL diagnostics calculated for each apparent horizon found"
diff --git a/param.ccl b/param.ccl
index 4a74802..0be0fea 100644
--- a/param.ccl
+++ b/param.ccl
@@ -215,7 +215,7 @@ boolean final_H_update_if_exit_x_H_small \
################################################################################
#
-# input/output parameters
+# I/O parameters
#
# this is mainly useful for debugging purposes
diff --git a/src/driver/driver.hh b/src/driver/driver.hh
index 2f6036b..9cb0684 100644
--- a/src/driver/driver.hh
+++ b/src/driver/driver.hh
@@ -159,9 +159,9 @@ struct AH_info
struct initial_guess_info initial_guess_info;
bool AH_found;
+ fp centroid_x, centroid_y, centroid_z;
fp area;
fp m_irreducible;
- fp centroid_x, centroid_y, centroid_z;
};
//
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index 8e871ff..32b30b5 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -199,6 +199,8 @@ setup_Cactus_gridfn_data_ptrs(cctkGH, state.cgi);
state.Jac_info, state.cgi, state.gi,
ps, AH_info.Jac_ptr,
hn, state.N_horizons);
+
+ // compute BH diagnostics?
if (AH_info.AH_found)
then {
BH_diagnostics(state.diagnostics_info,
@@ -222,6 +224,17 @@ setup_Cactus_gridfn_data_ptrs(cctkGH, state.cgi);
then CCTK_VInfo(CCTK_THORNSTRING,
"no apparent horizon found");
}
+
+ // store results in Cactus array variables
+ AH_found[hn] = AH_info.AH_found;
+ if (AH_info.AH_found)
+ then {
+ centroid_x[hn] = AH_info.centroid_x;
+ centroid_y[hn] = AH_info.centroid_y;
+ centroid_z[hn] = AH_info.centroid_z;
+ area[hn] = AH_info.area;
+ m_irreducible[hn] = AH_info.m_irreducible;
+ }
break;
default:
CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -589,12 +602,12 @@ default:
int(ps.type())); /*NOTREACHED*/
}
-AH_info.area = integral_one;
-AH_info.m_irreducible = sqrt(AH_info.area / (16.0*PI));
-
AH_info.centroid_x = integral_x / integral_one;
AH_info.centroid_y = integral_y / integral_one;
AH_info.centroid_z = integral_z / integral_one;
+
+AH_info.area = integral_one;
+AH_info.m_irreducible = sqrt(AH_info.area / (16.0*PI));
}
}