aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev
diff options
context:
space:
mode:
authorIan Hawke <ih@maths.soton.ac.uk>2005-02-18 16:44:00 +0000
committerIan Hawke <ih@maths.soton.ac.uk>2005-02-18 16:44:00 +0000
commit86b60b8dd5b498779ee004369ff665a51ff41698 (patch)
tree2a7030b487db9b68241bb42ba9d5adc946184fed /CarpetDev
parentde1e2516157419f47c65ed2b5a130a6d6111563c (diff)
Fix adaptive patch hitting boundary
darcs-hash:20050218164449-58c7f-a63ebeaedb7ea80c398986e7267af95dd0dd4679.gz
Diffstat (limited to 'CarpetDev')
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
index eb18a5ca6..7ad17ed66 100644
--- a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
+++ b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc
@@ -523,7 +523,36 @@ namespace CarpetAdaptiveRegrid {
abs(lo[d] - exterior_min[d]) < 1.0e-6 * spacing[d];
ob[d][1] =
abs(up[d] - exterior_max[d]) < 1.0e-6 * spacing[d];
+
+ if (veryverbose) {
+ ostringstream buf;
+ buf << "Done clipping domain:"
+ << endl << lo << endl << up << endl << str;
+ CCTK_INFO(buf.str().c_str());
+ }
+
+ // Check that the striding is correct.
+
+ rvect remainder = (up - lo) / str - floor( (up - lo) / str );
+
+ for (int d=0; d < dim; ++d) {
+ if ( abs(remainder[d]) > 1.e-6 ) {
+ if (ob[d][0]) {
+ up[d] += str[d] * (1 - remainder[d]);
+ }
+ else if (ob[d][1]) {
+ lo[d] -= str[d] * remainder[d];
+ }
+ }
+ }
+ if (veryverbose) {
+ ostringstream buf;
+ buf << "Corrected coords for striding:"
+ << endl << lo << endl << up << endl << str;
+ CCTK_INFO(buf.str().c_str());
+ }
+
newbbcoord = rbbox(lo, up, str);
}
if (verbose) {
@@ -564,6 +593,13 @@ namespace CarpetAdaptiveRegrid {
}
}
}
+
+ if (veryverbose) {
+ ostringstream buf;
+ buf << "Corrected integer coords for min_width:"
+ << endl << ilo << endl << ihi << endl << istr;
+ CCTK_INFO(buf.str().c_str());
+ }
ibbox newbb(ilo, ihi, istr);