aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid2
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-04-24 16:36:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-04-24 16:36:00 +0000
commitad2ab7fd2ebec4a8dc5a8a881f7cb639d9e3e4df (patch)
tree12ba6ab8dff4c233c2bb4392113b66fdc7fbf6e9 /Carpet/CarpetRegrid2
parentd0acdee2a9bb8254ab8e69bbc4a8e4c7f1d88860 (diff)
CarpetRegrid2: Do not enlarge grids if they are not properly nested
Do not enlarge grids if they are not properly nested. Abort with an error instead. darcs-hash:20070424163656-dae7b-b7c135dcc329df4fd634205491adcdfcb1ce8d49.gz
Diffstat (limited to 'Carpet/CarpetRegrid2')
-rw-r--r--Carpet/CarpetRegrid2/src/regrid.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc
index bee94261d..a91454edc 100644
--- a/Carpet/CarpetRegrid2/src/regrid.cc
+++ b/Carpet/CarpetRegrid2/src/regrid.cc
@@ -534,7 +534,7 @@ namespace CarpetRegrid2 {
//
// TODO: move this to the top, and check the current grid
// instead of the next coarser one
- if (rl > 1) {
+ if (rl > 0) {
ibbox const & coarse = * regions.at(rl-1).begin();
i2vect const fdistance =
@@ -555,8 +555,16 @@ namespace CarpetRegrid2 {
coarsified |= ecbb;
}
- regions.at(rl-1) |= coarsified;
- regions.at(rl-1).normalize();
+#if 0
+ // We cannot just enlarge the grid; all the nice properties
+ // that were ensured above are then broken
+ if (rl > 1) {
+ // Do not enlarge the coarsest grid
+ regions.at(rl-1) |= coarsified;
+ regions.at(rl-1).normalize();
+ }
+#endif
+ assert (coarsified <= regions.at(rl-1));
}