aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetTracker
diff options
context:
space:
mode:
authorroland haas <roland.haas@physics.gatech.edu>2012-02-22 07:33:18 -0800
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:02 +0100
commitef28ac317f734b5edb8d7d5f8c4de0582359a643 (patch)
tree32bd020c30ec8c83372f5ebf19ed92f800817f83 /Carpet/CarpetTracker
parent12b4a99653dc25c21c567afb6a5a1b841b8d5e77 (diff)
CarpetTracker: add support for named spherical surfaces
Diffstat (limited to 'Carpet/CarpetTracker')
-rw-r--r--Carpet/CarpetTracker/interface.ccl5
-rw-r--r--Carpet/CarpetTracker/param.ccl8
-rw-r--r--Carpet/CarpetTracker/src/SetPositions.cc3
3 files changed, 15 insertions, 1 deletions
diff --git a/Carpet/CarpetTracker/interface.ccl b/Carpet/CarpetTracker/interface.ccl
index a484d7a55..879afe7f8 100644
--- a/Carpet/CarpetTracker/interface.ccl
+++ b/Carpet/CarpetTracker/interface.ccl
@@ -3,3 +3,8 @@
IMPLEMENTS: CarpetTracker
INHERITS: SphericalSurface CarpetRegrid2
+
+# 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/Carpet/CarpetTracker/param.ccl b/Carpet/CarpetTracker/param.ccl
index 41f0f4a88..55fa55c41 100644
--- a/Carpet/CarpetTracker/param.ccl
+++ b/Carpet/CarpetTracker/param.ccl
@@ -16,6 +16,14 @@ CCTK_INT surface[10] "Spherical surface index which is the source for the locati
+CCTK_STRING surface_name[10] "Spherical surface name which is the source for the location of the refine regions" STEERABLE=always
+{
+ "" :: "use surface"
+ ".*" :: "any string"
+} ""
+
+
+
SHARES: SphericalSurface
USES CCTK_INT nsurfaces
diff --git a/Carpet/CarpetTracker/src/SetPositions.cc b/Carpet/CarpetTracker/src/SetPositions.cc
index 7a986347f..9569aaadf 100644
--- a/Carpet/CarpetTracker/src/SetPositions.cc
+++ b/Carpet/CarpetTracker/src/SetPositions.cc
@@ -5,6 +5,7 @@
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
+#include "cctk_Functions.h"
@@ -38,7 +39,7 @@ using namespace std;
cctk_iteration_done = cctk_iteration;
for (int n = 0; n < num_surfaces; ++ n) {
- int const sn = surface[n];
+ int const sn = sf_IdFromName(surface[n], surface_name[n]);
if (sn >= 0) {
assert (sn >= 0 and sn < nsurfaces);