From f3db0bdf01c05888ca41a5fe35284e8b0c8c1d73 Mon Sep 17 00:00:00 2001 From: schnetter Date: Thu, 23 Aug 2007 21:10:04 +0000 Subject: Add new variable sf_active. In constrast to sf_valid, it indicates whether a surface was found in the past, and thus whether it may still be used, although it is probably somewhat inaccurate. Using this version of SphericalSurface requires updating all using thorns, since sf_active has to be set correctly. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@26 40f6ab95-0e4f-0410-8daa-ee8d7420be1d --- interface.ccl | 6 ++++++ schedule.ccl | 2 ++ src/radius.c | 2 ++ src/setup.c | 1 + 4 files changed, 11 insertions(+) diff --git a/interface.ccl b/interface.ccl index 03af59d..833b7e3 100644 --- a/interface.ccl +++ b/interface.ccl @@ -7,6 +7,12 @@ IMPLEMENTS: SphericalSurface PUBLIC: +# To be defined by the setting thorn. +# Suggested meanings: +# zero: The surface data are invalid (garbage) +# one: The surface data are valid in principle, although they may be outdated +CCTK_INT sf_active[nsurfaces] TYPE=scalar + # To be defined by the setting thorn. # Suggested meanings: # zero: No surface is provided at this time step diff --git a/schedule.ccl b/schedule.ccl index ad7de7b..a4aac33 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -1,6 +1,7 @@ # Schedule definitions for thorn SphericalSurface # $Header$ +STORAGE: sf_active STORAGE: sf_valid STORAGE: sf_info STORAGE: sf_radius sf_origin @@ -12,6 +13,7 @@ STORAGE: sf_shape_descriptors SCHEDULE SphericalSurface_Setup AT basegrid { LANG: C + OPTIONS: global } "Calculate surface coordinate descriptors" diff --git a/src/radius.c b/src/radius.c index 0356259..0958b4c 100644 --- a/src/radius.c +++ b/src/radius.c @@ -40,6 +40,7 @@ void SphericalSurface_Set (CCTK_ARGUMENTS) if (set_spherical[n]) { + sf_active[n] = +1; sf_valid[n] = +1; sf_area[n] = 4 * pi * pow (radius[n], 2); @@ -103,6 +104,7 @@ void SphericalSurface_Set (CCTK_ARGUMENTS) CCTK_REAL const ry2 = pow (radius_y[n], 2); CCTK_REAL const rz2 = pow (radius_z[n], 2); + sf_active[n] = +1; sf_valid[n] = +1; sf_area[n] = 0 * 4 * pi * pow (radius[n], 2); diff --git a/src/setup.c b/src/setup.c index 3bc37d9..d4cd599 100644 --- a/src/setup.c +++ b/src/setup.c @@ -115,6 +115,7 @@ void SphericalSurface_Setup (CCTK_ARGUMENTS) /* mark surface as uninitialised */ + sf_active[n] = 0; sf_valid[n] = 0; } /* for n */ -- cgit v1.2.3