aboutsummaryrefslogtreecommitdiff
path: root/Carpet
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
commita8485bd04ce129caff0e5edb6b487899fc28aa65 (patch)
tree12ba6ab8dff4c233c2bb4392113b66fdc7fbf6e9 /Carpet
parentaed232234341500ef097d2176c4047462389c08e (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')
-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));
}