aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetTracker
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-08-21 19:13:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-08-21 19:13:00 +0000
commit8ba6af739f3a3600bc7b348fd23e0a4881fbfcf0 (patch)
treeb09b725bb1932cf2fe37d36141985fa6192ce0fd /Carpet/CarpetTracker
parenta165a43d746a10a45d4e6d363060e0e75367b975 (diff)
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
Diffstat (limited to 'Carpet/CarpetTracker')
-rw-r--r--Carpet/CarpetTracker/src/SetPositions.cc51
1 files changed, 34 insertions, 17 deletions
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 <double> (sf_centroid_x[sn]),
- static_cast <double> (sf_centroid_y[sn]),
- static_cast <double> (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 <double> (sf_centroid_x[sn]),
+ static_cast <double> (sf_centroid_y[sn]),
+ static_cast <double> (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