From 5b07cb7d51be62ea3c90e43bc4a83a64ea69294c Mon Sep 17 00:00:00 2001 From: rhaas Date: Tue, 24 Jan 2012 20:26:51 +0000 Subject: support named spherical surfaces git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinUtils/SetMask_SphericalSurface/trunk@114 053b05ff-9803-4dc7-a0e4-4b49d75fdb53 --- interface.ccl | 5 +++++ param.ccl | 5 +++++ src/SetMask.c | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/interface.ccl b/interface.ccl index cba914b..12ff4e3 100644 --- a/interface.ccl +++ b/interface.ccl @@ -5,3 +5,8 @@ implements: SetMask_SphericalSurface inherits: HydroBase SphericalSurface USES INCLUDE: HydroBase.h + +# 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 71ff822..21ec0c3 100644 --- a/param.ccl +++ b/param.ccl @@ -14,6 +14,11 @@ CCTK_INT SetMask_SurfaceIndex[10] "Index of spherical surface to use to set mask -1:* :: "-1 to disable (default), >=0 for index" } -1 +CCTK_String SetMask_SurfaceName[10] "Name of spherical surface to use to set mask" STEERABLE=always +{ + ".*":: "emtpy to use SetMask_SurfaceIndex, any other string to use" +} "" + CCTK_REAL SetMask_RadiusFactor[10] "Factor to modify radius of surface for mask" STEERABLE=always { 0:* :: "Some positive factor, default: 1" diff --git a/src/SetMask.c b/src/SetMask.c index c2c5541..41453f5 100644 --- a/src/SetMask.c +++ b/src/SetMask.c @@ -1,6 +1,7 @@ #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" +#include "cctk_Functions.h" #include "loopcontrol.h" #include "HydroBase.h" @@ -16,7 +17,7 @@ void SetMask_SphericalSurface (CCTK_ARGUMENTS) for (int smi = 0; smi < 10; smi++) { - CCTK_INT sfi = SetMask_SurfaceIndex[smi]; + CCTK_INT sfi = sf_IdFromName(SetMask_SurfaceIndex[smi], SetMask_SurfaceName[smi]); if (sfi >= 0 && sf_active[sfi] && sf_valid[sfi] >= 0) { #pragma omp parallel -- cgit v1.2.3