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
039bb3fb
"wrappers/vscode:/vscode.git/clone" did not exist on "d30460490a698f1babe9c612c5362e6db6aaafa0"
Commit
039bb3fb
authored
May 08, 2013
by
Peter Eastman
Browse files
Very minor code simplification
parent
70ff98db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
86 deletions
+82
-86
platforms/cuda/src/kernels/coulombLennardJones.cu
platforms/cuda/src/kernels/coulombLennardJones.cu
+41
-43
platforms/opencl/src/kernels/coulombLennardJones.cl
platforms/opencl/src/kernels/coulombLennardJones.cl
+41
-43
No files found.
platforms/cuda/src/kernels/coulombLennardJones.cu
View file @
039bb3fb
#if USE_EWALD
bool
needCorrection
=
hasExclusions
&&
isExcluded
&&
atom1
!=
atom2
&&
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
;
if
(
!
isExcluded
||
needCorrection
)
{
if
(
r2
<
CUTOFF_SQUARED
||
needCorrection
)
{
if
((
!
isExcluded
&&
r2
<
CUTOFF_SQUARED
)
||
needCorrection
)
{
const
real
alphaR
=
EWALD_ALPHA
*
r
;
const
real
expAlphaRSqr
=
EXP
(
-
alphaR
*
alphaR
);
const
real
prefactor
=
138.935456
f
*
posq1
.
w
*
posq2
.
w
*
invR
;
...
...
@@ -52,7 +51,6 @@ if (!isExcluded || needCorrection) {
#endif
}
dEdR
+=
tempForce
*
invR
*
invR
;
}
}
#else
{
...
...
platforms/opencl/src/kernels/coulombLennardJones.cl
View file @
039bb3fb
#
if
USE_EWALD
bool
needCorrection
=
hasExclusions
&&
isExcluded
&&
atom1
!=
atom2
&&
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
;
if
(
!isExcluded
|
| needCorrection) {
if (r2 < CUTOFF_SQUARED |
|
needCorrection
)
{
if
((
!isExcluded
&&
r2
<
CUTOFF_SQUARED
)
||
needCorrection
)
{
const
real
alphaR
=
EWALD_ALPHA*r
;
const
real
expAlphaRSqr
=
EXP
(
-alphaR*alphaR
)
;
const
real
prefactor
=
138.935456f*posq1.w*posq2.w*invR
;
...
...
@@ -52,7 +51,6 @@ if (!isExcluded || needCorrection) {
#
endif
}
dEdR
+=
tempForce*invR*invR
;
}
}
#
else
{
...
...
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