aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@f88db872-0e4f-0410-b76b-b9085cfa78c5>2012-01-24 20:24:54 +0000
committerrhaas <rhaas@f88db872-0e4f-0410-b76b-b9085cfa78c5>2012-01-24 20:24:54 +0000
commit6610ba2a0fee45722ecf26f1cc04efbee667c832 (patch)
tree6fca62dd5facb9d4d5f171164edffebf48fbe44b
parenta3a115cd402f70ae7e24ffbb0aed7c2f4d4e90b0 (diff)
support named spherical surfaces
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1562 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--interface.ccl7
-rw-r--r--param.ccl8
-rw-r--r--src/driver/announce.cc4
-rw-r--r--test/misner1.2-025.par4
4 files changed, 21 insertions, 2 deletions
diff --git a/interface.ccl b/interface.ccl
index 5ca0d73..52724ac 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -138,3 +138,10 @@ CCTK_INT FUNCTION IO_TruncateOutputFiles \
USES FUNCTION IO_TruncateOutputFiles
################################################################################
+
+# translate SphericalSurface name into ID
+CCTK_INT \
+FUNCTION sf_IdFromName (CCTK_INT IN id, CCTK_POINTER_TO_CONST IN name)
+USES FUNCTION sf_IdFromName
+
+################################################################################
diff --git a/param.ccl b/param.ccl
index ad6e3f6..470991c 100644
--- a/param.ccl
+++ b/param.ccl
@@ -189,6 +189,14 @@ int which_surface_to_store_info[101] \
0:* :: "store info into the corresponding surface"
} -1
+string which_surface_to_store_info_by_name[101] \
+ "into which surface should we store the info?" \
+ STEERABLE=recover
+{
+"" :: "use which_surface_to_store_info"
+".*" :: "any string"
+} ""
+
#
# This parameter controls how verbose this thorn is in printing
# informational (non-error) messages describing what it's doing.
diff --git a/src/driver/announce.cc b/src/driver/announce.cc
index 5c0b62b..58265ca 100644
--- a/src/driver/announce.cc
+++ b/src/driver/announce.cc
@@ -13,6 +13,7 @@
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "cctk_Functions.h"
#include "config.h"
#include "stdc.h"
@@ -124,7 +125,8 @@ for (int hn = 1; hn <= N_horizons; ++ hn)
{
// Store in spherical surface
- const int sn = which_surface_to_store_info[hn];
+ const int sn = sf_IdFromName(which_surface_to_store_info[hn],
+ which_surface_to_store_info_by_name[hn]);
if (sn == -1)
then continue;
diff --git a/test/misner1.2-025.par b/test/misner1.2-025.par
index eca6add..6e68a4d 100644
--- a/test/misner1.2-025.par
+++ b/test/misner1.2-025.par
@@ -84,8 +84,10 @@ SphericalSurface::ntheta [0] = 32
SphericalSurface::nphi [0] = 32
SphericalSurface::nghoststheta[0] = 2
SphericalSurface::nghostsphi [0] = 2
+SphericalSurface::name [0] = "CommonHorizon"
# individual AH
+SphericalSurface::name [1] = "ApparentHorizon"
SphericalSurface::ntheta [1] = 22
SphericalSurface::nphi [1] = 22
SphericalSurface::nghoststheta[1] = 2
@@ -115,7 +117,7 @@ AHFInderDirect::mask_radius_offset = 0.0
AHFinderDirect::max_N_zones_per_right_angle = 20
# individual AH
-AHFinderDirect::which_surface_to_store_info[1] = 1
+AHFinderDirect::which_surface_to_store_info_by_name[1] = "ApparentHorizon"
AHFinderDirect::N_zones_per_right_angle[1] = 20
AHFinderDirect::origin_x[1] = 0.0
AHFinderDirect::origin_y[1] = 0.0