3#include "math/libfunc.h"
16#define IMAGE_TRI__(xr, yr, zr, l1, l2, l3, ra, rb, rc) \
18 real fx = REAL_FLOOR(0.5f + zr * ra.z + yr * ra.y + xr * ra.x); \
19 real fy = REAL_FLOOR(0.5f + zr * rb.z + yr * rb.y); \
20 real fz = REAL_FLOOR(0.5f + zr * rc.z); \
21 xr -= (fz * l1.z + fy * l1.y + fx * l1.x); \
22 yr -= (fz * l2.z + fy * l2.y); \
27#define IMAGE_MONO__(xr, yr, zr, l1, l2, l3, ra, rb, rc) \
29 real fx = REAL_FLOOR(0.5f + zr * ra.z + xr * ra.x); \
30 real fy = REAL_FLOOR(0.5f + yr * rb.y); \
31 real fz = REAL_FLOOR(0.5f + zr * rc.z); \
32 xr -= (fz * l1.z + fx * l1.x); \
38#define IMAGE_ORTHO__(xr, yr, zr, l1, l2, l3, ra, rb, rc) \
40 real fx = REAL_FLOOR(0.5f + xr * ra.x); \
41 real fy = REAL_FLOOR(0.5f + yr * rb.y); \
42 real fz = REAL_FLOOR(0.5f + zr * rc.z); \
49#define IMAGE_OCT__(xr, yr, zr, l1, l2, l3, ra, rb, rc) \
51 real fx = xr * ra.x; \
52 real fy = yr * ra.x; \
53 real fz = zr * ra.x; \
54 fx -= REAL_FLOOR(0.5f + fx); \
55 fy -= REAL_FLOOR(0.5f + fy); \
56 fz -= REAL_FLOOR(0.5f + fz); \
57 if (REAL_ABS(fx) + REAL_ABS(fy) + REAL_ABS(fz) > 0.75f) { \
58 fx -= REAL_SIGN(0.5f, fx); \
59 fy -= REAL_SIGN(0.5f, fy); \
60 fz -= REAL_SIGN(0.5f, fz); \
84 img(xr, yr, zr, l1, l2, l3, ra, rb, rc);
85 return xr * xr + yr * yr + zr * zr;
103 img(xr, yr, zr, l1, l2, l3, ra, rb, rc);
104 return xr * xr + yr * yr + zr * zr;
122 img(xr, yr, zr, l1, l2, l3, ra, rb, rc);
123 return xr * xr + yr * yr + zr * zr;
141 img(xr, yr, zr, l1, l2, l3, ra, rb, rc);
142 return xr * xr + yr * yr + zr * zr;
153 return xr * xr + yr * yr + zr * zr;
179 return xr * xr + yr * yr + zr * zr;
197 return xr * xr + yr * yr + zr * zr;
210# define image(x, y, z) imageGeneral(x, y, z, TINKER_IMAGE_ARGS)
218# define image2(x, y, z) image2General(x, y, z, TINKER_IMAGE_ARGS)
226# define imagen2(x, y, z) imagen2General(x, y, z, TINKER_IMAGE_ARGS)
static __device__ real img2(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:100
static __device__ real img2(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:138
static __device__ real img2(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:81
static __device__ real img2(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:119
static __device__ real img2(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, real3, real3, real3, real3, real3, real3)
Definition: image.h:150
#define SEQ_ROUTINE
Definition: acc/seqdef.h:7
Definition: acc/realndef.h:48
#define IMAGE_MONO__(xr, yr, zr, l1, l2, l3, ra, rb, rc)
Image displacement for the monoclinic PBC.
Definition: image.h:27
#define IMAGE_OCT__(xr, yr, zr, l1, l2, l3, ra, rb, rc)
Image displacement for the truncated octahedron PBC.
Definition: image.h:49
#define IMAGE_TRI__(xr, yr, zr, l1, l2, l3, ra, rb, rc)
Image displacement for the triclinic PBC.
Definition: image.h:16
BoxShape
Shapes of the periodic box.
Definition: box.h:11
#define IMAGE_ORTHO__(xr, yr, zr, l1, l2, l3, ra, rb, rc)
Image displacement for the orthogonal PBC.
Definition: image.h:38
@ OCT
truncated octahedron
#define restrict
Definition: macro.h:51
float real
Definition: precision.h:80
__device__ real image2General(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, BoxShape sh, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:175
__device__ real imagen2General(real &xr, real &yr, real &zr, BoxShape sh, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:183
__device__ void imageGeneral(real &__restrict__ xr, real &__restrict__ yr, real &__restrict__ zr, BoxShape sh, real3 l1, real3 l2, real3 l3, real3 ra, real3 rb, real3 rc)
Definition: image.h:158