Tinker9
70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
include
seq
epolartorque.h
1
#pragma once
2
#include "ff/amoeba/mpole.h"
3
#include "ff/precision.h"
4
5
namespace
tinker
{
6
__global__
7
static
void
epolarTorque_cu(
real
*
restrict
trqx
,
real
*
restrict
trqy
,
8
real
*
restrict
trqz
,
int
n
,
const
real
(*
restrict
rpole
)[10],
9
const
real
(*
restrict
ufld
)[3],
const
real
(*
restrict
dufld
)[6])
10
{
11
for
(
int
i = threadIdx.x + blockIdx.x * blockDim.x; i <
n
;
12
i += blockDim.x * gridDim.x) {
13
real
dix =
rpole
[i][
MPL_PME_X
];
14
real
diy =
rpole
[i][
MPL_PME_Y
];
15
real
diz =
rpole
[i][
MPL_PME_Z
];
16
real
qixx =
rpole
[i][
MPL_PME_XX
];
17
real
qixy =
rpole
[i][
MPL_PME_XY
];
18
real
qixz =
rpole
[i][
MPL_PME_XZ
];
19
real
qiyy =
rpole
[i][
MPL_PME_YY
];
20
real
qiyz =
rpole
[i][
MPL_PME_YZ
];
21
real
qizz =
rpole
[i][
MPL_PME_ZZ
];
22
23
real
tep1 = diz *
ufld
[i][1] - diy *
ufld
[i][2] + qixz *
dufld
[i][1]
24
- qixy *
dufld
[i][3] + 2 * qiyz * (
dufld
[i][2] -
dufld
[i][5])
25
+ (qizz - qiyy) *
dufld
[i][4];
26
real
tep2 = dix *
ufld
[i][2] - diz *
ufld
[i][0] - qiyz *
dufld
[i][1]
27
+ qixy *
dufld
[i][4] + 2 * qixz * (
dufld
[i][5] -
dufld
[i][0])
28
+ (qixx - qizz) *
dufld
[i][3];
29
real
tep3 = diy *
ufld
[i][0] - dix *
ufld
[i][1] + qiyz *
dufld
[i][3]
30
- qixz *
dufld
[i][4] + 2 * qixy * (
dufld
[i][0] -
dufld
[i][2])
31
+ (qiyy - qixx) *
dufld
[i][1];
32
33
trqx
[i] += tep1;
34
trqy
[i] += tep2;
35
trqz
[i] += tep3;
36
}
37
}
38
}
restrict
#define restrict
Definition:
macro.h:51
tinker::n
int n
Number of atoms padded by WARP_SIZE.
tinker::real
float real
Definition:
precision.h:80
tinker
Definition:
testrt.h:9
tinker::ufld
real(* ufld)[3]
tinker::MPL_PME_XY
@ MPL_PME_XY
Definition:
mpole.h:13
tinker::MPL_PME_Y
@ MPL_PME_Y
Definition:
mpole.h:8
tinker::MPL_PME_ZZ
@ MPL_PME_ZZ
Definition:
mpole.h:12
tinker::MPL_PME_YZ
@ MPL_PME_YZ
Definition:
mpole.h:15
tinker::MPL_PME_XX
@ MPL_PME_XX
Definition:
mpole.h:10
tinker::MPL_PME_XZ
@ MPL_PME_XZ
Definition:
mpole.h:14
tinker::MPL_PME_X
@ MPL_PME_X
Definition:
mpole.h:7
tinker::MPL_PME_YY
@ MPL_PME_YY
Definition:
mpole.h:11
tinker::MPL_PME_Z
@ MPL_PME_Z
Definition:
mpole.h:9
tinker::dufld
real(* dufld)[6]
tinker::rpole
real(* rpole)[MPL_TOTAL]
tinker::trqx
real * trqx
tinker::trqz
real * trqz
tinker::trqy
real * trqy
Generated by
1.9.5