aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorRoland Haas <roland.haas@physics.gatech.edu>2012-05-05 15:15:09 -0700
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:26 +0100
commit592bc3794e9cab179198ddde1f512f74a1a6d3f0 (patch)
treea144e6cea4b73e0a4184df09f37d4a4a6f1f7b9e /Carpet
parentf6ee6617f4afe31cdaee9320fa16df12b21dbdb9 (diff)
CarpetLib: add index checking on source array in mixed restriction operator
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
index 070472cc1..04049048f 100644
--- a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
@@ -248,6 +248,24 @@ namespace CarpetLib {
for (int k=0; k<regkext; ++k) {
for (int j=0; j<regjext; ++j) {
for (int i=0; i<regiext; ++i) {
+#ifdef CARPET_DEBUG
+ if(not (2 * k + centk < srckext and
+ 2 * j + centj < srcjext and
+ 2 * i + centi < srciext))
+ {
+ cout << "restrict_3d_vc_rf2.cc\n";
+ cout << "regext " << regext << "\n";
+ cout << "srcext " << srcext << "\n";
+ cout << "srcbbox=" << srcbbox << "\n";
+ cout << "dstbbox=" << dstbbox << "\n";
+ cout << "regbbox=" << regbbox << "\n";
+ cout << "srcregbbox=" << srcregbbox << "\n";
+ cout << "icent=" << icent << "\n";
+ }
+ assert(2 * k + centk < srckext and
+ 2 * j + centj < srcjext and
+ 2 * i + centi < srciext);
+#endif
dst [DSTIND3(i, j, k)] =
restrict3<T,centi,centj,centk>::call