From a57400b5ba2d31f183acfa4e2eea94bd30602447 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Fri, 13 Oct 2006 21:11:00 +0000 Subject: 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 --- Carpet/CarpetRegrid2/src/regrid.cc | 16 +++++++++++----- 1 file 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; -- cgit v1.2.3