Block-Structured AMR Software Framework
AMReX_SPACE.H File Reference
#include <AMReX_Config.H>

Go to the source code of this file.

Macros

#define BL_SPACEDIM   AMREX_SPACEDIM
 
#define AMREX_D_EXPR(a, b, c)   ((void)((a),0))
 
#define AMREX_D_DECL(a, b, c)   a
 
#define AMREX_D_TERM(a, b, c)   a
 
#define AMREX_D_PICK(a, b, c)   a
 
#define AMREX_1D_ONLY(a)   a
 
#define AMREX_2D_ONLY(a)   ((void)0)
 
#define AMREX_3D_ONLY(a)   ((void)0)
 

Macro Definition Documentation

◆ AMREX_1D_ONLY

#define AMREX_1D_ONLY (   a)    a

◆ AMREX_2D_ONLY

#define AMREX_2D_ONLY (   a)    ((void)0)

◆ AMREX_3D_ONLY

#define AMREX_3D_ONLY (   a)    ((void)0)

◆ AMREX_D_DECL

#define AMREX_D_DECL (   a,
  b,
 
)    a

The AMREX_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 AMREX_SPACEDIM. This can be used to write portable function calls that depend on 1, 2, or 3 arguments, corresponding to the value of AMREX_SPACEDIM.

For example:

return IntVect(AMREX_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 AMREX_SPACEDIM values of 1, 2, or 3.

◆ AMREX_D_EXPR

#define AMREX_D_EXPR (   a,
  b,
 
)    ((void)((a),0))

The AMREX_D_EXPR(a,b,c) macro expands to a comma expression that will evaluate SpaceDim of its arguments, counting from the left; i.e. AMREX_SPACEDIM==1 implies only a is evaluated, AMREX_SPACEDIM==2 implies both a and b, and AMREX_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 AMREX_SPACEDIM.

For example:

AMREX_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 AMREX_SPACEDIM values of 1, 2, or 3.

◆ AMREX_D_PICK

#define AMREX_D_PICK (   a,
  b,
 
)    a

The AMREX_D_PICK(a,b,c) macro expands to a single result equal to the 1st, 2nd, or 3rd of the arguments of the call, depending on the value of AMREX_SPACEDIM. This can be used to write program logic that depend on the value of AMREX_SPACEDIM.

For example:

maxsize = AMREX_D_PICK(1024, 128, 32);

More explicitly, this macro evaluates to one of

maxsize = 1024;

maxsize = 128;

maxsize = 32;

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

◆ AMREX_D_TERM

#define AMREX_D_TERM (   a,
  b,
 
)    a

The AMREX_D_TERM(a,b,c) macro expands to a whitespace-separated list of 1, 2, or all 3 of the arguments of the call, depending on the value of AMREX_SPACEDIM. This can be used to write program logic that depend on 1, 2, or 3 arguments, corresponding to the value of AMREX_SPACEDIM.

For example:

return AMREX_D_TERM(len[0], *len[1], *len[2]);

More explicitly, this macro evaluates to one of

a

a b

a b c

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

◆ BL_SPACEDIM

#define BL_SPACEDIM   AMREX_SPACEDIM