Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

Chombo Macros


Defines

#define ForAllThisPencil(T, b, ns, nc)
#define ForAllXBPencil(T, x, b, ns, nc)
#define ForAllThisCPencil(T, b, ns, nc)
#define ForAllXBNN(T, x, b, ns, nc)
#define ForAllXCBNN(T, x, b, ns, nc)
#define ForAllThisBNN(T, b, ns, nc)
#define ForAllThisCBNN(T, b, ns, nc)
#define ForAllThisBNNXC(T, b, ns, nc, x, nss)
#define ForAllThisBNNXCBN(T, b, ns, nc, x, bx, nss)
#define ForAllThisBNNXCBNYCBN(T, b, ns, nc, x, bx, nsx, y, by, nsy)
#define EndForTX   }}}}
#define EndFor   }}}
#define EndForPencil   }}
#define ForAllXPencil(T, x)   ForAllXBPencil(T,x,((x).box()),0,((x).nComp()))
#define ForAllX(T, x)   ForAllXBNN(T,x,((x).box()),0,((x).nComp()))
#define ForAllXC(T, x)   ForAllXCBNN(T,x,((x).box()),0,((x).nComp()))
#define ForAllXB(T, x, b)   ForAllXBNN(T,x,(b),0,(x).nComp())
#define ForAllXBC(T, x, b)   ForAllXCBNN(T,x,(b),0,(x).nComp())
#define ForAllThis(T)   ForAllThisBNN(T,domain,0,nComp())
#define ForAllThisC(T)   ForAllThisCBNN(T,domain,0,nComp())
#define ForAllThisB(T, b)   ForAllThisBNN(T,(b),0,nComp())
#define ForAllThisCB(T, b)   ForAllThisCBNN(T,(b),0,nComp())
#define ForAllThisNN(T, ns, nc)   ForAllThisBNN(T,domain,ns,nc)
#define ForAllThisXC(T, x)   ForAllThisBNNXC(T,domain,0,nComp(),x,0)
#define CHOMBO_VERSION_MAJOR   1
#define CHOMBO_VERSION_MINOR   5
#define FORTRAN_NAME(NAME,name)
 Used to declare a fortran routine in a portable way.

#define CHF_MULTIDO(box, i, j, k)
 Used in ChomboFortran to write dimension-indenpendent loops.

#define CHF_ENDDO
#define CHF_INT(i)   &i
#define CHF_CONST_INT(i)   &i
#define CHF_REAL(r)   &r
#define CHF_CONST_REAL(r)   &r
#define CHF_I1D(ia, dimen)   ia,(const int*)chfptr(dimen-1)
#define CHF_CONST_I1D(ia, dimen)   ia,(const int*)chfptr(dimen-1)
#define CHF_R1D(ra, dimen)   ra,(const int*)chfptr(dimen-1)
#define CHF_CONST_R1D(ra, dimen)   ra,(const int*)chfptr(dimen-1)
#define CHF_INTVECT(a)   a.dataPtr( )
#define CHF_CONST_INTVECT(a)   a.dataPtr( )
#define CHF_REALVECT(a)   a.dataPtr( )
#define CHF_CONST_REALVECT(a)   a.dataPtr( )
#define CHF_VI(v)   &v[0],(const int*)chfptr(v.size()-1)
#define CHF_CONST_VI(v)   &v[0],(const int*)chfptr(v.size()-1)
#define CHF_VR(v)   &v[0],(const int*)chfptr(v.size()-1)
#define CHF_CONST_VR(v)   &v[0],(const int*)chfptr(v.size()-1)
#define CHF_BOX(b)
#define CHF_FIA(a)
#define CHF_FRA(a)
#define CHF_CONST_FIA(a)
#define CHF_CONST_FRA(a)
#define CHF_FIA1(a, n)
#define CHF_FRA1(a, n)
#define CHF_CONST_FIA1(a, n)
#define CHF_CONST_FRA1(a, n)
#define CH_SPACEDIM
#define D_EXPR(a, b, c)   ((void)((a),(b),(c),0))
#define D_DECL(a, b, c)   a,b,c
#define D_TERM(a, b, c)   a b c


Define Documentation

#define ForAllThisPencil T,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    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();                                     \
    T* _th_p = dptr;                                                    \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        T *_th_pp = _th_p                                               \
            + ((_b_lo[0] - _th_plo[0])                                  \
               + _n * _th_plen[0]);                                     \
        T &thisR = * _th_pp;                                            \
        const int thisLen = _b_len[0];                                  \
The macro ForAllThisPencil(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro acts upon the BaseFab *this. Instead of iterating over the entire Box b, it iterates over components starting at component ns and ending at component ns+nc-1, in all directions except the first coordinate direction. The user must iterate over the first coordinate direction within the ForAllThisPencil loop. The macro creates two internal reference variables; thisR that references the first element in the pencil, and thisLen that gives the length of the pencil. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over.

We can rewrite the code illustrated in `ForAllThisBNN' in this form:

    template <class T>
    void BaseFab<T>::performSetVal(const T val, const Box bx, int ns, int nc)
    {
       assert(domain.contains(bx));
       ForAllThisPencil(T,bx,ns,nc)
       {
          T* dog = &thisR;
          for (int i = 0; i < thisLen; i++)
             dog[i] = val;
       } EndForPencil
    }

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllXBPencil T,
x,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    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();                                     \
    T* _th_p = x.dataPtr();                                             \
    for(int nR = (ns); nR < (ns)+(nc); ++nR) {                          \
        T * xR = _th_p                                                  \
            + ((_b_lo[0] - _th_plo[0])                                  \
               + nR * _th_plen[0]);                                     \
    const int thisLen = _b_len[0];
Same as ForAllThisPencil, except that it operates on the the argument BaseFab passed in. added by bvs, 05/27/99

#define ForAllThisCPencil T,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    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();                                     \
    const T* _th_p = dptr;                                              \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        int nR = _n; nR += 0;                                           \
        const T *_th_pp = _th_p                                         \
            + ((_b_lo[0] - _th_plo[0])                                  \
               + _n * _th_plen[0]);                                     \
        const T &thisR = * _th_pp;                                      \
        const int thisLen = _b_len[0];
The macro ForAllThisCPencil(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This is the constant version of ForAllThisPencil; i.e. it works when the underlying BaseFab is constant.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllXBNN T,
x,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    assert(x.contains(b));                                              \
    assert((ns) >= 0 && (ns) + (nc) <= (x).nComp());                    \
    const int *_x_plo = (x).loVect();                                   \
    const int *_x_plen = (x).size();                                    \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size();                                     \
    T* _x_p = (x) .dataPtr();                                           \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        T *_x_pp = _x_p                                                 \
            + ((_b_lo[0] - _x_plo[0])                                   \
               + _n * _x_plen[0]);                                      \
        for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) {                \
            const int iR = _i + _b_lo[0];                               \
            T &x##R = * _x_pp;
The macro ForAllXBNN(T,x,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro acts upon the BaseFab x where the loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over. The reference variable is xR, where x is literally replaced by the macros second argument. Thus an expression ForAllXBNN(int,dog,...) would have a reference variable dogR of type int.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllXCBNN T,
x,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    assert(x.contains(b));                                              \
    assert((ns) >= 0 && (ns) + (nc) <= (x).nComp());                    \
    const int *_x_plo = (x).loVect();                                   \
    const int *_x_plen = (x).size();                                    \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    const T* _x_p = (x).dataPtr();                                      \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        const T *_x_pp = _x_p                                           \
            + ((_b_lo[0] - _x_plo[0])                                   \
               + _n * _x_plen[0]);                                      \
        for(int _i = 0; _i < _b_len[0]; ++_i) {                         \
            const int iR = _i + _b_lo[0];                               \
            const T & x##R = _x_pp[_i];
The macro ForAllXCBNN(T,x,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This is the constant version of ForAllXBNN; i.e. it works when the underlying BaseFab is constant.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllThisBNN T,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    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) {                          \
        int nR = _n; nR += 0;                                           \
        T *_th_pp = _th_p                                               \
            + ((_b_lo[0] - _th_plo[0])                                  \
               + _n * _th_plen[0]);                                     \
        for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) {               \
            int iR = _i + _b_lo[0]; iR += 0;                            \
            T &thisR = * _th_pp;
The ForAllThisBNN(T,b,ns,nc) macro is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro performs the loop over the current object (*this) where the loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over. The reference variable is thisR.

For example:

    template<class T>
    void
    BaseFab<T>::performSetVal (const T val, const Box bx, int ns, int num)
    {
      assert(domain.contains(bx));
      ForAllThisBNN(T,bx,ns,num)
      {
        thisR = val;
      } EndFor
    }

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllThisCBNN T,
b,
ns,
nc   ) 
 

Value:

{                                                                       \
    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) {                          \
        const int nR = _n;                                              \
        const T *_th_pp = _th_p                                         \
            + ((_b_lo[0] - _th_plo[0])                                  \
               + _n * _th_plen[0]);                                     \
        for(int _i = 0; _i < _b_len[0]; ++_i) {                         \
            const int iR = _i + _b_lo[0];                               \
            const T &thisR = _th_pp[_i];
The macro ForAllThisCBNN(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This is the constant version of ForAllThisBNN; i.e. it works when the underlying BaseFab is constant.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllThisBNNXC T,
b,
ns,
nc,
x,
nss   ) 
 

Value:

{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nss) >= 0 && (nss) + (nc) <= (x).nComp());                  \
    Box _subbox_((x).box());                                            \
    _subbox_ &= box();                                                  \
    _subbox_ &= b;                                                      \
    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 *_subbox_lo = _subbox_.loVect();                      \
        const int *_subbox_len = _subbox_.size().getVect();             \
        T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR = _n; nR += 0;                                       \
            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;                   \
                T &thisR = * _th_pp; const T & x##R = _x_pp[_i];
The macro ForAllThisBNNXC(T,b,ns,nc,x,nss) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x. The loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The reference variables are thisR and xR, respectively. As usual the x in xR is replaced by the macro's fifth argument. The sixth argument nss is the number of the argument in x that corresponds to the ns argument in *this.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllThisBNNXCBN T,
b,
ns,
nc,
x,
bx,
nss   ) 
 

Value:

{                                                                       \
    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];
The macro ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x. The loop runs over the points in the Box b with components starting at ns and ending at ns+nc-1. The reference variables are thisR and xR, respectively. As usual the x in xR is replaced by the macro's fifth argument. The sixth argument nss is the number of the argument in x that corresponds to the ns argument in *this. Box bx must be the same size as this->box() intersected with b.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define ForAllThisBNNXCBNYCBN T,
b,
ns,
nc,
x,
bx,
nsx,
y,
by,
nsy   ) 
 

The macro ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers.

This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x and const BaseFab y. The loop runs over the points in the intersection of Box b with components starting at ns and ending at ns+nc-1. The reference variables are thisR, xR, and yR respectively. As usual the x in xR is replaced by the macro's fifth argument and likewise for the y in yR. The seventh argument nsx is the number of the argument in x that corresponds to the ns argument in *this, and the eighth argument nsy is the number of the argument in y that corresponds to the ns argument in *this. Boxes bx and by must be the same size as this->box() intersected with b.

Looping macro mnemonics:

This stands for the current object

C for a const

X stands for a BaseFab

B for a Box

N for an int

#define EndForTX   }}}}
 

The macro EndForTX must be used to end all ForAllThisBNNXC, ForAllThisBNNXCBN and ForAllThisBNNXCBNYCBN looping constructs.

#define EndFor   }}}
 

The macro EndFor must be used to end all ForAllXBNN, ForAllXCBNN, ForAllThisBNN, and ForAllThisCBNN looping constructs.

#define EndForPencil   }}
 

The macro EndForPencil must be used to end ForAll*Pencil looping constructs.

#define ForAllXPencil T,
 )     ForAllXBPencil(T,x,((x).box()),0,((x).nComp()))
 

The Macro ForAllXPencil is a shortened version of ForAllXBPencil where the box is defaulted to the entire domain the the components run over all components of x

#define ForAllX T,
 )     ForAllXBNN(T,x,((x).box()),0,((x).nComp()))
 

The macro ForAllX(T,x) is a shortened form of `ForAllXBNN' where the Box defaults to the domain of x and the components run over all the components of x.

#define ForAllXC T,
 )     ForAllXCBNN(T,x,((x).box()),0,((x).nComp()))
 

The macro ForAllXC(T,x) is the constant form of ForAllX(T,x).

#define ForAllXB T,
x,
 )     ForAllXBNN(T,x,(b),0,(x).nComp())
 

The macro ForAllXB(T,x,b) is a shortened form of `ForAllXBNN' where the components run over all the components of x.

#define ForAllXBC T,
x,
 )     ForAllXCBNN(T,x,(b),0,(x).nComp())
 

The macro ForAllXBC(T,x,b) is the constant form of ForAllXB(T,x,b).

#define ForAllThis  )     ForAllThisBNN(T,domain,0,nComp())
 

The macro ForAllThis(T) is a shortened form of `ForAllThisBNN' where the Box defaults to the domain of x and the components run over all the components of x.

#define ForAllThisC  )     ForAllThisCBNN(T,domain,0,nComp())
 

The macro ForAllThisC(T) is the constant form of ForAllThis(T).

#define ForAllThisB T,
 )     ForAllThisBNN(T,(b),0,nComp())
 

The macro ForAllThisB(T,b) is a shortened form of `ForAllThisBNN' where the components run over all the components of x.

#define ForAllThisCB T,
 )     ForAllThisCBNN(T,(b),0,nComp())
 

The macro ForAllThisCB(T,b) is the constant form of ForAllThisB(T,b).

#define ForAllThisNN T,
ns,
nc   )     ForAllThisBNN(T,domain,ns,nc)
 

The macro ForAllThisNN(T,ns,nc) is a shortened form of `ForAllThisBNN' where the Box defaults to the domain of *this.

#define ForAllThisXC T,
 )     ForAllThisBNNXC(T,domain,0,nComp(),x,0)
 

The macro ForAllThisXC(T,x) is a shortened form of `ForAllThisBNNXC' where the Box defaults to the domain of *this and the components run over all the components of *this.

#define CHOMBO_VERSION_MAJOR   1
 

The major version number of Chombo -- an integer.

The Chombo version number has the form:

CHOMBO_VERSION_MAJOR::CHOMBO_VERSION_MINOR

#define CHOMBO_VERSION_MINOR   5
 

The minor version number of Chombo -- an integer.

#define FORTRAN_NAME NAME,
name   ) 
 

Used to declare a fortran routine in a portable way.

#define CHF_MULTIDO box,
i,
j,
 ) 
 

Used in ChomboFortran to write dimension-indenpendent loops.

CHF_MULTIDO is used to iterate over a box in a dimension independent fashion by setting up nested Fortran do loops and CHF_ENDDO is used to terminate those do loops correctly. Specifically, CHF_MULTIDO[box;i;j;k] will generate a do loop for i nested inside a do loop for j and, in 3D, this will be nested inside a do loop for k. The i loop will go from first element of the low corner of box to the first element of the high corner of box. Similarly, the { j} loop will use the second element and, in 3D, the k loop will use the third element. CHF_ENDDO will end all the do loops set up by CHF_MULTIDO.

Here is an example using these macros:

      subroutine LOOP(CHF_FRA1[array],CHF_BOX[box])

      integer CHF_DDECL[i;j;k]
      integer productsum

      productsum = 0
      CHF_MULTIDO[box;i;j;k]
        productsum = productsum + i*j*k
        array(CHF_IX[i;j;k]) = productsum
      CHF_ENDDO

      return
      end

see the section of the Chombo Design document about Chombo Fortran for a more detailed use of macros in Fortran

#define CHF_ENDDO
 

#define CHF_INT  )     &i
 

#define CHF_CONST_INT  )     &i
 

#define CHF_REAL  )     &r
 

#define CHF_CONST_REAL  )     &r
 

#define CHF_I1D ia,
dimen   )     ia,(const int*)chfptr(dimen-1)
 

#define CHF_CONST_I1D ia,
dimen   )     ia,(const int*)chfptr(dimen-1)
 

#define CHF_R1D ra,
dimen   )     ra,(const int*)chfptr(dimen-1)
 

#define CHF_CONST_R1D ra,
dimen   )     ra,(const int*)chfptr(dimen-1)
 

#define CHF_INTVECT  )     a.dataPtr( )
 

#define CHF_CONST_INTVECT  )     a.dataPtr( )
 

#define CHF_REALVECT  )     a.dataPtr( )
 

#define CHF_CONST_REALVECT  )     a.dataPtr( )
 

#define CHF_VI  )     &v[0],(const int*)chfptr(v.size()-1)
 

#define CHF_CONST_VI  )     &v[0],(const int*)chfptr(v.size()-1)
 

#define CHF_VR  )     &v[0],(const int*)chfptr(v.size()-1)
 

#define CHF_CONST_VR  )     &v[0],(const int*)chfptr(v.size()-1)
 

#define CHF_BOX  ) 
 

Value:

D_DECL( &b.loVect()[0] \
                            ,&b.loVect()[1] \
                            ,&b.loVect()[2] ) \
                    ,D_DECL( &b.hiVect()[0] \
                            ,&b.hiVect()[1] \
                            ,&b.hiVect()[2] )

#define CHF_FIA  ) 
 

Value:

a.dataPtr( 0 ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] ) \
                     ,a.nCompPtr()

#define CHF_FRA  ) 
 

Value:

a.dataPtr( 0 ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] ) \
                     ,a.nCompPtr()

#define CHF_CONST_FIA  ) 
 

Value:

a.dataPtr( 0 ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] ) \
                     ,a.nCompPtr()

#define CHF_CONST_FRA  ) 
 

Value:

a.dataPtr( 0 ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] ) \
                     ,a.nCompPtr()

#define CHF_FIA1 a,
 ) 
 

Value:

a.dataPtr( n ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] )

#define CHF_FRA1 a,
 ) 
 

Value:

a.dataPtr( n ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] )

#define CHF_CONST_FIA1 a,
 ) 
 

Value:

a.dataPtr( n ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] )

#define CHF_CONST_FRA1 a,
 ) 
 

Value:

a.dataPtr( n ) \
                     ,D_DECL( &a.loVect()[0] \
                             ,&a.loVect()[1] \
                             ,&a.loVect()[2] ) \
                     ,D_DECL( &a.hiVect()[0] \
                             ,&a.hiVect()[1] \
                             ,&a.hiVect()[2] )

#define CH_SPACEDIM
 

compile time cpp macro that controls the dimensionality of the Chombo package.

#define D_EXPR a,
b,
 )     ((void)((a),(b),(c),0))
 

The D_EXPR(a,b,c) macro expands to a comma expression that will evaluate SpaceDim of its arguments, counting from the left; i.e. CH_SPACEDIM==1 implies only `a' is evaluated, CH_SPACEDIM==2 implies both `a' and `b', and CH_SPACEDIM==3 implies all three arguments are evaluated. This macro can be used to enhance the portability of code that works with structures whose size depends on CH_SPACEDIM.

For example:

D_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s);

More explicitly, this macro evaluates to one of

((void)((a),0))

((void)((a),(b),0))

((void)((a),(b),(c),0))

corresponding to CH_SPACEDIM values of 1, 2, or 3.

#define D_DECL a,
b,
 )     a,b,c
 

The D_DECL(a,b,c) macro expands to a comma-separated list of 1, 2, or all 3 of the arguments of the call, depending on the value of CH_SPACEDIM. This can be used to write portable function calls that depend on 1, 2, or 3 arguments, corresponding to the value of CH_SPACEDIM.

For example:

return IntVect(D_DECL(p[0] + s, p[1] + s, p[2] + s));

More explicitly, this macro evaluates to one of

a

a,b

a,b,c

corresponding to CH_SPACEDIM values of 1, 2, or 3.

#define D_TERM a,
b,
 )     a b c
 

define D_TERM(a,b,c) a b c

More explicitly, this macro evaluates to one of

a

a b

a b c

corresponding to CH_SPACEDIM values of 1, 2, or 3.

handy for situations like:

Real norm = sqrt(D_TERM(u[0]*u[0],+u[1]*u[1],+u[2]*u[2]));


Generated on Fri Jul 2 17:56:05 2004 for Chombo by doxygen 1.3.2