aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-10-13 21:11:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-10-13 21:11:00 +0000
commita57400b5ba2d31f183acfa4e2eea94bd30602447 (patch)
tree2a8dea23f7d2ffb0dc6f3563b7cb5b1f0390c6fa /Carpet
parent7048338e888c1413e862849c50fb75eef8015283 (diff)
CarpetRegrid2: Keep sufficient separation between level boundaries
Take ghost zones, inner and outer buffer zones, and the prolongation stencil size into account when calculating the necessary minimum distance between refinement level boundaries. darcs-hash:20061013211100-dae7b-367cc0eee54c5434ce8ddeb175d6ae03380fd6ac.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetRegrid2/src/regrid.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc
index 1e3154b0c..32a590d54 100644
--- a/Carpet/CarpetRegrid2/src/regrid.cc
+++ b/Carpet/CarpetRegrid2/src/regrid.cc
@@ -280,7 +280,13 @@ namespace CarpetRegrid2 {
// Ensure that the coarser grids contain the finer ones
for (size_t rl = regions.size() - 1; rl >= 2; -- rl) {
- ibbox coarse = * regions.at(rl-1).begin();
+ ibbox const coarse = * regions.at(rl-1).begin();
+
+ i2vect const fdistance =
+ i2vect(ivect(0 * min_distance)) + dd.ghosts + dd.buffers;
+ i2vect const cdistance =
+ i2vect(ivect(min_distance + dd.inner_buffer_width +
+ dd.prolongation_stencil_size()));
regions.at(rl).normalize();
ibboxset coarsified;
@@ -288,11 +294,11 @@ namespace CarpetRegrid2 {
ibb != regions.at(rl).end();
++ ibb)
{
- ivect const distance (min_distance);
ibbox const fbb = * ibb;
- ibbox const cbb = fbb.expanded_for(coarse);
- ibbox const ebb = cbb.expand (distance, distance);
- coarsified |= ebb;
+ ibbox const efbb = fbb.expand (fdistance[0], fdistance[1]);
+ ibbox const cbb = efbb.expanded_for(coarse);
+ ibbox const ecbb = cbb.expand (cdistance[0], cdistance[1]);
+ coarsified |= ecbb;
}
regions.at(rl-1) |= coarsified;