Go to the documentation of this file. 19 #ifndef LAST_BASEFABMACROS_H_SPACEDIM 20 #define LAST_BASEFABMACROS_H_SPACEDIM 0 22 #if CH_SPACEDIM != LAST_BASEFABMACROS_H_SPACEDIM 23 #undef LAST_BASEFABMACROS_H_SPACEDIM 38 #ifdef ForAllThisCPencil 39 # undef ForAllThisCPencil 40 # undef ForAllThisPencil 41 # undef ForAllXBPencil 42 # undef ForAllXBNNnoindx 46 # undef ForAllThisCBNN 47 # undef ForAllThisBNNXC 48 # undef ForAllThisCBNNXC 49 # undef ForAllThisBNNXCBN 50 # undef ForAllThisBNNXCBNYCBN 51 # undef ForAllRevXBNYCBNNN 59 # define ForAllThisCPencil ForAllThisCPencil1 60 # define ForAllThisPencil ForAllThisPencil1 61 # define ForAllXBPencil ForAllXBPencil1 62 # define ForAllXBNN ForAllXBNN1 63 # define ForAllXBNNnoindx ForAllXBNNnoindx1 64 # define ForAllXCBNN ForAllXCBNN1 65 # define ForAllThisBNN ForAllThisBNN1 66 # define ForAllThisCBNN ForAllThisCBNN1 67 # define ForAllThisBNNXC ForAllThisBNNXC1 68 # define ForAllThisCBNNXC ForAllThisCBNNXC1 69 # define ForAllThisBNNXCBN ForAllThisBNNXCBN1 70 # define ForAllThisBNNXCBNYCBN ForAllThisBNNXCBNYCBN1 71 # define ForAllRevXBNYCBNNN ForAllRevXBNYCBNNN1 72 # define EndFor EndFor1 73 # define EndForTX EndForTX1 74 # define EndForPencil EndForPencil1 75 # define MD_CIX MD_CIX1 76 # define LAST_BASEFABMACROS_H_SPACEDIM 1 79 # define ForAllThisCPencil ForAllThisCPencil2 80 # define ForAllThisPencil ForAllThisPencil2 81 # define ForAllXBPencil ForAllXBPencil2 82 # define ForAllXBNN ForAllXBNN2 83 # define ForAllXBNNnoindx ForAllXBNNnoindx2 84 # define ForAllXCBNN ForAllXCBNN2 85 # define ForAllThisBNN ForAllThisBNN2 86 # define ForAllThisCBNN ForAllThisCBNN2 87 # define ForAllThisBNNXC ForAllThisBNNXC2 88 # define ForAllThisCBNNXC ForAllThisCBNNXC2 89 # define ForAllThisBNNXCBN ForAllThisBNNXCBN2 90 # define ForAllThisBNNXCBNYCBN ForAllThisBNNXCBNYCBN2 91 # define ForAllRevXBNYCBNNN ForAllRevXBNYCBNNN2 92 # define EndFor EndFor2 93 # define EndForTX EndForTX2 94 # define EndForPencil EndForPencil2 95 # define MD_CIX MD_CIX2 96 # define LAST_BASEFABMACROS_H_SPACEDIM 2 99 # define ForAllThisCPencil ForAllThisCPencil3 100 # define ForAllThisPencil ForAllThisPencil3 101 # define ForAllXBPencil ForAllXBPencil3 102 # define ForAllXBNN ForAllXBNN3 103 # define ForAllXBNNnoindx ForAllXBNNnoindx3 104 # define ForAllXCBNN ForAllXCBNN3 105 # define ForAllThisBNN ForAllThisBNN3 106 # define ForAllThisCBNN ForAllThisCBNN3 107 # define ForAllThisBNNXC ForAllThisBNNXC3 108 # define ForAllThisCBNNXC ForAllThisCBNNXC3 109 # define ForAllThisBNNXCBN ForAllThisBNNXCBN3 110 # define ForAllThisBNNXCBNYCBN ForAllThisBNNXCBNYCBN3 111 # define ForAllRevXBNYCBNNN ForAllRevXBNYCBNNN3 112 # define EndFor EndFor3 113 # define EndForTX EndForTX3 114 # define EndForPencil EndForPencil3 115 # define MD_CIX MD_CIX3 116 # define LAST_BASEFABMACROS_H_SPACEDIM 3 119 # define MD_CIX MD_CIX4 122 # define MD_CIX MD_CIX5 125 # define MD_CIX MD_CIX6 129 # define ForAllThisCPencil ForAllThisCPencilHiDim 130 # define ForAllThisPencil ForAllThisPencilHiDim 131 # define ForAllXBPencil ForAllXBPencilHiDim 132 # define ForAllXBNN ForAllXBNNHiDim 133 # define ForAllXBNNnoindx ForAllXBNNnoindxHiDim 134 # define ForAllXCBNN ForAllXCBNNHiDim 135 # define ForAllThisBNN ForAllThisBNNHiDim 136 # define ForAllThisCBNN ForAllThisCBNNHiDim 137 # define ForAllThisBNNXC ForAllThisBNNXCHiDim 138 # define ForAllThisCBNNXC ForAllThisCBNNXCHiDim 139 # define ForAllThisBNNXCBN ForAllThisBNNXCBNHiDim 140 # define ForAllThisBNNXCBNYCBN ForAllThisBNNXCBNYCBNHiDim 141 # define ForAllRevXBNYCBNNN ForAllRevXBNYCBNNNHiDim 142 # define EndFor EndForHiDim 143 # define EndForTX EndForTXHiDim 144 # define EndForPencil EndForPencilHiDim 145 # define LAST_BASEFABMACROS_H_SPACEDIM HiDim 148 #if (CH_SPACEDIM == 1) 196 #define ForAllThisPencil1(T,b,ns,nc) \ 198 CH_assert(contains(b)); \ 199 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 200 const int *_th_plo = this->loVect(); \ 201 const IntVect _th_plen = this->size(); \ 202 const int *_b_lo = (b).loVect(); \ 203 const IntVect _b_len = (b).size(); \ 204 T* _th_p = this->m_dptr; \ 205 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 207 const int nR = _n; (int&)nR += 0; \ 209 + ((_b_lo[0] - _th_plo[0]) \ 210 + _n * _th_plen[0]); \ 211 T &thisR = * _th_pp; \ 212 const int thisLen = _b_len[0]; \ 218 #define ForAllXBPencil1(T,x,b,ns,nc) \ 220 CH_assert(x.contains(b)); \ 221 CH_assert((ns) >= 0 && (ns) + (nc) <= x.nComp()); \ 222 const int *_th_plo = x.loVect(); \ 223 const IntVect _th_plen = x.size(); \ 224 const int *_b_lo = (b).loVect(); \ 225 const IntVect _b_len = (b).size(); \ 226 T* _th_p = x.dataPtr(); \ 227 for (int nR = (ns); nR < (ns)+(nc); ++nR) \ 230 + ((_b_lo[0] - _th_plo[0]) \ 231 + nR * _th_plen[0]); \ 232 const int thisLen = _b_len[0]; 255 #define ForAllThisCPencil1(T,b,ns,nc) \ 257 CH_assert(this->contains(b)); \ 258 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 259 const int *_th_plo = this->loVect(); \ 260 const IntVect _th_plen = this->size(); \ 261 const int *_b_lo = (b).loVect(); \ 262 const IntVect _b_len = (b).size(); \ 263 const T* _th_p = this->m_dptr; \ 264 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 266 int nR = _n; nR += 0; \ 267 const T *_th_pp = _th_p \ 268 + ((_b_lo[0] - _th_plo[0]) \ 269 + _n * _th_plen[0]); \ 270 const T &thisR = * _th_pp; \ 271 const int thisLen = _b_len[0]; 298 #define ForAllXBNN1(T,x,b,ns,nc) \ 300 CH_assert(x.contains(b)); \ 301 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 302 const int *_x_plo = (x).loVect(); \ 303 const IntVect _x_plen = (x).size(); \ 304 const int *_b_lo = (b).loVect(); \ 305 const IntVect _b_len = (b).size(); \ 306 T* _x_p = (x) .dataPtr(); \ 307 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 309 const int nR = _n; (int&)nR += 0; \ 311 + ((_b_lo[0] - _x_plo[0]) \ 312 + _n * _x_plen[0]); \ 313 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 315 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 324 #define ForAllXBNNnoindx1(T,x,b,ns,nc) \ 326 CH_assert(x.contains(b)); \ 327 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 328 const int *_x_plo = (x).loVect(); \ 329 const IntVect _x_plen = (x).size(); \ 330 const int *_b_lo = (b).loVect(); \ 331 const IntVect _b_len = (b).size(); \ 332 T* _x_p = (x) .dataPtr(); \ 333 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 336 + ((_b_lo[0] - _x_plo[0]) \ 337 + _n * _x_plen[0]); \ 338 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 363 #define ForAllXCBNN1(T,x,b,ns,nc) \ 365 CH_assert(x.contains(b)); \ 366 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 367 const int *_x_plo = (x).loVect(); \ 368 const IntVect _x_plen = (x).size(); \ 369 const int *_b_lo = (b).loVect(); \ 370 const IntVect _b_len = (b).size(); \ 371 const T* _x_p = (x).dataPtr(); \ 372 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 374 const int nR = _n; (int&)nR += 0; \ 375 const T *_x_pp = _x_p \ 376 + ((_b_lo[0] - _x_plo[0]) \ 377 + _n * _x_plen[0]); \ 378 for (int _i = 0; _i < _b_len[0]; ++_i) \ 380 const int iR = _i + _b_lo[0]; (int&) iR += 0; \ 381 const T & x##R = _x_pp[_i]; 421 #define ForAllThisBNN1(T,b,ns,nc) \ 423 CH_assert(this->contains(b)); \ 424 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 425 const int *_th_plo = this->loVect(); \ 426 const IntVect _th_plen = this->size(); \ 427 const int *_b_lo = (b).loVect(); \ 428 const IntVect _b_len = (b).size(); \ 429 T* _th_p = this->m_dptr; \ 430 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 432 int nR = _n; nR += 0; \ 434 + ((_b_lo[0] - _th_plo[0]) \ 435 + _n * _th_plen[0]); \ 436 for (int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) \ 438 int iR = _i + _b_lo[0]; iR += 0; \ 462 #define ForAllThisCBNN1(T,b,ns,nc) \ 464 CH_assert(this->contains(b)); \ 465 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 466 const int *_th_plo = this->loVect(); \ 467 const IntVect _th_plen = this->size(); \ 468 const int *_b_lo = (b).loVect(); \ 469 const IntVect _b_len = (b).size(); \ 470 const T* _th_p = this->m_dptr; \ 471 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 473 const int nR = _n; (int&)nR += 0; \ 474 const T *_th_pp = _th_p \ 475 + ((_b_lo[0] - _th_plo[0]) \ 476 + _n * _th_plen[0]); \ 477 for (int _i = 0; _i < _b_len[0]; ++_i) \ 479 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 480 const T &thisR = _th_pp[_i]; 507 #define ForAllThisBNNXC1(T,b,ns,nc,x,nss) \ 509 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 510 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 511 Box _subbox_((x).box()); \ 512 _subbox_ &= this->box(); \ 514 if (!_subbox_.isEmpty()) \ 516 const int *_th_plo = this->loVect(); \ 517 const IntVect _th_plen = this->size(); \ 518 const int *_x_plo = (x).loVect(); \ 519 const IntVect _x_plen = (x).size(); \ 520 const int *_subbox_lo = _subbox_.loVect(); \ 521 const IntVect _subbox_len = _subbox_.size(); \ 522 T* _th_p = dataPtr(ns); \ 523 const T* _x_p = (x).dataPtr(nss); \ 524 for (int _n = 0; _n < (nc); ++_n) \ 526 int nR = _n; nR += 0; \ 528 + ((_subbox_lo[0] - _th_plo[0]) \ 529 + _n * _th_plen[0]); \ 530 const T *_x_pp = _x_p \ 531 + ((_subbox_lo[0] - _x_plo[0]) \ 532 + _n * _x_plen[0]); \ 533 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 535 int iR = _i + _subbox_lo[0]; iR += 0; \ 536 T &thisR = * _th_pp; \ 537 const T & x##R = _x_pp[_i]; 539 #define ForAllThisCBNNXC1(T,b,ns,nc,x,nss) \ 541 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 542 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 543 Box _subbox_((x).box()); \ 544 _subbox_ &= this->box(); \ 546 if (!_subbox_.isEmpty()) \ 548 const int *_th_plo = this->loVect(); \ 549 const IntVect _th_plen = this->size(); \ 550 const int *_x_plo = (x).loVect(); \ 551 const IntVect _x_plen = (x).size(); \ 552 const int *_subbox_lo = _subbox_.loVect(); \ 553 const IntVect _subbox_len = _subbox_.size(); \ 554 const T* _th_p = this->dataPtr(ns); \ 555 const T* _x_p = (x).dataPtr(nss); \ 556 for (int _n = 0; _n < (nc); ++_n) \ 558 int nR = _n; nR += 0; \ 559 const T *_th_pp = _th_p \ 560 + ((_subbox_lo[0] - _th_plo[0]) \ 561 + _n * _th_plen[0]); \ 562 const T *_x_pp = _x_p \ 563 + ((_subbox_lo[0] - _x_plo[0]) \ 564 + _n * _x_plen[0]); \ 565 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 567 int iR = _i + _subbox_lo[0]; iR += 0; \ 568 const T &thisR = * _th_pp; \ 569 const T & x##R = _x_pp[_i]; 597 #define ForAllThisBNNXCBN1(T,b,ns,nc,x,bx,nss) \ 599 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 600 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 601 CH_assert(bx.sameSize((b))); \ 602 if (!((b).isEmpty())) \ 604 const int *_th_plo = this->loVect(); \ 605 const IntVect _th_plen = this->size(); \ 606 const int *_x_plo = (x).loVect(); \ 607 const IntVect _x_plen = (x).size(); \ 608 const int *_subbox_lo = (b).loVect(); \ 609 const IntVect _subbox_len = (b).size(); \ 610 const int *_bx_lo = (bx).loVect(); \ 611 T* _th_p = this->dataPtr(ns); \ 612 const T* _x_p = (x).dataPtr(nss); \ 613 for (int _n = 0; _n < (nc); ++_n) \ 615 int nR = _n + ns; nR += 0; \ 616 int n##x##R = _n + nss; n##x##R += 0; \ 618 + ((_subbox_lo[0] - _th_plo[0]) \ 619 + _n * _th_plen[0]); \ 620 const T *_x_pp = _x_p \ 621 + ((_bx_lo[0] - _x_plo[0]) \ 622 + _n * _x_plen[0]); \ 623 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 625 int iR = _i + _subbox_lo[0]; iR += 0; \ 626 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ 627 T &thisR = * _th_pp; \ 628 const T & x##R = _x_pp[_i]; 659 #define ForAllThisBNNXCBNYCBN1(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ 661 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 662 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 663 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 664 Box _subbox_ = this->box(); \ 666 CH_assert((bx).sameSize(_subbox_)); \ 667 CH_assert((by).sameSize(_subbox_)); \ 668 if (!_subbox_.isEmpty()) \ 670 const int *_th_plo = this->loVect(); \ 671 const IntVect _th_plen = this->size(); \ 672 const int *_x_plo = (x).loVect(); \ 673 const IntVect _x_plen = (x).size(); \ 674 const int *_y_plo = (y).loVect(); \ 675 const IntVect _y_plen = (y).size(); \ 676 const int *_subbox_lo = _subbox_.loVect(); \ 677 const IntVect _subbox_len = _subbox_.size(); \ 678 const int *_bx_lo = (bx).loVect(); \ 679 const int *_by_lo = (by).loVect(); \ 680 T* _th_p = this->dataPtr(ns); \ 681 const T* _x_p = (x).dataPtr(nsx); \ 682 const T* _y_p = (y).dataPtr(nsy); \ 683 for (int _n = 0; _n < (nc); ++_n) \ 685 int nR = _n + ns; nR += 0; \ 686 int n##x##R = _n + nsx; n##x##R += 0; \ 687 int n##y##R = _n + nsy; n##y##R += 0; \ 689 + ((_subbox_lo[0] - _th_plo[0]) \ 690 + _n * _th_plen[0]); \ 691 const T *_x_pp = _x_p \ 692 + ((_bx_lo[0] - _x_plo[0]) \ 693 + _n * _x_plen[0]); \ 694 const T *_y_pp = _y_p \ 695 + ((_by_lo[0] - _y_plo[0]) \ 696 + _n * _y_plen[0]); \ 697 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 699 int iR = _i + _subbox_lo[0]; iR += 0; \ 700 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ 701 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ 702 T &thisR = * _th_pp; \ 703 const T & x##R = _x_pp[_i]; \ 704 const T & y##R = _y_pp[_i]; 706 #define ForAllRevXBNYCBNNN1(T,x,bx,nsx,y,by,nsy,nc,ri) \ 708 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 709 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 710 CH_assert((x).contains(bx)); \ 711 CH_assert((y).contains(by)); \ 712 CH_assert((bx).sameSize(by)); \ 713 const int *_x_plo = (x).loVect(); \ 714 const IntVect _x_plen = (x).size(); \ 715 const int *_y_plo = (y).loVect(); \ 716 const IntVect _y_plen = (y).size(); \ 717 const IntVect _len = (bx).size(); \ 718 const int *_bx_lo = (bx).loVect(); \ 719 const int *_by_lo = (by).loVect(); \ 720 T* _x_p = (x).dataPtr(nsx); \ 721 const T* _y_p = (y).dataPtr(nsy); \ 722 for (int _n = 0; _n < (nc); ++_n) \ 724 int n##x##R = _n + nsx; n##x##R += 0; \ 725 int n##y##R = _n + nsy; n##y##R += 0; \ 728 + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \ 729 + _n * _x_plen[0]); \ 730 const T *_y_pp = _y_p \ 731 + ((_by_lo[0] - _y_plo[0]) \ 732 + _n * _y_plen[0]); \ 733 for (int _i = 0; _i < _len[0]; ++_i, --_ix) \ 735 T & x##R = _x_pp[_ix]; \ 736 const T & y##R = _y_pp[_i]; 760 #define EndForPencil1 \ 764 #elif (CH_SPACEDIM == 2) 766 #define ForAllThisCPencil2(T,b,ns,nc) \ 768 CH_assert(contains(b)); \ 769 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 770 const int *_th_plo = this->loVect(); \ 771 const IntVect _th_plen = this->size(); \ 772 const int *_b_lo = (b).loVect(); \ 773 const IntVect _b_len = (b).size(); \ 774 const T* _th_p = this->m_dptr; \ 775 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 777 int nR = _n; nR += 0; \ 778 for (int _j = 0; _j < _b_len[1]; ++_j) \ 780 const int jR = _j + _b_lo[1]; \ 781 const T *_th_pp = _th_p \ 782 + ((_b_lo[0] - _th_plo[0]) \ 785 + _n * _th_plen[1])); \ 786 const T &thisR = * _th_pp; \ 787 const int thisLen = _b_len[0]; 789 #define ForAllThisPencil2(T,b,ns,nc) \ 791 CH_assert(this->contains(b)); \ 792 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 793 const int *_th_plo = this->loVect(); \ 794 const IntVect _th_plen = this->size(); \ 795 const int *_b_lo = (b).loVect(); \ 796 const IntVect _b_len = (b).size(); \ 797 T* _th_p = this->m_dptr; \ 798 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 800 const int nR = _n; (int&)nR += 0; \ 801 for (int _j = 0; _j < _b_len[1]; ++_j) \ 803 const int jR = _j + _b_lo[1]; (int&)jR += 0; \ 805 + ((_b_lo[0] - _th_plo[0]) \ 808 + _n * _th_plen[1])); \ 809 T &thisR = * _th_pp; \ 810 const int thisLen = _b_len[0]; \ 812 #define ForAllXBPencil2(T,x,b,ns,nc) \ 814 CH_assert((x).contains(b)); \ 815 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 816 const int *_th_plo = (x).loVect(); \ 817 const IntVect _th_plen =(x).size(); \ 818 const int *_b_lo = (b).loVect(); \ 819 const IntVect _b_len = (b).size(); \ 820 T* _th_p = (x) .dataPtr(); \ 821 for (int nR = (ns); nR < (ns)+(nc); ++nR) \ 823 for (int _j = 0; _j < _b_len[1]; ++_j) \ 825 const int jR = _j + _b_lo[1]; (int&)jR += 0; \ 827 + ((_b_lo[0] - _th_plo[0]) \ 830 + nR * _th_plen[1])); \ 831 const int thisLen = _b_len[0]; \ 833 #define ForAllXBNN2(T,x,b,ns,nc) \ 835 CH_assert((x).contains(b)); \ 836 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 837 const int *_x_plo = (x).loVect(); \ 838 const IntVect _x_plen = (x).size(); \ 839 const int *_b_lo = (b).loVect(); \ 840 const IntVect _b_len = (b).size(); \ 841 T* _x_p = (x) .dataPtr(); \ 842 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 844 const int nR = _n; (int&)nR += 0; \ 845 for (int _j = 0; _j < _b_len[1]; ++_j) \ 847 const int jR = _j + _b_lo[1]; (int&)jR += 0; \ 849 + ((_b_lo[0] - _x_plo[0]) \ 852 + _n * _x_plen[1])); \ 853 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 855 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 858 #define ForAllXBNNnoindx2(T,x,b,ns,nc) \ 860 CH_assert((x).contains(b)); \ 861 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 862 const int *_x_plo = (x).loVect(); \ 863 const IntVect _x_plen = (x).size(); \ 864 const int *_b_lo = (b).loVect(); \ 865 const IntVect _b_len = (b).size(); \ 866 T* _x_p = (x) .dataPtr(); \ 867 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 869 for (int _j = 0; _j < _b_len[1]; ++_j) \ 871 const int jR = _j + _b_lo[1]; \ 873 + ((_b_lo[0] - _x_plo[0]) \ 876 + _n * _x_plen[1])); \ 877 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 881 #define ForAllXCBNN2(T,x,b,ns,nc) \ 883 CH_assert(x.contains(b)); \ 884 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 885 const int *_x_plo = (x).loVect(); \ 886 const IntVect _x_plen = (x).size(); \ 887 const int *_b_lo = (b).loVect(); \ 888 const IntVect _b_len = (b).size(); \ 889 const T* _x_p = (x).dataPtr(); \ 890 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 892 const int nR = _n; (int&)nR += 0; \ 893 for (int _j = 0; _j < _b_len[1]; ++_j) \ 895 const int jR = _j + _b_lo[1]; \ 896 const T *_x_pp = _x_p \ 897 + ((_b_lo[0] - _x_plo[0]) \ 900 + _n * _x_plen[1])); \ 901 for (int _i = 0; _i < _b_len[0]; ++_i) \ 903 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 904 const T & x##R = _x_pp[_i]; 906 #define ForAllThisBNN2(T,b,ns,nc) \ 908 CH_assert(this->contains(b)); \ 909 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 910 const int *_th_plo = this->loVect(); \ 911 const IntVect _th_plen = this->size(); \ 912 const int *_b_lo = (b).loVect(); \ 913 const IntVect _b_len = (b).size(); \ 914 T* _th_p = this->m_dptr; \ 915 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 917 int nR = _n; nR += 0; \ 918 for (int _j = 0; _j < _b_len[1]; ++_j) \ 920 const int jR = _j + _b_lo[1]; \ 922 + ((_b_lo[0] - _th_plo[0]) \ 925 + _n * _th_plen[1])); \ 926 for (int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) \ 928 int iR = _i + _b_lo[0]; iR += 0; \ 931 #define ForAllThisCBNN2(T,b,ns,nc) \ 933 CH_assert(this->contains(b)); \ 934 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 935 const int *_th_plo = this->loVect(); \ 936 const IntVect _th_plen = this->size(); \ 937 const int *_b_lo = (b).loVect(); \ 938 const IntVect _b_len = (b).size(); \ 939 const T* _th_p = this->m_dptr; \ 940 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 942 const int nR = _n; (int&)nR += 0; \ 943 for (int _j = 0; _j < _b_len[1]; ++_j) \ 945 const int jR = _j + _b_lo[1]; (int&)jR+=0;; \ 946 const T *_th_pp = _th_p \ 947 + ((_b_lo[0] - _th_plo[0]) \ 949 (_j + _b_lo[1] - _th_plo[1]) \ 950 + _n * _th_plen[1])); \ 951 for (int _i = 0; _i < _b_len[0]; ++_i) \ 953 const int iR = _i + _b_lo[0]; (int&)iR +=0; \ 954 const T &thisR = _th_pp[_i]; 956 #define ForAllThisBNNXC2(T,b,ns,nc,x,nss) \ 958 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 959 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 960 Box _subbox_((x).box()); \ 961 _subbox_ &= this->box(); \ 963 if (!_subbox_.isEmpty()) \ 965 const int *_th_plo = this->loVect(); \ 966 const IntVect _th_plen = this->size(); \ 967 const int *_x_plo = (x).loVect(); \ 968 const IntVect _x_plen = (x).size(); \ 969 const int *_subbox_lo = _subbox_.loVect(); \ 970 const IntVect _subbox_len = _subbox_.size(); \ 971 T* _th_p = this->dataPtr(ns); \ 972 const T* _x_p = (x).dataPtr(nss); \ 973 for (int _n = 0; _n < (nc); ++_n) \ 975 int nR = _n; nR += 0; \ 976 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 978 const int jR = _j + _subbox_lo[1]; \ 980 + ((_subbox_lo[0] - _th_plo[0]) \ 983 + _n * _th_plen[1])); \ 984 const T *_x_pp = _x_p \ 985 + ((_subbox_lo[0] - _x_plo[0]) \ 988 + _n * _x_plen[1])); \ 989 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 991 int iR = _i + _subbox_lo[0]; iR += 0; \ 992 T &thisR = * _th_pp; \ 993 const T & x##R = _x_pp[_i]; 995 #define ForAllThisCBNNXC2(T,b,ns,nc,x,nss) \ 997 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 998 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 999 Box _subbox_((x).box()); \ 1000 _subbox_ &= this->box(); \ 1002 if (!_subbox_.isEmpty()) \ 1004 const int *_th_plo = this->loVect(); \ 1005 const IntVect _th_plen = this->size(); \ 1006 const int *_x_plo = (x).loVect(); \ 1007 const IntVect _x_plen = (x).size(); \ 1008 const int *_subbox_lo = _subbox_.loVect(); \ 1009 const IntVect _subbox_len = _subbox_.size(); \ 1010 const T* _th_p = this->dataPtr(ns); \ 1011 const T* _x_p = (x).dataPtr(nss); \ 1012 for (int _n = 0; _n < (nc); ++_n) \ 1014 int nR = _n; nR += 0; \ 1015 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1017 const int jR = _j + _subbox_lo[1]; \ 1018 const T *_th_pp = _th_p \ 1019 + ((_subbox_lo[0] - _th_plo[0]) \ 1022 + _n * _th_plen[1])); \ 1023 const T *_x_pp = _x_p \ 1024 + ((_subbox_lo[0] - _x_plo[0]) \ 1027 + _n * _x_plen[1])); \ 1028 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 1030 int iR = _i + _subbox_lo[0]; iR += 0; \ 1031 const T &thisR = * _th_pp; \ 1032 const T & x##R = _x_pp[_i]; 1034 #define ForAllThisBNNXCBN2(T,b,ns,nc,x,bx,nss) \ 1036 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1037 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1038 CH_assert(bx.sameSize((b))); \ 1039 if (!((b).isEmpty())) \ 1041 const int *_th_plo = this->loVect(); \ 1042 const IntVect _th_plen = this->size(); \ 1043 const int *_x_plo = (x).loVect(); \ 1044 const IntVect _x_plen = (x).size(); \ 1045 const int *_subbox_lo = (b).loVect(); \ 1046 const IntVect _subbox_len = (b).size(); \ 1047 const int *_bx_lo = (bx).loVect(); \ 1048 T* _th_p = this->dataPtr(ns); \ 1049 int nR = ns; int n##x##R = nss; \ 1050 const T* _x_p = (x).dataPtr(nss); \ 1051 for (int _n = 0; _n < (nc); ++_n, ++nR, ++n##x##R ) \ 1053 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1055 const int jR = _j + _subbox_lo[1]; \ 1056 const int j##x##R = _j + _bx_lo[1]; \ 1058 + ((_subbox_lo[0] - _th_plo[0]) \ 1061 + _n * _th_plen[1])); \ 1062 const T *_x_pp = _x_p \ 1063 + ((_bx_lo[0] - _x_plo[0]) \ 1065 (j##x##R - _x_plo[1]) \ 1066 + _n * _x_plen[1])); \ 1067 int iR = _subbox_lo[0]; int i##x##R = _bx_lo[0]; \ 1068 for (int _i = 0; _i < _subbox_len[0]; \ 1069 ++_i, ++_th_pp, ++_x_pp, ++iR, ++i##x##R) \ 1071 T &thisR = * _th_pp; \ 1072 const T & x##R = * _x_pp; 1074 #define ForAllThisBNNXCBNYCBN2(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ 1076 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1077 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 1078 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 1079 Box _subbox_ = this->box(); \ 1081 CH_assert((bx).sameSize(_subbox_)); \ 1082 CH_assert((by).sameSize(_subbox_)); \ 1083 if (!_subbox_.isEmpty()) \ 1085 const int *_th_plo = this->loVect(); \ 1086 const IntVect _th_plen = this->size(); \ 1087 const int *_x_plo = (x).loVect(); \ 1088 const IntVect _x_plen = (x).size(); \ 1089 const int *_y_plo = (y).loVect(); \ 1090 const IntVect _y_plen = (y).size(); \ 1091 const int *_subbox_lo = _subbox_.loVect(); \ 1092 const IntVect _subbox_len = _subbox_.size(); \ 1093 const int *_bx_lo = (bx).loVect(); \ 1094 const int *_by_lo = (by).loVect(); \ 1095 T* _th_p = this->dataPtr(ns); \ 1096 const T* _x_p = (x).dataPtr(nsx); \ 1097 const T* _y_p = (y).dataPtr(nsy); \ 1098 for (int _n = 0; _n < (nc); ++_n) \ 1100 int nR = _n + ns; nR += 0; \ 1101 int n##x##R = _n + nsx; n##x##R += 0; \ 1102 int n##y##R = _n + nsy; n##y##R += 0; \ 1103 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1105 const int jR = _j + _subbox_lo[1]; \ 1106 const int j##x##R = _j + _bx_lo[1]; \ 1107 const int j##y##R = _j + _by_lo[1]; \ 1109 + ((_subbox_lo[0] - _th_plo[0]) \ 1112 + _n * _th_plen[1])); \ 1113 const T *_x_pp = _x_p \ 1114 + ((_bx_lo[0] - _x_plo[0]) \ 1116 (j##x##R - _x_plo[1]) \ 1117 + _n * _x_plen[1])); \ 1118 const T *_y_pp = _y_p \ 1119 + ((_by_lo[0] - _y_plo[0]) \ 1121 (j##y##R - _y_plo[1]) \ 1122 + _n * _y_plen[1])); \ 1123 for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) \ 1125 int iR = _i + _subbox_lo[0]; iR += 0; \ 1126 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ 1127 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ 1128 T &thisR = * _th_pp; \ 1129 const T & x##R = _x_pp[_i]; \ 1130 const T & y##R = _y_pp[_i]; 1132 #define ForAllRevXBNYCBNNN2(T,x,bx,nsx,y,by,nsy,nc,ir) \ 1134 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 1135 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 1136 CH_assert((ir) >= 0 && (ir) < SpaceDim); \ 1137 CH_assert((x).contains(bx)); \ 1138 CH_assert((y).contains(by)); \ 1139 CH_assert((bx).sameSize(by)); \ 1140 const int *_x_plo = (x).loVect(); \ 1141 const IntVect _x_plen = (x).size(); \ 1142 const int *_y_plo = (y).loVect(); \ 1143 const int *_y_plen = (y).size(); \ 1144 const int *_bx_lo = (bx).loVect(); \ 1145 const int *_by_lo = (by).loVect(); \ 1146 const IntVect _len = (bx).size(); \ 1147 T* _x_p = (x).dataPtr(nsx); \ 1148 const T* _y_p = (y).dataPtr(nsy); \ 1149 for (int _n = 0; _n < (nc); ++_n) \ 1151 int n##x##R = _n + nsx; n##x##R += 0; \ 1152 int n##y##R = _n + nsy; n##y##R += 0; \ 1153 for (int _j = 0; _j < _len[1]; ++_j) \ 1155 const int j##x##R = _j + _bx_lo[1]; \ 1156 const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \ 1157 const int j##y##R = _j + _by_lo[1]; \ 1164 + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \ 1166 (j##x##R - _x_plo[1]) \ 1167 + _n * _x_plen[1])); \ 1173 + ((_bx_lo[0] - _x_plo[0]) \ 1175 (jrev##x##R - _x_plo[1]) \ 1176 + _n * _x_plen[1])); \ 1179 const T *_y_pp = _y_p \ 1180 + ((_by_lo[0] - _y_plo[0]) \ 1182 (j##y##R - _y_plo[1]) \ 1183 + _n * _y_plen[1])); \ 1184 int _x_rev = _len[0]-1; _x_rev += 0; \ 1185 for (int _i = 0; _i < _len[0]; ++_i, _ix+=_istrd) \ 1187 T & x##R = _x_pp[_ix]; \ 1188 const T & y##R = _y_pp[_i]; 1203 #define EndForPencil2 \ 1208 #elif (CH_SPACEDIM == 3) 1210 #define ForAllThisCPencil3(T,b,ns,nc) \ 1212 CH_assert(this->contains(b)); \ 1213 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1214 const int *_th_plo = this->loVect(); \ 1215 const IntVect _th_plen = this->size(); \ 1216 const int *_b_lo = (b).loVect(); \ 1217 const IntVect _b_len = (b).size(); \ 1218 const T* _th_p = this->m_dptr; \ 1219 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1221 int nR = _n; nR += 0; \ 1222 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1224 const int kR = _k + _b_lo[2]; \ 1225 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1227 const int jR = _j + _b_lo[1]; \ 1228 const T *_th_pp = _th_p \ 1229 + ((_b_lo[0] - _th_plo[0]) \ 1234 + _n * _th_plen[2]))); \ 1235 const T &thisR = * _th_pp; \ 1236 const int thisLen = _b_len[0]; 1238 #define ForAllThisPencil3(T,b,ns,nc) \ 1240 CH_assert(this->contains(b)); \ 1241 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1242 const int *_th_plo = this->loVect(); \ 1243 const IntVect _th_plen = this->size(); \ 1244 const int *_b_lo = (b).loVect(); \ 1245 const IntVect _b_len = (b).size(); \ 1246 T* _th_p = this->m_dptr; \ 1247 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1249 const int nR = _n; (int&)nR += 0; \ 1250 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1252 const int kR = _k + _b_lo[2]; \ 1253 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1255 const int jR = _j + _b_lo[1]; \ 1257 + ((_b_lo[0] - _th_plo[0]) \ 1262 + _n * _th_plen[2]))); \ 1263 T &thisR = * _th_pp; \ 1264 const int thisLen = _b_len[0]; \ 1266 #define ForAllXBPencil3(T,x,b,ns,nc) \ 1268 CH_assert((x).contains(b)); \ 1269 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1270 const int *_th_plo = (x).loVect(); \ 1271 const IntVect _th_plen = (x).size(); \ 1272 const int *_b_lo = (b).loVect(); \ 1273 const IntVect _b_len = (b).size(); \ 1274 T* _th_p = (x) .dataPtr(); \ 1275 for (int nR = (ns); nR < (ns)+(nc); ++nR) \ 1277 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1279 const int kR = _k + _b_lo[2]; \ 1280 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1282 const int jR = _j + _b_lo[1]; \ 1284 + ((_b_lo[0] - _th_plo[0]) \ 1289 + nR * _th_plen[2]))); \ 1290 const int thisLen = _b_len[0]; 1292 #define ForAllXBNN3(T,x,b,ns,nc) \ 1294 CH_assert(x.contains(b)); \ 1295 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1296 const int *_x_plo = (x).loVect(); \ 1297 const IntVect _x_plen = (x).size(); \ 1298 const int *_b_lo = (b).loVect(); \ 1299 const IntVect _b_len = (b).size(); \ 1300 T* _x_p = (x) .dataPtr(); \ 1301 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1303 const int nR = _n; (int&)nR += 0; \ 1304 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1306 const int kR = _k + _b_lo[2]; \ 1307 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1309 const int jR = _j + _b_lo[1]; \ 1311 + ((_b_lo[0] - _x_plo[0]) \ 1316 + _n * _x_plen[2]))); \ 1317 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 1319 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 1322 #define ForAllXBNNnoindx3(T,x,b,ns,nc) \ 1324 CH_assert(x.contains(b)); \ 1325 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1326 const int *_x_plo = (x).loVect(); \ 1327 const IntVect _x_plen = (x).size(); \ 1328 const int *_b_lo = (b).loVect(); \ 1329 const IntVect _b_len = (b).size(); \ 1330 T* _x_p = (x) .dataPtr(); \ 1331 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1333 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1335 const int kR = _k + _b_lo[2]; \ 1336 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1338 const int jR = _j + _b_lo[1]; \ 1340 + ((_b_lo[0] - _x_plo[0]) \ 1345 + _n * _x_plen[2]))); \ 1346 for (int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) \ 1350 #define ForAllXCBNN3(T,x,b,ns,nc) \ 1352 CH_assert(x.contains(b)); \ 1353 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1354 const int *_x_plo = (x).loVect(); \ 1355 const IntVect _x_plen = (x).size(); \ 1356 const int *_b_lo = (b).loVect(); \ 1357 const IntVect _b_len = (b).size(); \ 1358 const T* _x_p = (x).dataPtr(); \ 1359 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1361 const int nR = _n; (int&)nR += 0; \ 1362 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1364 const int kR = _k + _b_lo[2]; \ 1365 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1367 const int jR = _j + _b_lo[1]; \ 1368 const T *_x_pp = _x_p \ 1369 + ((_b_lo[0] - _x_plo[0]) \ 1374 + _n * _x_plen[2]))); \ 1375 for (int _i = 0; _i < _b_len[0]; ++_i) \ 1377 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 1378 const T & x##R = _x_pp[_i]; 1380 #define ForAllThisBNN3(T,b,ns,nc) \ 1382 CH_assert(this->contains(b)); \ 1383 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1384 const int *_th_plo = this->loVect(); \ 1385 const IntVect _th_plen = this->size(); \ 1386 const int *_b_lo = (b).loVect(); \ 1387 const IntVect _b_len = (b).size(); \ 1388 T* _th_p = this->m_dptr; \ 1389 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1391 int nR = _n; nR += 0; \ 1392 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1394 const int kR = _k + _b_lo[2]; \ 1395 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1397 const int jR = _j + _b_lo[1]; \ 1399 + ((_b_lo[0] - _th_plo[0]) \ 1404 + _n * _th_plen[2]))); \ 1405 for (int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) \ 1407 int iR = _i + _b_lo[0]; iR += 0; \ 1408 T &thisR = * _th_pp; 1410 #define ForAllThisCBNN3(T,b,ns,nc) \ 1412 CH_assert(this->contains(b)); \ 1413 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1414 const int *_th_plo = this->loVect(); \ 1415 const IntVect _th_plen = this->size(); \ 1416 const int *_b_lo = (b).loVect(); \ 1417 const IntVect _b_len = (b).size(); \ 1418 const T* _th_p = this->m_dptr; \ 1419 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1421 const int nR = _n; (int&)nR += 0; \ 1422 for (int _k = 0; _k < _b_len[2]; ++_k) \ 1424 const int kR = _k + _b_lo[2]; \ 1425 for (int _j = 0; _j < _b_len[1]; ++_j) \ 1427 const int jR = _j + _b_lo[1]; \ 1428 const T *_th_pp = _th_p \ 1429 + ((_b_lo[0] - _th_plo[0]) \ 1434 + _n * _th_plen[2]))); \ 1435 for (int _i = 0; _i < _b_len[0]; ++_i) \ 1437 const int iR = _i + _b_lo[0]; (int&)iR += 0; \ 1438 const T &thisR = _th_pp[_i]; 1440 #define ForAllThisBNNXC3(T,b,ns,nc,x,nss) \ 1442 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1443 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1444 Box _subbox_((x).box()); \ 1445 _subbox_ &= this->box(); \ 1447 if (!_subbox_.isEmpty()) \ 1449 const int *_th_plo = this->loVect(); \ 1450 const IntVect _th_plen = this->size(); \ 1451 const int *_x_plo = (x).loVect(); \ 1452 const IntVect _x_plen = (x).size(); \ 1453 const int *_subbox_lo = _subbox_.loVect(); \ 1454 const IntVect _subbox_len = _subbox_.size(); \ 1455 T* _th_p = this->dataPtr(ns); \ 1456 const T* _x_p = (x).dataPtr(nss); \ 1457 for (int _n = 0; _n < (nc); ++_n) \ 1459 int nR = _n; nR += 0; \ 1460 for (int _k = 0; _k < _subbox_len[2]; ++_k) \ 1462 const int kR = _k + _subbox_lo[2]; \ 1463 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1465 const int jR = _j + _subbox_lo[1]; \ 1467 + ((_subbox_lo[0] - _th_plo[0]) \ 1472 + _n * _th_plen[2]))); \ 1473 const T *_x_pp = _x_p \ 1474 + ((_subbox_lo[0] - _x_plo[0]) \ 1479 + _n * _x_plen[2]))); \ 1480 for (int _i = 0; _i < _subbox_len[0]; \ 1483 int iR = _i + _subbox_lo[0]; iR += 0; \ 1484 T &thisR = * _th_pp; \ 1485 const T & x##R = _x_pp[_i]; 1487 #define ForAllThisCBNNXC3(T,b,ns,nc,x,nss) \ 1489 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1490 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1491 Box _subbox_((x).box()); \ 1492 _subbox_ &= this->box(); \ 1494 if (!_subbox_.isEmpty()) \ 1496 const int *_th_plo = this->loVect(); \ 1497 const IntVect _th_plen = this->size(); \ 1498 const int *_x_plo = (x).loVect(); \ 1499 const IntVect _x_plen = (x).size(); \ 1500 const int *_subbox_lo = _subbox_.loVect(); \ 1501 const IntVect _subbox_len = _subbox_.size(); \ 1502 const T* _th_p = this->dataPtr(ns); \ 1503 const T* _x_p = (x).dataPtr(nss); \ 1504 for (int _n = 0; _n < (nc); ++_n) \ 1506 int nR = _n; nR += 0; \ 1507 for (int _k = 0; _k < _subbox_len[2]; ++_k) \ 1509 const int kR = _k + _subbox_lo[2]; \ 1510 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1512 const int jR = _j + _subbox_lo[1]; \ 1513 const T *_th_pp = _th_p \ 1514 + ((_subbox_lo[0] - _th_plo[0]) \ 1519 + _n * _th_plen[2]))); \ 1520 const T *_x_pp = _x_p \ 1521 + ((_subbox_lo[0] - _x_plo[0]) \ 1526 + _n * _x_plen[2]))); \ 1527 for (int _i = 0; _i < _subbox_len[0]; \ 1530 int iR = _i + _subbox_lo[0]; iR += 0; \ 1531 const T &thisR = * _th_pp; \ 1532 const T & x##R = _x_pp[_i]; 1534 #define ForAllThisBNNXCBN3(T,b,ns,nc,x,bx,nss) \ 1536 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1537 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1538 CH_assert((bx).sameSize((b))); \ 1539 if (!((b).isEmpty())) \ 1541 const int *_th_plo = this->loVect(); \ 1542 const IntVect _th_plen = this->size(); \ 1543 const int *_x_plo = (x).loVect(); \ 1544 const IntVect _x_plen = (x).size(); \ 1545 const int *_subbox_lo = (b).loVect(); \ 1546 IntVect _subbox_len = (b).size(); \ 1547 const int *_bx_lo = (bx).loVect(); \ 1548 T* _th_p = this->dataPtr(ns); \ 1549 const T* _x_p = (x).dataPtr(nss); \ 1550 for (int _n = 0; _n < (nc); ++_n) \ 1552 int nR = _n + ns; nR += 0; \ 1553 int n##x##R = _n + nss; n##x##R += 0; \ 1554 for (int _k = 0; _k < _subbox_len[2]; ++_k) \ 1556 const int kR = _k + _subbox_lo[2]; \ 1557 const int k##x##R = _k + _bx_lo[2]; \ 1558 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1560 const int jR = _j + _subbox_lo[1]; \ 1561 const int j##x##R = _j + _bx_lo[1]; \ 1563 + ((_subbox_lo[0] - _th_plo[0]) \ 1568 + _n * _th_plen[2]))); \ 1569 const T *_x_pp = _x_p \ 1570 + ((_bx_lo[0] - _x_plo[0]) \ 1572 (j##x##R - _x_plo[1]) \ 1574 (k##x##R - _x_plo[2]) \ 1575 + _n * _x_plen[2]))); \ 1576 for (int _i = 0; _i < _subbox_len[0]; \ 1579 int iR = _i + _subbox_lo[0]; iR += 0; \ 1580 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ 1581 T &thisR = * _th_pp; \ 1582 const T & x##R = _x_pp[_i]; 1584 #define ForAllThisBNNXCBNYCBN3(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ 1586 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1587 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 1588 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 1589 Box _subbox_(this->box()); \ 1591 CH_assert((bx).sameSize(_subbox_)); \ 1592 CH_assert((by).sameSize(_subbox_)); \ 1593 if (!_subbox_.isEmpty()) \ 1595 const int *_th_plo = this->loVect(); \ 1596 const IntVect _th_plen = this->size(); \ 1597 const int *_x_plo = (x).loVect(); \ 1598 const IntVect _x_plen = (x).size(); \ 1599 const int *_y_plo = (y).loVect(); \ 1600 const IntVect _y_plen = (y).size(); \ 1601 const int *_subbox_lo = _subbox_.loVect(); \ 1602 const IntVect _subbox_len = _subbox_.size(); \ 1603 const int *_bx_lo = (bx).loVect(); \ 1604 const int *_by_lo = (by).loVect(); \ 1605 T* _th_p = this->dataPtr(ns); \ 1606 const T* _x_p = (x).dataPtr(nsx); \ 1607 const T* _y_p = (y).dataPtr(nsy); \ 1608 for (int _n = 0; _n < (nc); ++_n) \ 1610 int nR = _n + ns; nR += 0; \ 1611 int n##x##R = _n + nsx; n##x##R += 0; \ 1612 int n##y##R = _n + nsy; n##y##R += 0; \ 1613 for (int _k = 0; _k < _subbox_len[2]; ++_k) \ 1615 const int kR = _k + _subbox_lo[2]; \ 1616 const int k##x##R = _k + _bx_lo[2]; \ 1617 const int k##y##R = _k + _by_lo[2]; \ 1618 for (int _j = 0; _j < _subbox_len[1]; ++_j) \ 1620 const int jR = _j + _subbox_lo[1]; \ 1621 const int j##x##R = _j + _bx_lo[1]; \ 1622 const int j##y##R = _j + _by_lo[1]; \ 1624 + ((_subbox_lo[0] - _th_plo[0]) \ 1629 + _n * _th_plen[2]))); \ 1630 const T *_x_pp = _x_p \ 1631 + ((_bx_lo[0] - _x_plo[0]) \ 1633 (j##x##R - _x_plo[1]) \ 1635 (k##x##R - _x_plo[2]) \ 1636 + _n * _x_plen[2]))); \ 1637 const T *_y_pp = _y_p \ 1638 + ((_by_lo[0] - _y_plo[0]) \ 1640 (j##y##R - _y_plo[1]) \ 1642 (k##y##R - _y_plo[2]) \ 1643 + _n * _y_plen[2]))); \ 1644 for (int _i = 0; _i < _subbox_len[0]; \ 1647 int iR = _i + _subbox_lo[0]; iR += 0; \ 1648 int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ 1649 int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ 1650 T &thisR = * _th_pp; \ 1651 const T & x##R = _x_pp[_i]; \ 1652 const T & y##R = _y_pp[_i]; 1654 #define ForAllRevXBNYCBNNN3(T,x,bx,nsx,y,by,nsy,nc,ir) \ 1656 CH_assert((ir) >= 0 && (ir) < SpaceDim); \ 1657 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 1658 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 1659 CH_assert((x).contains(bx)); \ 1660 CH_assert((y).contains(by)); \ 1661 CH_assert((bx).sameSize(by)); \ 1662 const int *_x_plo = (x).loVect(); \ 1663 const IntVect _x_plen = (x).size(); \ 1664 const int *_y_plo = (y).loVect(); \ 1665 intVect _y_plen = (y).size(); \ 1666 const int *_bx_lo = (bx).loVect(); \ 1667 const int *_by_lo = (by).loVect(); \ 1668 const IntVect _len = (bx).size(); \ 1669 T* _x_p = (x).dataPtr(nsx); \ 1670 const T* _y_p = (y).dataPtr(nsy); \ 1671 for (int _n = 0; _n < (nc); ++_n) \ 1673 int n##x##R = _n + nsx; n##x##R += 0; \ 1674 int n##y##R = _n + nsy; n##y##R += 0; \ 1675 for (int _k = 0; _k < _len[2]; ++_k) \ 1677 const int k##x##R = _k + _bx_lo[2]; \ 1678 const int krev##x##R = _len[2]-1-_k + _bx_lo[2]; \ 1679 const int k##y##R = _k + _by_lo[2]; \ 1680 for (int _j = 0; _j < _len[1]; ++_j) \ 1682 const int j##x##R = _j + _bx_lo[1]; \ 1683 const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \ 1684 const int j##y##R = _j + _by_lo[1]; \ 1691 + ((_bx_lo[0] - _x_plo[0]) + _len[0]-1 \ 1693 (j##x##R - _x_plo[1]) \ 1695 (k##x##R - _x_plo[2]) \ 1696 + _n * _x_plen[2]))); \ 1702 + ((_bx_lo[0] - _x_plo[0]) \ 1704 (jrev##x##R - _x_plo[1]) \ 1706 (k##x##R - _x_plo[2]) \ 1707 + _n * _x_plen[2]))); \ 1712 + ((_bx_lo[0] - _x_plo[0]) \ 1714 (j##x##R - _x_plo[1]) \ 1716 (krev##x##R - _x_plo[2]) \ 1717 + _n * _x_plen[2]))); \ 1719 const T *_y_pp = _y_p \ 1720 + ((_by_lo[0] - _y_plo[0]) \ 1722 (j##y##R - _y_plo[1]) \ 1724 (k##y##R - _y_plo[2]) \ 1725 + _n * _y_plen[2]))); \ 1726 for (int _i = 0; _i < _len[0]; ++_i, _ix += _istrd) \ 1728 T & x##R = _x_pp[_ix]; \ 1729 const T & y##R = _y_pp[_i]; 1746 #define EndForPencil3 \ 1752 #elif (CH_SPACEDIM > 3) 1754 #define ForAllThisCPencilHiDim(T,b,ns,nc) \ 1756 CH_assert(this->contains(b)); \ 1757 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1758 const IntVect _b_len = (b).size(); \ 1759 Box _pencil_box(b); \ 1760 _pencil_box.setBig(0,b.smallEnd(0)); \ 1761 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1763 int nR = _n; nR += 0; \ 1764 BoxIterator _bit( _pencil_box ); \ 1765 for (_bit.begin(); _bit.ok(); ++_bit) \ 1767 IntVect _iv = _bit(); \ 1768 const T &thisR = this->operator()(_iv,_n); \ 1769 const int thisLen = _b_len[0]; \ 1770 int jR = _iv[1]; jR += 0; \ 1771 int kR = _iv[2]; kR += 0; 1773 #define ForAllThisPencilHiDim(T,b,ns,nc) \ 1775 CH_assert(this->contains(b)); \ 1776 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1777 const IntVect _b_len = (b).size(); \ 1778 Box _pencil_box(b); \ 1779 _pencil_box.setBig(0,b.smallEnd(0)); \ 1780 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1782 const int nR = _n; \ 1783 BoxIterator _bit( _pencil_box ); \ 1784 for (_bit.begin(); _bit.ok(); ++_bit) \ 1786 IntVect _iv = _bit(); \ 1787 T &thisR = this->operator()(_iv,nR); \ 1788 const int thisLen = _b_len[0]; \ 1789 int jR = _iv[1]; jR += 0; \ 1790 int kR = _iv[2]; kR += 0; 1792 #define ForAllXBPencilHiDim(T,x,b,ns,nc) \ 1794 CH_assert((x).contains(b)); \ 1795 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1796 const IntVect _b_len = (b).size(); \ 1797 Box _pencil_box(b); \ 1798 _pencil_box.setBig(0,b.smallEnd(0)); \ 1799 for (int nR = (ns); nR < (ns)+(nc); ++nR) \ 1801 BoxIterator _bit( _pencil_box ); \ 1802 for (_bit.begin(); _bit.ok(); ++_bit) \ 1804 IntVect _iv = _bit(); \ 1805 T *xR = &(x).operator()(_iv,nR); \ 1806 const int thisLen = _b_len[0]; \ 1807 int jR = _iv[1]; jR += 0; \ 1808 int kR = _iv[2]; kR += 0; 1810 #define ForAllXBNNHiDim(T,x,b,ns,nc) \ 1812 CH_assert(x.contains(b)); \ 1813 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1814 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1816 const int nR = _n; (int&)nR += 0; \ 1817 BoxIterator _bit( (b) ); \ 1818 for (_bit.begin(); _bit.ok(); ++_bit) \ 1820 IntVect _iv = _bit(); \ 1821 T &x##R = (x)(_iv,nR); \ 1822 T *_x_pp = &x##R; _x_pp += 0; \ 1823 int iR = _iv[0]; iR += 0; \ 1824 int jR = _iv[1]; jR += 0; \ 1825 int kR = _iv[2]; kR += 0; 1827 #define ForAllXBNNnoindxHiDim(T,x,b,ns,nc) \ 1829 CH_assert(x.contains(b)); \ 1830 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1831 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1833 BoxIterator _bit( (b) ); \ 1834 for (_bit.begin(); _bit.ok(); ++_bit) \ 1836 IntVect _iv = _bit(); \ 1837 T& x##R = (x)(_iv,_n); \ 1838 int iR = _iv[0]; iR += 0; \ 1839 int jR = _iv[1]; jR += 0; \ 1840 int kR = _iv[2]; kR += 0; 1842 #define ForAllXCBNNHiDim(T,x,b,ns,nc) \ 1844 CH_assert(x.contains(b)); \ 1845 CH_assert((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ 1846 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1848 const int nR = _n; \ 1849 BoxIterator _bit( (b) ); \ 1850 for (_bit.begin(); _bit.ok(); ++_bit) \ 1852 IntVect _iv = _bit(); \ 1853 const T & x##R = (x)(_iv, nR); \ 1854 const T *_x_pp = &x##R; _x_pp += 0; \ 1855 const int iR = _iv[0]; (int&)iR += 0; \ 1856 const int jR = _iv[1]; (int&)jR += 0; \ 1857 const int kR = _iv[2]; (int&)kR += 0; 1859 #define ForAllThisBNNHiDim(T,b,ns,nc) \ 1861 CH_assert(this->contains(b)); \ 1862 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1863 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1865 int nR = _n; nR += 0; \ 1866 BoxIterator _bit( (b)); \ 1867 for (_bit.begin(); _bit.ok(); ++_bit) \ 1869 IntVect _iv = _bit(); \ 1870 T &thisR = this->operator()(_iv,nR); \ 1871 int iR = _iv[0]; iR += 0; \ 1872 int jR = _iv[1]; jR += 0; \ 1873 int kR = _iv[2]; kR += 0; 1875 #define ForAllThisCBNNHiDim(T,b,ns,nc) \ 1877 CH_assert(this->contains(b)); \ 1878 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1879 for (int _n = (ns); _n < (ns)+(nc); ++_n) \ 1881 const int nR = _n; \ 1882 BoxIterator _bit( (b) ); \ 1883 for (_bit.begin(); _bit.ok(); ++_bit) \ 1885 IntVect _iv = _bit(); \ 1886 const T &thisR = this->operator()(_iv,nR); \ 1887 const int iR = _iv[0]; (int&)iR +=0; \ 1888 const int jR = _iv[1]; (int&)jR +=0; \ 1889 const int kR = _iv[2]; (int&)kR +=0; 1891 #define ForAllThisBNNXCHiDim(T,b,ns,nc,x,nss) \ 1893 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1894 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1895 Box _subbox_((x).box()); \ 1896 _subbox_ &= this->box(); \ 1898 if (!_subbox_.isEmpty()) \ 1900 for (int _n = 0; _n < (nc); ++_n) \ 1902 int nR = _n; nR += 0; \ 1903 BoxIterator _bit(_subbox_); \ 1904 for (_bit.begin(); _bit.ok(); ++_bit) \ 1906 IntVect _iv = _bit(); \ 1907 T &thisR = this->operator()(_iv, ns+nR); \ 1908 const T & x##R = (x)(_iv, nss+nR); \ 1909 const int iR = _iv[0]; (int&)iR += 0; \ 1910 const int jR = _iv[1]; (int&)jR += 0; \ 1911 const int kR = _iv[2]; (int&)kR += 0; 1913 #define ForAllThisCBNNXCHiDim(T,b,ns,nc,x,nss) \ 1915 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1916 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1917 Box _subbox_((x).box()); \ 1918 _subbox_ &= this->box(); \ 1920 if (!_subbox_.isEmpty()) \ 1922 for (int _n = 0; _n < (nc); ++_n) \ 1924 int nR = _n; nR += 0; \ 1925 BoxIterator _bit(_subbox_); \ 1926 for (_bit.begin(); _bit.ok(); ++_bit) \ 1928 IntVect _iv = _bit(); \ 1929 const T &thisR = this->operator()(_iv,ns+nR); \ 1930 const T & x##R = (x)(_iv,nss+nR); \ 1931 const int iR = _iv[0]; (int&)iR += 0; \ 1932 const int jR = _iv[1]; (int&)jR += 0; \ 1933 const int kR = _iv[2]; (int&)kR += 0; 1935 #define ForAllThisBNNXCBNHiDim(T,b,ns,nc,x,bx,nss) \ 1937 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1938 CH_assert((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ 1939 CH_assert((bx).sameSize((b))); \ 1940 if (!((b).isEmpty())) \ 1942 for (int _n = 0; _n < (nc); ++_n) \ 1944 int nR = _n + ns; nR += 0; \ 1945 int n##x##R = _n + nss; n##x##R += 0; \ 1946 BoxIterator this_Bit( (b) ); \ 1947 IntVect _bxOffset = bx.smallEnd() - b.smallEnd(); \ 1948 for (this_Bit.begin(); this_Bit.ok(); ++this_Bit) \ 1950 IntVect _thisIV = this_Bit(); \ 1951 IntVect _xIV = _thisIV + _bxOffset; \ 1952 T &thisR = this->operator()(_thisIV, nR); \ 1953 const T & x##R = (x)(_xIV,n##x##R); \ 1954 int iR = _xIV[0]; iR += 0; \ 1955 int jR = _xIV[1]; jR += 0; \ 1956 int kR = _xIV[2]; kR += 0; 1958 #define ForAllThisBNNXCBNYCBNHiDim(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ 1960 CH_assert((ns) >= 0 && (ns) + (nc) <= this->nComp()); \ 1961 CH_assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ 1962 CH_assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ 1963 Box _subbox_(this->box()); \ 1965 CH_assert((bx).sameSize(_subbox_)); \ 1966 CH_assert((by).sameSize(_subbox_)); \ 1967 if (!_subbox_.isEmpty()) \ 1969 for (int _n = 0; _n < (nc); ++_n) \ 1971 int nR = _n + ns; nR += 0; \ 1972 int n##x##R = _n + nsx; n##x##R += 0; \ 1973 int n##y##R = _n + nsy; n##y##R += 0; \ 1974 BoxIterator _thisBit(_subbox_); \ 1975 IntVect _xOffset = bx.smallEnd() - _subbox_.smallEnd(); \ 1976 IntVect _yOffset = by.smallEnd() - _subbox_.smallEnd(); \ 1977 for (_thisBit.begin(); _thisBit.ok(); ++_thisBit) \ 1979 IntVect _thisIV = _thisBit(); \ 1980 IntVect _xIV = _thisIV + _xOffset; \ 1981 IntVect _yIV = _thisIV + _yOffset; \ 1982 T &thisR = this->operator()(_thisIV,nR); \ 1983 const T & x##R = (x)(_xIV,n##x##R); \ 1984 const T & y##R = (y)(_yIV,n##y##R); \ 1985 int iR = _thisIV[0]; iR += 0; \ 1986 int jR = _thisIV[1]; jR += 0; \ 1987 int kR = _thisIV[2]; kR += 0; 1989 #define EndForHiDim \ 1994 #define EndForTXHiDim \ 2000 #define EndForPencilHiDim \ 2011 #define ForAllXPencil(T,x) ForAllXBPencil(T,x,((x).box()),0,((x).nComp())) 2018 #define ForAllX(T,x) ForAllXBNN(T,x,((x).box()),0,((x).nComp())) 2023 #define ForAllXC(T,x) ForAllXCBNN(T,x,((x).box()),0,((x).nComp())) 2029 #define ForAllXB(T,x,b) ForAllXBNN(T,x,(b),0,(x).nComp()) 2034 #define ForAllXBC(T,x,b) ForAllXCBNN(T,x,(b),0,(x).nComp()) 2041 #define ForAllThis(T) ForAllThisBNN(T,this->m_domain,0,this->nComp()) 2046 #define ForAllThisC(T) ForAllThisCBNN(T,this->m_domain,0,this->nComp()) 2052 #define ForAllThisB(T,b) ForAllThisBNN(T,(b),0,this->nComp()) 2057 #define ForAllThisCB(T,b) ForAllThisCBNN(T,(b),0,this->nComp()) 2063 #define ForAllThisNN(T,ns,nc) ForAllThisBNN(T,this->m_domain,ns,nc) 2070 #define ForAllThisXC(T,x) ForAllThisBNNXC(T,this->m_domain,0,this->nComp(),x,0) 2083 #define MD_DECLIX(T, x) \ 2084 D_DECL6(T x##0, T x##1, T x##2, T x##3, T x##4, T x##5) 2090 #define MD_EXPANDIX(x) \ 2091 D_DECL6(x##0, x##1, x##2, x##3, x##4, x##5) 2097 #define MD_GETIV(x) \ 2098 IntVect(D_DECL6(x##0, x##1, x##2, x##3, x##4, x##5)) 2110 #define MD_BOXLOOP(_box, x) \ 2112 for (int x##0 = (_box).smallEnd(0); x##0 <= (_box).bigEnd(0); ++ x##0), \ 2113 for (int x##1 = (_box).smallEnd(1); x##1 <= (_box).bigEnd(1); ++ x##1), \ 2114 for (int x##2 = (_box).smallEnd(2); x##2 <= (_box).bigEnd(2); ++ x##2), \ 2115 for (int x##3 = (_box).smallEnd(3); x##3 <= (_box).bigEnd(3); ++ x##3), \ 2116 for (int x##4 = (_box).smallEnd(4); x##4 <= (_box).bigEnd(4); ++ x##4), \ 2117 for (int x##5 = (_box).smallEnd(5); x##5 <= (_box).bigEnd(5); ++ x##5)) 2119 #define MD_2BOXLOOP(_boxA, x, _boxB, y) \ 2121 for (int x##0 = (_boxA).smallEnd(0), y##0 = (_boxB).smallEnd(0); x##0 <= (_boxA).bigEnd(0); ++ x##0, ++ y##0), \ 2122 for (int x##1 = (_boxA).smallEnd(1), y##1 = (_boxB).smallEnd(1); x##1 <= (_boxA).bigEnd(1); ++ x##1, ++ y##1), \ 2123 for (int x##2 = (_boxA).smallEnd(2), y##2 = (_boxB).smallEnd(2); x##2 <= (_boxA).bigEnd(2); ++ x##2, ++ y##2), \ 2124 for (int x##3 = (_boxA).smallEnd(3), y##3 = (_boxB).smallEnd(3); x##3 <= (_boxA).bigEnd(3); ++ x##3, ++ y##3), \ 2125 for (int x##4 = (_boxA).smallEnd(4), y##4 = (_boxB).smallEnd(4); x##4 <= (_boxA).bigEnd(4); ++ x##4, ++ y##4), \ 2126 for (int x##5 = (_boxA).smallEnd(5), y##5 = (_boxB).smallEnd(5); x##5 <= (_boxA).bigEnd(5); ++ x##5, ++ y##5)) 2141 #define MD_BOXLOOP_PENCIL(_box, x) \ 2144 for (int x##1 = (_box).smallEnd(1); x##1 <= (_box).bigEnd(1); ++ x##1), \ 2145 for (int x##2 = (_box).smallEnd(2); x##2 <= (_box).bigEnd(2); ++ x##2), \ 2146 for (int x##3 = (_box).smallEnd(3); x##3 <= (_box).bigEnd(3); ++ x##3), \ 2147 for (int x##4 = (_box).smallEnd(4); x##4 <= (_box).bigEnd(4); ++ x##4), \ 2148 for (int x##5 = (_box).smallEnd(5); x##5 <= (_box).bigEnd(5); ++ x##5)) 2150 #define MD_2BOXLOOP_PENCIL(_boxA, x, _boxB, y) \ 2153 for (int x##1 = (_boxA).smallEnd(1), y##1 = (_boxB).smallEnd(1); x##1 <= (_boxA).bigEnd(1); ++ x##1, ++ y##1), \ 2154 for (int x##2 = (_boxA).smallEnd(2), y##2 = (_boxB).smallEnd(2); x##2 <= (_boxA).bigEnd(2); ++ x##2, ++ y##2), \ 2155 for (int x##3 = (_boxA).smallEnd(3), y##3 = (_boxB).smallEnd(3); x##3 <= (_boxA).bigEnd(3); ++ x##3, ++ y##3), \ 2156 for (int x##4 = (_boxA).smallEnd(4), y##4 = (_boxB).smallEnd(4); x##4 <= (_boxA).bigEnd(4); ++ x##4, ++ y##4), \ 2157 for (int x##5 = (_boxA).smallEnd(5), y##5 = (_boxB).smallEnd(5); x##5 <= (_boxA).bigEnd(5); ++ x##5, ++ y##5)) 2169 #define MD_IX(x, c) \ 2170 (c)] D_INVTERM6([(x##0) , [(x##1)], [(x##2)], \ 2171 [(x##3)], [(x##4)], [(x##5)]) 2180 #define MD_IV(x, c) \ 2181 (c)] D_INVTERM6([(x)[0] , [(x)[1]], [(x)[2]], \ 2182 [(x)[3]], [(x)[4]], [(x)[5]]) 2195 #define MD_CIX1(c, x) \ 2197 #elif CH_SPACEDIM==2 2198 #define MD_CIX2(c, x) \ 2200 #elif CH_SPACEDIM==3 2201 #define MD_CIX3(c, x) \ 2202 (x##2)][(x##1)][(x##0)][(c) 2203 #elif CH_SPACEDIM==4 2204 #define MD_CIX4(c, x) \ 2205 (x##3)][(x##2)][(x##1)][(x##0)][(c) 2206 #elif CH_SPACEDIM==5 2207 #define MD_CIX5(c, x) \ 2208 (x##4)][(x##3)][(x##2)][(x##1)][(x##0)][(c) 2209 #elif CH_SPACEDIM==6 2210 #define MD_CIX6(c, x) \ 2211 (x##5)][(x##4)][(x##3)][(x##2)][(x##1)][(x##0)][(c) 2227 #define MD_ID(x, _dir) \ 2228 D_DECL6((x##0) = ((_dir) == 0), \ 2229 (x##1) = ((_dir) == 1), \ 2230 (x##2) = ((_dir) == 2), \ 2231 (x##3) = ((_dir) == 3), \ 2232 (x##4) = ((_dir) == 4), \ 2233 (x##5) = ((_dir) == 5)) 2250 #define MD_OFFSETIX(x, op, o, c) \ 2251 (c)] D_INVTERM6([((x##0) op (o##0)) , \ 2252 [((x##1) op (o##1))], \ 2253 [((x##2) op (o##2))], \ 2254 [((x##3) op (o##3))], \ 2255 [((x##4) op (o##4))], \ 2256 [((x##5) op (o##5))]) 2272 #define MD_OFFSETIV(x, op, ov, c) \ 2273 (c)] D_INVTERM6([((x##0) op ov[0]) , \ 2274 [((x##1) op ov[1])], \ 2275 [((x##2) op ov[2])], \ 2276 [((x##3) op ov[3])], \ 2277 [((x##4) op ov[4])], \ 2278 [((x##5) op ov[5])]) 2284 #endif // matches CH_SPACEDIM != LAST_BASEFABMACROS_H_SPACEDIM