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
93900ab2
Commit
93900ab2
authored
Jan 04, 2011
by
Peter Eastman
Browse files
Updated Amoeba plugin based on refactoring of reference platform
parent
c27f5d1f
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
38 deletions
+47
-38
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.h
...e/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.h
+9
-9
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceUreyBradleyForce.cpp
...ce/src/SimTKReference/AmoebaReferenceUreyBradleyForce.cpp
+8
-5
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceUreyBradleyForce.h
...ence/src/SimTKReference/AmoebaReferenceUreyBradleyForce.h
+5
-5
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
.../reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
+8
-5
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
...ms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
+6
-6
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceWcaDispersionForce.cpp
.../src/SimTKReference/AmoebaReferenceWcaDispersionForce.cpp
+7
-4
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceWcaDispersionForce.h
...ce/src/SimTKReference/AmoebaReferenceWcaDispersionForce.h
+4
-4
No files found.
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.h
View file @
93900ab2
...
...
@@ -25,7 +25,7 @@
#ifndef __AmoebaReferenceTorsionTorsionForce_H__
#define __AmoebaReferenceTorsionTorsionForce_H__
#include "SimTKUtilities/
SimTKOpenMMRealType
.h"
#include "SimTKUtilities/
RealVec
.h"
#include <vector>
// ---------------------------------------------------------------------------------------
...
...
@@ -71,7 +71,7 @@ public:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateForceAndEnergy
(
int
numTorsionTorsions
,
RealOpenMM
**
posData
,
RealOpenMM
calculateForceAndEnergy
(
int
numTorsionTorsions
,
std
::
vector
<
OpenMM
::
RealVec
>&
posData
,
const
std
::
vector
<
int
>&
particle1
,
const
std
::
vector
<
int
>&
particle2
,
const
std
::
vector
<
int
>&
particle3
,
...
...
@@ -80,7 +80,7 @@ public:
const
std
::
vector
<
int
>&
chiralCheckAtom
,
const
std
::
vector
<
int
>&
gridIndices
,
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
>
>&
torsionTorsionGrids
,
RealOpenMM
**
forceData
)
const
;
std
::
vector
<
OpenMM
::
RealVec
>&
forceData
)
const
;
private:
...
...
@@ -185,8 +185,8 @@ private:
--------------------------------------------------------------------------------------- */
int
checkTorsionSign
(
const
Real
OpenMM
*
positionAtomA
,
const
Real
OpenMM
*
positionAtomB
,
const
Real
OpenMM
*
positionAtomC
,
const
Real
OpenMM
*
positionAtomD
)
const
;
int
checkTorsionSign
(
const
OpenMM
::
RealVec
&
positionAtomA
,
const
OpenMM
::
RealVec
&
positionAtomB
,
const
OpenMM
::
RealVec
&
positionAtomC
,
const
OpenMM
::
RealVec
&
positionAtomD
)
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -206,11 +206,11 @@ private:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateTorsionTorsionIxn
(
const
Real
OpenMM
*
positionAtomA
,
const
Real
OpenMM
*
positionAtomB
,
const
Real
OpenMM
*
positionAtomC
,
const
Real
OpenMM
*
positionAtomD
,
const
Real
OpenMM
*
positionAtomE
,
const
Real
OpenMM
*
chiralCheckAtom
,
RealOpenMM
calculateTorsionTorsionIxn
(
const
OpenMM
::
RealVec
&
positionAtomA
,
const
OpenMM
::
RealVec
&
positionAtomB
,
const
OpenMM
::
RealVec
&
positionAtomC
,
const
OpenMM
::
RealVec
&
positionAtomD
,
const
OpenMM
::
RealVec
&
positionAtomE
,
const
OpenMM
::
RealVec
*
chiralCheckAtom
,
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
>&
grid
,
Real
OpenMM
*
*
forces
)
const
;
OpenMM
::
RealVec
*
forces
)
const
;
};
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceUreyBradleyForce.cpp
View file @
93900ab2
...
...
@@ -25,6 +25,9 @@
#include "AmoebaReferenceUreyBradleyForce.h"
#include "AmoebaReferenceForce.h"
using
std
::
vector
;
using
OpenMM
::
RealVec
;
/**---------------------------------------------------------------------------------------
Calculate Amoeba UB ixn (force and energy)
...
...
@@ -41,10 +44,10 @@
--------------------------------------------------------------------------------------- */
RealOpenMM
AmoebaReferenceUreyBradleyForce
::
calculateUreyBradleyIxn
(
const
Real
OpenMM
*
positionAtomA
,
const
Real
OpenMM
*
positionAtomB
,
RealOpenMM
AmoebaReferenceUreyBradleyForce
::
calculateUreyBradleyIxn
(
const
Real
Vec
&
positionAtomA
,
const
Real
Vec
&
positionAtomB
,
RealOpenMM
idealLength
,
RealOpenMM
kForceConstant
,
RealOpenMM
cubicK
,
RealOpenMM
quarticK
,
Real
OpenMM
*
*
forces
)
const
{
Real
Vec
*
forces
)
const
{
// ---------------------------------------------------------------------------------------
...
...
@@ -85,21 +88,21 @@ RealOpenMM AmoebaReferenceUreyBradleyForce::calculateUreyBradleyIxn( const RealO
}
RealOpenMM
AmoebaReferenceUreyBradleyForce
::
calculateForceAndEnergy
(
int
numIxns
,
RealOpenMM
**
particlePositions
,
vector
<
RealVec
>&
particlePositions
,
const
std
::
vector
<
int
>&
particle1
,
const
std
::
vector
<
int
>&
particle2
,
const
std
::
vector
<
RealOpenMM
>&
length
,
const
std
::
vector
<
RealOpenMM
>&
kQuadratic
,
RealOpenMM
globalUreyBradleyCubic
,
RealOpenMM
globalUreyBradleyQuartic
,
RealOpenMM
**
forceData
)
const
{
vector
<
RealVec
>&
forceData
)
const
{
RealOpenMM
energy
=
0.0
;
for
(
int
ii
=
0
;
ii
<
numIxns
;
ii
++
){
int
particle1Index
=
particle1
[
ii
];
int
particle2Index
=
particle2
[
ii
];
RealOpenMM
idealLength
=
length
[
ii
];
RealOpenMM
kForceConstant
=
kQuadratic
[
ii
];
Real
OpenMM
*
forces
[
2
];
Real
Vec
forces
[
2
];
forces
[
0
]
=
forceData
[
particle1Index
];
forces
[
1
]
=
forceData
[
particle2Index
];
energy
+=
calculateUreyBradleyIxn
(
particlePositions
[
particle1Index
],
particlePositions
[
particle2Index
],
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceUreyBradleyForce.h
View file @
93900ab2
...
...
@@ -25,7 +25,7 @@
#ifndef __AmoebaReferenceUreyBradleyForce_H__
#define __AmoebaReferenceUreyBradleyForce_H__
#include "SimTKUtilities/
SimTKOpenMMRealType
.h"
#include "SimTKUtilities/
RealVec
.h"
#include <vector>
// ---------------------------------------------------------------------------------------
...
...
@@ -68,13 +68,13 @@ public:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateForceAndEnergy
(
int
numIxns
,
RealOpenMM
**
posData
,
RealOpenMM
calculateForceAndEnergy
(
int
numIxns
,
std
::
vector
<
OpenMM
::
RealVec
>&
posData
,
const
std
::
vector
<
int
>&
particle1
,
const
std
::
vector
<
int
>&
particle2
,
const
std
::
vector
<
RealOpenMM
>&
length
,
const
std
::
vector
<
RealOpenMM
>&
kForce
,
RealOpenMM
cubic
,
RealOpenMM
quartic
,
RealOpenMM
**
forceData
)
const
;
std
::
vector
<
OpenMM
::
RealVec
>&
forceData
)
const
;
private:
...
...
@@ -94,10 +94,10 @@ private:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateUreyBradleyIxn
(
const
Real
OpenMM
*
positionAtomA
,
const
Real
OpenMM
*
positionAtomB
,
RealOpenMM
calculateUreyBradleyIxn
(
const
OpenMM
::
RealVec
&
positionAtomA
,
const
OpenMM
::
RealVec
&
positionAtomB
,
RealOpenMM
idealLength
,
RealOpenMM
kForce
,
RealOpenMM
cubic
,
RealOpenMM
quartic
,
Real
OpenMM
*
*
forces
)
const
;
OpenMM
::
RealVec
*
forces
)
const
;
};
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
View file @
93900ab2
...
...
@@ -27,6 +27,9 @@
#include <algorithm>
#include <cctype>
using
std
::
vector
;
using
OpenMM
::
RealVec
;
AmoebaReferenceVdwForce
::
AmoebaReferenceVdwForce
(
)
:
_nonbondedMethod
(
NoCutoff
)
{
setSigmaCombiningRule
(
"ARITHMETIC"
);
...
...
@@ -127,7 +130,7 @@ RealOpenMM AmoebaReferenceVdwForce::hhgEpsilonCombiningRule( RealOpenMM epsilonI
void
AmoebaReferenceVdwForce
::
addReducedForce
(
unsigned
int
particleI
,
unsigned
int
particleIV
,
RealOpenMM
reduction
,
RealOpenMM
sign
,
Vec3
&
force
,
RealOpenMM
**
forces
)
const
{
Vec3
&
force
,
vector
<
RealVec
>&
forces
)
const
{
// ---------------------------------------------------------------------------------------
...
...
@@ -197,14 +200,14 @@ RealOpenMM AmoebaReferenceVdwForce::calculatePairIxn( RealOpenMM combindedSigma,
}
RealOpenMM
AmoebaReferenceVdwForce
::
calculateNoCutoffForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
const
vector
<
RealVec
>&
particlePositions
,
const
std
::
vector
<
int
>&
indexIVs
,
const
std
::
vector
<
int
>&
indexClasses
,
const
std
::
vector
<
RealOpenMM
>&
sigmas
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
const
std
::
vector
<
RealOpenMM
>&
reductions
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
allExclusions
,
RealOpenMM
**
forces
)
const
{
vector
<
RealVec
>&
forces
)
const
{
// ---------------------------------------------------------------------------------------
...
...
@@ -282,14 +285,14 @@ RealOpenMM AmoebaReferenceVdwForce::calculateNoCutoffForceAndEnergy( int numPart
}
RealOpenMM
AmoebaReferenceVdwForce
::
calculateForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
const
vector
<
RealVec
>&
particlePositions
,
const
std
::
vector
<
int
>&
indexIVs
,
const
std
::
vector
<
int
>&
indexClasses
,
const
std
::
vector
<
RealOpenMM
>&
sigmas
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
const
std
::
vector
<
RealOpenMM
>&
reductions
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
allExclusions
,
RealOpenMM
**
forces
)
const
{
vector
<
RealVec
>&
forces
)
const
{
if
(
getNonbondedMethod
()
==
NoCutoff
||
1
){
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
View file @
93900ab2
...
...
@@ -25,7 +25,7 @@
#ifndef __AmoebaReferenceVdwForce_H__
#define __AmoebaReferenceVdwForce_H__
#include "SimTKUtilities/
SimTKOpenMMRealType
.h"
#include "SimTKUtilities/
RealVec
.h"
#include "openmm/Vec3.h"
#include <string>
#include <vector>
...
...
@@ -168,13 +168,13 @@ public:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
RealOpenMM
calculateForceAndEnergy
(
int
numParticles
,
const
std
::
vector
<
OpenMM
::
RealVec
>&
particlePositions
,
const
std
::
vector
<
int
>&
indexIVs
,
const
std
::
vector
<
int
>&
indexClasses
,
const
std
::
vector
<
RealOpenMM
>&
sigmas
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
const
std
::
vector
<
RealOpenMM
>&
reductions
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
vdwExclusions
,
RealOpenMM
**
forces
)
const
;
std
::
vector
<
OpenMM
::
RealVec
>&
forces
)
const
;
private:
...
...
@@ -208,7 +208,7 @@ private:
void
addReducedForce
(
unsigned
int
particleI
,
unsigned
int
particleIV
,
RealOpenMM
reduction
,
RealOpenMM
sign
,
Vec3
&
force
,
RealOpenMM
**
forces
)
const
;
Vec3
&
force
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
)
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -246,13 +246,13 @@ private:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateNoCutoffForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
RealOpenMM
calculateNoCutoffForceAndEnergy
(
int
numParticles
,
const
std
::
vector
<
OpenMM
::
RealVec
>&
particlePositions
,
const
std
::
vector
<
int
>&
indexIVs
,
const
std
::
vector
<
int
>&
indexClasses
,
const
std
::
vector
<
RealOpenMM
>&
sigmas
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
const
std
::
vector
<
RealOpenMM
>&
reductions
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
vdwExclusions
,
RealOpenMM
**
forces
)
const
;
std
::
vector
<
OpenMM
::
RealVec
>&
forces
)
const
;
};
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceWcaDispersionForce.cpp
View file @
93900ab2
...
...
@@ -25,6 +25,9 @@
#include "AmoebaReferenceForce.h"
#include "AmoebaReferenceWcaDispersionForce.h"
using
std
::
vector
;
using
OpenMM
::
RealVec
;
AmoebaReferenceWcaDispersionForce
::
AmoebaReferenceWcaDispersionForce
(
RealOpenMM
epso
,
RealOpenMM
epsh
,
RealOpenMM
rmino
,
RealOpenMM
rminh
,
RealOpenMM
awater
,
RealOpenMM
shctd
,
RealOpenMM
dispoff
,
RealOpenMM
slevy
)
:
_epso
(
epso
),
_epsh
(
epsh
),
_rmino
(
rmino
),
_rminh
(
rminh
),
_awater
(
awater
),
_shctd
(
shctd
),
_dispoff
(
dispoff
),
_slevy
(
slevy
)
{
...
...
@@ -32,8 +35,8 @@ AmoebaReferenceWcaDispersionForce::AmoebaReferenceWcaDispersionForce( RealOpenMM
RealOpenMM
AmoebaReferenceWcaDispersionForce
::
calculatePairIxn
(
RealOpenMM
radiusI
,
RealOpenMM
radiusK
,
const
Real
OpenMM
*
particleIPosition
,
const
Real
OpenMM
*
particleJPosition
,
const
Real
Vec
&
particleIPosition
,
const
Real
Vec
&
particleJPosition
,
const
RealOpenMM
*
const
intermediateValues
,
Vec3
&
force
)
const
{
...
...
@@ -252,11 +255,11 @@ RealOpenMM AmoebaReferenceWcaDispersionForce::calculatePairIxn( RealOpenMM radiu
}
RealOpenMM
AmoebaReferenceWcaDispersionForce
::
calculateForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
const
vector
<
RealVec
>&
particlePositions
,
const
std
::
vector
<
RealOpenMM
>&
radii
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
RealOpenMM
totalMaximumDispersionEnergy
,
RealOpenMM
**
forces
)
const
{
vector
<
RealVec
>&
forces
)
const
{
// ---------------------------------------------------------------------------------------
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceWcaDispersionForce.h
View file @
93900ab2
...
...
@@ -25,7 +25,7 @@
#ifndef __AmoebaReferenceWcaDispersionForce_H__
#define __AmoebaReferenceWcaDispersionForce_H__
#include "SimTKUtilities/
SimTKOpenMMRealType
.h"
#include "SimTKUtilities/
RealVec
.h"
#include "openmm/Vec3.h"
#include <string>
#include <vector>
...
...
@@ -79,10 +79,10 @@ public:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculateForceAndEnergy
(
int
numParticles
,
RealOpenMM
**
const
particlePositions
,
RealOpenMM
calculateForceAndEnergy
(
int
numParticles
,
const
std
::
vector
<
OpenMM
::
RealVec
>&
particlePositions
,
const
std
::
vector
<
RealOpenMM
>&
radii
,
const
std
::
vector
<
RealOpenMM
>&
epsilons
,
RealOpenMM
totalMaximumDispersionEnergy
,
RealOpenMM
**
forces
)
const
;
RealOpenMM
totalMaximumDispersionEnergy
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
)
const
;
private:
RealOpenMM
_epso
;
...
...
@@ -112,7 +112,7 @@ private:
--------------------------------------------------------------------------------------- */
RealOpenMM
calculatePairIxn
(
RealOpenMM
radiusI
,
RealOpenMM
radiusJ
,
const
Real
OpenMM
*
particleIPosition
,
const
Real
OpenMM
*
particleJPosition
,
const
OpenMM
::
RealVec
&
particleIPosition
,
const
OpenMM
::
RealVec
&
particleJPosition
,
const
RealOpenMM
*
const
intermediateValues
,
Vec3
&
force
)
const
;
...
...
Prev
1
2
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