2#include "ff/amoeba/mpole.h"
3#include "ff/hippo/erepel.h"
4#include "math/libfunc.h"
21 int id = INT_ABS(k) - 1;
34 real c1 = ybd * zcd - zbd * ycd;
35 real c2 = ycd * zad - zcd * yad;
36 real c3 = yad * zbd - zad * ybd;
37 real vol = xad * c1 + xbd * c2 + xcd * c3;
41 if ((k < 0 && vol > 0) or (k > 0 && vol < 0)) {
58 real a1 = REAL_RSQRT(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]);
76 a[0] += (b[0] + c[0]);
77 a[1] += (b[1] + c[1]);
78 a[2] += (b[2] + c[2]);
94#pragma acc loop seq collapse(2)
96 for (
int i = 1; i < 4; ++i)
97 for (
int j = 1; j < 4; ++j)
98 rpole[isite][i] +=
pole[isite][j] * a[j - 1][i - 1];
101 real rp[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
115 for (
int i = 0; i < 3; ++i) {
119 for (
int j = 0; j <= i; ++j) {
124#pragma acc loop seq collapse(2)
126 for (
int k = 0; k < 3; ++k)
127 for (
int m = 0; m < 3; ++m)
128 rp[j][i] += a[k][i] * a[m][j] * mp[m][k];
153 int iy = INT_ABS(
zaxis[i].yaxis) - 1;
156 real a[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
175 int okay = !(REAL_ABS(zz[0]) > 0.866f);
176 xx[0] = (okay ? 1 : 0);
177 xx[1] = (okay ? 0 : 1);
210 real dotxz = xx[0] * zz[0] + xx[1] * zz[1] + xx[2] * zz[2];
211 xx[0] -= dotxz * zz[0];
212 xx[1] -= dotxz * zz[1];
213 xx[2] -= dotxz * zz[2];
217 a[1][0] = a[0][2] * a[2][1] - a[0][1] * a[2][2];
218 a[1][1] = a[0][0] * a[2][2] - a[0][2] * a[2][0];
219 a[1][2] = a[0][1] * a[2][0] - a[0][0] * a[2][1];
#define SEQ_ROUTINE
Definition: acc/seqdef.h:7
#define restrict
Definition: macro.h:51
real * z
Current coordinates used in energy evaluation and neighbor lists.
real * x
Number of the trajectory frames.
real * y
Current coordinates used in energy evaluation and neighbor lists.
float real
Definition: precision.h:80
@ MPL_PME_ZX
Definition: mpole.h:18
@ MPL_PME_XY
Definition: mpole.h:13
@ MPL_PME_Y
Definition: mpole.h:8
@ LFRM_NONE
Definition: mpole.h:21
@ MPL_PME_ZZ
Definition: mpole.h:12
@ LFRM_3_FOLD
Definition: mpole.h:26
@ LFRM_BISECTOR
Definition: mpole.h:24
@ MPL_PME_YX
Definition: mpole.h:17
@ MPL_PME_ZY
Definition: mpole.h:19
@ MPL_PME_YZ
Definition: mpole.h:15
@ LFRM_Z_THEN_X
Definition: mpole.h:23
@ LFRM_Z_BISECT
Definition: mpole.h:25
@ MPL_PME_XX
Definition: mpole.h:10
@ MPL_PME_XZ
Definition: mpole.h:14
@ MPL_PME_YY
Definition: mpole.h:11
@ LFRM_Z_ONLY
Definition: mpole.h:22
@ MPL_TOTAL
Definition: mpole.h:16
__device__ void rotpoleNorm(real *a)
Definition: rotpole.h:56
__device__ void rotsite(int isite, const real(*__restrict__ a)[3], real(*__restrict__ rpole)[10], const real(*__restrict__ pole)[10])
Definition: rotpole.h:82
__device__ void rotpoleAtomI(int i, real(*__restrict__ rpole)[MPL_TOTAL], const real(*__restrict__ pole)[MPL_TOTAL], const LocalFrame *__restrict__ zaxis, const real *__restrict__ x, const real *__restrict__ y, const real *__restrict__ z)
Definition: rotpole.h:143
__device__ void chkpoleAtomI(int i, real(*__restrict__ pole)[MPL_TOTAL], LocalFrame *zaxis, const real *__restrict__ x, const real *__restrict__ y, const real *__restrict__ z)
Definition: rotpole.h:9
__device__ void rotpoleAddBy2(real *__restrict__ a, const real *__restrict__ b, const real *__restrict__ c)
Definition: rotpole.h:73
__device__ void rotpoleAddBy(real *__restrict__ a, const real *__restrict__ b)
Definition: rotpole.h:65
Local axis type and x,y,z-axis defining atoms for each multipole site.
Definition: mpole.h:31
int xaxis
X-axis defining atom, starting from 0.
Definition: mpole.h:33
int zaxis
Z-axis defining atom, starting from 0.
Definition: mpole.h:32
int yaxis
Y-axis defining atom, starting from ONE.
Definition: mpole.h:34
int polaxe
Local frame definition.
Definition: mpole.h:35