From 8ba6af739f3a3600bc7b348fd23e0a4881fbfcf0 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 21 Aug 2007 19:13:00 +0000 Subject: CarpetTracker: Use sf_active instead of sf_valid Use SphericalSurface::sf_active instead of SphericalSurface::sf_valid when tracking horizons. darcs-hash:20070821191301-dae7b-a8c25937106903d4760fecf6f09c9ba3b432b003.gz --- Carpet/CarpetTracker/src/SetPositions.cc | 51 +++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'Carpet/CarpetTracker') diff --git a/Carpet/CarpetTracker/src/SetPositions.cc b/Carpet/CarpetTracker/src/SetPositions.cc index 2daa32dc2..b621fd4b0 100644 --- a/Carpet/CarpetTracker/src/SetPositions.cc +++ b/Carpet/CarpetTracker/src/SetPositions.cc @@ -37,31 +37,48 @@ using namespace std; if (sn >= 0) { assert (sn >= 0 and sn < nsurfaces); - if (sf_valid[sn] > 0) { - - if (verbose) { - CCTK_VInfo (CCTK_THORNSTRING, - "Setting position of refined region #%d from surface #%d to (%g,%g,%g)", - n + 1, sn, - static_cast (sf_centroid_x[sn]), - static_cast (sf_centroid_y[sn]), - static_cast (sf_centroid_z[sn])); - } - - // Set position in CarpetRegrid2 - position_x[n] = sf_centroid_x[sn]; - position_y[n] = sf_centroid_y[sn]; - position_z[n] = sf_centroid_z[sn]; + if (sf_active[sn]) { + if (sf_valid[sn] > 0) { + + if (verbose) { + CCTK_VInfo (CCTK_THORNSTRING, + "Setting position of refined region #%d from surface #%d to (%g,%g,%g)", + n + 1, sn, + static_cast (sf_centroid_x[sn]), + static_cast (sf_centroid_y[sn]), + static_cast (sf_centroid_z[sn])); + } + + // Activate region + active[n] = 1; + + // Set position in CarpetRegrid2 + position_x[n] = sf_centroid_x[sn]; + position_y[n] = sf_centroid_y[sn]; + position_z[n] = sf_centroid_z[sn]; + + } else { + + if (verbose) { + CCTK_VInfo (CCTK_THORNSTRING, + "No position information available for refined region #%d from surface #%d", + n + 1, sn); + } + + } // if not valid } else { if (verbose) { CCTK_VInfo (CCTK_THORNSTRING, - "No position information available for refined region #%d from surface #%d", + "Refined region #%d (depending on surface #%d) is inactive", n + 1, sn); } - } // if valid + // Deactivate region + active[n] = 0; + + } // if not active } // if sn > 0 } // for n -- cgit v1.2.3