HiRep 0.1
Loading...
Searching...
No Matches
geometry_indexing.h
Go to the documentation of this file.
1
6#ifndef GEOMETRY_INDEXING_H
7#define GEOMETRY_INDEXING_H
8
9#define _lexi(_T, _X, _Y, _Z, _t, _x, _y, _z) ((((_t) * (_X) + (_x)) * (_Y) + (_y)) * (_Z) + (_z))
10#define ipt_ext(t, x, y, z) ipt[_lexi(T_EXT, X_EXT, Y_EXT, Z_EXT, t, x, y, z)]
11#define ipt_ext_gpu(t, x, y, z) ipt_gpu[_lexi(T_EXT_GPU, X_EXT_GPU, Y_EXT_GPU, Z_EXT_GPU, t, x, y, z)]
12#define ipt(t, x, y, z) ipt_ext((t) + T_BORDER, (x) + X_BORDER, (y) + Y_BORDER, (z) + Z_BORDER)
13#define imask(ix) imask[ix]
14
15#define ipt_4d(t, x) ipt_4d[(t) * (VOL3) + (x)]
16#define iup(site, dir) iup[(site) * 4 + (dir)]
17#define idn(site, dir) idn[(site) * 4 + (dir)]
18
19#ifdef WITH_GPU
20#define _PTR(_field) (_field)->gpu_ptr
21#else
22#define _PTR(_field) (_field)->ptr
23#endif
24
25#endif