diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-10 14:53:37 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-10 14:53:37 +0000 |
commit | b930e34239a92ca3c76ba03833026fdaedc2cb37 (patch) | |
tree | 8327ccddc4badae512d3458762944d4e895cd19d /src/patch/ghost_zone.cc | |
parent | 5807777222061a9983836b6033327f5aa6ee87db (diff) |
slightly refactor some code -- no functional changes
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@483 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/ghost_zone.cc')
-rw-r--r-- | src/patch/ghost_zone.cc | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/patch/ghost_zone.cc b/src/patch/ghost_zone.cc index fb70c13..6179af5 100644 --- a/src/patch/ghost_zone.cc +++ b/src/patch/ghost_zone.cc @@ -391,41 +391,43 @@ const int other_min_iperp = std::min(other_iperp(min_iperp()), const int other_max_iperp = std::max(other_iperp(min_iperp()), other_iperp(max_iperp())); // -// set up arrays giving [min,max] ipar that we'll use at each other_iperp +// compute extreme range of ipar that we'll use, +// and set up arrays giving actual [min,max] ipar that we'll use +// at each other_iperp // ... we will pass these arrays by reference to the other patch's // patch_interp object, with ipar being parindex there // +int extreme_min_ipar = +INT_MAX; +int extreme_max_ipar = -INT_MAX; min_ipar_used_ = new jtutil::array1d<int>(other_min_iperp, other_max_iperp); max_ipar_used_ = new jtutil::array1d<int>(other_min_iperp, other_max_iperp); for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { - (*min_ipar_used_)(other_iperp(iperp)) = min_ipar(iperp); - (*max_ipar_used_)(other_iperp(iperp)) = max_ipar(iperp); + const int min_ipar_here = min_ipar(iperp); + const int max_ipar_here = max_ipar(iperp); + extreme_min_ipar = std::min(extreme_min_ipar, min_ipar_here); + extreme_max_ipar = std::max(extreme_max_ipar, max_ipar_here); + (*min_ipar_used_)(other_iperp(iperp)) = min_ipar_here; + (*max_ipar_used_)(other_iperp(iperp)) = max_ipar_here; } // // set up array giving other patch's par coordinate for interpolation +// ... for simplicity we just use the extreme ipar range, rather than +// only computing this on just the actually-used ipar range for each iperp // -// ... note that we can't yet count on any other ghost zone existing, -// so we don't yet know whether or not we'll want our corners -// (since that depends on the type of our patch's adjacent ghost zones) -// ==> we include the corners on the chance we may want them later, -// and use the appropriate parts of them in synchronize() below -other_par_ = new jtutil::array2d<fp> - (other_min_iperp, other_max_iperp, - ghost_zone_min_ipar(), ghost_zone_max_ipar()); +other_par_ = new jtutil::array2d<fp>(other_min_iperp, other_max_iperp, + extreme_min_ipar, extreme_max_ipar); for (int iperp = min_iperp() ; iperp <= max_iperp() ; ++iperp) { - for (int ipar = ghost_zone_min_ipar() ; - ipar <= ghost_zone_max_ipar() ; - ++ipar) + for (int ipar = extreme_min_ipar ; ipar <= extreme_max_ipar ; ++ipar) { // compute the other_par corresponding to (iperp,ipar) - // ... here we use the fact (which we verified above) that - // other edge's parallel coordinate == our tau coordinate + // ... here we use the fact (which we verified in our constructor) + // that other edge's parallel coordinate == our tau coordinate // (at least modulo 2*pi radians = 360 degrees) const fp perp = my_edge().perp_of_iperp(iperp); const fp par = my_edge().par_of_ipar(ipar); @@ -449,7 +451,7 @@ interp_result_buffer_ = new jtutil::array3d<fp> (my_patch().ghosted_min_gfn(), my_patch().ghosted_max_gfn(), other_min_iperp, other_max_iperp, - ghost_zone_min_ipar(), ghost_zone_max_ipar()); + extreme_min_ipar, extreme_max_ipar); // // construct the patch_interp object to interpolate from the *other* patch |