Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
470c9b7f
Commit
470c9b7f
authored
Jan 27, 2012
by
Mark Friedrichs
Browse files
Renamed math functions in Cuda kernels to single-precision equivalent [cos() -> cosf()]
parent
fed50628
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
148 additions
and
148 deletions
+148
-148
platforms/cuda/src/kernels/kMonteCarloBarostat.cu
platforms/cuda/src/kernels/kMonteCarloBarostat.cu
+3
-3
platforms/cuda/src/kernels/kRandom.cu
platforms/cuda/src/kernels/kRandom.cu
+6
-6
platforms/cuda/src/kernels/kSettle.cu
platforms/cuda/src/kernels/kSettle.cu
+9
-9
platforms/cuda/src/kernels/rng.cpp
platforms/cuda/src/kernels/rng.cpp
+6
-6
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaFixedEAndGkFields.cu
...cuda/src/kernels/kCalculateAmoebaCudaFixedEAndGkFields.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaGrycuk.cu
.../platforms/cuda/src/kernels/kCalculateAmoebaCudaGrycuk.cu
+5
-5
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
...latforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
...rms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
+3
-3
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff_b.h
...ms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff_b.h
+3
-3
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood_b.h
...atforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood_b.h
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaLocalForces.cu
...forms/cuda/src/kernels/kCalculateAmoebaCudaLocalForces.cu
+19
-19
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
...eba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
+5
-5
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
...src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
+21
-21
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticF2P.h
...c/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticF2P.h
+4
-4
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticT2.h
...rc/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticT2.h
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
...ms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
+6
-6
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
.../src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
+12
-12
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
.../platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
+6
-6
plugins/amoeba/platforms/cuda/src/kernels/kFindInteractingBlocksVdw.h
...ba/platforms/cuda/src/kernels/kFindInteractingBlocksVdw.h
+6
-6
plugins/freeEnergy/platforms/cuda/src/kernels/kCalculateCDLJObcGbsaSoftcoreForces1.h
...s/cuda/src/kernels/kCalculateCDLJObcGbsaSoftcoreForces1.h
+30
-30
No files found.
platforms/cuda/src/kernels/kMonteCarloBarostat.cu
View file @
470c9b7f
...
...
@@ -57,9 +57,9 @@ __global__ void kScaleAtomCoordinates_kernel(float scale, int numMolecules, floa
// Move it into the first periodic box.
int
xcell
=
(
int
)
floor
(
center
.
x
*
invPeriodicBoxSize
.
x
);
int
ycell
=
(
int
)
floor
(
center
.
y
*
invPeriodicBoxSize
.
y
);
int
zcell
=
(
int
)
floor
(
center
.
z
*
invPeriodicBoxSize
.
z
);
int
xcell
=
(
int
)
floor
f
(
center
.
x
*
invPeriodicBoxSize
.
x
);
int
ycell
=
(
int
)
floor
f
(
center
.
y
*
invPeriodicBoxSize
.
y
);
int
zcell
=
(
int
)
floor
f
(
center
.
z
*
invPeriodicBoxSize
.
z
);
float3
delta
=
make_float3
(
xcell
*
periodicBoxSize
.
x
,
ycell
*
periodicBoxSize
.
y
,
zcell
*
periodicBoxSize
.
z
);
center
.
x
-=
delta
.
x
;
center
.
y
-=
delta
.
y
;
...
...
platforms/cuda/src/kernels/kRandom.cu
View file @
470c9b7f
...
...
@@ -94,7 +94,7 @@ void kGenerateRandoms_kernel()
state
.
y
^=
state
.
y
<<
13
;
state
.
y
^=
state
.
y
>>
17
;
state
.
y
^=
state
.
y
<<
5
;
x1
=
sqrt
(
-
2.0
f
*
log
(
x1
));
x1
=
sqrt
f
(
-
2.0
f
*
log
f
(
x1
));
k
=
(
state
.
z
>>
2
)
+
(
state
.
w
>>
3
)
+
(
carry
>>
2
);
m
=
state
.
w
+
state
.
w
+
state
.
z
+
carry
;
state
.
z
=
state
.
w
;
...
...
@@ -106,7 +106,7 @@ void kGenerateRandoms_kernel()
state
.
y
^=
state
.
y
<<
13
;
state
.
y
^=
state
.
y
>>
17
;
state
.
y
^=
state
.
y
<<
5
;
sRand
[
pos1
].
x
=
x1
*
cos
(
2.0
f
*
3.14159265
f
*
x2
);
sRand
[
pos1
].
x
=
x1
*
cos
f
(
2.0
f
*
3.14159265
f
*
x2
);
k
=
(
state
.
z
>>
2
)
+
(
state
.
w
>>
3
)
+
(
carry
>>
2
);
m
=
state
.
w
+
state
.
w
+
state
.
z
+
carry
;
state
.
z
=
state
.
w
;
...
...
@@ -117,7 +117,7 @@ void kGenerateRandoms_kernel()
state
.
y
^=
state
.
y
<<
13
;
state
.
y
^=
state
.
y
>>
17
;
state
.
y
^=
state
.
y
<<
5
;
x3
=
sqrt
(
-
2.0
f
*
log
(
x3
));
x3
=
sqrt
f
(
-
2.0
f
*
log
f
(
x3
));
k
=
(
state
.
z
>>
2
)
+
(
state
.
w
>>
3
)
+
(
carry
>>
2
);
m
=
state
.
w
+
state
.
w
+
state
.
z
+
carry
;
state
.
z
=
state
.
w
;
...
...
@@ -129,7 +129,7 @@ void kGenerateRandoms_kernel()
state
.
y
^=
state
.
y
<<
13
;
state
.
y
^=
state
.
y
>>
17
;
state
.
y
^=
state
.
y
<<
5
;
sRand
[
pos1
].
y
=
x3
*
cos
(
2.0
f
*
3.14159265
f
*
x4
);
sRand
[
pos1
].
y
=
x3
*
cos
f
(
2.0
f
*
3.14159265
f
*
x4
);
k
=
(
state
.
z
>>
2
)
+
(
state
.
w
>>
3
)
+
(
carry
>>
2
);
m
=
state
.
w
+
state
.
w
+
state
.
z
+
carry
;
state
.
z
=
state
.
w
;
...
...
@@ -140,14 +140,14 @@ void kGenerateRandoms_kernel()
state
.
y
^=
state
.
y
<<
13
;
state
.
y
^=
state
.
y
>>
17
;
state
.
y
^=
state
.
y
<<
5
;
x5
=
sqrt
(
-
2.0
f
*
log
(
x5
));
x5
=
sqrt
f
(
-
2.0
f
*
log
f
(
x5
));
k
=
(
state
.
z
>>
2
)
+
(
state
.
w
>>
3
)
+
(
carry
>>
2
);
m
=
state
.
w
+
state
.
w
+
state
.
z
+
carry
;
state
.
z
=
state
.
w
;
state
.
w
=
m
;
carry
=
k
>>
30
;
float
x6
=
(
float
)(
state
.
x
+
state
.
y
+
state
.
w
)
/
(
float
)
0xffffffff
;
sRand
[
pos1
].
z
=
x5
*
cos
(
2.0
f
*
3.14159265
f
*
x6
);
sRand
[
pos1
].
z
=
x5
*
cos
f
(
2.0
f
*
3.14159265
f
*
x6
);
pos1
+=
blockDim
.
x
;
}
...
...
platforms/cuda/src/kernels/kSettle.cu
View file @
470c9b7f
...
...
@@ -131,9 +131,9 @@ void kApplySettle_kernel()
float
yaksYd
=
zaksZd
*
xaksXd
-
xaksZd
*
zaksXd
;
float
zaksYd
=
xaksZd
*
yaksXd
-
yaksZd
*
xaksXd
;
float
axlng
=
sqrt
(
xaksXd
*
xaksXd
+
yaksXd
*
yaksXd
+
zaksXd
*
zaksXd
);
float
aylng
=
sqrt
(
xaksYd
*
xaksYd
+
yaksYd
*
yaksYd
+
zaksYd
*
zaksYd
);
float
azlng
=
sqrt
(
xaksZd
*
xaksZd
+
yaksZd
*
yaksZd
+
zaksZd
*
zaksZd
);
float
axlng
=
sqrt
f
(
xaksXd
*
xaksXd
+
yaksXd
*
yaksXd
+
zaksXd
*
zaksXd
);
float
aylng
=
sqrt
f
(
xaksYd
*
xaksYd
+
yaksYd
*
yaksYd
+
zaksYd
*
zaksYd
);
float
azlng
=
sqrt
f
(
xaksZd
*
xaksZd
+
yaksZd
*
yaksZd
+
zaksZd
*
zaksZd
);
float
trns11
=
xaksXd
/
axlng
;
float
trns21
=
yaksXd
/
axlng
;
float
trns31
=
zaksXd
/
axlng
;
...
...
@@ -159,13 +159,13 @@ void kApplySettle_kernel()
// --- Step2 A2' ---
float
rc
=
0.5
f
*
params
.
y
;
float
rb
=
sqrt
(
params
.
x
*
params
.
x
-
rc
*
rc
);
float
rb
=
sqrt
f
(
params
.
x
*
params
.
x
-
rc
*
rc
);
float
ra
=
rb
*
(
m1
+
m2
)
/
totalMass
;
rb
-=
ra
;
float
sinphi
=
za1d
/
ra
;
float
cosphi
=
sqrt
(
1.0
f
-
sinphi
*
sinphi
);
float
cosphi
=
sqrt
f
(
1.0
f
-
sinphi
*
sinphi
);
float
sinpsi
=
(
zb1d
-
zc1d
)
/
(
2
*
rc
*
cosphi
);
float
cospsi
=
sqrt
(
1.0
f
-
sinpsi
*
sinpsi
);
float
cospsi
=
sqrt
f
(
1.0
f
-
sinpsi
*
sinpsi
);
float
ya2d
=
ra
*
cosphi
;
float
xb2d
=
-
rc
*
cospsi
;
...
...
@@ -173,7 +173,7 @@ void kApplySettle_kernel()
float
yc2d
=
-
rb
*
cosphi
+
rc
*
sinpsi
*
sinphi
;
float
xb2d2
=
xb2d
*
xb2d
;
float
hh2
=
4.0
f
*
xb2d2
+
(
yb2d
-
yc2d
)
*
(
yb2d
-
yc2d
)
+
(
zb1d
-
zc1d
)
*
(
zb1d
-
zc1d
);
float
deltx
=
2.0
f
*
xb2d
+
sqrt
(
4.0
f
*
xb2d2
-
hh2
+
params
.
y
*
params
.
y
);
float
deltx
=
2.0
f
*
xb2d
+
sqrt
f
(
4.0
f
*
xb2d2
-
hh2
+
params
.
y
*
params
.
y
);
xb2d
-=
deltx
*
0.5
f
;
// --- Step3 al,be,ga ---
...
...
@@ -183,11 +183,11 @@ void kApplySettle_kernel()
float
gama
=
xb0d
*
yb1d
-
xb1d
*
yb0d
+
xc0d
*
yc1d
-
xc1d
*
yc0d
;
float
al2be2
=
alpa
*
alpa
+
beta
*
beta
;
float
sinthe
=
(
alpa
*
gama
-
beta
*
sqrt
(
al2be2
-
gama
*
gama
)
)
/
al2be2
;
float
sinthe
=
(
alpa
*
gama
-
beta
*
sqrt
f
(
al2be2
-
gama
*
gama
)
)
/
al2be2
;
// --- Step4 A3' ---
float
costhe
=
sqrt
(
1.0
f
-
sinthe
*
sinthe
);
float
costhe
=
sqrt
f
(
1.0
f
-
sinthe
*
sinthe
);
float
xa3d
=
-
ya2d
*
sinthe
;
float
ya3d
=
ya2d
*
costhe
;
float
za3d
=
za1d
;
...
...
platforms/cuda/src/kernels/rng.cpp
View file @
470c9b7f
...
...
@@ -96,7 +96,7 @@ void RNG::zigset()
wn
[
0
]
=
q
/
m1
;
wn
[
127
]
=
tn
/
m1
;
fn
[
0
]
=
1.
;
fn
[
127
]
=
exp
(
-
.5
*
tn
*
tn
);
for
(
uint
i
=
126
;
i
>
0
;
i
--
)
{
const
double
dn
=
sqrt
(
-
2
*
log
(
vn
/
tn
+
exp
(
-
.5
*
tn
*
tn
)));
const
double
dn
=
sqrt
f
(
-
2
*
log
(
vn
/
tn
+
exp
(
-
.5
*
tn
*
tn
)));
kn
[
i
+
1
]
=
ULONG32
((
dn
/
tn
)
*
m1
);
fn
[
i
]
=
exp
(
-
.5
*
dn
*
dn
);
wn
[
i
]
=
dn
/
m1
;
...
...
@@ -130,7 +130,7 @@ double RNG::gamma(double shape, double scale)
return
gamma
(
shape
+
1.
,
scale
)
*
pow
(
rand_open01
(),
1.0
/
shape
);
const
double
d
=
shape
-
1.
/
3.
;
const
double
c
=
1.
/
sqrt
(
9.
*
d
);
const
double
c
=
1.
/
sqrt
f
(
9.
*
d
);
double
x
,
v
;
for
(;;)
{
do
{
...
...
@@ -186,7 +186,7 @@ int RNG::poisson(double mu)
if
(
big_mu
)
{
new_big_mu
=
1
;
muprev
=
mu
;
s
=
sqrt
(
mu
);
s
=
sqrt
f
(
mu
);
d
=
6.
*
mu
*
mu
;
big_l
=
floor
(
mu
-
1.1484
);
}
...
...
@@ -240,7 +240,7 @@ int RNG::poisson(double mu)
if
(
new_big_mu
||
mu
!=
muprev2
)
{
muprev2
=
mu
;
omega
=
1.0
/
(
sqrt
(
2.0
*
PI
)
*
s
);
omega
=
1.0
/
(
sqrt
f
(
2.0
*
PI
)
*
s
);
b1
=
one_24
/
mu
;
b2
=
0.3
*
b1
*
b1
;
c3
=
one_7
*
b1
*
b2
;
...
...
@@ -280,7 +280,7 @@ Step_F:
-
del
;
else
px
=
fk
*
log
(
1.
+
v
)
-
difmuk
-
del
;
py
=
1.0
/
(
sqrt
(
2.0
*
PI
)
*
sqrt
(
fk
));
py
=
1.0
/
(
sqrt
f
(
2.0
*
PI
)
*
sqrt
f
(
fk
));
}
x
=
(
0.5
-
difmuk
)
/
s
;
x
*=
x
;
/* x^2 */
...
...
@@ -332,7 +332,7 @@ int RNG::binomial(double pp, int n)
m
=
(
int
)
ffm
;
fm
=
m
;
npq
=
np
*
q
;
p1
=
(
int
)(
2.195
*
sqrt
(
npq
)
-
4.6
*
q
)
+
0.5
;
p1
=
(
int
)(
2.195
*
sqrt
f
(
npq
)
-
4.6
*
q
)
+
0.5
;
xm
=
fm
+
0.5
;
xl
=
xm
-
p1
;
xr
=
xm
+
p1
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaFixedEAndGkFields.cu
View file @
470c9b7f
...
...
@@ -156,7 +156,7 @@ __device__ void calculateFixedGkFieldPairIxn_kernel( float4 atomCoordinatesI,
qyzk
=
labFrameQuadrupoleJ
[
5
];
qzzk
=
labFrameQuadrupoleJ
[
8
];
expterm
=
exp
(
-
r2
/
(
gkc
*
rb2
));
expterm
=
exp
f
(
-
r2
/
(
gkc
*
rb2
));
expc
=
expterm
/
gkc
;
dexpc
=
-
2.0
f
/
(
gkc
*
rb2
);
gf2
=
1.0
f
/
(
r2
+
rb2
*
expterm
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaGrycuk.cu
View file @
470c9b7f
...
...
@@ -105,7 +105,7 @@ __device__ void calculateGrycukBornRadiiPairIxn_kernel( GrycukParticle& atomI, G
zr
=
atomJ
.
z
-
atomI
.
z
;
r2
=
xr
*
xr
+
yr
*
yr
+
zr
*
zr
;
r
=
sqrt
(
r2
);
r
=
sqrt
f
(
r2
);
sk
=
atomJ
.
scaledRadius
;
sk2
=
sk
*
sk
;
...
...
@@ -170,7 +170,7 @@ void kReduceGrycukGbsaBornSum_kernel()
float
radius
=
cSim
.
pObcData
[
pos
].
x
;
radius
=
1.0
f
/
(
radius
*
radius
*
radius
);
sum
=
radius
-
sum
;
sum
=
sum
<=
0.0
f
?
1000.0
f
:
pow
(
sum
,
-
1.0
f
/
3.0
f
);
sum
=
sum
<=
0.0
f
?
1000.0
f
:
pow
f
(
sum
,
-
1.0
f
/
3.0
f
);
cSim
.
pBornRadii
[
pos
]
=
sum
;
pos
+=
gridDim
.
x
*
blockDim
.
x
;
...
...
@@ -305,9 +305,9 @@ __device__ void calculateGrycukChainRulePairIxn_kernel( GrycukChainRuleParticle&
float
lik
,
uik
;
float
lik4
,
uik4
;
float
factor
=
-
pow
(
pi
,
third
)
*
pow
(
6.0
f
,(
2.0
f
*
third
))
/
9.0
f
;
float
factor
=
-
pow
f
(
pi
,
third
)
*
pow
f
(
6.0
f
,(
2.0
f
*
third
))
/
9.0
f
;
float
term
=
pi43
/
(
atomI
.
bornRadius
*
atomI
.
bornRadius
*
atomI
.
bornRadius
);
term
=
factor
/
pow
(
term
,
(
4.0
f
*
third
)
);
term
=
factor
/
pow
f
(
term
,
(
4.0
f
*
third
)
);
float
xr
=
atomJ
.
x
-
atomI
.
x
;
float
yr
=
atomJ
.
y
-
atomI
.
y
;
...
...
@@ -316,7 +316,7 @@ __device__ void calculateGrycukChainRulePairIxn_kernel( GrycukChainRuleParticle&
float
sk
=
atomJ
.
scaledRadius
;
float
sk2
=
sk
*
sk
;
float
r2
=
xr
*
xr
+
yr
*
yr
+
zr
*
zr
;
float
r
=
sqrt
(
r2
);
float
r
=
sqrt
f
(
r2
);
float
de
=
0.0
f
;
if
(
(
atomI
.
radius
+
r
)
<
sk
){
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
View file @
470c9b7f
...
...
@@ -172,7 +172,7 @@ __device__ void calculateKirkwoodPairIxnOrig_kernel( KirkwoodParticle& atomI,
dexpcr
=
2.0
f
/
(
cAmoebaSim
.
gkc
*
rb2
*
rb2
);
dgfdr
=
0.5
f
*
expterm
*
(
1.0
f
+
r2
/
(
rb2
*
cAmoebaSim
.
gkc
));
gf2
=
1.0
f
/
(
r2
+
rb2
*
expterm
);
gf
=
sqrt
(
gf2
);
gf
=
sqrt
f
(
gf2
);
gf3
=
gf2
*
gf
;
gf5
=
gf3
*
gf2
;
gf7
=
gf5
*
gf2
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
View file @
470c9b7f
...
...
@@ -186,9 +186,9 @@ __device__ void calculateKirkwoodEDiffPairIxnOrig_kernel( KirkwoodEDiffParticle&
scale7
=
1.0
f
-
(
1.0
f
-
damp
+
0.6
f
*
damp2
)
*
dampE
;
//scale9 = 1.0f - (1.0f - damp + (18.0f*damp2 - (9.0f*damp*damp2))/35.0f)*dampE;
ddsc3_1
=
-
3.0
f
*
damp
*
exp
(
damp
)
*
xr
/
r2
;
ddsc3_2
=
-
3.0
f
*
damp
*
exp
(
damp
)
*
yr
/
r2
;
ddsc3_3
=
-
3.0
f
*
damp
*
exp
(
damp
)
*
zr
/
r2
;
ddsc3_1
=
-
3.0
f
*
damp
*
exp
f
(
damp
)
*
xr
/
r2
;
ddsc3_2
=
-
3.0
f
*
damp
*
exp
f
(
damp
)
*
yr
/
r2
;
ddsc3_3
=
-
3.0
f
*
damp
*
exp
f
(
damp
)
*
zr
/
r2
;
ddsc5_1
=
-
damp
*
ddsc3_1
;
ddsc5_2
=
-
damp
*
ddsc3_2
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff_b.h
View file @
470c9b7f
...
...
@@ -69,9 +69,9 @@ __device__ void SUB_METHOD_NAME( calculateKirkwoodEDiffPairIxn, _kernel)( Kirkwo
scale7
=
1
.
0
f
-
(
1
.
0
f
-
damp
+
0
.
6
f
*
damp2
)
*
dampE
;
#ifdef F1
ddsc3_1
=
-
3
.
0
f
*
damp
*
exp
(
damp
)
*
xr
*
rr2
*
rr3
;
ddsc3_2
=
-
3
.
0
f
*
damp
*
exp
(
damp
)
*
yr
*
rr2
*
rr3
;
ddsc3_3
=
-
3
.
0
f
*
damp
*
exp
(
damp
)
*
zr
*
rr2
*
rr3
;
ddsc3_1
=
-
3
.
0
f
*
damp
*
exp
f
(
damp
)
*
xr
*
rr2
*
rr3
;
ddsc3_2
=
-
3
.
0
f
*
damp
*
exp
f
(
damp
)
*
yr
*
rr2
*
rr3
;
ddsc3_3
=
-
3
.
0
f
*
damp
*
exp
f
(
damp
)
*
zr
*
rr2
*
rr3
;
ddsc5_1
=
-
3
.
0
f
*
damp
*
ddsc3_1
*
rr2
;
ddsc5_2
=
-
3
.
0
f
*
damp
*
ddsc3_2
*
rr2
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood_b.h
View file @
470c9b7f
...
...
@@ -51,7 +51,7 @@ static __device__ void SUB_METHOD_NAME( calculateKirkwoodPairIxn, _kernel)( Kirk
float
dgfdr
=
0
.
5
f
*
expterm
*
(
1
.
0
f
+
r2
/
(
rb2
*
cAmoebaSim
.
gkc
));
float
gf2
=
1
.
0
f
/
(
r2
+
rb2
*
expterm
);
float
gf
=
sqrt
(
gf2
);
float
gf
=
sqrt
f
(
gf2
);
float
gf3
=
gf2
*
gf
;
float
gf5
=
gf3
*
gf2
;
float
gf7
=
gf5
*
gf2
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaLocalForces.cu
View file @
470c9b7f
...
...
@@ -320,7 +320,7 @@ void kCalculateAmoebaLocalForces_kernel()
float
dy
=
atomB
.
y
-
atomA
.
y
;
float
dz
=
atomB
.
z
-
atomA
.
z
;
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
r
=
sqrt
(
r2
);
float
r
=
sqrt
f
(
r2
);
float
deltaIdeal
=
r
-
bond
.
x
;
#if defined OLD
energy
+=
0.5
f
*
bond
.
y
*
deltaIdeal
*
deltaIdeal
;
...
...
@@ -382,16 +382,16 @@ void kCalculateAmoebaLocalForces_kernel()
float3
cp
;
CROSS_PRODUCT
(
v0
,
v1
,
cp
);
float
rp
=
DOT3
(
cp
,
cp
);
//cx * cx + cy * cy + cz * cz;
rp
=
max
(
sqrt
(
rp
),
1.0e-06
f
);
rp
=
max
(
sqrt
f
(
rp
),
1.0e-06
f
);
float
r21
=
DOT3
(
v0
,
v0
);
// dx1 * dx1 + dy1 * dy1 + dz1 * dz1;
float
r23
=
DOT3
(
v1
,
v1
);
// dx2 * dx2 + dy2 * dy2 + dz2 * dz2;
float
dot
=
DOT3
(
v0
,
v1
);
// dx1 * dx2 + dy1 * dy2 + dz1 * dz2;
float
cosine
=
dot
/
sqrt
(
r21
*
r23
);
float
cosine
=
dot
/
sqrt
f
(
r21
*
r23
);
// e = angunit * force * dt2 * (1.0d0+cang*dt+qang*dt2+pang*dt3+sang*dt4)
// deddt = angunit * force * dt * radian * (2.0d0 + 3.0d0*cang*dt + 4.0d0*qang*dt2 + 5.0d0*pang*dt3 + 6.0d0*sang*dt4)
float
angle
=
acos
(
cosine
);
float
angle
=
acos
f
(
cosine
);
float
deltaIdeal
=
angle
*
(
180.0
f
/
LOCAL_HACK_PI
)
-
bond_angle1
.
x
;
float
deltaIdeal2
=
deltaIdeal
*
deltaIdeal
;
float
deltaIdeal3
=
deltaIdeal
*
deltaIdeal2
;
...
...
@@ -507,7 +507,7 @@ void kCalculateAmoebaLocalForces_kernel()
float
cosine
=
product
>
0.0
f
?
(
dot
/
product
)
:
0.0
f
;
cosine
=
cosine
>
1.0
f
?
1.0
f
:
cosine
;
cosine
=
cosine
<
-
1.0
f
?
-
1.0
f
:
cosine
;
float
angle
=
acos
(
cosine
);
float
angle
=
acos
f
(
cosine
);
// if product == 0, set force/energy to 0
...
...
@@ -670,19 +670,19 @@ void kCalculateAmoebaLocalForces_kernel()
float
v1
=
torsionParam1
.
x
;
float
angle
=
torsionParam1
.
y
;
float
c1
=
cos
(
angle
);
float
s1
=
sin
(
angle
);
float
c1
=
cos
f
(
angle
);
float
s1
=
sin
f
(
angle
);
float
v2
=
torsionParam1
.
z
;
angle
=
torsionParam1
.
w
;
float
c2
=
cos
(
angle
);
float
s2
=
sin
(
angle
);
float
c2
=
cos
f
(
angle
);
float
s2
=
sin
f
(
angle
);
float
v3
=
torsionParam2
.
x
;
angle
=
torsionParam2
.
y
;
float
c3
=
cos
(
angle
);
float
s3
=
sin
(
angle
);
float
c3
=
cos
f
(
angle
);
float
s3
=
sin
f
(
angle
);
// compute the multiple angle trigonometry and the phase terms
...
...
@@ -857,7 +857,7 @@ void kCalculateAmoebaLocalForces_kernel()
float
ru2
=
xu
*
xu
+
yu
*
yu
+
zu
*
zu
;
float
rtru
=
sqrtf
(
rt2
*
ru2
);
float
rdc
=
sqrt
(
xdc
*
xdc
+
ydc
*
ydc
+
zdc
*
zdc
);
float
rdc
=
sqrt
f
(
xdc
*
xdc
+
ydc
*
ydc
+
zdc
*
zdc
);
float
cosine
=
rtru
>
0.0
f
?
(
xt
*
xu
+
yt
*
yu
+
zt
*
zu
)
/
rtru
:
0.0
f
;
float
sine
=
(
rtru
*
rdc
)
>
0.0
f
?
(
xdc
*
xtu
+
ydc
*
ytu
+
zdc
*
ztu
)
/
(
rdc
*
rtru
)
:
0.0
f
;
...
...
@@ -1020,13 +1020,13 @@ void kCalculateAmoebaLocalForces_kernel()
float
yp
=
zcb
*
xab
-
xcb
*
zab
;
float
zp
=
xcb
*
yab
-
ycb
*
xab
;
float
rp
=
sqrt
(
xp
*
xp
+
yp
*
yp
+
zp
*
zp
);
float
rp
=
sqrt
f
(
xp
*
xp
+
yp
*
yp
+
zp
*
zp
);
float
dot
=
xab
*
xcb
+
yab
*
ycb
+
zab
*
zcb
;
float
cosine
=
rab
*
rcb
>
0.0
f
?
(
dot
/
(
rab
*
rcb
))
:
1.0
f
;
cosine
=
cosine
>
1.0
f
?
1.0
f
:
cosine
;
cosine
=
cosine
<
-
1.0
f
?
-
1.0
f
:
cosine
;
float
angle
=
acos
(
cosine
);
float
angle
=
acos
f
(
cosine
);
// find chain rule terms for the bond angle deviation
...
...
@@ -1158,9 +1158,9 @@ void kCalculateAmoebaLocalForces_kernel()
float
adXcd_nrm2
=
adXcd_0
*
adXcd_0
+
adXcd_1
*
adXcd_1
+
adXcd_2
*
adXcd_2
;
float
adXcd_dot_db
=
xdb
*
adXcd_0
+
ydb
*
adXcd_1
+
zdb
*
adXcd_2
;
adXcd_dot_db
/=
sqrt
(
rdb2
*
adXcd_nrm2
);
adXcd_dot_db
/=
sqrt
f
(
rdb2
*
adXcd_nrm2
);
float
angle
=
abs
(
asin
(
adXcd_dot_db
)
);
float
angle
=
abs
(
asin
f
(
adXcd_dot_db
)
);
// find the out-of-plane energy and master chain rule terms
...
...
@@ -1327,7 +1327,7 @@ void kCalculateAmoebaLocalForces_kernel()
cosine1
=
cosine1
>
1.0
f
?
1.0
f
:
cosine1
;
cosine1
=
cosine1
<
-
1.0
f
?
-
1.0
f
:
cosine1
;
float
angle1
=
LOCAL_HACK_RADIAN
*
acos
(
cosine1
);
float
angle1
=
LOCAL_HACK_RADIAN
*
acos
f
(
cosine1
);
float
sign
=
xba
*
xu
+
yba
*
yu
+
zba
*
zu
;
angle1
=
sign
<
0.0
f
?
-
angle1
:
angle1
;
float
value1
=
angle1
;
...
...
@@ -1336,7 +1336,7 @@ void kCalculateAmoebaLocalForces_kernel()
float
cosine2
=
(
xu
*
xv
+
yu
*
yv
+
zu
*
zv
)
/
rurv
;
cosine2
=
cosine2
>
1.0
f
?
1.0
f
:
cosine2
;
cosine2
=
cosine2
<
-
1.0
f
?
-
1.0
f
:
cosine2
;
float
angle2
=
LOCAL_HACK_RADIAN
*
acos
(
cosine2
);
float
angle2
=
LOCAL_HACK_RADIAN
*
acos
f
(
cosine2
);
sign
=
xcb
*
xv
+
ycb
*
yv
+
zcb
*
zv
;
angle2
=
sign
<
0.0
f
?
-
angle2
:
angle2
;
...
...
@@ -1577,7 +1577,7 @@ void kCalculateAmoebaLocalForces_kernel()
float
dz
=
atomB
.
z
-
atomA
.
z
;
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
r
=
sqrt
(
r2
);
float
r
=
sqrt
f
(
r2
);
float
deltaIdeal
=
r
-
bond
.
x
;
float
deltaIdeal2
=
deltaIdeal
*
deltaIdeal
;
energy
+=
bond
.
y
*
deltaIdeal2
*
(
1.0
f
+
cAmoebaSim
.
amoebaUreyBradleyCubicParameter
*
deltaIdeal
+
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPME.cu
View file @
470c9b7f
...
...
@@ -137,9 +137,9 @@ void kComputeAmoebaBsplines_kernel()
for
(
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
i
<
cSim
.
atoms
;
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
float4
posq
=
cSim
.
pPosq
[
i
];
posq
.
x
-=
floor
(
posq
.
x
*
cSim
.
invPeriodicBoxSizeX
)
*
cSim
.
periodicBoxSizeX
;
posq
.
y
-=
floor
(
posq
.
y
*
cSim
.
invPeriodicBoxSizeY
)
*
cSim
.
periodicBoxSizeY
;
posq
.
z
-=
floor
(
posq
.
z
*
cSim
.
invPeriodicBoxSizeZ
)
*
cSim
.
periodicBoxSizeZ
;
posq
.
x
-=
floor
f
(
posq
.
x
*
cSim
.
invPeriodicBoxSizeX
)
*
cSim
.
periodicBoxSizeX
;
posq
.
y
-=
floor
f
(
posq
.
y
*
cSim
.
invPeriodicBoxSizeY
)
*
cSim
.
periodicBoxSizeY
;
posq
.
z
-=
floor
f
(
posq
.
z
*
cSim
.
invPeriodicBoxSizeZ
)
*
cSim
.
periodicBoxSizeZ
;
// First axis.
...
...
@@ -210,7 +210,7 @@ void kFindAmoebaAtomRangeForGrid_kernel()
// some work in the charge spreading kernel.
float
posz
=
cSim
.
pPosq
[
atomData
.
x
].
z
;
posz
-=
floor
(
posz
*
cSim
.
invPeriodicBoxSizeZ
)
*
cSim
.
periodicBoxSizeZ
;
posz
-=
floor
f
(
posz
*
cSim
.
invPeriodicBoxSizeZ
)
*
cSim
.
periodicBoxSizeZ
;
float
w
=
posz
*
cSim
.
invPeriodicBoxSizeZ
;
float
fr
=
cSim
.
pmeGridSize
.
z
*
(
w
-
(
int
)(
w
+
0.5
f
)
+
0.5
f
);
int
z
=
((
int
)
fr
)
-
AMOEBA_PME_ORDER
+
1
;
...
...
@@ -449,7 +449,7 @@ void kAmoebaReciprocalConvolution_kernel()
cuComplex
grid
=
cSim
.
pPmeGrid
[
index
];
float
m2
=
mhx
*
mhx
+
mhy
*
mhy
+
mhz
*
mhz
;
float
denom
=
m2
*
bx
*
by
*
bz
;
float
eterm
=
scaleFactor
*
exp
(
-
expFactor
*
m2
)
/
denom
;
float
eterm
=
scaleFactor
*
exp
f
(
-
expFactor
*
m2
)
/
denom
;
cSim
.
pPmeGrid
[
index
]
=
make_cuComplex
(
grid
.
x
*
eterm
,
grid
.
y
*
eterm
);
}
}
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostatic.cu
View file @
470c9b7f
...
...
@@ -192,10 +192,10 @@ __device__ void calculateBn_kernel( float r, float4* bn, float* bn0, float *bn5
if
(
cSim
.
alphaEwald
>
0.0
f
){
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
}
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
float
rr1
=
1.0
f
/
r
;
*
bn0
=
erfc
(
ralpha
)
*
rr1
;
*
bn0
=
erfc
f
(
ralpha
)
*
rr1
;
float
rr2
=
rr1
*
rr1
;
alsq2n
*=
alsq2
;
...
...
@@ -241,14 +241,14 @@ __device__ void calculatePmeDirectElectrostaticPairIxnOrig_kernel( const PmeDire
// periodic box
xr
-=
floor
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
xr
-=
floor
f
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
f
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
f
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
float
r2
=
xr
*
xr
+
yr
*
yr
+
zr
*
zr
;
if
(
r2
<=
cSim
.
nonbondedCutoffSqr
){
float
r
=
sqrt
(
r2
);
float
r
=
sqrt
f
(
r2
);
float
ck
=
atomJ
.
q
;
// set the permanent multipole and induced dipole values;
...
...
@@ -282,14 +282,14 @@ __device__ void calculatePmeDirectElectrostaticPairIxnOrig_kernel( const PmeDire
// calculate the real space error function terms
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
bn0
=
erfc
(
ralpha
)
/
r
;
float
bn0
=
erfc
f
(
ralpha
)
/
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
float
alsq2n
=
0.0
f
;
if
(
cSim
.
alphaEwald
>
0.0
f
){
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
}
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
alsq2n
*=
alsq2
;
float
bn1
=
(
bn0
+
alsq2n
*
exp2a
)
/
r2
;
...
...
@@ -336,7 +336,7 @@ __device__ void calculatePmeDirectElectrostaticPairIxnOrig_kernel( const PmeDire
float
ratio
=
r
/
damp
;
damp
=
-
pgamma
*
ratio
*
ratio
*
ratio
;
if
(
damp
>
-
50.0
f
){
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
scale3
=
1.0
f
-
expdamp
;
scale5
=
1.0
f
-
(
1.0
f
-
damp
)
*
expdamp
;
scale7
=
1.0
f
-
(
1.0
f
-
damp
+
0.6
f
*
damp
*
damp
)
*
expdamp
;
...
...
@@ -957,16 +957,16 @@ __device__ void calculatePmeDirectElectrostaticPairIxn_kernel( PmeDirectElectros
// periodic box
delta
.
x
-=
floor
(
delta
.
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
.
y
-=
floor
(
delta
.
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
.
z
-=
floor
(
delta
.
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
delta
.
x
-=
floor
f
(
delta
.
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
.
y
-=
floor
f
(
delta
.
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
.
z
-=
floor
f
(
delta
.
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
delta
.
w
=
delta
.
x
*
delta
.
x
+
delta
.
y
*
delta
.
y
+
delta
.
z
*
delta
.
z
;
if
(
delta
.
w
>
cSim
.
nonbondedCutoffSqr
){
return
;
}
float
r
=
sqrt
(
delta
.
w
);
float
r
=
sqrt
f
(
delta
.
w
);
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
...
...
@@ -974,11 +974,11 @@ __device__ void calculatePmeDirectElectrostaticPairIxn_kernel( PmeDirectElectros
if
(
cSim
.
alphaEwald
>
0.0
f
){
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
}
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
float
rr1
=
1.0
f
/
r
;
delta
.
w
=
rr1
;
float
bn0
=
erfc
(
ralpha
)
*
rr1
;
float
bn0
=
erfc
f
(
ralpha
)
*
rr1
;
*
energy
+=
forceFactor
*
atomI
.
q
*
atomJ
.
q
*
bn0
;
float
rr2
=
rr1
*
rr1
;
alsq2n
*=
alsq2
;
...
...
@@ -1058,16 +1058,16 @@ __device__ void calculatePmeDirectElectrostaticPairIxnOrigg_kernel( PmeDirectEle
// periodic box
delta
.
x
-=
floor
(
delta
.
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
.
y
-=
floor
(
delta
.
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
.
z
-=
floor
(
delta
.
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
delta
.
x
-=
floor
f
(
delta
.
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
.
y
-=
floor
f
(
delta
.
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
.
z
-=
floor
f
(
delta
.
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
delta
.
w
=
delta
.
x
*
delta
.
x
+
delta
.
y
*
delta
.
y
+
delta
.
z
*
delta
.
z
;
if
(
delta
.
w
>
cSim
.
nonbondedCutoffSqr
){
return
;
}
float
r
=
sqrt
(
delta
.
w
);
float
r
=
sqrt
f
(
delta
.
w
);
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
...
...
@@ -1075,11 +1075,11 @@ __device__ void calculatePmeDirectElectrostaticPairIxnOrigg_kernel( PmeDirectEle
if
(
cSim
.
alphaEwald
>
0.0
f
){
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
}
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
float
rr1
=
1.0
f
/
r
;
delta
.
w
=
rr1
;
float
bn0
=
erfc
(
ralpha
)
*
rr1
;
float
bn0
=
erfc
f
(
ralpha
)
*
rr1
;
*
energy
+=
forceFactor
*
atomI
.
q
*
atomJ
.
q
*
bn0
;
float
rr2
=
rr1
*
rr1
;
alsq2n
*=
alsq2
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticF2P.h
View file @
470c9b7f
...
...
@@ -41,7 +41,7 @@ static __device__ void SUB_METHOD_NAME( calculatePmeDirectElectrostaticPairIxnF2
damp
=
damp
<
-
50
.
0
f
?
0
.
0
f
:
damp
;
}
float
scale5
=
(
damp
==
0
.
0
f
)
?
1
.
0
f
:
(
1
.
0
f
-
(
1
.
0
f
-
damp
)
*
exp
(
damp
));
float
scale5
=
(
damp
==
0
.
0
f
)
?
1
.
0
f
:
(
1
.
0
f
-
(
1
.
0
f
-
damp
)
*
exp
f
(
damp
));
float
rr5
=
rr1
*
rr1
;
rr5
=
3
.
0
f
*
rr1
*
rr5
*
rr5
;
#ifdef APPLY_SCALE
...
...
@@ -79,7 +79,7 @@ static __device__ void SUB_METHOD_NAME( calculatePmeDirectElectrostaticPairIxnF2
ftm23
+=
(
qiuk3
+
qiukp3
)
*
psc5
;
#endif
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
float
scale3
=
(
damp
==
0
.
0
f
)
?
1
.
0
f
:
(
1
.
0
f
-
expdamp
);
float
rr3
=
rr1
*
rr1
*
rr1
;
...
...
@@ -190,7 +190,7 @@ static __device__ void SUB_METHOD_NAME( calculatePmeDirectElectrostaticPairIxnF2
if
(
damp
!=
0
.
0
f
){
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
float
temp3
=
-
1
.
5
f
*
damp
*
expdamp
*
rr1
*
rr1
;
float
temp5
=
-
damp
;
float
temp7
=
-
0
.
2
f
-
0
.
6
f
*
damp
;
...
...
@@ -395,7 +395,7 @@ static __device__ void SUB_METHOD_NAME( calculatePmeDirectElectrostaticPairIxnF2
if
(
damp
!=
0
.
0
f
){
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
float
temp3
=
-
1
.
5
f
*
damp
*
expdamp
*
rr1
*
rr1
;
float
temp5
=
-
damp
;
float
temp7
=
-
0
.
2
f
-
0
.
6
f
*
damp
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeDirectElectrostaticT2.h
View file @
470c9b7f
...
...
@@ -42,7 +42,7 @@ static __device__ void SUB_METHOD_NAME( calculatePmeDirectElectrostaticPairIxnT2
float
ratio
=
1
.
0
f
/
(
rr1
*
damp
);
damp
=
-
pgamma
*
ratio
*
ratio
*
ratio
;
if
(
damp
>
-
50
.
0
f
){
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
scale3
=
1
.
0
f
-
expdamp
;
scale5
=
1
.
0
f
-
(
1
.
0
f
-
damp
)
*
expdamp
;
scale7
=
1
.
0
f
-
(
1
.
0
f
-
damp
+
0
.
6
f
*
damp
*
damp
)
*
expdamp
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeFixedEField.cu
View file @
470c9b7f
...
...
@@ -201,9 +201,9 @@ __device__ void calculateFixedFieldRealSpacePairIxn_kernel( FixedFieldParticle&
// periodic boundary conditions
xr
-=
floor
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
xr
-=
floor
f
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
f
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
f
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
float
r2
=
xr
*
xr
+
yr
*
yr
+
zr
*
zr
;
if
(
r2
<=
cSim
.
nonbondedCutoffSqr
){
...
...
@@ -214,10 +214,10 @@ __device__ void calculateFixedFieldRealSpacePairIxn_kernel( FixedFieldParticle&
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
bn0
=
erfc
(
ralpha
)
/
r
;
float
bn0
=
erfc
f
(
ralpha
)
/
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
float
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
alsq2n
*=
alsq2
;
float
bn1
=
(
bn0
+
alsq2n
*
exp2a
)
/
r2
;
...
...
@@ -243,7 +243,7 @@ __device__ void calculateFixedFieldRealSpacePairIxn_kernel( FixedFieldParticle&
damp
=
-
pgamma
*
ratio
;
if
(
damp
>
-
50.0
f
)
{
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
scale3
=
1.0
f
-
expdamp
;
scale5
=
1.0
f
-
expdamp
*
(
1.0
f
-
damp
);
scale7
=
1.0
f
-
expdamp
*
(
1.0
f
-
damp
+
(
0.6
f
*
damp
*
damp
));
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
View file @
470c9b7f
...
...
@@ -85,9 +85,9 @@ __device__ void setupMutualInducedFieldPairIxn_kernel( const MutualInducedPartic
// pdelta->xiodic boundary conditions
delta
->
x
-=
floor
(
delta
->
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
->
y
-=
floor
(
delta
->
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
->
z
-=
floor
(
delta
->
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
delta
->
x
-=
floor
f
(
delta
->
x
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
delta
->
y
-=
floor
f
(
delta
->
y
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
delta
->
z
-=
floor
f
(
delta
->
z
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
float
r2
=
(
delta
->
x
*
delta
->
x
)
+
(
delta
->
y
*
delta
->
y
)
+
(
delta
->
z
*
delta
->
z
);
if
(
r2
<=
cSim
.
nonbondedCutoffSqr
){
...
...
@@ -97,10 +97,10 @@ __device__ void setupMutualInducedFieldPairIxn_kernel( const MutualInducedPartic
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
bn0
=
erfc
(
ralpha
)
/
r
;
float
bn0
=
erfc
f
(
ralpha
)
/
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
float
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
alsq2n
*=
alsq2
;
float
bn1
=
(
bn0
+
alsq2n
*
exp2a
)
/
r2
;
...
...
@@ -120,7 +120,7 @@ __device__ void setupMutualInducedFieldPairIxn_kernel( const MutualInducedPartic
damp
=
-
pgamma
*
ratio
;
if
(
damp
>
-
50.0
f
)
{
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
scale3
=
1.0
f
-
expdamp
;
scale5
=
1.0
f
-
expdamp
*
(
1.0
f
-
damp
);
}
...
...
@@ -171,9 +171,9 @@ __device__ void calculatePmeDirectMutualInducedFieldPairIxn_kernel( MutualInduce
// periodic boundary conditions
xr
-=
floor
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
xr
-=
floor
f
(
xr
*
cSim
.
invPeriodicBoxSizeX
+
0.5
f
)
*
cSim
.
periodicBoxSizeX
;
yr
-=
floor
f
(
yr
*
cSim
.
invPeriodicBoxSizeY
+
0.5
f
)
*
cSim
.
periodicBoxSizeY
;
zr
-=
floor
f
(
zr
*
cSim
.
invPeriodicBoxSizeZ
+
0.5
f
)
*
cSim
.
periodicBoxSizeZ
;
float
r2
=
xr
*
xr
+
yr
*
yr
+
zr
*
zr
;
if
(
r2
<=
cSim
.
nonbondedCutoffSqr
){
...
...
@@ -183,10 +183,10 @@ __device__ void calculatePmeDirectMutualInducedFieldPairIxn_kernel( MutualInduce
float
ralpha
=
cSim
.
alphaEwald
*
r
;
float
bn0
=
erfc
(
ralpha
)
/
r
;
float
bn0
=
erfc
f
(
ralpha
)
/
r
;
float
alsq2
=
2.0
f
*
cSim
.
alphaEwald
*
cSim
.
alphaEwald
;
float
alsq2n
=
1.0
f
/
(
cAmoebaSim
.
sqrtPi
*
cSim
.
alphaEwald
);
float
exp2a
=
exp
(
-
(
ralpha
*
ralpha
));
float
exp2a
=
exp
f
(
-
(
ralpha
*
ralpha
));
alsq2n
*=
alsq2
;
float
bn1
=
(
bn0
+
alsq2n
*
exp2a
)
/
r2
;
...
...
@@ -206,7 +206,7 @@ __device__ void calculatePmeDirectMutualInducedFieldPairIxn_kernel( MutualInduce
damp
=
-
pgamma
*
ratio
;
if
(
damp
>
-
50.0
f
)
{
float
expdamp
=
exp
(
damp
);
float
expdamp
=
exp
f
(
damp
);
scale3
=
1.0
f
-
expdamp
;
scale5
=
1.0
f
-
expdamp
*
(
1.0
f
-
damp
);
}
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
View file @
470c9b7f
...
...
@@ -117,9 +117,9 @@ void METHOD_NAME(kCalculateAmoebaVdw14_7, _kernel)(
ijForce
[
2
]
=
psA
[
j
].
z
-
localParticle
.
z
;
if
(
cAmoebaSim
.
vdwUsePBC
)
{
ijForce
[
0
]
-=
floor
(
ijForce
[
0
]
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
ijForce
[
1
]
-=
floor
(
ijForce
[
1
]
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
ijForce
[
2
]
-=
floor
(
ijForce
[
2
]
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
ijForce
[
0
]
-=
floor
f
(
ijForce
[
0
]
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
ijForce
[
1
]
-=
floor
f
(
ijForce
[
1
]
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
ijForce
[
2
]
-=
floor
f
(
ijForce
[
2
]
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
}
float
energy
;
...
...
@@ -211,9 +211,9 @@ flags = 0xFFFFFFFF;
ijForce
[
2
]
=
psA
[
jIdx
].
z
-
localParticle
.
z
;
if
(
cAmoebaSim
.
vdwUsePBC
)
{
ijForce
[
0
]
-=
floor
(
ijForce
[
0
]
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
ijForce
[
1
]
-=
floor
(
ijForce
[
1
]
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
ijForce
[
2
]
-=
floor
(
ijForce
[
2
]
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
ijForce
[
0
]
-=
floor
f
(
ijForce
[
0
]
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
ijForce
[
1
]
-=
floor
f
(
ijForce
[
1
]
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
ijForce
[
2
]
-=
floor
f
(
ijForce
[
2
]
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
}
calculateVdw14_7PairIxn_kernel
(
combindedSigma
,
combindedEpsilon
,
ijForce
,
&
energy
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kFindInteractingBlocksVdw.h
View file @
470c9b7f
...
...
@@ -47,9 +47,9 @@ __global__ void METHOD_NAME(kFindBlocksWithInteractionsVdw, _kernel)()
float
dy
=
centera
.
y
-
centerb
.
y
;
float
dz
=
centera
.
z
-
centerb
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float4
boxSizea
=
cSim
.
pGridBoundingBox
[
x
];
float4
boxSizeb
=
cSim
.
pGridBoundingBox
[
y
];
...
...
@@ -108,9 +108,9 @@ __global__ void METHOD_NAME(kFindInteractionsWithinBlocksVdw, _kernel)(unsigned
float
dy
=
apos
.
y
-
center
.
y
;
float
dz
=
apos
.
z
-
center
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
*
cSim
.
invPeriodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
*
cSim
.
invPeriodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
*
cSim
.
invPeriodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
dx
=
max
(
0
.
0
f
,
abs
(
dx
)
-
boxSize
.
x
);
dy
=
max
(
0
.
0
f
,
abs
(
dy
)
-
boxSize
.
y
);
...
...
plugins/freeEnergy/platforms/cuda/src/kernels/kCalculateCDLJObcGbsaSoftcoreForces1.h
View file @
470c9b7f
...
...
@@ -113,12 +113,12 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
dy
=
psA
[
j
].
y
-
apos
.
y
;
float
dz
=
psA
[
j
].
z
-
apos
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
invR
=
1
.
0
f
/
sqrt
(
r2
);
float
invR
=
1
.
0
f
/
sqrt
f
(
r2
);
float
sig
=
a
.
x
+
psA
[
j
].
sig
;
float
eps
=
a
.
y
*
psA
[
j
].
eps
;
#ifdef USE_SOFTCORE_LJ
...
...
@@ -147,9 +147,9 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
// ObcGbsaForce1 part
float
alpha2_ij
=
br
*
psA
[
j
].
br
;
float
D_ij
=
r2
/
(
4
.
0
f
*
alpha2_ij
);
float
expTerm
=
exp
(
-
D_ij
);
float
expTerm
=
exp
f
(
-
D_ij
);
float
denominator2
=
r2
+
alpha2_ij
*
expTerm
;
float
denominator
=
sqrt
(
denominator2
);
float
denominator
=
sqrt
f
(
denominator2
);
float
Gpol
=
(
q2
*
psA
[
j
].
q
)
/
(
denominator
*
denominator2
);
float
dGpol_dalpha2_ij
=
-
0
.
5
f
*
Gpol
*
expTerm
*
(
1
.
0
f
+
D_ij
);
dEdR
+=
Gpol
*
(
1
.
0
f
-
0
.
25
f
*
expTerm
);
...
...
@@ -190,12 +190,12 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
dy
=
psA
[
j
].
y
-
apos
.
y
;
float
dz
=
psA
[
j
].
z
-
apos
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
invR
=
1
.
0
f
/
sqrt
(
r2
);
float
invR
=
1
.
0
f
/
sqrt
f
(
r2
);
float
sig
=
a
.
x
+
psA
[
j
].
sig
;
float
eps
=
a
.
y
*
psA
[
j
].
eps
;
...
...
@@ -235,9 +235,9 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
alpha2_ij
=
br
*
psA
[
j
].
br
;
float
D_ij
=
r2
/
(
4
.
0
f
*
alpha2_ij
);
float
expTerm
=
exp
(
-
D_ij
);
float
expTerm
=
exp
f
(
-
D_ij
);
float
denominator2
=
r2
+
alpha2_ij
*
expTerm
;
float
denominator
=
sqrt
(
denominator2
);
float
denominator
=
sqrt
f
(
denominator2
);
float
Gpol
=
(
q2
*
psA
[
j
].
q
)
/
(
denominator
*
denominator2
);
float
dGpol_dalpha2_ij
=
-
0
.
5
f
*
Gpol
*
expTerm
*
(
1
.
0
f
+
D_ij
);
dEdR
+=
Gpol
*
(
1
.
0
f
-
0
.
25
f
*
expTerm
);
...
...
@@ -333,12 +333,12 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
dy
=
psA
[
tj
].
y
-
apos
.
y
;
float
dz
=
psA
[
tj
].
z
-
apos
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
invR
=
1
.
0
f
/
sqrt
(
r2
);
float
invR
=
1
.
0
f
/
sqrt
f
(
r2
);
float
sig
=
a
.
x
+
psA
[
tj
].
sig
;
float
eps
=
a
.
y
*
psA
[
tj
].
eps
;
...
...
@@ -367,9 +367,9 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
alpha2_ij
=
br
*
psA
[
tj
].
br
;
float
D_ij
=
r2
/
(
4
.
0
f
*
alpha2_ij
);
float
expTerm
=
exp
(
-
D_ij
);
float
expTerm
=
exp
f
(
-
D_ij
);
float
denominator2
=
r2
+
alpha2_ij
*
expTerm
;
float
denominator
=
sqrt
(
denominator2
);
float
denominator
=
sqrt
f
(
denominator2
);
float
Gpol
=
(
q2
*
psA
[
tj
].
q
)
/
(
denominator
*
denominator2
);
float
dGpol_dalpha2_ij
=
-
0
.
5
f
*
Gpol
*
expTerm
*
(
1
.
0
f
+
D_ij
);
dEdR
+=
Gpol
*
(
1
.
0
f
-
0
.
25
f
*
expTerm
);
...
...
@@ -418,12 +418,12 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
dy
=
psA
[
j
].
y
-
apos
.
y
;
float
dz
=
psA
[
j
].
z
-
apos
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
invR
=
1
.
0
f
/
sqrt
(
r2
);
float
invR
=
1
.
0
f
/
sqrt
f
(
r2
);
float
sig
=
a
.
x
+
psA
[
j
].
sig
;
float
eps
=
a
.
y
*
psA
[
j
].
eps
;
#ifdef USE_SOFTCORE_LJ
...
...
@@ -451,9 +451,9 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
// ObcGbsaForce1 part
float
alpha2_ij
=
br
*
psA
[
j
].
br
;
float
D_ij
=
r2
/
(
4
.
0
f
*
alpha2_ij
);
float
expTerm
=
exp
(
-
D_ij
);
float
expTerm
=
exp
f
(
-
D_ij
);
float
denominator2
=
r2
+
alpha2_ij
*
expTerm
;
float
denominator
=
sqrt
(
denominator2
);
float
denominator
=
sqrt
f
(
denominator2
);
float
Gpol
=
(
q2
*
psA
[
j
].
q
)
/
(
denominator
*
denominator2
);
float
dGpol_dalpha2_ij
=
-
0
.
5
f
*
Gpol
*
expTerm
*
(
1
.
0
f
+
D_ij
);
dEdR
+=
Gpol
*
(
1
.
0
f
-
0
.
25
f
*
expTerm
);
...
...
@@ -544,12 +544,12 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
dy
=
psA
[
tj
].
y
-
apos
.
y
;
float
dz
=
psA
[
tj
].
z
-
apos
.
z
;
#ifdef USE_PERIODIC
dx
-=
floor
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
dx
-=
floor
f
(
dx
/
cSim
.
periodicBoxSizeX
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeX
;
dy
-=
floor
f
(
dy
/
cSim
.
periodicBoxSizeY
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeY
;
dz
-=
floor
f
(
dz
/
cSim
.
periodicBoxSizeZ
+
0
.
5
f
)
*
cSim
.
periodicBoxSizeZ
;
#endif
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
float
invR
=
1
.
0
f
/
sqrt
(
r2
);
float
invR
=
1
.
0
f
/
sqrt
f
(
r2
);
float
sig
=
a
.
x
+
psA
[
tj
].
sig
;
float
eps
=
a
.
y
*
psA
[
tj
].
eps
;
#ifdef USE_SOFTCORE_LJ
...
...
@@ -582,9 +582,9 @@ void METHOD_NAME(kCalculateCDLJObcGbsaSoftcore, Forces1_kernel)(unsigned int* wo
float
alpha2_ij
=
br
*
psA
[
tj
].
br
;
float
D_ij
=
r2
/
(
4
.
0
f
*
alpha2_ij
);
float
expTerm
=
exp
(
-
D_ij
);
float
expTerm
=
exp
f
(
-
D_ij
);
float
denominator2
=
r2
+
alpha2_ij
*
expTerm
;
float
denominator
=
sqrt
(
denominator2
);
float
denominator
=
sqrt
f
(
denominator2
);
float
Gpol
=
(
q2
*
psA
[
tj
].
q
)
/
(
denominator
*
denominator2
);
float
dGpol_dalpha2_ij
=
-
0
.
5
f
*
Gpol
*
expTerm
*
(
1
.
0
f
+
D_ij
);
dEdR
+=
Gpol
*
(
1
.
0
f
-
0
.
25
f
*
expTerm
);
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment