(git:e7e05ae)
grid_common.h File Reference

Go to the source code of this file.

Data Structures

struct  orbital
 Orbital angular momentum. More...
 

Macros

#define GRID_STRINGIFY(SYMBOL)   #SYMBOL
 
#define GRID_PRAGMA_SIMD(OBJS, N)    _Pragma(GRID_STRINGIFY(omp simd linear OBJS simdlen(N)))
 
#define GRID_PRAGMA_UNROLL(N)   _Pragma(GRID_STRINGIFY(unroll(N)))
 
#define GRID_PRAGMA_UNROLL_UP_TO(N)   _Pragma("unroll")
 
#define GRID_HOST_DEVICE
 

Functions

static GRID_HOST_DEVICE double fac (const int i)
 Factorial function, e.g. fac(5) = 5! = 120. More...
 
static GRID_HOST_DEVICE int ncoset (const int l)
 Number of Cartesian orbitals up to given angular momentum quantum. More...
 
static GRID_HOST_DEVICE int coset (int lx, int ly, int lz)
 Maps three angular momentum components to a single zero based index. More...
 
static GRID_HOST_DEVICE int imin (int x, int y)
 Returns the smaller of two given integer (missing from the C standard) More...
 
static GRID_HOST_DEVICE int imax (int x, int y)
 Returns the larger of two given integer (missing from the C standard) More...
 
static GRID_HOST_DEVICE int modulo (int a, int m)
 Equivalent of Fortran's MODULO, which always return a positive number. https://gcc.gnu.org/onlinedocs/gfortran/MODULO.html. More...
 
static GRID_HOST_DEVICE orbital up (const int i, const orbital a)
 Increase i'th component of given orbital angular momentum. More...
 
static GRID_HOST_DEVICE orbital down (const int i, const orbital a)
 Decrease i'th component of given orbital angular momentum. More...
 
static GRID_HOST_DEVICE int idx (const orbital a)
 Return coset index of given orbital angular momentum. More...
 

Macro Definition Documentation

◆ GRID_STRINGIFY

#define GRID_STRINGIFY (   SYMBOL)    #SYMBOL

Definition at line 10 of file grid_common.h.

◆ GRID_PRAGMA_SIMD

#define GRID_PRAGMA_SIMD (   OBJS,
 
)     _Pragma(GRID_STRINGIFY(omp simd linear OBJS simdlen(N)))

Definition at line 20 of file grid_common.h.

◆ GRID_PRAGMA_UNROLL

#define GRID_PRAGMA_UNROLL (   N)    _Pragma(GRID_STRINGIFY(unroll(N)))

Definition at line 34 of file grid_common.h.

◆ GRID_PRAGMA_UNROLL_UP_TO

#define GRID_PRAGMA_UNROLL_UP_TO (   N)    _Pragma("unroll")

Definition at line 35 of file grid_common.h.

◆ GRID_HOST_DEVICE

#define GRID_HOST_DEVICE

Definition at line 41 of file grid_common.h.

Function Documentation

◆ fac()

static GRID_HOST_DEVICE double fac ( const int  i)
inlinestatic

Factorial function, e.g. fac(5) = 5! = 120.

Author
Ole Schuett

Definition at line 48 of file grid_common.h.

◆ ncoset()

static GRID_HOST_DEVICE int ncoset ( const int  l)
inlinestatic

Number of Cartesian orbitals up to given angular momentum quantum.

Author
Ole Schuett

Definition at line 73 of file grid_common.h.

Here is the caller graph for this function:

◆ coset()

static GRID_HOST_DEVICE int coset ( int  lx,
int  ly,
int  lz 
)
inlinestatic

Maps three angular momentum components to a single zero based index.

Author
Ole Schuett

Definition at line 87 of file grid_common.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imin()

static GRID_HOST_DEVICE int imin ( int  x,
int  y 
)
inlinestatic

Returns the smaller of two given integer (missing from the C standard)

Author
Ole Schuett

Definition at line 100 of file grid_common.h.

◆ imax()

static GRID_HOST_DEVICE int imax ( int  x,
int  y 
)
inlinestatic

Returns the larger of two given integer (missing from the C standard)

Author
Ole Schuett

Definition at line 108 of file grid_common.h.

Here is the caller graph for this function:

◆ modulo()

static GRID_HOST_DEVICE int modulo ( int  a,
int  m 
)
inlinestatic

Equivalent of Fortran's MODULO, which always return a positive number. https://gcc.gnu.org/onlinedocs/gfortran/MODULO.html.

Author
Ole Schuett

Definition at line 117 of file grid_common.h.

◆ up()

static GRID_HOST_DEVICE orbital up ( const int  i,
const orbital  a 
)
inlinestatic

Increase i'th component of given orbital angular momentum.

Author
Ole Schuett

Definition at line 133 of file grid_common.h.

Here is the caller graph for this function:

◆ down()

static GRID_HOST_DEVICE orbital down ( const int  i,
const orbital  a 
)
inlinestatic

Decrease i'th component of given orbital angular momentum.

Author
Ole Schuett

Definition at line 143 of file grid_common.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx()

static GRID_HOST_DEVICE int idx ( const orbital  a)
inlinestatic

Return coset index of given orbital angular momentum.

Author
Ole Schuett

Definition at line 153 of file grid_common.h.

Here is the call graph for this function:
Here is the caller graph for this function: