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
103618fb
Commit
103618fb
authored
Jan 11, 2016
by
Jason Swails
Browse files
Ugh... stop shadowing dot so I can use it as a function. I hate obscure compiler
errors.
parent
9d6aa7ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
plugins/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
...s/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
+3
-3
plugins/amoeba/platforms/cuda/src/kernels/amoebaStretchBendForce.cu
...oeba/platforms/cuda/src/kernels/amoebaStretchBendForce.cu
+5
-4
No files found.
plugins/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
View file @
103618fb
...
@@ -39,9 +39,9 @@ real ym = zcp*xap - xcp*zap;
...
@@ -39,9 +39,9 @@ real ym = zcp*xap - xcp*zap;
real
zm
=
xcp
*
yap
-
ycp
*
xap
;
real
zm
=
xcp
*
yap
-
ycp
*
xap
;
real
rm
=
max
(
SQRT
(
xm
*
xm
+
ym
*
ym
+
zm
*
zm
),
(
real
)
1e-6
f
);
real
rm
=
max
(
SQRT
(
xm
*
xm
+
ym
*
ym
+
zm
*
zm
),
(
real
)
1e-6
f
);
real
dot
=
xap
*
xcp
+
yap
*
ycp
+
zap
*
zcp
;
real
dot
p
=
xap
*
xcp
+
yap
*
ycp
+
zap
*
zcp
;
real
product
=
SQRT
(
rap2
*
rcp2
);
real
product
=
SQRT
(
rap2
*
rcp2
);
real
cosine
=
(
product
>
0
?
(
dot
/
product
)
:
0
);
real
cosine
=
(
product
>
0
?
(
dot
p
/
product
)
:
0
);
cosine
=
max
(
min
(
cosine
,
(
real
)
1
),
(
real
)
-
1
);
cosine
=
max
(
min
(
cosine
,
(
real
)
1
),
(
real
)
-
1
);
real
angle
;
real
angle
;
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
...
@@ -51,7 +51,7 @@ if (cosine > 0.99f || cosine < -0.99f) {
...
@@ -51,7 +51,7 @@ if (cosine > 0.99f || cosine < -0.99f) {
angle
=
180
-
angle
;
angle
=
180
-
angle
;
}
}
else
else
real
angle
=
ACOS
(
cosine
)
*
RAD_TO_DEG
;
angle
=
ACOS
(
cosine
)
*
RAD_TO_DEG
;
// if product == 0, set force/energy to 0
// if product == 0, set force/energy to 0
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaStretchBendForce.cu
View file @
103618fb
...
@@ -17,19 +17,20 @@ real zp = xcb*yab - ycb*xab;
...
@@ -17,19 +17,20 @@ real zp = xcb*yab - ycb*xab;
real
rp
=
SQRT
(
xp
*
xp
+
yp
*
yp
+
zp
*
zp
);
real
rp
=
SQRT
(
xp
*
xp
+
yp
*
yp
+
zp
*
zp
);
real
dot
=
xab
*
xcb
+
yab
*
ycb
+
zab
*
zcb
;
real
dot
p
=
xab
*
xcb
+
yab
*
ycb
+
zab
*
zcb
;
real
cosine
=
rab
*
rcb
>
0
?
(
dot
/
(
rab
*
rcb
))
:
(
real
)
1
;
real
cosine
=
rab
*
rcb
>
0
?
(
dot
p
/
(
rab
*
rcb
))
:
(
real
)
1
;
cosine
=
(
cosine
>
1
?
(
real
)
1
:
cosine
);
cosine
=
(
cosine
>
1
?
(
real
)
1
:
cosine
);
cosine
=
(
cosine
<
-
1
?
-
(
real
)
1
:
cosine
);
cosine
=
(
cosine
<
-
1
?
-
(
real
)
1
:
cosine
);
real
angle
;
real
angle
;
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
// Highly unlikely a stretch-bend angle will be near 0 or 180, but just in case...
real3
cross_prod
=
cross
(
make_real3
(
xab
,
yab
,
zab
),
make_real3
(
xcb
,
ycb
,
zcb
));
real3
cross_prod
=
cross
(
make_real3
(
xab
,
yab
,
zab
),
make_real3
(
xcb
,
ycb
,
zcb
));
angle
=
ASIN
(
SQRT
(
dot
(
cross_prod
,
cross_prod
)
/
(
ra
p2
*
rc
p2
)
))
*
RAD_TO_DEG
;
angle
=
ASIN
(
SQRT
(
dot
(
cross_prod
,
cross_prod
)
)
/
(
ra
b
*
rc
b
))
*
RAD_TO_DEG
;
if
(
cosine
<
0.0
f
)
if
(
cosine
<
0.0
f
)
angle
=
180
-
angle
;
angle
=
180
-
angle
;
}
}
else
else
real
angle
=
ACOS
(
cosine
)
*
RAD_TO_DEG
;
angle
=
ACOS
(
cosine
)
*
RAD_TO_DEG
;
// find chain rule terms for the bond angle deviation
// find chain rule terms for the bond angle deviation
...
...
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