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
7fb10336
Commit
7fb10336
authored
Feb 20, 2015
by
peastman
Browse files
Cleaned up lots of formatting to be more consistent with the rest of OpenMM
parent
1d3ffd7b
Changes
73
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
180 additions
and
180 deletions
+180
-180
platforms/reference/include/ReferenceLJCoulombIxn.h
platforms/reference/include/ReferenceLJCoulombIxn.h
+7
-7
platforms/reference/include/ReferenceLincsAlgorithm.h
platforms/reference/include/ReferenceLincsAlgorithm.h
+6
-6
platforms/reference/include/ReferenceNeighborList.h
platforms/reference/include/ReferenceNeighborList.h
+2
-2
platforms/reference/include/ReferencePairIxn.h
platforms/reference/include/ReferencePairIxn.h
+4
-4
platforms/reference/include/ReferenceProperDihedralBond.h
platforms/reference/include/ReferenceProperDihedralBond.h
+4
-4
platforms/reference/include/ReferenceRbDihedralBond.h
platforms/reference/include/ReferenceRbDihedralBond.h
+4
-4
platforms/reference/include/ReferenceStochasticDynamics.h
platforms/reference/include/ReferenceStochasticDynamics.h
+7
-7
platforms/reference/include/ReferenceVariableStochasticDynamics.h
...s/reference/include/ReferenceVariableStochasticDynamics.h
+9
-9
platforms/reference/include/ReferenceVariableVerletDynamics.h
...forms/reference/include/ReferenceVariableVerletDynamics.h
+4
-4
platforms/reference/include/ReferenceVerletDynamics.h
platforms/reference/include/ReferenceVerletDynamics.h
+2
-2
platforms/reference/include/SimTKOpenMMUtilities.h
platforms/reference/include/SimTKOpenMMUtilities.h
+17
-17
platforms/reference/src/ReferenceKernelFactory.cpp
platforms/reference/src/ReferenceKernelFactory.cpp
+1
-1
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+9
-9
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
...erence/src/SimTKReference/ReferenceAndersenThermostat.cpp
+4
-4
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
...ms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
+22
-22
platforms/reference/src/SimTKReference/ReferenceBondForce.cpp
...forms/reference/src/SimTKReference/ReferenceBondForce.cpp
+7
-7
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
+49
-49
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
...eference/src/SimTKReference/ReferenceBrownianDynamics.cpp
+9
-9
platforms/reference/src/SimTKReference/ReferenceCustomAngleIxn.cpp
.../reference/src/SimTKReference/ReferenceCustomAngleIxn.cpp
+6
-6
platforms/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
...s/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
+7
-7
No files found.
platforms/reference/include/ReferenceLJCoulombIxn.h
View file @
7fb10336
...
@@ -67,9 +67,9 @@ class ReferenceLJCoulombIxn {
...
@@ -67,9 +67,9 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
calculateOneIxn
(
int
atom1
,
int
atom2
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculateOneIxn
(
int
atom1
,
int
atom2
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
**
atomParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
public:
public:
...
@@ -80,7 +80,7 @@ class ReferenceLJCoulombIxn {
...
@@ -80,7 +80,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceLJCoulombIxn
(
);
ReferenceLJCoulombIxn
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -88,7 +88,7 @@ class ReferenceLJCoulombIxn {
...
@@ -88,7 +88,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceLJCoulombIxn
(
);
~
ReferenceLJCoulombIxn
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -100,7 +100,7 @@ class ReferenceLJCoulombIxn {
...
@@ -100,7 +100,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
);
void
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -110,7 +110,7 @@ class ReferenceLJCoulombIxn {
...
@@ -110,7 +110,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setUseSwitchingFunction
(
RealOpenMM
distance
);
void
setUseSwitchingFunction
(
RealOpenMM
distance
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/include/ReferenceLincsAlgorithm.h
View file @
7fb10336
...
@@ -92,7 +92,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -92,7 +92,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceLincsAlgorithm
(
int
numberOfConstraints
,
int
**
atomIndices
,
RealOpenMM
*
distance
);
ReferenceLincsAlgorithm
(
int
numberOfConstraints
,
int
**
atomIndices
,
RealOpenMM
*
distance
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -102,7 +102,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -102,7 +102,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
getNumberOfConstraints
(
void
)
const
;
int
getNumberOfConstraints
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -112,7 +112,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -112,7 +112,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
getNumTerms
(
void
)
const
;
int
getNumTerms
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -120,7 +120,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -120,7 +120,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setNumTerms
(
int
terms
);
void
setNumTerms
(
int
terms
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -136,8 +136,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -136,8 +136,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/include/ReferenceNeighborList.h
View file @
7fb10336
platforms/reference/include/ReferencePairIxn.h
View file @
7fb10336
...
@@ -42,7 +42,7 @@ class OPENMM_EXPORT ReferencePairIxn {
...
@@ -42,7 +42,7 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferencePairIxn
(
);
ReferencePairIxn
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -50,7 +50,7 @@ class OPENMM_EXPORT ReferencePairIxn {
...
@@ -50,7 +50,7 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferencePairIxn
(
);
~
ReferencePairIxn
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -67,10 +67,10 @@ class OPENMM_EXPORT ReferencePairIxn {
...
@@ -67,10 +67,10 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
virtual
void
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
=
0
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
=
0
;
};
};
...
...
platforms/reference/include/ReferenceProperDihedralBond.h
View file @
7fb10336
...
@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
...
@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceProperDihedralBond
(
);
ReferenceProperDihedralBond
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceProperDihedralBond
(
);
~
ReferenceProperDihedralBond
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -65,9 +65,9 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
...
@@ -65,9 +65,9 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
totalEnergy
)
const
;
};
};
...
...
platforms/reference/include/ReferenceRbDihedralBond.h
View file @
7fb10336
...
@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceRbDihedralBond
(
);
ReferenceRbDihedralBond
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceRbDihedralBond
(
);
~
ReferenceRbDihedralBond
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -63,9 +63,9 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -63,9 +63,9 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
totalEnergy
)
const
;
};
};
...
...
platforms/reference/include/ReferenceStochasticDynamics.h
View file @
7fb10336
...
@@ -51,7 +51,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -51,7 +51,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceStochasticDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
,
RealOpenMM
tau
,
RealOpenMM
temperature
);
ReferenceStochasticDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
,
RealOpenMM
tau
,
RealOpenMM
temperature
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -59,7 +59,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -59,7 +59,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceStochasticDynamics
(
);
~
ReferenceStochasticDynamics
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -69,7 +69,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -69,7 +69,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getTau
(
void
)
const
;
RealOpenMM
getTau
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -100,8 +100,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -100,8 +100,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
virtual
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -115,8 +115,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -115,8 +115,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
virtual
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
};
};
...
...
platforms/reference/include/ReferenceVariableStochasticDynamics.h
View file @
7fb10336
...
@@ -50,7 +50,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -50,7 +50,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVariableStochasticDynamics
(
int
numberOfAtoms
,
RealOpenMM
tau
,
RealOpenMM
temperature
,
RealOpenMM
accuracy
);
ReferenceVariableStochasticDynamics
(
int
numberOfAtoms
,
RealOpenMM
tau
,
RealOpenMM
temperature
,
RealOpenMM
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -58,7 +58,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -58,7 +58,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceVariableStochasticDynamics
(
);
~
ReferenceVariableStochasticDynamics
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -68,7 +68,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -68,7 +68,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getTau
(
void
)
const
;
RealOpenMM
getTau
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -78,7 +78,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -78,7 +78,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getAccuracy
(
void
)
const
;
RealOpenMM
getAccuracy
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -86,7 +86,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -86,7 +86,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setAccuracy
(
RealOpenMM
accuracy
);
void
setAccuracy
(
RealOpenMM
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -120,9 +120,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -120,9 +120,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
,
RealOpenMM
maxStepSize
);
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
,
RealOpenMM
maxStepSize
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -136,9 +136,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -136,9 +136,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
std
::
vector
<
OpenMM
::
RealVec
>&
xPrime
);
};
};
...
...
platforms/reference/include/ReferenceVariableVerletDynamics.h
View file @
7fb10336
...
@@ -48,7 +48,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -48,7 +48,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVariableVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
accuracy
);
ReferenceVariableVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -56,7 +56,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -56,7 +56,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceVariableVerletDynamics
(
);
~
ReferenceVariableVerletDynamics
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -66,7 +66,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -66,7 +66,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getAccuracy
(
void
)
const
;
RealOpenMM
getAccuracy
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -74,7 +74,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -74,7 +74,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setAccuracy
(
RealOpenMM
accuracy
);
void
setAccuracy
(
RealOpenMM
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/include/ReferenceVerletDynamics.h
View file @
7fb10336
...
@@ -49,7 +49,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
...
@@ -49,7 +49,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
);
ReferenceVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -57,7 +57,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
...
@@ -57,7 +57,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
~
ReferenceVerletDynamics
(
);
~
ReferenceVerletDynamics
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/include/SimTKOpenMMUtilities.h
View file @
7fb10336
...
@@ -56,8 +56,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -56,8 +56,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
// dummy constructor/destructor
// dummy constructor/destructor
SimTKOpenMMUtilities
(){};
SimTKOpenMMUtilities
()
{};
~
SimTKOpenMMUtilities
(){};
~
SimTKOpenMMUtilities
()
{};
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -75,9 +75,9 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -75,9 +75,9 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
*
allocateOneDRealOpenMMArray
(
int
iSize
,
RealOpenMM
*
array1D
,
int
initialize
,
static
RealOpenMM
*
allocateOneDRealOpenMMArray
(
int
iSize
,
RealOpenMM
*
array1D
,
int
initialize
,
RealOpenMM
initialValue
,
RealOpenMM
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
)
);
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
)
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -96,10 +96,10 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -96,10 +96,10 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
**
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
static
RealOpenMM
**
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
RealOpenMM
**
array2D
,
int
initialize
,
RealOpenMM
**
array2D
,
int
initialize
,
RealOpenMM
initialValue
,
RealOpenMM
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
)
);
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
)
);
/* ---------------------------------------------------------------------------------------
/* ---------------------------------------------------------------------------------------
...
@@ -112,8 +112,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -112,8 +112,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
freeOneDRealOpenMMArray
(
RealOpenMM
*
array1D
,
static
void
freeOneDRealOpenMMArray
(
RealOpenMM
*
array1D
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
)
);
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
)
);
/* ---------------------------------------------------------------------------------------
/* ---------------------------------------------------------------------------------------
...
@@ -126,8 +126,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -126,8 +126,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
freeTwoDRealOpenMMArray
(
RealOpenMM
**
array2D
,
static
void
freeTwoDRealOpenMMArray
(
RealOpenMM
**
array2D
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
)
);
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
)
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -142,8 +142,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -142,8 +142,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
static
void
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
RealOpenMM
**
array2D
,
RealOpenMM
initialValue
);
RealOpenMM
**
array2D
,
RealOpenMM
initialValue
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -159,7 +159,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -159,7 +159,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
crossProductVector3
(
RealOpenMM
*
vectorX
,
RealOpenMM
*
vectorY
,
RealOpenMM
*
vectorZ
);
static
void
crossProductVector3
(
RealOpenMM
*
vectorX
,
RealOpenMM
*
vectorY
,
RealOpenMM
*
vectorZ
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -169,7 +169,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -169,7 +169,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getNormallyDistributedRandomNumber
(
void
);
static
RealOpenMM
getNormallyDistributedRandomNumber
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -179,7 +179,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -179,7 +179,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getUniformlyDistributedRandomNumber
(
void
);
static
RealOpenMM
getUniformlyDistributedRandomNumber
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -189,7 +189,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -189,7 +189,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
uint32_t
getRandomNumberSeed
(
void
);
static
uint32_t
getRandomNumberSeed
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -199,7 +199,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -199,7 +199,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
setRandomNumberSeed
(
uint32_t
seed
);
static
void
setRandomNumberSeed
(
uint32_t
seed
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/ReferenceKernelFactory.cpp
View file @
7fb10336
...
@@ -100,5 +100,5 @@ KernelImpl* ReferenceKernelFactory::createKernelImpl(std::string name, const Pla
...
@@ -100,5 +100,5 @@ KernelImpl* ReferenceKernelFactory::createKernelImpl(std::string name, const Pla
return
new
ReferenceApplyMonteCarloBarostatKernel
(
name
,
platform
);
return
new
ReferenceApplyMonteCarloBarostatKernel
(
name
,
platform
);
if
(
name
==
RemoveCMMotionKernel
::
Name
())
if
(
name
==
RemoveCMMotionKernel
::
Name
())
return
new
ReferenceRemoveCMMotionKernel
(
name
,
platform
,
data
);
return
new
ReferenceRemoveCMMotionKernel
(
name
,
platform
,
data
);
throw
OpenMMException
(
(
std
::
string
(
"Tried to create kernel with illegal kernel name '"
)
+
name
+
"'"
).
c_str
()
);
throw
OpenMMException
((
std
::
string
(
"Tried to create kernel with illegal kernel name '"
)
+
name
+
"'"
).
c_str
());
}
}
platforms/reference/src/ReferenceKernels.cpp
View file @
7fb10336
...
@@ -1105,8 +1105,8 @@ void ReferenceCalcGBSAOBCForceKernel::initialize(const System& system, const GBS
...
@@ -1105,8 +1105,8 @@ void ReferenceCalcGBSAOBCForceKernel::initialize(const System& system, const GBS
ObcParameters
*
obcParameters
=
new
ObcParameters
(
numParticles
,
ObcParameters
::
ObcTypeII
);
ObcParameters
*
obcParameters
=
new
ObcParameters
(
numParticles
,
ObcParameters
::
ObcTypeII
);
obcParameters
->
setAtomicRadii
(
atomicRadii
);
obcParameters
->
setAtomicRadii
(
atomicRadii
);
obcParameters
->
setScaledRadiusFactors
(
scaleFactors
);
obcParameters
->
setScaledRadiusFactors
(
scaleFactors
);
obcParameters
->
setSolventDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSolventDielectric
())
);
obcParameters
->
setSolventDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSolventDielectric
()));
obcParameters
->
setSoluteDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSoluteDielectric
())
);
obcParameters
->
setSoluteDielectric
(
static_cast
<
RealOpenMM
>
(
force
.
getSoluteDielectric
()));
obcParameters
->
setPi4Asolv
(
4
*
M_PI
*
force
.
getSurfaceAreaEnergy
());
obcParameters
->
setPi4Asolv
(
4
*
M_PI
*
force
.
getSurfaceAreaEnergy
());
if
(
force
.
getNonbondedMethod
()
!=
GBSAOBCForce
::
NoCutoff
)
if
(
force
.
getNonbondedMethod
()
!=
GBSAOBCForce
::
NoCutoff
)
obcParameters
->
setUseCutoff
(
static_cast
<
RealOpenMM
>
(
force
.
getCutoffDistance
()));
obcParameters
->
setUseCutoff
(
static_cast
<
RealOpenMM
>
(
force
.
getCutoffDistance
()));
...
@@ -1152,7 +1152,7 @@ ReferenceCalcGBVIForceKernel::~ReferenceCalcGBVIForceKernel() {
...
@@ -1152,7 +1152,7 @@ ReferenceCalcGBVIForceKernel::~ReferenceCalcGBVIForceKernel() {
}
}
}
}
void
ReferenceCalcGBVIForceKernel
::
initialize
(
const
System
&
system
,
const
GBVIForce
&
force
,
const
std
::
vector
<
double
>
&
inputScaledRadii
)
{
void
ReferenceCalcGBVIForceKernel
::
initialize
(
const
System
&
system
,
const
GBVIForce
&
force
,
const
std
::
vector
<
double
>
&
inputScaledRadii
)
{
int
numParticles
=
system
.
getNumParticles
();
int
numParticles
=
system
.
getNumParticles
();
...
@@ -1201,7 +1201,7 @@ double ReferenceCalcGBVIForceKernel::execute(ContextImpl& context, bool includeF
...
@@ -1201,7 +1201,7 @@ double ReferenceCalcGBVIForceKernel::execute(ContextImpl& context, bool includeF
gbvi
->
computeBornForces
(
posData
,
charges
,
forceData
);
gbvi
->
computeBornForces
(
posData
,
charges
,
forceData
);
energy
=
0.0
;
energy
=
0.0
;
}
}
if
(
includeEnergy
){
if
(
includeEnergy
)
{
energy
=
gbvi
->
computeBornEnergy
(
posData
,
charges
);
energy
=
gbvi
->
computeBornEnergy
(
posData
,
charges
);
}
}
return
static_cast
<
double
>
(
energy
);
return
static_cast
<
double
>
(
energy
);
...
@@ -1710,7 +1710,7 @@ void ReferenceIntegrateVerletStepKernel::execute(ContextImpl& context, const Ver
...
@@ -1710,7 +1710,7 @@ void ReferenceIntegrateVerletStepKernel::execute(ContextImpl& context, const Ver
if
(
dynamics
)
if
(
dynamics
)
delete
dynamics
;
delete
dynamics
;
dynamics
=
new
ReferenceVerletDynamics
(
context
.
getSystem
().
getNumParticles
(),
static_cast
<
RealOpenMM
>
(
stepSize
)
);
dynamics
=
new
ReferenceVerletDynamics
(
context
.
getSystem
().
getNumParticles
(),
static_cast
<
RealOpenMM
>
(
stepSize
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
prevStepSize
=
stepSize
;
prevStepSize
=
stepSize
;
}
}
...
@@ -1748,12 +1748,12 @@ void ReferenceIntegrateLangevinStepKernel::execute(ContextImpl& context, const L
...
@@ -1748,12 +1748,12 @@ void ReferenceIntegrateLangevinStepKernel::execute(ContextImpl& context, const L
if
(
dynamics
)
if
(
dynamics
)
delete
dynamics
;
delete
dynamics
;
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
dynamics
=
new
ReferenceStochasticDynamics
(
dynamics
=
new
ReferenceStochasticDynamics
(
context
.
getSystem
().
getNumParticles
(),
context
.
getSystem
().
getNumParticles
(),
static_cast
<
RealOpenMM
>
(
stepSize
),
static_cast
<
RealOpenMM
>
(
stepSize
),
static_cast
<
RealOpenMM
>
(
tau
),
static_cast
<
RealOpenMM
>
(
tau
),
static_cast
<
RealOpenMM
>
(
temperature
)
);
static_cast
<
RealOpenMM
>
(
temperature
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
prevTemp
=
temperature
;
prevTemp
=
temperature
;
prevFriction
=
friction
;
prevFriction
=
friction
;
...
@@ -1797,7 +1797,7 @@ void ReferenceIntegrateBrownianStepKernel::execute(ContextImpl& context, const B
...
@@ -1797,7 +1797,7 @@ void ReferenceIntegrateBrownianStepKernel::execute(ContextImpl& context, const B
context
.
getSystem
().
getNumParticles
(),
context
.
getSystem
().
getNumParticles
(),
static_cast
<
RealOpenMM
>
(
stepSize
),
static_cast
<
RealOpenMM
>
(
stepSize
),
static_cast
<
RealOpenMM
>
(
friction
),
static_cast
<
RealOpenMM
>
(
friction
),
static_cast
<
RealOpenMM
>
(
temperature
)
);
static_cast
<
RealOpenMM
>
(
temperature
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
prevTemp
=
temperature
;
prevTemp
=
temperature
;
prevFriction
=
friction
;
prevFriction
=
friction
;
...
@@ -1837,7 +1837,7 @@ double ReferenceIntegrateVariableLangevinStepKernel::execute(ContextImpl& contex
...
@@ -1837,7 +1837,7 @@ double ReferenceIntegrateVariableLangevinStepKernel::execute(ContextImpl& contex
if
(
dynamics
)
if
(
dynamics
)
delete
dynamics
;
delete
dynamics
;
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
RealOpenMM
tau
=
static_cast
<
RealOpenMM
>
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
dynamics
=
new
ReferenceVariableStochasticDynamics
(
context
.
getSystem
().
getNumParticles
(),
(
RealOpenMM
)
tau
,
(
RealOpenMM
)
temperature
,
(
RealOpenMM
)
errorTol
);
dynamics
=
new
ReferenceVariableStochasticDynamics
(
context
.
getSystem
().
getNumParticles
(),
(
RealOpenMM
)
tau
,
(
RealOpenMM
)
temperature
,
(
RealOpenMM
)
errorTol
);
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
dynamics
->
setReferenceConstraintAlgorithm
(
&
extractConstraints
(
context
));
prevTemp
=
temperature
;
prevTemp
=
temperature
;
...
...
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
View file @
7fb10336
...
@@ -37,7 +37,7 @@ using namespace OpenMM;
...
@@ -37,7 +37,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAndersenThermostat
::
ReferenceAndersenThermostat
(
)
{
ReferenceAndersenThermostat
::
ReferenceAndersenThermostat
()
{
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -46,7 +46,7 @@ using namespace OpenMM;
...
@@ -46,7 +46,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAndersenThermostat
::~
ReferenceAndersenThermostat
(
)
{
ReferenceAndersenThermostat
::~
ReferenceAndersenThermostat
()
{
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -61,8 +61,8 @@ using namespace OpenMM;
...
@@ -61,8 +61,8 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAndersenThermostat
::
applyThermostat
(
const
vector
<
vector
<
int
>
>&
atomGroups
,
vector
<
RealVec
>&
atomVelocities
,
vector
<
RealOpenMM
>&
atomMasses
,
void
ReferenceAndersenThermostat
::
applyThermostat
(
const
vector
<
vector
<
int
>
>&
atomGroups
,
vector
<
RealVec
>&
atomVelocities
,
vector
<
RealOpenMM
>&
atomMasses
,
RealOpenMM
temperature
,
RealOpenMM
collisionFrequency
,
RealOpenMM
stepSize
)
const
{
RealOpenMM
temperature
,
RealOpenMM
collisionFrequency
,
RealOpenMM
stepSize
)
const
{
const
RealOpenMM
collisionProbability
=
1.0
f
-
EXP
(
-
collisionFrequency
*
stepSize
);
const
RealOpenMM
collisionProbability
=
1.0
f
-
EXP
(
-
collisionFrequency
*
stepSize
);
for
(
int
i
=
0
;
i
<
(
int
)
atomGroups
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
(
int
)
atomGroups
.
size
();
++
i
)
{
...
...
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
View file @
7fb10336
...
@@ -39,7 +39,7 @@ using namespace OpenMM;
...
@@ -39,7 +39,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn
::
ReferenceAngleBondIxn
(
){
ReferenceAngleBondIxn
::
ReferenceAngleBondIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -55,7 +55,7 @@ ReferenceAngleBondIxn::ReferenceAngleBondIxn( ){
...
@@ -55,7 +55,7 @@ ReferenceAngleBondIxn::ReferenceAngleBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn
::~
ReferenceAngleBondIxn
(
){
ReferenceAngleBondIxn
::~
ReferenceAngleBondIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -77,8 +77,8 @@ ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
...
@@ -77,8 +77,8 @@ ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
void
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
{
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -91,9 +91,9 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
...
@@ -91,9 +91,9 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
RealOpenMM
angle
;
RealOpenMM
angle
;
if
(
cosine
>=
one
){
if
(
cosine
>=
one
)
{
angle
=
zero
;
angle
=
zero
;
}
else
if
(
cosine
<=
-
one
){
}
else
if
(
cosine
<=
-
one
)
{
angle
=
PI_M
;
angle
=
PI_M
;
}
else
{
}
else
{
angle
=
ACOS
(
cosine
);
angle
=
ACOS
(
cosine
);
...
@@ -119,11 +119,11 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
...
@@ -119,11 +119,11 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAngleBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
void
ReferenceAngleBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
RealOpenMM
*
parameters
,
vector
<
RealVec
>&
forces
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
totalEnergy
)
const
{
// constants -- reduce Visual Studio warnings regarding conversions between float & double
// constants -- reduce Visual Studio warnings regarding conversions between float & double
...
@@ -146,31 +146,31 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
...
@@ -146,31 +146,31 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
int
atomAIndex
=
atomIndices
[
0
];
int
atomAIndex
=
atomIndices
[
0
];
int
atomBIndex
=
atomIndices
[
1
];
int
atomBIndex
=
atomIndices
[
1
];
int
atomCIndex
=
atomIndices
[
2
];
int
atomCIndex
=
atomIndices
[
2
];
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
0
]
);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
0
]);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomCIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
1
]
);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomCIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
1
]);
RealOpenMM
pVector
[
threeI
];
RealOpenMM
pVector
[
threeI
];
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
deltaR
[
1
],
pVector
);
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
deltaR
[
1
],
pVector
);
RealOpenMM
rp
=
DOT3
(
pVector
,
pVector
);
RealOpenMM
rp
=
DOT3
(
pVector
,
pVector
);
rp
=
SQRT
(
rp
);
rp
=
SQRT
(
rp
);
if
(
rp
<
1.0e-06
){
if
(
rp
<
1.0e-06
)
{
rp
=
(
RealOpenMM
)
1.0e-06
;
rp
=
(
RealOpenMM
)
1.0e-06
;
}
}
RealOpenMM
dot
=
DOT3
(
deltaR
[
0
],
deltaR
[
1
]
);
RealOpenMM
dot
=
DOT3
(
deltaR
[
0
],
deltaR
[
1
]);
RealOpenMM
cosine
=
dot
/
SQRT
(
(
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
deltaR
[
1
][
ReferenceForce
::
R2Index
])
);
RealOpenMM
cosine
=
dot
/
SQRT
((
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
deltaR
[
1
][
ReferenceForce
::
R2Index
]));
RealOpenMM
dEdR
;
RealOpenMM
dEdR
;
RealOpenMM
energy
;
RealOpenMM
energy
;
getPrefactorsGivenAngleCosine
(
cosine
,
parameters
,
&
dEdR
,
&
energy
);
getPrefactorsGivenAngleCosine
(
cosine
,
parameters
,
&
dEdR
,
&
energy
);
RealOpenMM
termA
=
dEdR
/
(
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
termA
=
dEdR
/
(
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
termC
=
-
dEdR
/
(
deltaR
[
1
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
termC
=
-
dEdR
/
(
deltaR
[
1
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
deltaCrossP
[
LastAtomIndex
][
threeI
];
RealOpenMM
deltaCrossP
[
LastAtomIndex
][
threeI
];
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
pVector
,
deltaCrossP
[
0
]
);
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
pVector
,
deltaCrossP
[
0
]);
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
1
],
pVector
,
deltaCrossP
[
2
]
);
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
1
],
pVector
,
deltaCrossP
[
2
]);
for
(
int
ii
=
0
;
ii
<
threeI
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
threeI
;
ii
++
)
{
deltaCrossP
[
0
][
ii
]
*=
termA
;
deltaCrossP
[
0
][
ii
]
*=
termA
;
deltaCrossP
[
2
][
ii
]
*=
termC
;
deltaCrossP
[
2
][
ii
]
*=
termC
;
deltaCrossP
[
1
][
ii
]
=
oneM
*
(
deltaCrossP
[
0
][
ii
]
+
deltaCrossP
[
2
][
ii
]);
deltaCrossP
[
1
][
ii
]
=
oneM
*
(
deltaCrossP
[
0
][
ii
]
+
deltaCrossP
[
2
][
ii
]);
...
@@ -178,8 +178,8 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
...
@@ -178,8 +178,8 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
// accumulate forces
// accumulate forces
for
(
int
jj
=
0
;
jj
<
LastAtomIndex
;
jj
++
){
for
(
int
jj
=
0
;
jj
<
LastAtomIndex
;
jj
++
)
{
for
(
int
ii
=
0
;
ii
<
threeI
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
threeI
;
ii
++
)
{
forces
[
atomIndices
[
jj
]][
ii
]
+=
deltaCrossP
[
jj
][
ii
];
forces
[
atomIndices
[
jj
]][
ii
]
+=
deltaCrossP
[
jj
][
ii
];
}
}
}
}
...
...
platforms/reference/src/SimTKReference/ReferenceBondForce.cpp
View file @
7fb10336
...
@@ -38,7 +38,7 @@ using namespace OpenMM;
...
@@ -38,7 +38,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondForce
::
ReferenceBondForce
(
){
ReferenceBondForce
::
ReferenceBondForce
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -54,7 +54,7 @@ ReferenceBondForce::ReferenceBondForce( ){
...
@@ -54,7 +54,7 @@ ReferenceBondForce::ReferenceBondForce( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondForce
::~
ReferenceBondForce
(
){
ReferenceBondForce
::~
ReferenceBondForce
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -79,12 +79,12 @@ ReferenceBondForce::~ReferenceBondForce( ){
...
@@ -79,12 +79,12 @@ ReferenceBondForce::~ReferenceBondForce( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceBondForce
::
calculateForce
(
int
numberOfBonds
,
int
**
atomIndices
,
void
ReferenceBondForce
::
calculateForce
(
int
numberOfBonds
,
int
**
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
parameters
,
RealOpenMM
**
parameters
,
vector
<
RealVec
>&
forces
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
,
RealOpenMM
*
totalEnergy
,
ReferenceBondIxn
&
referenceBondIxn
){
ReferenceBondIxn
&
referenceBondIxn
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -93,12 +93,12 @@ void ReferenceBondForce::calculateForce( int numberOfBonds, int** atomIndices,
...
@@ -93,12 +93,12 @@ void ReferenceBondForce::calculateForce( int numberOfBonds, int** atomIndices,
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
)
{
// calculate bond ixn
// calculate bond ixn
referenceBondIxn
.
calculateBondIxn
(
atomIndices
[
ii
],
atomCoordinates
,
parameters
[
ii
],
referenceBondIxn
.
calculateBondIxn
(
atomIndices
[
ii
],
atomCoordinates
,
parameters
[
ii
],
forces
,
totalEnergy
);
forces
,
totalEnergy
);
}
}
}
}
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
View file @
7fb10336
...
@@ -39,7 +39,7 @@ using namespace OpenMM;
...
@@ -39,7 +39,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondIxn
::
ReferenceBondIxn
(
){
ReferenceBondIxn
::
ReferenceBondIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -55,7 +55,7 @@ ReferenceBondIxn::ReferenceBondIxn( ){
...
@@ -55,7 +55,7 @@ ReferenceBondIxn::ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondIxn
::~
ReferenceBondIxn
(
){
ReferenceBondIxn
::~
ReferenceBondIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -77,9 +77,9 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
...
@@ -77,9 +77,9 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
parameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
totalEnergy
)
const
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nReferenceBondIxn::calculateBondIxn";
// static const std::string methodName = "\nReferenceBondIxn::calculateBondIxn";
...
@@ -103,8 +103,8 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
...
@@ -103,8 +103,8 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceBondIxn
::
getNormedDotProduct
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
ReferenceBondIxn
::
getNormedDotProduct
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
int
hasREntry
=
0
)
{
int
hasREntry
=
0
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -123,35 +123,35 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
...
@@ -123,35 +123,35 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
#if defined USE_DOUBLE_FOR_NORMED_DOT_PRODUCT
#if defined USE_DOUBLE_FOR_NORMED_DOT_PRODUCT
double
v1D
[
3
];
double
v1D
[
3
];
double
v2D
[
3
];
double
v2D
[
3
];
v1D
[
0
]
=
static_cast
<
double
>
(
vector1
[
0
]
);
v1D
[
0
]
=
static_cast
<
double
>
(
vector1
[
0
]);
v1D
[
1
]
=
static_cast
<
double
>
(
vector1
[
1
]
);
v1D
[
1
]
=
static_cast
<
double
>
(
vector1
[
1
]);
v1D
[
2
]
=
static_cast
<
double
>
(
vector1
[
2
]
);
v1D
[
2
]
=
static_cast
<
double
>
(
vector1
[
2
]);
v2D
[
0
]
=
static_cast
<
double
>
(
vector2
[
0
]
);
v2D
[
0
]
=
static_cast
<
double
>
(
vector2
[
0
]);
v2D
[
1
]
=
static_cast
<
double
>
(
vector2
[
1
]
);
v2D
[
1
]
=
static_cast
<
double
>
(
vector2
[
1
]);
v2D
[
2
]
=
static_cast
<
double
>
(
vector2
[
2
]
);
v2D
[
2
]
=
static_cast
<
double
>
(
vector2
[
2
]);
double
dotProductD
=
DOT3
(
v1D
,
v2D
);
double
dotProductD
=
DOT3
(
v1D
,
v2D
);
if
(
dotProductD
!=
0.0
){
if
(
dotProductD
!=
0.0
)
{
if
(
hasREntry
){
if
(
hasREntry
)
{
dotProductD
/=
(
static_cast
<
double
>
(
vector1
[
ReferenceForce
::
RIndex
])
*
static_cast
<
double
>
(
vector2
[
ReferenceForce
::
RIndex
])
);
dotProductD
/=
(
static_cast
<
double
>
(
vector1
[
ReferenceForce
::
RIndex
])
*
static_cast
<
double
>
(
vector2
[
ReferenceForce
::
RIndex
]));
}
else
{
}
else
{
double
norm1
=
DOT3
(
v1D
,
v1D
);
double
norm1
=
DOT3
(
v1D
,
v1D
);
double
norm2
=
DOT3
(
v2D
,
v2D
);
double
norm2
=
DOT3
(
v2D
,
v2D
);
dotProductD
/=
sqrt
(
norm1
*
norm2
);
dotProductD
/=
sqrt
(
norm1
*
norm2
);
}
}
}
}
RealOpenMM
dotProduct
=
static_cast
<
RealOpenMM
>
(
dotProductD
);
RealOpenMM
dotProduct
=
static_cast
<
RealOpenMM
>
(
dotProductD
);
#else
#else
RealOpenMM
dotProduct
=
DOT3
(
vector1
,
vector2
);
RealOpenMM
dotProduct
=
DOT3
(
vector1
,
vector2
);
if
(
dotProduct
!=
zero
){
if
(
dotProduct
!=
zero
)
{
if
(
hasREntry
){
if
(
hasREntry
)
{
dotProduct
/=
(
vector1
[
ReferenceForce
::
RIndex
]
*
vector2
[
ReferenceForce
::
RIndex
]
);
dotProduct
/=
(
vector1
[
ReferenceForce
::
RIndex
]
*
vector2
[
ReferenceForce
::
RIndex
]);
}
else
{
}
else
{
RealOpenMM
norm1
=
DOT3
(
vector1
,
vector1
);
RealOpenMM
norm1
=
DOT3
(
vector1
,
vector1
);
RealOpenMM
norm2
=
DOT3
(
vector2
,
vector2
);
RealOpenMM
norm2
=
DOT3
(
vector2
,
vector2
);
dotProduct
/=
SQRT
(
norm1
*
norm2
);
dotProduct
/=
SQRT
(
norm1
*
norm2
);
}
}
}
}
...
@@ -160,9 +160,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
...
@@ -160,9 +160,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
// clamp dot product to [-1,1]
// clamp dot product to [-1,1]
if
(
dotProduct
>
one
){
if
(
dotProduct
>
one
)
{
dotProduct
=
one
;
dotProduct
=
one
;
}
else
if
(
dotProduct
<
-
one
){
}
else
if
(
dotProduct
<
-
one
)
{
dotProduct
=
-
one
;
dotProduct
=
-
one
;
}
}
...
@@ -184,9 +184,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
...
@@ -184,9 +184,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceBondIxn
::
getAngleBetweenTwoVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
ReferenceBondIxn
::
getAngleBetweenTwoVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
*
outputDotProduct
=
NULL
,
RealOpenMM
*
outputDotProduct
=
NULL
,
int
hasREntry
=
0
)
{
int
hasREntry
=
0
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -199,7 +199,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
...
@@ -199,7 +199,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
// get dot product betweenn vectors and then angle
// get dot product betweenn vectors and then angle
RealOpenMM
dotProduct
=
getNormedDotProduct
(
vector1
,
vector2
,
hasREntry
);
RealOpenMM
dotProduct
=
getNormedDotProduct
(
vector1
,
vector2
,
hasREntry
);
RealOpenMM
angle
;
RealOpenMM
angle
;
if
(
dotProduct
>
(
RealOpenMM
)
0.99
||
dotProduct
<
(
RealOpenMM
)
-
0.99
)
{
if
(
dotProduct
>
(
RealOpenMM
)
0.99
||
dotProduct
<
(
RealOpenMM
)
-
0.99
)
{
...
@@ -215,7 +215,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
...
@@ -215,7 +215,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
angle
=
ACOS
(
dotProduct
);
angle
=
ACOS
(
dotProduct
);
}
}
if
(
outputDotProduct
){
if
(
outputDotProduct
)
{
*
outputDotProduct
=
dotProduct
;
*
outputDotProduct
=
dotProduct
;
}
}
...
@@ -241,14 +241,14 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
...
@@ -241,14 +241,14 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceBondIxn
::
getDihedralAngleBetweenThreeVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
ReferenceBondIxn
::
getDihedralAngleBetweenThreeVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
*
vector2
,
RealOpenMM
*
vector3
,
RealOpenMM
*
vector3
,
RealOpenMM
**
outputCrossProduct
=
NULL
,
RealOpenMM
**
outputCrossProduct
=
NULL
,
RealOpenMM
*
cosineOfAngle
=
NULL
,
RealOpenMM
*
cosineOfAngle
=
NULL
,
RealOpenMM
*
signVector
=
NULL
,
RealOpenMM
*
signVector
=
NULL
,
RealOpenMM
*
signOfAngle
=
NULL
,
RealOpenMM
*
signOfAngle
=
NULL
,
int
hasREntry
=
0
)
{
int
hasREntry
=
0
)
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -264,7 +264,7 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
...
@@ -264,7 +264,7 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
// get cross products between vectors and then angle between cross product vectors
// get cross products between vectors and then angle between cross product vectors
RealOpenMM
*
crossProduct
[
2
];
RealOpenMM
*
crossProduct
[
2
];
if
(
outputCrossProduct
){
if
(
outputCrossProduct
)
{
crossProduct
[
0
]
=
outputCrossProduct
[
0
];
crossProduct
[
0
]
=
outputCrossProduct
[
0
];
crossProduct
[
1
]
=
outputCrossProduct
[
1
];
crossProduct
[
1
]
=
outputCrossProduct
[
1
];
}
else
{
}
else
{
...
@@ -272,17 +272,17 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
...
@@ -272,17 +272,17 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
crossProduct
[
1
]
=
tempVectors
+
3
;
crossProduct
[
1
]
=
tempVectors
+
3
;
}
}
SimTKOpenMMUtilities
::
crossProductVector3
(
vector1
,
vector2
,
crossProduct
[
0
]
);
SimTKOpenMMUtilities
::
crossProductVector3
(
vector1
,
vector2
,
crossProduct
[
0
]);
SimTKOpenMMUtilities
::
crossProductVector3
(
vector2
,
vector3
,
crossProduct
[
1
]
);
SimTKOpenMMUtilities
::
crossProductVector3
(
vector2
,
vector3
,
crossProduct
[
1
]);
RealOpenMM
angle
=
getAngleBetweenTwoVectors
(
crossProduct
[
0
],
crossProduct
[
1
],
cosineOfAngle
,
0
);
RealOpenMM
angle
=
getAngleBetweenTwoVectors
(
crossProduct
[
0
],
crossProduct
[
1
],
cosineOfAngle
,
0
);
// take care of sign of angle
// take care of sign of angle
if
(
signVector
){
if
(
signVector
)
{
RealOpenMM
dotProduct
=
DOT3
(
signVector
,
crossProduct
[
1
]
);
RealOpenMM
dotProduct
=
DOT3
(
signVector
,
crossProduct
[
1
]);
RealOpenMM
sign
=
dotProduct
<
zero
?
-
one
:
one
;
RealOpenMM
sign
=
dotProduct
<
zero
?
-
one
:
one
;
if
(
signOfAngle
){
if
(
signOfAngle
)
{
*
signOfAngle
=
sign
;
*
signOfAngle
=
sign
;
}
}
angle
*=
sign
;
angle
*=
sign
;
...
...
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
View file @
7fb10336
...
@@ -47,10 +47,10 @@ using namespace OpenMM;
...
@@ -47,10 +47,10 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBrownianDynamics
::
ReferenceBrownianDynamics
(
int
numberOfAtoms
,
ReferenceBrownianDynamics
::
ReferenceBrownianDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
,
RealOpenMM
friction
,
RealOpenMM
deltaT
,
RealOpenMM
friction
,
RealOpenMM
temperature
)
:
RealOpenMM
temperature
)
:
ReferenceDynamics
(
numberOfAtoms
,
deltaT
,
temperature
),
friction
(
friction
)
{
ReferenceDynamics
(
numberOfAtoms
,
deltaT
,
temperature
),
friction
(
friction
)
{
if
(
friction
<=
0
)
{
if
(
friction
<=
0
)
{
std
::
stringstream
message
;
std
::
stringstream
message
;
...
@@ -67,7 +67,7 @@ ReferenceBrownianDynamics::ReferenceBrownianDynamics( int numberOfAtoms,
...
@@ -67,7 +67,7 @@ ReferenceBrownianDynamics::ReferenceBrownianDynamics( int numberOfAtoms,
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBrownianDynamics
::~
ReferenceBrownianDynamics
(
){
ReferenceBrownianDynamics
::~
ReferenceBrownianDynamics
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -85,7 +85,7 @@ ReferenceBrownianDynamics::~ReferenceBrownianDynamics( ){
...
@@ -85,7 +85,7 @@ ReferenceBrownianDynamics::~ReferenceBrownianDynamics( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceBrownianDynamics
::
getFriction
(
void
)
const
{
RealOpenMM
ReferenceBrownianDynamics
::
getFriction
()
const
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -125,10 +125,10 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
...
@@ -125,10 +125,10 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// first-time-through initialization
// first-time-through initialization
int
numberOfAtoms
=
system
.
getNumParticles
();
int
numberOfAtoms
=
system
.
getNumParticles
();
if
(
getTimeStep
()
==
0
){
if
(
getTimeStep
()
==
0
)
{
// invert masses
// invert masses
for
(
int
ii
=
0
;
ii
<
numberOfAtoms
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfAtoms
;
ii
++
)
{
if
(
masses
[
ii
]
==
zero
)
if
(
masses
[
ii
]
==
zero
)
inverseMasses
[
ii
]
=
zero
;
inverseMasses
[
ii
]
=
zero
;
else
else
...
@@ -138,7 +138,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
...
@@ -138,7 +138,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// Perform the integration.
// Perform the integration.
const
RealOpenMM
noiseAmplitude
=
static_cast
<
RealOpenMM
>
(
sqrt
(
2.0
*
BOLTZ
*
getTemperature
()
*
getDeltaT
()
/
getFriction
())
);
const
RealOpenMM
noiseAmplitude
=
static_cast
<
RealOpenMM
>
(
sqrt
(
2.0
*
BOLTZ
*
getTemperature
()
*
getDeltaT
()
/
getFriction
()));
const
RealOpenMM
forceScale
=
getDeltaT
()
/
getFriction
();
const
RealOpenMM
forceScale
=
getDeltaT
()
/
getFriction
();
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
++
i
)
{
if
(
masses
[
i
]
!=
zero
)
if
(
masses
[
i
]
!=
zero
)
...
@@ -152,7 +152,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
...
@@ -152,7 +152,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// Update the positions and velocities.
// Update the positions and velocities.
RealOpenMM
velocityScale
=
static_cast
<
RealOpenMM
>
(
1.0
/
getDeltaT
()
);
RealOpenMM
velocityScale
=
static_cast
<
RealOpenMM
>
(
1.0
/
getDeltaT
());
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
++
i
)
{
if
(
masses
[
i
]
!=
zero
)
if
(
masses
[
i
]
!=
zero
)
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
...
...
platforms/reference/src/SimTKReference/ReferenceCustomAngleIxn.cpp
View file @
7fb10336
...
@@ -61,7 +61,7 @@ ReferenceCustomAngleIxn::ReferenceCustomAngleIxn(const Lepton::CompiledExpressio
...
@@ -61,7 +61,7 @@ ReferenceCustomAngleIxn::ReferenceCustomAngleIxn(const Lepton::CompiledExpressio
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceCustomAngleIxn
::~
ReferenceCustomAngleIxn
(
){
ReferenceCustomAngleIxn
::~
ReferenceCustomAngleIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -83,11 +83,11 @@ ReferenceCustomAngleIxn::~ReferenceCustomAngleIxn( ){
...
@@ -83,11 +83,11 @@ ReferenceCustomAngleIxn::~ReferenceCustomAngleIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceCustomAngleIxn
::
calculateBondIxn
(
int
*
atomIndices
,
void
ReferenceCustomAngleIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
RealOpenMM
*
parameters
,
vector
<
RealVec
>&
forces
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
totalEnergy
)
const
{
static
const
std
::
string
methodName
=
"
\n
ReferenceCustomAngleIxn::calculateAngleIxn"
;
static
const
std
::
string
methodName
=
"
\n
ReferenceCustomAngleIxn::calculateAngleIxn"
;
...
...
platforms/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
View file @
7fb10336
...
@@ -61,7 +61,7 @@ ReferenceCustomBondIxn::ReferenceCustomBondIxn(const Lepton::CompiledExpression&
...
@@ -61,7 +61,7 @@ ReferenceCustomBondIxn::ReferenceCustomBondIxn(const Lepton::CompiledExpression&
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceCustomBondIxn
::~
ReferenceCustomBondIxn
(
){
ReferenceCustomBondIxn
::~
ReferenceCustomBondIxn
()
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -83,11 +83,11 @@ ReferenceCustomBondIxn::~ReferenceCustomBondIxn( ){
...
@@ -83,11 +83,11 @@ ReferenceCustomBondIxn::~ReferenceCustomBondIxn( ){
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceCustomBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
void
ReferenceCustomBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
RealOpenMM
*
parameters
,
vector
<
RealVec
>&
forces
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
totalEnergy
)
const
{
static
const
std
::
string
methodName
=
"
\n
ReferenceCustomBondIxn::calculateBondIxn"
;
static
const
std
::
string
methodName
=
"
\n
ReferenceCustomBondIxn::calculateBondIxn"
;
...
@@ -109,7 +109,7 @@ void ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
...
@@ -109,7 +109,7 @@ void ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
int
atomAIndex
=
atomIndices
[
0
];
int
atomAIndex
=
atomIndices
[
0
];
int
atomBIndex
=
atomIndices
[
1
];
int
atomBIndex
=
atomIndices
[
1
];
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
);
ReferenceForce
::
setVariable
(
energyR
,
deltaR
[
ReferenceForce
::
RIndex
]);
ReferenceForce
::
setVariable
(
energyR
,
deltaR
[
ReferenceForce
::
RIndex
]);
ReferenceForce
::
setVariable
(
forceR
,
deltaR
[
ReferenceForce
::
RIndex
]);
ReferenceForce
::
setVariable
(
forceR
,
deltaR
[
ReferenceForce
::
RIndex
]);
...
...
Prev
1
2
3
4
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