00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BL_LOOPING_H
00024 #define BL_LOOPING_H
00025
00026
00027
00028
00029
00030 #if (BL_SPACEDIM == 1)
00031
00069 #define ForAllThisPencil(T,b,ns,nc) \
00070 { \
00071 BL_ASSERT(contains(b)); \
00072 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00073 const int *_th_plo = loVect(); \
00074 const int *_th_plen = length(); \
00075 const int *_b_lo = (b).loVect(); \
00076 const int *_b_len = (b).length(); \
00077 T* _th_p = dptr; \
00078 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00079 const int nR = _n; \
00080 T *_th_pp = _th_p \
00081 + ((_b_lo[0] - _th_plo[0]) \
00082 + _n * _th_plen[0]); \
00083 T &thisR = * _th_pp; \
00084 const int thisLen = _b_len[0]; \
00085
00086
00103 #define ForAllThisCPencil(T,b,ns,nc) \
00104 { \
00105 BL_ASSERT(contains(b)); \
00106 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00107 const int *_th_plo = loVect(); \
00108 const int *_th_plen = length(); \
00109 const int *_b_lo = (b).loVect(); \
00110 const int *_b_len = (b).length().getVect(); \
00111 const T* _th_p = dptr; \
00112 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00113 int nR = _n; nR += 0; \
00114 const T *_th_pp = _th_p \
00115 + ((_b_lo[0] - _th_plo[0]) \
00116 + _n * _th_plen[0]); \
00117 const T &thisR = * _th_pp; \
00118 const int thisLen = _b_len[0];
00119
00141 #define ForAllXBNN(T,x,b,ns,nc) \
00142 { \
00143 BL_ASSERT(x.contains(b)); \
00144 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00145 const int *_x_plo = (x).loVect(); \
00146 const int *_x_plen = (x).length(); \
00147 const int *_b_lo = (b).loVect(); \
00148 const int *_b_len = (b).length(); \
00149 T* _x_p = (x) .dataPtr(); \
00150 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00151 const int nR = _n; \
00152 T *_x_pp = _x_p \
00153 + ((_b_lo[0] - _x_plo[0]) \
00154 + _n * _x_plen[0]); \
00155 for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \
00156 const int iR = _i + _b_lo[0]; \
00157 T &x##R = * _x_pp;
00158
00176 #define ForAllXCBNN(T,x,b,ns,nc) \
00177 { \
00178 BL_ASSERT(x.contains(b)); \
00179 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00180 const int *_x_plo = (x).loVect(); \
00181 const int *_x_plen = (x).length(); \
00182 const int *_b_lo = (b).loVect(); \
00183 const int *_b_len = (b).length().getVect(); \
00184 const T* _x_p = (x).dataPtr(); \
00185 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00186 const int nR = _n; \
00187 const T *_x_pp = _x_p \
00188 + ((_b_lo[0] - _x_plo[0]) \
00189 + _n * _x_plen[0]); \
00190 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00191 const int iR = _i + _b_lo[0]; \
00192 const T & x##R = _x_pp[_i];
00193
00226 #define ForAllThisBNN(T,b,ns,nc) \
00227 { \
00228 BL_ASSERT(contains(b)); \
00229 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00230 const int *_th_plo = loVect(); \
00231 const int *_th_plen = length(); \
00232 const int *_b_lo = (b).loVect(); \
00233 const int *_b_len = (b).length().getVect(); \
00234 T* _th_p = dptr; \
00235 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00236 int nR = _n; nR += 0; \
00237 T *_th_pp = _th_p \
00238 + ((_b_lo[0] - _th_plo[0]) \
00239 + _n * _th_plen[0]); \
00240 for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \
00241 int iR = _i + _b_lo[0]; iR += 0; \
00242 T &thisR = * _th_pp;
00243
00261 #define ForAllThisCBNN(T,b,ns,nc) \
00262 { \
00263 BL_ASSERT(contains(b)); \
00264 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00265 const int *_th_plo = loVect(); \
00266 const int *_th_plen = length(); \
00267 const int *_b_lo = (b).loVect(); \
00268 const int *_b_len = (b).length().getVect(); \
00269 const T* _th_p = dptr; \
00270 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00271 const int nR = _n; \
00272 const T *_th_pp = _th_p \
00273 + ((_b_lo[0] - _th_plo[0]) \
00274 + _n * _th_plen[0]); \
00275 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00276 const int iR = _i + _b_lo[0]; \
00277 const T &thisR = _th_pp[_i];
00278
00300 #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \
00301 { \
00302 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00303 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
00304 Box _subbox_((x).box()); \
00305 _subbox_ &= box(); \
00306 _subbox_ &= b; \
00307 if(_subbox_.ok()) { \
00308 const int *_th_plo = loVect(); \
00309 const int *_th_plen = length(); \
00310 const int *_x_plo = (x).loVect(); \
00311 const int *_x_plen = (x).length(); \
00312 const int *_subbox_lo = _subbox_.loVect(); \
00313 const int *_subbox_len = _subbox_.length().getVect(); \
00314 T* _th_p = dataPtr(ns); \
00315 const T* _x_p = (x).dataPtr(nss); \
00316 for(int _n = 0; _n < (nc); ++_n) { \
00317 int nR = _n; nR += 0; \
00318 T *_th_pp = _th_p \
00319 + ((_subbox_lo[0] - _th_plo[0]) \
00320 + _n * _th_plen[0]); \
00321 const T *_x_pp = _x_p \
00322 + ((_subbox_lo[0] - _x_plo[0]) \
00323 + _n * _x_plen[0]); \
00324 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00325 int iR = _i + _subbox_lo[0]; iR += 0; \
00326 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
00327
00349 #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \
00350 { \
00351 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00352 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
00353 Box _subbox_ = box(); \
00354 _subbox_ &= b; \
00355 BL_ASSERT(bx.sameSize(_subbox_)); \
00356 if(_subbox_.ok()) { \
00357 const int *_th_plo = loVect(); \
00358 const int *_th_plen = length(); \
00359 const int *_x_plo = (x).loVect(); \
00360 const int *_x_plen = (x).length(); \
00361 const int *_subbox_lo = _subbox_.loVect(); \
00362 const int *_subbox_len = _subbox_.length().getVect(); \
00363 const int *_bx_lo = (bx).loVect(); \
00364 \
00365 T* _th_p = dataPtr(ns); \
00366 const T* _x_p = (x).dataPtr(nss); \
00367 for(int _n = 0; _n < (nc); ++_n) { \
00368 int nR = _n + ns; nR += 0; \
00369 int n##x##R = _n + nss; n##x##R += 0; \
00370 T *_th_pp = _th_p \
00371 + ((_subbox_lo[0] - _th_plo[0]) \
00372 + _n * _th_plen[0]); \
00373 const T *_x_pp = _x_p \
00374 + ((_bx_lo[0] - _x_plo[0]) \
00375 + _n * _x_plen[0]); \
00376 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00377 int iR = _i + _subbox_lo[0]; iR += 0; \
00378 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
00379 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
00380
00406 #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \
00407 { \
00408 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00409 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
00410 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
00411 Box _subbox_ = box(); \
00412 _subbox_ &= b; \
00413 BL_ASSERT((bx).sameSize(_subbox_)); \
00414 BL_ASSERT((by).sameSize(_subbox_)); \
00415 if(_subbox_.ok()) { \
00416 const int *_th_plo = loVect(); \
00417 const int *_th_plen = length(); \
00418 const int *_x_plo = (x).loVect(); \
00419 const int *_x_plen = (x).length(); \
00420 const int *_y_plo = (y).loVect(); \
00421 const int *_y_plen = (y).length(); \
00422 const int *_subbox_lo = _subbox_.loVect(); \
00423 const int *_subbox_len = _subbox_.length().getVect(); \
00424 const int *_bx_lo = (bx).loVect(); \
00425 \
00426 const int *_by_lo = (by).loVect(); \
00427 \
00428 T* _th_p = dataPtr(ns); \
00429 const T* _x_p = (x).dataPtr(nsx); \
00430 const T* _y_p = (y).dataPtr(nsy); \
00431 for(int _n = 0; _n < (nc); ++_n) { \
00432 int nR = _n + ns; nR += 0; \
00433 int n##x##R = _n + nsx; n##x##R += 0; \
00434 int n##y##R = _n + nsy; n##y##R += 0; \
00435 T *_th_pp = _th_p \
00436 + ((_subbox_lo[0] - _th_plo[0]) \
00437 + _n * _th_plen[0]); \
00438 const T *_x_pp = _x_p \
00439 + ((_bx_lo[0] - _x_plo[0]) \
00440 + _n * _x_plen[0]); \
00441 const T *_y_pp = _y_p \
00442 + ((_by_lo[0] - _y_plo[0]) \
00443 + _n * _y_plen[0]); \
00444 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00445 int iR = _i + _subbox_lo[0]; iR += 0; \
00446 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
00447 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \
00448 T &thisR = * _th_pp; \
00449 const T & x##R = _x_pp[_i]; \
00450 const T & y##R = _y_pp[_i];
00451
00452 #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ri) \
00453 { \
00454 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
00455 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
00456 BL_ASSERT((x).contains(bx)); \
00457 BL_ASSERT((y).contains(by)); \
00458 BL_ASSERT((bx).sameSize(by)); \
00459 const int *_x_plo = (x).loVect(); \
00460 const int *_x_plen = (x).length(); \
00461 const int *_y_plo = (y).loVect(); \
00462 const int *_y_plen = (y).length(); \
00463 const int *_len = (bx).length().getVect(); \
00464 const int *_bx_lo = (bx).loVect(); \
00465 const int *_by_lo = (by).loVect(); \
00466 T* _x_p = (x).dataPtr(nsx); \
00467 const T* _y_p = (y).dataPtr(nsy); \
00468 for(int _n = 0; _n < (nc); ++_n) { \
00469 int n##x##R = _n + nsx; n##x##R += 0; \
00470 int n##y##R = _n + nsy; n##y##R += 0; \
00471 int _ix = 0; \
00472 T *_x_pp = _x_p \
00473 + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \
00474 + _n * _x_plen[0]); \
00475 const T *_y_pp = _y_p \
00476 + ((_by_lo[0] - _y_plo[0]) \
00477 + _n * _y_plen[0]); \
00478 for(int _i = 0; _i < _len[0]; ++_i, --_ix) { \
00479 T & x##R = _x_pp[_ix]; \
00480 const T & y##R = _y_pp[_i];
00481
00486 #define EndForTX }}}}
00487
00492 #define EndFor }}}
00493
00497 #define EndForPencil }}
00498
00499 #elif (BL_SPACEDIM == 2)
00500
00501 #define ForAllThisCPencil(T,b,ns,nc) \
00502 { \
00503 BL_ASSERT(contains(b)); \
00504 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00505 const int *_th_plo = loVect(); \
00506 const int *_th_plen = length(); \
00507 const int *_b_lo = (b).loVect(); \
00508 const int *_b_len = (b).length().getVect(); \
00509 const T* _th_p = dptr; \
00510 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00511 int nR = _n; nR += 0; \
00512 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00513 const int jR = _j + _b_lo[1]; \
00514 const T *_th_pp = _th_p \
00515 + ((_b_lo[0] - _th_plo[0]) \
00516 + _th_plen[0]*( \
00517 (jR - _th_plo[1]) \
00518 + _n * _th_plen[1])); \
00519 const T &thisR = * _th_pp; \
00520 const int thisLen = _b_len[0];
00521
00522 #define ForAllThisPencil(T,b,ns,nc) \
00523 { \
00524 BL_ASSERT(contains(b)); \
00525 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00526 const int *_th_plo = loVect(); \
00527 const int *_th_plen = length(); \
00528 const int *_b_lo = (b).loVect(); \
00529 const int *_b_len = (b).length().getVect(); \
00530 T* _th_p = dptr; \
00531 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00532 const int nR = _n; \
00533 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00534 const int jR = _j + _b_lo[1]; \
00535 T *_th_pp = _th_p \
00536 + ((_b_lo[0] - _th_plo[0]) \
00537 + _th_plen[0]*( \
00538 (jR - _th_plo[1]) \
00539 + _n * _th_plen[1])); \
00540 T &thisR = * _th_pp; \
00541 const int thisLen = _b_len[0]; \
00542
00543
00544 #define ForAllXBNN(T,x,b,ns,nc) \
00545 { \
00546 BL_ASSERT(x.contains(b)); \
00547 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00548 const int *_x_plo = (x).loVect(); \
00549 const int *_x_plen = (x).length(); \
00550 const int *_b_lo = (b).loVect(); \
00551 const int *_b_len = (b).length().getVect(); \
00552 T* _x_p = (x) .dataPtr(); \
00553 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00554 const int nR = _n; \
00555 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00556 const int jR = _j + _b_lo[1]; \
00557 T *_x_pp = _x_p \
00558 + ((_b_lo[0] - _x_plo[0]) \
00559 + _x_plen[0]*( \
00560 (jR - _x_plo[1]) \
00561 + _n * _x_plen[1])); \
00562 for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \
00563 const int iR = _i + _b_lo[0]; \
00564 T &x##R = * _x_pp;
00565
00566 #define ForAllXCBNN(T,x,b,ns,nc) \
00567 { \
00568 BL_ASSERT(x.contains(b)); \
00569 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00570 const int *_x_plo = (x).loVect(); \
00571 const int *_x_plen = (x).length(); \
00572 const int *_b_lo = (b).loVect(); \
00573 const int *_b_len = (b).length().getVect(); \
00574 const T* _x_p = (x).dataPtr(); \
00575 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00576 const int nR = _n; \
00577 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00578 const int jR = _j + _b_lo[1]; \
00579 const T *_x_pp = _x_p \
00580 + ((_b_lo[0] - _x_plo[0]) \
00581 + _x_plen[0]*( \
00582 (jR - _x_plo[1]) \
00583 + _n * _x_plen[1])); \
00584 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00585 const int iR = _i + _b_lo[0]; \
00586 const T & x##R = _x_pp[_i];
00587
00588
00589 #define ForAllThisBNN(T,b,ns,nc) \
00590 { \
00591 BL_ASSERT(contains(b)); \
00592 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00593 const int *_th_plo = loVect(); \
00594 const int *_th_plen = length(); \
00595 const int *_b_lo = (b).loVect(); \
00596 const int *_b_len = (b).length().getVect(); \
00597 T* _th_p = dptr; \
00598 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00599 int nR = _n; nR += 0; \
00600 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00601 const int jR = _j + _b_lo[1]; \
00602 T *_th_pp = _th_p \
00603 + ((_b_lo[0] - _th_plo[0]) \
00604 + _th_plen[0]*( \
00605 (jR - _th_plo[1]) \
00606 + _n * _th_plen[1])); \
00607 for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \
00608 int iR = _i + _b_lo[0]; iR += 0; \
00609 T &thisR = * _th_pp;
00610
00611 #define ForAllThisCBNN(T,b,ns,nc) \
00612 { \
00613 BL_ASSERT(contains(b)); \
00614 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00615 const int *_th_plo = loVect(); \
00616 const int *_th_plen = length(); \
00617 const int *_b_lo = (b).loVect(); \
00618 const int *_b_len = (b).length().getVect(); \
00619 const T* _th_p = dptr; \
00620 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00621 const int nR = _n; \
00622 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00623 const int jR = _j + _b_lo[1]; \
00624 const T *_th_pp = _th_p \
00625 + ((_b_lo[0] - _th_plo[0]) \
00626 + _th_plen[0]*( \
00627 (_j + _b_lo[1] - _th_plo[1]) \
00628 + _n * _th_plen[1])); \
00629 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00630 const int iR = _i + _b_lo[0]; \
00631 const T &thisR = _th_pp[_i];
00632
00633 #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \
00634 { \
00635 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00636 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
00637 Box _subbox_((x).box()); \
00638 _subbox_ &= box(); \
00639 _subbox_ &= b; \
00640 if(_subbox_.ok()) { \
00641 const int *_th_plo = loVect(); \
00642 const int *_th_plen = length(); \
00643 const int *_x_plo = (x).loVect(); \
00644 const int *_x_plen = (x).length(); \
00645 const int *_subbox_lo = _subbox_.loVect(); \
00646 const int *_subbox_len = _subbox_.length().getVect(); \
00647 T* _th_p = dataPtr(ns); \
00648 const T* _x_p = (x).dataPtr(nss); \
00649 for(int _n = 0; _n < (nc); ++_n) { \
00650 int nR = _n; nR += 0; \
00651 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
00652 const int jR = _j + _subbox_lo[1]; \
00653 T *_th_pp = _th_p \
00654 + ((_subbox_lo[0] - _th_plo[0]) \
00655 + _th_plen[0]*( \
00656 (jR - _th_plo[1]) \
00657 + _n * _th_plen[1])); \
00658 const T *_x_pp = _x_p \
00659 + ((_subbox_lo[0] - _x_plo[0]) \
00660 + _x_plen[0]*( \
00661 (jR - _x_plo[1]) \
00662 + _n * _x_plen[1])); \
00663 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00664 int iR = _i + _subbox_lo[0]; iR += 0; \
00665 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
00666
00667 #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \
00668 { \
00669 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00670 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
00671 Box _subbox_ = box(); \
00672 _subbox_ &= b; \
00673 BL_ASSERT(bx.sameSize(_subbox_)); \
00674 if(_subbox_.ok()) { \
00675 const int *_th_plo = loVect(); \
00676 const int *_th_plen = length(); \
00677 const int *_x_plo = (x).loVect(); \
00678 const int *_x_plen = (x).length(); \
00679 const int *_subbox_lo = _subbox_.loVect(); \
00680 const int *_subbox_len = _subbox_.length().getVect(); \
00681 const int *_bx_lo = (bx).loVect(); \
00682 \
00683 T* _th_p = dataPtr(ns); \
00684 const T* _x_p = (x).dataPtr(nss); \
00685 for(int _n = 0; _n < (nc); ++_n) { \
00686 int nR = _n + ns; nR += 0; \
00687 int n##x##R = _n + nss; n##x##R += 0; \
00688 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
00689 const int jR = _j + _subbox_lo[1]; \
00690 const int j##x##R = _j + _bx_lo[1]; \
00691 T *_th_pp = _th_p \
00692 + ((_subbox_lo[0] - _th_plo[0]) \
00693 + _th_plen[0]*( \
00694 (jR - _th_plo[1]) \
00695 + _n * _th_plen[1])); \
00696 const T *_x_pp = _x_p \
00697 + ((_bx_lo[0] - _x_plo[0]) \
00698 + _x_plen[0]*( \
00699 (j##x##R - _x_plo[1]) \
00700 + _n * _x_plen[1])); \
00701 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00702 int iR = _i + _subbox_lo[0]; iR += 0; \
00703 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
00704 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
00705
00706 #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \
00707 { \
00708 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00709 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
00710 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
00711 Box _subbox_ = box(); \
00712 _subbox_ &= b; \
00713 BL_ASSERT((bx).sameSize(_subbox_)); \
00714 BL_ASSERT((by).sameSize(_subbox_)); \
00715 if(_subbox_.ok()) { \
00716 const int *_th_plo = loVect(); \
00717 const int *_th_plen = length(); \
00718 const int *_x_plo = (x).loVect(); \
00719 const int *_x_plen = (x).length(); \
00720 const int *_y_plo = (y).loVect(); \
00721 const int *_y_plen = (y).length(); \
00722 const int *_subbox_lo = _subbox_.loVect(); \
00723 const int *_subbox_len = _subbox_.length().getVect(); \
00724 const int *_bx_lo = (bx).loVect(); \
00725 \
00726 const int *_by_lo = (by).loVect(); \
00727 \
00728 T* _th_p = dataPtr(ns); \
00729 const T* _x_p = (x).dataPtr(nsx); \
00730 const T* _y_p = (y).dataPtr(nsy); \
00731 for(int _n = 0; _n < (nc); ++_n) { \
00732 int nR = _n + ns; nR += 0; \
00733 int n##x##R = _n + nsx; n##x##R += 0; \
00734 int n##y##R = _n + nsy; n##y##R += 0; \
00735 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
00736 const int jR = _j + _subbox_lo[1]; \
00737 const int j##x##R = _j + _bx_lo[1]; \
00738 const int j##y##R = _j + _by_lo[1]; \
00739 T *_th_pp = _th_p \
00740 + ((_subbox_lo[0] - _th_plo[0]) \
00741 + _th_plen[0]*( \
00742 (jR - _th_plo[1]) \
00743 + _n * _th_plen[1])); \
00744 const T *_x_pp = _x_p \
00745 + ((_bx_lo[0] - _x_plo[0]) \
00746 + _x_plen[0]*( \
00747 (j##x##R - _x_plo[1]) \
00748 + _n * _x_plen[1])); \
00749 const T *_y_pp = _y_p \
00750 + ((_by_lo[0] - _y_plo[0]) \
00751 + _y_plen[0]*( \
00752 (j##y##R - _y_plo[1]) \
00753 + _n * _y_plen[1])); \
00754 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
00755 int iR = _i + _subbox_lo[0]; iR += 0; \
00756 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
00757 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \
00758 T &thisR = * _th_pp; \
00759 const T & x##R = _x_pp[_i]; \
00760 const T & y##R = _y_pp[_i];
00761
00762 #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ir) \
00763 { \
00764 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
00765 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
00766 BL_ASSERT((ir) >= 0 && (ir) < BL_SPACEDIM); \
00767 BL_ASSERT((x).contains(bx)); \
00768 BL_ASSERT((y).contains(by)); \
00769 BL_ASSERT((bx).sameSize(by)); \
00770 const int *_x_plo = (x).loVect(); \
00771 const int *_x_plen = (x).length(); \
00772 const int *_y_plo = (y).loVect(); \
00773 const int *_y_plen = (y).length(); \
00774 const int *_bx_lo = (bx).loVect(); \
00775 const int *_by_lo = (by).loVect(); \
00776 const int *_len = (bx).length().getVect(); \
00777 T* _x_p = (x).dataPtr(nsx); \
00778 const T* _y_p = (y).dataPtr(nsy); \
00779 for(int _n = 0; _n < (nc); ++_n) { \
00780 int n##x##R = _n + nsx; n##x##R += 0; \
00781 int n##y##R = _n + nsy; n##y##R += 0; \
00782 for(int _j = 0; _j < _len[1]; ++_j) { \
00783 const int j##x##R = _j + _bx_lo[1]; \
00784 const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \
00785 const int j##y##R = _j + _by_lo[1]; \
00786 T *_x_pp; \
00787 int _ix = 0; \
00788 int _istrd; \
00789 if (ir == 0) { \
00790 _x_pp = _x_p \
00791 + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \
00792 + _x_plen[0]*( \
00793 (j##x##R - _x_plo[1]) \
00794 + _n * _x_plen[1])); \
00795 _istrd = -1; \
00796 } else { \
00797 _x_pp = _x_p \
00798 + ((_bx_lo[0] - _x_plo[0]) \
00799 + _x_plen[0]*( \
00800 (jrev##x##R - _x_plo[1]) \
00801 + _n * _x_plen[1])); \
00802 _istrd = 1; \
00803 } \
00804 const T *_y_pp = _y_p \
00805 + ((_by_lo[0] - _y_plo[0]) \
00806 + _y_plen[0]*( \
00807 (j##y##R - _y_plo[1]) \
00808 + _n * _y_plen[1])); \
00809 int _x_rev = _len[0]-1; _x_rev += 0; \
00810 for(int _i = 0; _i < _len[0]; ++_i, _ix+=_istrd) { \
00811 T & x##R = _x_pp[_ix]; \
00812 const T & y##R = _y_pp[_i];
00813
00814
00815 #define EndFor }}}}
00816 #define EndForTX }}}}}
00817 #define EndForPencil }}}
00818
00819 #elif (BL_SPACEDIM == 3)
00820
00821 #define ForAllThisCPencil(T,b,ns,nc) \
00822 { \
00823 BL_ASSERT(contains(b)); \
00824 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00825 const int *_th_plo = loVect(); \
00826 const int *_th_plen = length(); \
00827 const int *_b_lo = (b).loVect(); \
00828 const int *_b_len = (b).length().getVect(); \
00829 const T* _th_p = dptr; \
00830 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00831 int nR = _n; nR += 0; \
00832 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00833 const int kR = _k + _b_lo[2]; \
00834 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00835 const int jR = _j + _b_lo[1]; \
00836 const T *_th_pp = _th_p \
00837 + ((_b_lo[0] - _th_plo[0]) \
00838 + _th_plen[0]*( \
00839 (jR - _th_plo[1]) \
00840 + _th_plen[1]*( \
00841 (kR - _th_plo[2]) \
00842 + _n * _th_plen[2]))); \
00843 const T &thisR = * _th_pp; \
00844 const int thisLen = _b_len[0];
00845
00846 #define ForAllThisPencil(T,b,ns,nc) \
00847 { \
00848 BL_ASSERT(contains(b)); \
00849 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00850 const int *_th_plo = loVect(); \
00851 const int *_th_plen = length(); \
00852 const int *_b_lo = (b).loVect(); \
00853 const int *_b_len = (b).length().getVect(); \
00854 T* _th_p = dptr; \
00855 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00856 const int nR = _n; \
00857 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00858 const int kR = _k + _b_lo[2]; \
00859 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00860 const int jR = _j + _b_lo[1]; \
00861 T *_th_pp = _th_p \
00862 + ((_b_lo[0] - _th_plo[0]) \
00863 + _th_plen[0]*( \
00864 (jR - _th_plo[1]) \
00865 + _th_plen[1]*( \
00866 (kR - _th_plo[2]) \
00867 + _n * _th_plen[2]))); \
00868 T &thisR = * _th_pp; \
00869 const int thisLen = _b_len[0]; \
00870
00871
00872 #define ForAllXBNN(T,x,b,ns,nc) \
00873 { \
00874 BL_ASSERT(x.contains(b)); \
00875 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00876 const int *_x_plo = (x).loVect(); \
00877 const int *_x_plen = (x).length(); \
00878 const int *_b_lo = (b).loVect(); \
00879 const int *_b_len = (b).length().getVect(); \
00880 T* _x_p = (x) .dataPtr(); \
00881 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00882 const int nR = _n; \
00883 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00884 const int kR = _k + _b_lo[2]; \
00885 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00886 const int jR = _j + _b_lo[1]; \
00887 T *_x_pp = _x_p \
00888 + ((_b_lo[0] - _x_plo[0]) \
00889 + _x_plen[0]*( \
00890 (jR - _x_plo[1]) \
00891 + _x_plen[1]*( \
00892 (kR - _x_plo[2]) \
00893 + _n * _x_plen[2]))); \
00894 for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \
00895 const int iR = _i + _b_lo[0]; \
00896 T &x##R = * _x_pp;
00897
00898 #define ForAllXCBNN(T,x,b,ns,nc) \
00899 { \
00900 BL_ASSERT(x.contains(b)); \
00901 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \
00902 const int *_x_plo = (x).loVect(); \
00903 const int *_x_plen = (x).length(); \
00904 const int *_b_lo = (b).loVect(); \
00905 const int *_b_len = (b).length().getVect(); \
00906 const T* _x_p = (x).dataPtr(); \
00907 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00908 const int nR = _n; \
00909 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00910 const int kR = _k + _b_lo[2]; \
00911 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00912 const int jR = _j + _b_lo[1]; \
00913 const T *_x_pp = _x_p \
00914 + ((_b_lo[0] - _x_plo[0]) \
00915 + _x_plen[0]*( \
00916 (jR - _x_plo[1]) \
00917 + _x_plen[1]*( \
00918 (kR - _x_plo[2]) \
00919 + _n * _x_plen[2]))); \
00920 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00921 const int iR = _i + _b_lo[0]; \
00922 const T & x##R = _x_pp[_i];
00923
00924
00925 #define ForAllThisBNN(T,b,ns,nc) \
00926 { \
00927 BL_ASSERT(contains(b)); \
00928 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00929 const int *_th_plo = loVect(); \
00930 const int *_th_plen = length(); \
00931 const int *_b_lo = (b).loVect(); \
00932 const int *_b_len = (b).length().getVect(); \
00933 T* _th_p = dptr; \
00934 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00935 int nR = _n; nR += 0; \
00936 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00937 const int kR = _k + _b_lo[2]; \
00938 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00939 const int jR = _j + _b_lo[1]; \
00940 T *_th_pp = _th_p \
00941 + ((_b_lo[0] - _th_plo[0]) \
00942 + _th_plen[0]*( \
00943 (jR - _th_plo[1]) \
00944 + _th_plen[1]*( \
00945 (kR - _th_plo[2]) \
00946 + _n * _th_plen[2]))); \
00947 for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \
00948 int iR = _i + _b_lo[0]; iR += 0; \
00949 T &thisR = * _th_pp;
00950
00951 #define ForAllThisCBNN(T,b,ns,nc) \
00952 { \
00953 BL_ASSERT(contains(b)); \
00954 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00955 const int *_th_plo = loVect(); \
00956 const int *_th_plen = length(); \
00957 const int *_b_lo = (b).loVect(); \
00958 const int *_b_len = (b).length().getVect(); \
00959 const T* _th_p = dptr; \
00960 for(int _n = (ns); _n < (ns)+(nc); ++_n) { \
00961 const int nR = _n; \
00962 for(int _k = 0; _k < _b_len[2]; ++_k) { \
00963 const int kR = _k + _b_lo[2]; \
00964 for(int _j = 0; _j < _b_len[1]; ++_j) { \
00965 const int jR = _j + _b_lo[1]; \
00966 const T *_th_pp = _th_p \
00967 + ((_b_lo[0] - _th_plo[0]) \
00968 + _th_plen[0]*( \
00969 (jR - _th_plo[1]) \
00970 + _th_plen[1]*( \
00971 (kR - _th_plo[2]) \
00972 + _n * _th_plen[2]))); \
00973 for(int _i = 0; _i < _b_len[0]; ++_i) { \
00974 const int iR = _i + _b_lo[0]; \
00975 const T &thisR = _th_pp[_i];
00976
00977 #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \
00978 { \
00979 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
00980 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
00981 Box _subbox_((x).box()); \
00982 _subbox_ &= box(); \
00983 _subbox_ &= b; \
00984 if(_subbox_.ok()) { \
00985 const int *_th_plo = loVect(); \
00986 const int *_th_plen = length(); \
00987 const int *_x_plo = (x).loVect(); \
00988 const int *_x_plen = (x).length(); \
00989 const int *_subbox_lo = _subbox_.loVect(); \
00990 const int *_subbox_len = _subbox_.length().getVect(); \
00991 T* _th_p = dataPtr(ns); \
00992 const T* _x_p = (x).dataPtr(nss); \
00993 for(int _n = 0; _n < (nc); ++_n) { \
00994 int nR = _n; nR += 0; \
00995 for(int _k = 0; _k < _subbox_len[2]; ++_k) { \
00996 const int kR = _k + _subbox_lo[2]; \
00997 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
00998 const int jR = _j + _subbox_lo[1]; \
00999 T *_th_pp = _th_p \
01000 + ((_subbox_lo[0] - _th_plo[0]) \
01001 + _th_plen[0]*( \
01002 (jR - _th_plo[1]) \
01003 + _th_plen[1]*( \
01004 (kR - _th_plo[2]) \
01005 + _n * _th_plen[2]))); \
01006 const T *_x_pp = _x_p \
01007 + ((_subbox_lo[0] - _x_plo[0]) \
01008 + _x_plen[0]*( \
01009 (jR - _x_plo[1]) \
01010 + _x_plen[1]*( \
01011 (kR - _x_plo[2]) \
01012 + _n * _x_plen[2]))); \
01013 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
01014 int iR = _i + _subbox_lo[0]; iR += 0; \
01015 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
01016
01017 #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \
01018 { \
01019 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
01020 BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \
01021 Box _subbox_(box()); \
01022 _subbox_ &= b; \
01023 BL_ASSERT((bx).sameSize(_subbox_)); \
01024 if(_subbox_.ok()) { \
01025 const int *_th_plo = loVect(); \
01026 const int *_th_plen = length(); \
01027 const int *_x_plo = (x).loVect(); \
01028 const int *_x_plen = (x).length(); \
01029 const int *_subbox_lo = _subbox_.loVect(); \
01030 const int *_subbox_len = _subbox_.length().getVect(); \
01031 const int *_bx_lo = (bx).loVect(); \
01032 \
01033 T* _th_p = dataPtr(ns); \
01034 const T* _x_p = (x).dataPtr(nss); \
01035 for(int _n = 0; _n < (nc); ++_n) { \
01036 int nR = _n + ns; nR += 0; \
01037 int n##x##R = _n + nss; n##x##R += 0; \
01038 for(int _k = 0; _k < _subbox_len[2]; ++_k) { \
01039 const int kR = _k + _subbox_lo[2]; \
01040 const int k##x##R = _k + _bx_lo[2]; \
01041 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
01042 const int jR = _j + _subbox_lo[1]; \
01043 const int j##x##R = _j + _bx_lo[1]; \
01044 T *_th_pp = _th_p \
01045 + ((_subbox_lo[0] - _th_plo[0]) \
01046 + _th_plen[0]*( \
01047 (jR - _th_plo[1]) \
01048 + _th_plen[1]*( \
01049 (kR - _th_plo[2]) \
01050 + _n * _th_plen[2]))); \
01051 const T *_x_pp = _x_p \
01052 + ((_bx_lo[0] - _x_plo[0]) \
01053 + _x_plen[0]*( \
01054 (j##x##R - _x_plo[1]) \
01055 + _x_plen[1]*( \
01056 (k##x##R - _x_plo[2]) \
01057 + _n * _x_plen[2]))); \
01058 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
01059 int iR = _i + _subbox_lo[0]; iR += 0; \
01060 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
01061 T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
01062
01063 #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \
01064 { \
01065 BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \
01066 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
01067 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
01068 Box _subbox_(box()); \
01069 _subbox_ &= b; \
01070 BL_ASSERT((bx).sameSize(_subbox_)); \
01071 BL_ASSERT((by).sameSize(_subbox_)); \
01072 if(_subbox_.ok()) { \
01073 const int *_th_plo = loVect(); \
01074 const int *_th_plen = length(); \
01075 const int *_x_plo = (x).loVect(); \
01076 const int *_x_plen = (x).length(); \
01077 const int *_y_plo = (y).loVect(); \
01078 const int *_y_plen = (y).length(); \
01079 const int *_subbox_lo = _subbox_.loVect(); \
01080 const int *_subbox_len = _subbox_.length().getVect(); \
01081 const int *_bx_lo = (bx).loVect(); \
01082 \
01083 const int *_by_lo = (by).loVect(); \
01084 \
01085 T* _th_p = dataPtr(ns); \
01086 const T* _x_p = (x).dataPtr(nsx); \
01087 const T* _y_p = (y).dataPtr(nsy); \
01088 for(int _n = 0; _n < (nc); ++_n) { \
01089 int nR = _n + ns; nR += 0; \
01090 int n##x##R = _n + nsx; n##x##R += 0; \
01091 int n##y##R = _n + nsy; n##y##R += 0; \
01092 for(int _k = 0; _k < _subbox_len[2]; ++_k) { \
01093 const int kR = _k + _subbox_lo[2]; \
01094 const int k##x##R = _k + _bx_lo[2]; \
01095 const int k##y##R = _k + _by_lo[2]; \
01096 for(int _j = 0; _j < _subbox_len[1]; ++_j) { \
01097 const int jR = _j + _subbox_lo[1]; \
01098 const int j##x##R = _j + _bx_lo[1]; \
01099 const int j##y##R = _j + _by_lo[1]; \
01100 T *_th_pp = _th_p \
01101 + ((_subbox_lo[0] - _th_plo[0]) \
01102 + _th_plen[0]*( \
01103 (jR - _th_plo[1]) \
01104 + _th_plen[1]*( \
01105 (kR - _th_plo[2]) \
01106 + _n * _th_plen[2]))); \
01107 const T *_x_pp = _x_p \
01108 + ((_bx_lo[0] - _x_plo[0]) \
01109 + _x_plen[0]*( \
01110 (j##x##R - _x_plo[1]) \
01111 + _x_plen[1]*( \
01112 (k##x##R - _x_plo[2]) \
01113 + _n * _x_plen[2]))); \
01114 const T *_y_pp = _y_p \
01115 + ((_by_lo[0] - _y_plo[0]) \
01116 + _y_plen[0]*( \
01117 (j##y##R - _y_plo[1]) \
01118 + _y_plen[1]*( \
01119 (k##y##R - _y_plo[2]) \
01120 + _n * _y_plen[2]))); \
01121 for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \
01122 int iR = _i + _subbox_lo[0]; iR += 0; \
01123 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \
01124 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \
01125 T &thisR = * _th_pp; \
01126 const T & x##R = _x_pp[_i]; \
01127 const T & y##R = _y_pp[_i];
01128
01129 #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ir) \
01130 { \
01131 BL_ASSERT((ir) >= 0 && (ir) < BL_SPACEDIM); \
01132 BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \
01133 BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \
01134 BL_ASSERT((x).contains(bx)); \
01135 BL_ASSERT((y).contains(by)); \
01136 BL_ASSERT((bx).sameSize(by)); \
01137 const int *_x_plo = (x).loVect(); \
01138 const int *_x_plen = (x).length(); \
01139 const int *_y_plo = (y).loVect(); \
01140 const int *_y_plen = (y).length(); \
01141 const int *_bx_lo = (bx).loVect(); \
01142 const int *_by_lo = (by).loVect(); \
01143 const int *_len = (bx).length().getVect(); \
01144 T* _x_p = (x).dataPtr(nsx); \
01145 const T* _y_p = (y).dataPtr(nsy); \
01146 for(int _n = 0; _n < (nc); ++_n) { \
01147 int n##x##R = _n + nsx; n##x##R += 0; \
01148 int n##y##R = _n + nsy; n##y##R += 0; \
01149 for(int _k = 0; _k < _len[2]; ++_k) { \
01150 const int k##x##R = _k + _bx_lo[2]; \
01151 const int krev##x##R = _len[2]-1-_k + _bx_lo[2]; \
01152 const int k##y##R = _k + _by_lo[2]; \
01153 for(int _j = 0; _j < _len[1]; ++_j) { \
01154 const int j##x##R = _j + _bx_lo[1]; \
01155 const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \
01156 const int j##y##R = _j + _by_lo[1]; \
01157 T *_x_pp; \
01158 int _ix = 0; \
01159 int _istrd = 1; \
01160 if (ir == 0) { \
01161 _x_pp = _x_p \
01162 + ((_bx_lo[0] - _x_plo[0]) + _len[0]-1 \
01163 + _x_plen[0]*( \
01164 (j##x##R - _x_plo[1]) \
01165 + _x_plen[1]*( \
01166 (k##x##R - _x_plo[2]) \
01167 + _n * _x_plen[2]))); \
01168 _istrd = -1; \
01169 } else if (ir == 1) { \
01170 _x_pp = _x_p \
01171 + ((_bx_lo[0] - _x_plo[0]) \
01172 + _x_plen[0]*( \
01173 (jrev##x##R - _x_plo[1]) \
01174 + _x_plen[1]*( \
01175 (k##x##R - _x_plo[2]) \
01176 + _n * _x_plen[2]))); \
01177 } else { \
01178 _x_pp = _x_p \
01179 + ((_bx_lo[0] - _x_plo[0]) \
01180 + _x_plen[0]*( \
01181 (j##x##R - _x_plo[1]) \
01182 + _x_plen[1]*( \
01183 (krev##x##R - _x_plo[2]) \
01184 + _n * _x_plen[2]))); \
01185 } \
01186 const T *_y_pp = _y_p \
01187 + ((_by_lo[0] - _y_plo[0]) \
01188 + _y_plen[0]*( \
01189 (j##y##R - _y_plo[1]) \
01190 + _y_plen[1]*( \
01191 (k##y##R - _y_plo[2]) \
01192 + _n * _y_plen[2]))); \
01193 for(int _i = 0; _i < _len[0]; ++_i, _ix += _istrd) { \
01194 T & x##R = _x_pp[_ix]; \
01195 const T & y##R = _y_pp[_i];
01196
01197 #define EndFor }}}}}
01198 #define EndForTX }}}}}}
01199 #define EndForPencil }}}}
01200
01201 #endif
01202
01208 #define ForAllX(T,x) ForAllXBNN(T,x,((x).box()),0,((x).nComp()))
01209
01213 #define ForAllXC(T,x) ForAllXCBNN(T,x,((x).box()),0,((x).nComp()))
01214
01219 #define ForAllXB(T,x,b) ForAllXBNN(T,x,(b),0,(x).nComp())
01220
01224 #define ForAllXBC(T,x,b) ForAllXCBNN(T,x,(b),0,(x).nComp())
01225
01231 #define ForAllThis(T) ForAllThisBNN(T,domain,0,nComp())
01232
01236 #define ForAllThisC(T) ForAllThisCBNN(T,domain,0,nComp())
01237
01242 #define ForAllThisB(T,b) ForAllThisBNN(T,(b),0,nComp())
01243
01247 #define ForAllThisCB(T,b) ForAllThisCBNN(T,(b),0,nComp())
01248
01253 #define ForAllThisNN(T,ns,nc) ForAllThisBNN(T,domain,ns,nc)
01254
01260 #define ForAllThisXC(T,x) ForAllThisBNNXC(T,domain,0,nComp(),x,0)
01261
01262 #endif