diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-21 19:13:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-21 19:13:00 +0000 |
commit | 771da9b0311f4f55ef4d956183bd72b387918017 (patch) | |
tree | b09b725bb1932cf2fe37d36141985fa6192ce0fd /Carpet/CarpetTracker/src | |
parent | 1ed019e8827e00b17608268674c5a29726eb9966 (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/src')
-rw-r--r-- | Carpet/CarpetTracker/src/SetPositions.cc | 51 |
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 |