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
b292cfcd
Commit
b292cfcd
authored
Jun 19, 2009
by
Mark Friedrichs
Browse files
One of loops in reference GBSA/OBC code was missing tests for periodic bndy conditions, cutoff, ...
parent
e1656dcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
platforms/reference/src/gbsa/CpuObc.cpp
platforms/reference/src/gbsa/CpuObc.cpp
+26
-13
No files found.
platforms/reference/src/gbsa/CpuObc.cpp
View file @
b292cfcd
...
@@ -527,12 +527,18 @@ int CpuObc::computeBornEnergyForces( RealOpenMM* bornRadii, RealOpenMM** atomCoo
...
@@ -527,12 +527,18 @@ int CpuObc::computeBornEnergyForces( RealOpenMM* bornRadii, RealOpenMM** atomCoo
if
(
atomJ
!=
atomI
){
if
(
atomJ
!=
atomI
){
RealOpenMM
deltaX
=
atomCoordinates
[
atomJ
][
0
]
-
atomCoordinates
[
atomI
][
0
];
RealOpenMM
deltaR
[
ReferenceForce
::
LastDeltaRIndex
];
RealOpenMM
deltaY
=
atomCoordinates
[
atomJ
][
1
]
-
atomCoordinates
[
atomI
][
1
];
if
(
_obcParameters
->
getPeriodic
())
RealOpenMM
deltaZ
=
atomCoordinates
[
atomJ
][
2
]
-
atomCoordinates
[
atomI
][
2
];
ReferenceForce
::
getDeltaRPeriodic
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
_obcParameters
->
getPeriodicBox
(),
deltaR
);
else
RealOpenMM
r2
=
deltaX
*
deltaX
+
deltaY
*
deltaY
+
deltaZ
*
deltaZ
;
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
deltaR
);
RealOpenMM
r
=
SQRT
(
r2
);
if
(
_obcParameters
->
getUseCutoff
()
&&
deltaR
[
ReferenceForce
::
RIndex
]
>
_obcParameters
->
getCutoffDistance
())
continue
;
RealOpenMM
deltaX
=
deltaR
[
ReferenceForce
::
XIndex
];
RealOpenMM
deltaY
=
deltaR
[
ReferenceForce
::
YIndex
];
RealOpenMM
deltaZ
=
deltaR
[
ReferenceForce
::
ZIndex
];
RealOpenMM
r
=
deltaR
[
ReferenceForce
::
RIndex
];
// radius w/ dielectric offset applied
// radius w/ dielectric offset applied
...
@@ -969,6 +975,7 @@ FILE* logFile = NULL;
...
@@ -969,6 +975,7 @@ FILE* logFile = NULL;
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
deltaR
);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
deltaR
);
if
(
_obcParameters
->
getUseCutoff
()
&&
deltaR
[
ReferenceForce
::
RIndex
]
>
_obcParameters
->
getCutoffDistance
())
if
(
_obcParameters
->
getUseCutoff
()
&&
deltaR
[
ReferenceForce
::
RIndex
]
>
_obcParameters
->
getCutoffDistance
())
continue
;
continue
;
RealOpenMM
r2
=
deltaR
[
ReferenceForce
::
R2Index
];
RealOpenMM
r2
=
deltaR
[
ReferenceForce
::
R2Index
];
RealOpenMM
deltaX
=
deltaR
[
ReferenceForce
::
XIndex
];
RealOpenMM
deltaX
=
deltaR
[
ReferenceForce
::
XIndex
];
RealOpenMM
deltaY
=
deltaR
[
ReferenceForce
::
YIndex
];
RealOpenMM
deltaY
=
deltaR
[
ReferenceForce
::
YIndex
];
...
@@ -1131,13 +1138,19 @@ for( int atomI = 0; atomI < numberOfAtoms; atomI++ ){
...
@@ -1131,13 +1138,19 @@ for( int atomI = 0; atomI < numberOfAtoms; atomI++ ){
if
(
atomJ
!=
atomI
){
if
(
atomJ
!=
atomI
){
RealOpenMM
deltaX
=
atomCoordinates
[
atomJ
][
0
]
-
atomCoordinates
[
atomI
][
0
];
RealOpenMM
deltaR
[
ReferenceForce
::
LastDeltaRIndex
];
RealOpenMM
deltaY
=
atomCoordinates
[
atomJ
][
1
]
-
atomCoordinates
[
atomI
][
1
];
if
(
_obcParameters
->
getPeriodic
())
RealOpenMM
deltaZ
=
atomCoordinates
[
atomJ
][
2
]
-
atomCoordinates
[
atomI
][
2
];
ReferenceForce
::
getDeltaRPeriodic
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
_obcParameters
->
getPeriodicBox
(),
deltaR
);
else
RealOpenMM
r2
=
deltaX
*
deltaX
+
deltaY
*
deltaY
+
deltaZ
*
deltaZ
;
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomI
],
atomCoordinates
[
atomJ
],
deltaR
);
RealOpenMM
r
=
SQRT
(
r2
);
if
(
_obcParameters
->
getUseCutoff
()
&&
deltaR
[
ReferenceForce
::
RIndex
]
>
_obcParameters
->
getCutoffDistance
())
continue
;
RealOpenMM
deltaX
=
deltaR
[
ReferenceForce
::
XIndex
];
RealOpenMM
deltaY
=
deltaR
[
ReferenceForce
::
YIndex
];
RealOpenMM
deltaZ
=
deltaR
[
ReferenceForce
::
ZIndex
];
RealOpenMM
r
=
deltaR
[
ReferenceForce
::
RIndex
];
// radius w/ dielectric offset applied
// radius w/ dielectric offset applied
RealOpenMM
radiusJ
=
atomicRadii
[
atomJ
]
-
dielectricOffset
;
RealOpenMM
radiusJ
=
atomicRadii
[
atomJ
]
-
dielectricOffset
;
...
...
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