⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basefabmacros.h

📁 自适应网格划分通用程序包
💻 H
📖 第 1 页 / 共 5 页
字号:
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_subbox_lo = _subbox_.loVect();                      \
        const int *_subbox_len = _subbox_.size().getVect();             \
        const T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR = _n; nR += 0;                                       \
            const T *_th_pp = _th_p                                           \
                + ((_subbox_lo[0] - _th_plo[0])                         \
                   + _n * _th_plen[0]);                                 \
            const T *_x_pp = _x_p                                       \
                + ((_subbox_lo[0] - _x_plo[0])                          \
                   + _n * _x_plen[0]);                                  \
            for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) {      \
                int iR = _i + _subbox_lo[0]; iR += 0;                   \
                const T &thisR = * _th_pp; const T & x##R = _x_pp[_i];

#define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss)                           \
{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nss) >= 0 && (nss) + (nc) <= (x).nComp());                  \
    assert(bx.sameSize((b)));                                             \
    if(!((b).isEmpty())) {                                                  \
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_subbox_lo = (b).loVect();                             \
        const int *_subbox_len = (b).size().getVect();                    \
        const int *_bx_lo = (bx).loVect();                              \
        T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR = _n + ns; nR += 0;                                  \
            int n##x##R = _n + nss; n##x##R += 0;                       \
            T *_th_pp = _th_p                                           \
                + ((_subbox_lo[0] - _th_plo[0])                         \
                   + _n * _th_plen[0]);                                 \
            const T *_x_pp = _x_p                                       \
                + ((_bx_lo[0] - _x_plo[0])                              \
                   + _n * _x_plen[0]);                                  \
            for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) {      \
                int iR = _i + _subbox_lo[0]; iR += 0;                   \
                int i##x##R = _i + _bx_lo[0]; i##x##R += 0;             \
                T &thisR = * _th_pp; const T & x##R = _x_pp[_i];

#define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy)              \
{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp());                  \
    assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp());                  \
    Box _subbox_ = box();                                               \
    _subbox_ &= b;                                                      \
    assert((bx).sameSize(_subbox_));                                    \
    assert((by).sameSize(_subbox_));                                    \
    if(!_subbox_.isEmpty()) {                                           \
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_y_plo = (y).loVect();                               \
        const int *_y_plen = (y).size();                                \
        const int *_subbox_lo = _subbox_.loVect();                      \
        const int *_subbox_len = _subbox_.size().getVect();             \
        const int *_bx_lo = (bx).loVect();                              \
        const int *_by_lo = (by).loVect();                              \
        T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nsx);                              \
        const T* _y_p  = (y).dataPtr(nsy);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR      = _n + ns;  nR      += 0;                       \
            int n##x##R = _n + nsx; n##x##R += 0;                       \
            int n##y##R = _n + nsy; n##y##R += 0;                       \
            T *_th_pp = _th_p                                           \
                + ((_subbox_lo[0] - _th_plo[0])                         \
                   + _n * _th_plen[0]);                                 \
            const T *_x_pp = _x_p                                       \
                + ((_bx_lo[0] - _x_plo[0])                              \
                   + _n * _x_plen[0]);                                  \
            const T *_y_pp = _y_p                                       \
                + ((_by_lo[0] - _y_plo[0])                              \
                   + _n * _y_plen[0]);                                  \
            for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) {      \
                int iR = _i + _subbox_lo[0];  iR += 0;                  \
                int i##x##R = _i + _bx_lo[0]; i##x##R += 0;             \
                int i##y##R = _i + _by_lo[0]; i##y##R += 0;             \
                T &thisR = * _th_pp;                                    \
                const T & x##R = _x_pp[_i];                             \
                const T & y##R = _y_pp[_i];

#define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ri)                   \
{                                                                       \
    assert((nsx) >= 0 && (nsx) + (nc) <= (x).nComp());                  \
    assert((nsy) >= 0 && (nsy) + (nc) <= (y).nComp());                  \
    assert((x).contains(bx));                                           \
    assert((y).contains(by));                                           \
    assert((bx).sameSize(by));                                          \
    const int *_x_plo = (x).loVect();                                   \
    const int *_x_plen = (x).size();                                    \
    const int *_y_plo = (y).loVect();                                   \
    const int *_y_plen = (y).size();                                    \
    const int *_len = (bx).size().getVect();                            \
    const int *_bx_lo = (bx).loVect();                                  \
    const int *_by_lo = (by).loVect();                                  \
    T* _x_p  = (x).dataPtr(nsx);                                        \
    const T* _y_p  = (y).dataPtr(nsy);                                  \
    for(int _n = 0; _n < (nc); ++_n) {                                  \
        int n##x##R = _n + nsx; n##x##R += 0;                           \
        int n##y##R = _n + nsy; n##y##R += 0;                           \
        int _ix = 0;                                                    \
        T *_x_pp = _x_p                                                 \
            + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1                    \
                + _n * _x_plen[0]);                                     \
        const T *_y_pp = _y_p                                           \
            + ((_by_lo[0] - _y_plo[0])                                  \
                + _n * _y_plen[0]);                                     \
        for(int _i = 0; _i < _len[0]; ++_i, --_ix) {                    \
            T & x##R = _x_pp[_ix];                                      \
            const T & y##R = _y_pp[_i];

#define EndForTX }}}}

#define EndFor }}}

#define EndForPencil }}

#elif (CH_SPACEDIM == 2)

#define ForAllThisCPencil(T,b,ns,nc)                                    \
{                                                                       \
    assert(contains(b));                                                \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    const int *_th_plo = loVect();                                      \
    const int *_th_plen = size();                                       \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    const T* _th_p = dptr;                                              \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        int nR = _n; nR += 0;                                           \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            const T *_th_pp = _th_p                                     \
                + ((_b_lo[0] - _th_plo[0])                              \
                   + _th_plen[0]*(                                      \
                       (jR - _th_plo[1])                                \
                       + _n * _th_plen[1]));                            \
            const T &thisR = * _th_pp;                                  \
            const int thisLen = _b_len[0];

#define ForAllThisPencil(T,b,ns,nc)                                     \
{                                                                       \
    assert(contains(b));                                                \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    const int *_th_plo = loVect();                                      \
    const int *_th_plen = size();                                       \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    T* _th_p = dptr;                                                    \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            T *_th_pp = _th_p                                           \
                + ((_b_lo[0] - _th_plo[0])                              \
                   + _th_plen[0]*(                                      \
                       (jR - _th_plo[1])                                \
                       + _n * _th_plen[1]));                            \
            T &thisR = * _th_pp;                                        \
            const int thisLen = _b_len[0];                              \

#define ForAllXBPencil(T,x,b,ns,nc)                                     \
{                                                                       \
    assert((x).contains(b));                                            \
    assert((ns) >= 0 && (ns) + (nc) <= (x).nComp());                    \
    const int *_th_plo = (x).loVect();                                  \
    const int *_th_plen =(x).size();                                    \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    T* _th_p = (x) .dataPtr();                                          \
    for(int nR = (ns); nR < (ns)+(nc); ++nR) {                          \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            T *xR = _th_p                                               \
                + ((_b_lo[0] - _th_plo[0])                              \
                   + _th_plen[0]*(                                      \
                       (jR - _th_plo[1])                                \
                       + nR * _th_plen[1]));                            \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -