aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid2
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-08-07 20:39:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-08-07 20:39:00 +0000
commit13130277bf3270645ae2a4f43800bc1321a364dd (patch)
tree8d5cd96d3bb324456eda6e2d4079a0f0cf7345de /Carpet/CarpetRegrid2
parent7b1cb654295c1259e0f740b92b3b345ef60f9771 (diff)
CarpetRegrid2: Handle refined regions near boundaries correctly
When a refined region is close to an outer (or symmetry) boundary, then extend the refined region up to that boundary, including the correct number of boundary points. darcs-hash:20060807203904-dae7b-b17a235e0cc50191b50647e1c89801970662aaf4.gz
Diffstat (limited to 'Carpet/CarpetRegrid2')
-rw-r--r--Carpet/CarpetRegrid2/src/regrid.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc
index f133d043b..078ae3d61 100644
--- a/Carpet/CarpetRegrid2/src/regrid.cc
+++ b/Carpet/CarpetRegrid2/src/regrid.cc
@@ -329,9 +329,9 @@ namespace CarpetRegrid2 {
ivect const level_exterior_iupper =
rpos2ipos1 (level_exterior_upper, origin, scale, hh, rl);
- // Find the minimum necessary distance to the outer boundary
- // due to buffer zones. This is in terms of grid points.
- i2vect const min_bnd_dist = dd.buffers;
+ // Find the minimum necessary distance to the outer boundary due
+ // to buffer and ghost zones. This is in terms of grid points.
+ i2vect const min_bnd_dist = dd.buffers + dd.ghosts;
// Clip at the outer boundary
regions.at(rl).normalize();
@@ -345,16 +345,16 @@ namespace CarpetRegrid2 {
// Clip boxes that extend outside the boundary. Enlarge boxes
// that are inside but too close to the outer boundary.
bvect const lower_is_outer =
- bb.lower() - min_bnd_dist[0] <= physical_ilower;
+ bb.lower() - min_bnd_dist[0] * bb.stride() <= physical_ilower;
bvect const upper_is_outer =
- bb.upper() + min_bnd_dist[1] >= physical_iupper;
+ bb.upper() + min_bnd_dist[1] * bb.stride() >= physical_iupper;
ibbox const clipped_bb
(either (lower_is_outer, level_exterior_ilower, bb.lower()),
either (upper_is_outer, level_exterior_iupper, bb.upper()),
bb.stride());
- clipped += clipped_bb;
+ clipped |= clipped_bb;
}
regions.at(rl) = clipped;