diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-05-05 15:15:09 -0700 |
---|---|---|
committer | Roland Haas <roland.haas@physics.gatech.edu> | 2012-05-05 15:15:09 -0700 |
commit | 55fdb0854e7af97103d04f5e8a23b15f2d15f715 (patch) | |
tree | 30a80cb3b68e41a2473fdc0f28818ea9e6ef0137 | |
parent | 7c544435834443a861c4cad9e2ad6e09381c6ad8 (diff) |
CarpetLib: add index checking on source array in mixed restriction operator
-rw-r--r-- | Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc | 18 |
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 |