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
a783b996
Commit
a783b996
authored
Jan 13, 2017
by
peastman
Browse files
Eliminated RealOpenMM type
parent
9500f3af
Changes
148
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
528 additions
and
727 deletions
+528
-727
platforms/reference/include/ReferenceRbDihedralBond.h
platforms/reference/include/ReferenceRbDihedralBond.h
+5
-5
platforms/reference/include/ReferenceSETTLEAlgorithm.h
platforms/reference/include/ReferenceSETTLEAlgorithm.h
+7
-7
platforms/reference/include/ReferenceStochasticDynamics.h
platforms/reference/include/ReferenceStochasticDynamics.h
+13
-13
platforms/reference/include/ReferenceVariableStochasticDynamics.h
...s/reference/include/ReferenceVariableStochasticDynamics.h
+15
-15
platforms/reference/include/ReferenceVariableVerletDynamics.h
...forms/reference/include/ReferenceVariableVerletDynamics.h
+8
-8
platforms/reference/include/ReferenceVerletDynamics.h
platforms/reference/include/ReferenceVerletDynamics.h
+5
-5
platforms/reference/include/ReferenceVirtualSites.h
platforms/reference/include/ReferenceVirtualSites.h
+3
-3
platforms/reference/include/SimTKOpenMMRealType.h
platforms/reference/include/SimTKOpenMMRealType.h
+1
-43
platforms/reference/include/SimTKOpenMMUtilities.h
platforms/reference/include/SimTKOpenMMUtilities.h
+18
-18
platforms/reference/include/fftpack.h
platforms/reference/include/fftpack.h
+4
-5
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+247
-247
platforms/reference/src/ReferencePlatform.cpp
platforms/reference/src/ReferencePlatform.cpp
+12
-12
platforms/reference/src/SimTKReference/ObcParameters.cpp
platforms/reference/src/SimTKReference/ObcParameters.cpp
+24
-23
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
...erence/src/SimTKReference/ReferenceAndersenThermostat.cpp
+5
-4
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
...ms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
+30
-65
platforms/reference/src/SimTKReference/ReferenceBondForce.cpp
...forms/reference/src/SimTKReference/ReferenceBondForce.cpp
+4
-25
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
+40
-119
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
...eference/src/SimTKReference/ReferenceBrownianDynamics.cpp
+15
-38
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
...s/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
+38
-38
platforms/reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
.../reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
+34
-34
No files found.
platforms/reference/include/ReferenceRbDihedralBond.h
View file @
a783b996
...
@@ -34,7 +34,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -34,7 +34,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
private:
private:
bool
usePeriodic
;
bool
usePeriodic
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
public:
public:
...
@@ -62,7 +62,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -62,7 +62,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -76,9 +76,9 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
...
@@ -76,9 +76,9 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
double
*
totalEnergy
,
double
*
energyParamDerivs
);
};
};
...
...
platforms/reference/include/ReferenceSETTLEAlgorithm.h
View file @
a783b996
...
@@ -44,7 +44,7 @@ namespace OpenMM {
...
@@ -44,7 +44,7 @@ namespace OpenMM {
class
OPENMM_EXPORT
ReferenceSETTLEAlgorithm
:
public
ReferenceConstraintAlgorithm
{
class
OPENMM_EXPORT
ReferenceSETTLEAlgorithm
:
public
ReferenceConstraintAlgorithm
{
public:
public:
ReferenceSETTLEAlgorithm
(
const
std
::
vector
<
int
>&
atom1
,
const
std
::
vector
<
int
>&
atom2
,
const
std
::
vector
<
int
>&
atom3
,
ReferenceSETTLEAlgorithm
(
const
std
::
vector
<
int
>&
atom1
,
const
std
::
vector
<
int
>&
atom2
,
const
std
::
vector
<
int
>&
atom3
,
const
std
::
vector
<
RealOpenMM
>&
distance1
,
const
std
::
vector
<
RealOpenMM
>&
distance2
,
std
::
vector
<
RealOpenMM
>&
masses
);
const
std
::
vector
<
double
>&
distance1
,
const
std
::
vector
<
double
>&
distance2
,
std
::
vector
<
double
>&
masses
);
/**
/**
* Get the number of clusters.
* Get the number of clusters.
...
@@ -60,7 +60,7 @@ public:
...
@@ -60,7 +60,7 @@ public:
* @param distance1 the distance between atoms 1 and 2
* @param distance1 the distance between atoms 1 and 2
* @param distance2 the distance between atoms 2 and 3
* @param distance2 the distance between atoms 2 and 3
*/
*/
void
getClusterParameters
(
int
index
,
int
&
atom1
,
int
&
atom2
,
int
&
atom3
,
RealOpenMM
&
distance1
,
RealOpenMM
&
distance2
)
const
;
void
getClusterParameters
(
int
index
,
int
&
atom1
,
int
&
atom2
,
int
&
atom3
,
double
&
distance1
,
double
&
distance2
)
const
;
/**
/**
* Apply the constraint algorithm.
* Apply the constraint algorithm.
*
*
...
@@ -69,7 +69,7 @@ public:
...
@@ -69,7 +69,7 @@ public:
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
* @param tolerance the constraint tolerance
*/
*/
void
apply
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
apply
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
/**
/**
* Apply the constraint algorithm to velocities.
* Apply the constraint algorithm to velocities.
...
@@ -79,14 +79,14 @@ public:
...
@@ -79,14 +79,14 @@ public:
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
* @param tolerance the constraint tolerance
*/
*/
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
private:
private:
std
::
vector
<
int
>
atom1
;
std
::
vector
<
int
>
atom1
;
std
::
vector
<
int
>
atom2
;
std
::
vector
<
int
>
atom2
;
std
::
vector
<
int
>
atom3
;
std
::
vector
<
int
>
atom3
;
std
::
vector
<
RealOpenMM
>
distance1
;
std
::
vector
<
double
>
distance1
;
std
::
vector
<
RealOpenMM
>
distance2
;
std
::
vector
<
double
>
distance2
;
std
::
vector
<
RealOpenMM
>
masses
;
std
::
vector
<
double
>
masses
;
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
platforms/reference/include/ReferenceStochasticDynamics.h
View file @
a783b996
...
@@ -34,9 +34,9 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -34,9 +34,9 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
protected:
protected:
std
::
vector
<
OpenMM
::
Real
Vec
>
xPrime
;
std
::
vector
<
OpenMM
::
Vec
3
>
xPrime
;
std
::
vector
<
RealOpenMM
>
inverseMasses
;
std
::
vector
<
double
>
inverseMasses
;
RealOpenMM
friction
;
double
friction
;
public:
public:
...
@@ -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
friction
,
RealOpenMM
temperature
);
ReferenceStochasticDynamics
(
int
numberOfAtoms
,
double
deltaT
,
double
friction
,
double
temperature
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -67,7 +67,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -67,7 +67,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getFriction
()
const
;
double
getFriction
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -82,8 +82,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -82,8 +82,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
);
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
double
tolerance
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -98,8 +98,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -98,8 +98,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
virtual
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
xPrime
);
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Vec
3
>&
xPrime
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -113,8 +113,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -113,8 +113,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
virtual
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
xPrime
);
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Vec
3
>&
xPrime
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -127,8 +127,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
...
@@ -127,8 +127,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
void
updatePart3
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
virtual
void
updatePart3
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
xPrime
);
std
::
vector
<
double
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Vec
3
>&
xPrime
);
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
platforms/reference/include/ReferenceVariableStochasticDynamics.h
View file @
a783b996
...
@@ -33,9 +33,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -33,9 +33,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
private:
private:
std
::
vector
<
OpenMM
::
Real
Vec
>
xPrime
;
std
::
vector
<
OpenMM
::
Vec
3
>
xPrime
;
std
::
vector
<
RealOpenMM
>
inverseMasses
;
std
::
vector
<
double
>
inverseMasses
;
RealOpenMM
friction
,
_accuracy
;
double
friction
,
_accuracy
;
public:
public:
...
@@ -50,7 +50,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -50,7 +50,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVariableStochasticDynamics
(
int
numberOfAtoms
,
RealOpenMM
friction
,
RealOpenMM
temperature
,
RealOpenMM
accuracy
);
ReferenceVariableStochasticDynamics
(
int
numberOfAtoms
,
double
friction
,
double
temperature
,
double
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -66,7 +66,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -66,7 +66,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getFriction
()
const
;
double
getFriction
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -76,7 +76,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -76,7 +76,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getAccuracy
()
const
;
double
getAccuracy
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -84,7 +84,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -84,7 +84,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setAccuracy
(
RealOpenMM
accuracy
);
void
setAccuracy
(
double
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -100,8 +100,8 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -100,8 +100,8 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
,
RealOpenMM
tolerance
);
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
double
maxStepSize
,
double
tolerance
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -118,9 +118,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -118,9 +118,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
void
updatePart1
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
std
::
vector
<
double
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
xPrime
,
RealOpenMM
maxStepSize
);
std
::
vector
<
OpenMM
::
Vec
3
>&
xPrime
,
double
maxStepSize
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -134,9 +134,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
...
@@ -134,9 +134,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
void
updatePart2
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
inverseMasses
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
xPrime
);
std
::
vector
<
OpenMM
::
Vec
3
>&
xPrime
);
};
};
...
...
platforms/reference/include/ReferenceVariableVerletDynamics.h
View file @
a783b996
...
@@ -33,9 +33,9 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -33,9 +33,9 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
private:
private:
std
::
vector
<
OpenMM
::
Real
Vec
>
xPrime
;
std
::
vector
<
OpenMM
::
Vec
3
>
xPrime
;
std
::
vector
<
RealOpenMM
>
inverseMasses
;
std
::
vector
<
double
>
inverseMasses
;
RealOpenMM
_accuracy
;
double
_accuracy
;
public:
public:
...
@@ -48,7 +48,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -48,7 +48,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVariableVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
accuracy
);
ReferenceVariableVerletDynamics
(
int
numberOfAtoms
,
double
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -66,7 +66,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -66,7 +66,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
getAccuracy
()
const
;
double
getAccuracy
()
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -74,7 +74,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -74,7 +74,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
setAccuracy
(
RealOpenMM
accuracy
);
void
setAccuracy
(
double
accuracy
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -90,8 +90,8 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
...
@@ -90,8 +90,8 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
maxStepSize
,
RealOpenMM
tolerance
);
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
double
maxStepSize
,
double
tolerance
);
};
};
...
...
platforms/reference/include/ReferenceVerletDynamics.h
View file @
a783b996
...
@@ -33,8 +33,8 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
...
@@ -33,8 +33,8 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
private:
private:
std
::
vector
<
OpenMM
::
Real
Vec
>
xPrime
;
std
::
vector
<
OpenMM
::
Vec
3
>
xPrime
;
std
::
vector
<
RealOpenMM
>
inverseMasses
;
std
::
vector
<
double
>
inverseMasses
;
public:
public:
...
@@ -49,7 +49,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
...
@@ -49,7 +49,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceVerletDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
);
ReferenceVerletDynamics
(
int
numberOfAtoms
,
double
deltaT
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -72,8 +72,8 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
...
@@ -72,8 +72,8 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
);
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
double
tolerance
);
};
};
...
...
platforms/reference/include/ReferenceVirtualSites.h
View file @
a783b996
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#define __ReferenceVirtualSites_H__
#define __ReferenceVirtualSites_H__
#include "openmm/System.h"
#include "openmm/System.h"
#include "
Real
Vec.h"
#include "
openmm/
Vec
3
.h"
#include <vector>
#include <vector>
namespace
OpenMM
{
namespace
OpenMM
{
...
@@ -43,11 +43,11 @@ public:
...
@@ -43,11 +43,11 @@ public:
/**
/**
* Compute the positions of all virtual sites.
* Compute the positions of all virtual sites.
*/
*/
static
void
computePositions
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
);
static
void
computePositions
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
);
/**
/**
* Distribute forces from virtual sites to the atoms they are based on.
* Distribute forces from virtual sites to the atoms they are based on.
*/
*/
static
void
distributeForces
(
const
OpenMM
::
System
&
system
,
const
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
);
static
void
distributeForces
(
const
OpenMM
::
System
&
system
,
const
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
);
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
platforms/reference/include/SimTKOpenMMRealType.h
View file @
a783b996
/* Portions copyright (c) 2006 Stanford University and Simbios.
/* Portions copyright (c) 2006
-2017
Stanford University and Simbios.
* Contributors: Pande Group
* Contributors: Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -28,46 +28,6 @@
...
@@ -28,46 +28,6 @@
#include <cmath>
#include <cmath>
// Set RealOpenMMType to 2 for double precision, 1 for float
#ifndef RealOpenMMType
#define RealOpenMMType 2
#endif
#if RealOpenMMType == 1
#define RealOpenMM float
#define SQRT sqrtf
#define POW powf
#define SIN sinf
#define COS cosf
#define TAN tanf
// LOG is used in Vishal's gpu code; modifying LOG -> LN
#define LN logf
#define EXP expf
#define FABS fabsf
#define ACOS acosf
#define ASIN asinf
#define ATAN atanf
#define TANH tanhf
#define FLOOR floorf
#define ATOF atoff
#define PI_M 3.141592653589f
#define TWO_SIX 1.122462048309372981f
#define RADIAN 57.29577951308f
#define RADIAN_TO_DEGREE 57.29577951308f
#define LOG_TEN 2.302585092994045684f
#define SQRT_TWO 1.41421356237309504f
#define DEGREE_TO_RADIAN 0.01745329252f
#define RADIAN_INVERSE 0.01745329252f
#else
#define RealOpenMM double
#define RealOpenMM double
#define SQRT sqrt
#define SQRT sqrt
#define POW pow
#define POW pow
...
@@ -98,8 +58,6 @@
...
@@ -98,8 +58,6 @@
#define DEGREE_TO_RADIAN 0.01745329252
#define DEGREE_TO_RADIAN 0.01745329252
#define RADIAN_INVERSE 0.01745329252
#define RADIAN_INVERSE 0.01745329252
#endif
#define DOT3(u,v) ((u[0])*(v[0]) + (u[1])*(v[1]) + (u[2])*(v[2]))
#define DOT3(u,v) ((u[0])*(v[0]) + (u[1])*(v[1]) + (u[2])*(v[2]))
#define MATRIXDOT3(u,v) u[0]*v[0] + u[1]*v[1] + u[2]*v[2] + \
#define MATRIXDOT3(u,v) u[0]*v[0] + u[1]*v[1] + u[2]*v[2] + \
...
...
platforms/reference/include/SimTKOpenMMUtilities.h
View file @
a783b996
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// class of shared, static utility methods
// class of shared, static utility methods
#include "
RealVec
.h"
#include "
SimTKOpenMMRealType
.h"
#include "sfmt/SFMT.h"
#include "sfmt/SFMT.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExport.h"
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -49,7 +49,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
static
uint32_t
_randomNumberSeed
;
static
uint32_t
_randomNumberSeed
;
static
bool
_randomInitialized
;
static
bool
_randomInitialized
;
static
bool
nextGaussianIsValid
;
static
bool
nextGaussianIsValid
;
static
RealOpenMM
nextGaussian
;
static
double
nextGaussian
;
static
OpenMM_SFMT
::
SFMT
sfmt
;
static
OpenMM_SFMT
::
SFMT
sfmt
;
public:
public:
...
@@ -61,7 +61,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -61,7 +61,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Allocate 1D
RealOpenMM
array (Simbios)
Allocate 1D
double
array (Simbios)
array[i]
array[i]
...
@@ -75,13 +75,13 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -75,13 +75,13 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
*
allocateOneDRealOpenMMArray
(
int
iSize
,
RealOpenMM
*
array1D
,
int
initialize
,
static
double
*
allocateOneDRealOpenMMArray
(
int
iSize
,
double
*
array1D
,
int
initialize
,
RealOpenMM
initialValue
,
double
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Allocate 2D
RealOpenMM
array (Simbios)
Allocate 2D
double
array (Simbios)
array[i][j]
array[i][j]
...
@@ -96,14 +96,14 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -96,14 +96,14 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
**
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
static
double
**
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
RealOpenMM
**
array2D
,
int
initialize
,
double
**
array2D
,
int
initialize
,
RealOpenMM
initialValue
,
double
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
/* ---------------------------------------------------------------------------------------
/* ---------------------------------------------------------------------------------------
Free 2D
RealOpenMM
array (Simbios)
Free 2D
double
array (Simbios)
array[i][j]
array[i][j]
...
@@ -112,12 +112,12 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -112,12 +112,12 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
freeOneDRealOpenMMArray
(
RealOpenMM
*
array1D
,
static
void
freeOneDRealOpenMMArray
(
double
*
array1D
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
/* ---------------------------------------------------------------------------------------
/* ---------------------------------------------------------------------------------------
Free 2D
RealOpenMM
array (Simbios)
Free 2D
double
array (Simbios)
array[i][j]
array[i][j]
...
@@ -126,12 +126,12 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -126,12 +126,12 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
freeTwoDRealOpenMMArray
(
RealOpenMM
**
array2D
,
static
void
freeTwoDRealOpenMMArray
(
double
**
array2D
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Initialize 2D
RealOpenMM
array (Simbios)
Initialize 2D
double
array (Simbios)
array[i][j]
array[i][j]
...
@@ -143,7 +143,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -143,7 +143,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
void
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
static
void
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
RealOpenMM
**
array2D
,
RealOpenMM
initialValue
);
double
**
array2D
,
double
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
(
double
*
vectorX
,
double
*
vectorY
,
double
*
vectorZ
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -169,7 +169,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -169,7 +169,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getNormallyDistributedRandomNumber
();
static
double
getNormallyDistributedRandomNumber
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -179,7 +179,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -179,7 +179,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getUniformlyDistributedRandomNumber
();
static
double
getUniformlyDistributedRandomNumber
();
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/include/fftpack.h
View file @
a783b996
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdio.h>
#include "RealVec.h"
#include "openmm/internal/windowsExport.h"
#include "openmm/internal/windowsExport.h"
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -33,15 +32,15 @@ extern "C" {
...
@@ -33,15 +32,15 @@ extern "C" {
class
t_complex
{
class
t_complex
{
public:
public:
RealOpenMM
re
;
double
re
;
RealOpenMM
im
;
double
im
;
t_complex
()
:
re
(
0.0
),
im
(
0.0
)
{
t_complex
()
:
re
(
0.0
),
im
(
0.0
)
{
}
}
t_complex
(
RealOpenMM
re
,
RealOpenMM
im
)
:
re
(
re
),
im
(
im
)
{
t_complex
(
double
re
,
double
im
)
:
re
(
re
),
im
(
im
)
{
}
}
t_complex
(
const
t_complex
&
c
)
:
re
(
c
.
re
),
im
(
c
.
im
)
{
t_complex
(
const
t_complex
&
c
)
:
re
(
c
.
re
),
im
(
c
.
im
)
{
}
}
t_complex
operator
*
(
RealOpenMM
r
)
{
t_complex
operator
*
(
double
r
)
{
return
t_complex
(
re
*
r
,
im
*
r
);
return
t_complex
(
re
*
r
,
im
*
r
);
}
}
t_complex
operator
+
(
const
t_complex
&
c
)
const
{
t_complex
operator
+
(
const
t_complex
&
c
)
const
{
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
a783b996
This diff is collapsed.
Click to expand it.
platforms/reference/src/ReferencePlatform.cpp
View file @
a783b996
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include "ReferenceKernels.h"
#include "ReferenceKernels.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "
Real
Vec.h"
#include "
openmm/
Vec
3
.h"
#include <map>
#include <map>
#include <vector>
#include <vector>
...
@@ -82,7 +82,7 @@ double ReferencePlatform::getSpeed() const {
...
@@ -82,7 +82,7 @@ double ReferencePlatform::getSpeed() const {
}
}
bool
ReferencePlatform
::
supportsDoublePrecision
()
const
{
bool
ReferencePlatform
::
supportsDoublePrecision
()
const
{
return
(
sizeof
(
RealOpenMM
)
>=
sizeof
(
double
))
;
return
true
;
}
}
void
ReferencePlatform
::
contextCreated
(
ContextImpl
&
context
,
const
map
<
string
,
string
>&
properties
)
const
{
void
ReferencePlatform
::
contextCreated
(
ContextImpl
&
context
,
const
map
<
string
,
string
>&
properties
)
const
{
...
@@ -95,21 +95,21 @@ void ReferencePlatform::contextDestroyed(ContextImpl& context) const {
...
@@ -95,21 +95,21 @@ void ReferencePlatform::contextDestroyed(ContextImpl& context) const {
}
}
ReferencePlatform
::
PlatformData
::
PlatformData
(
const
System
&
system
)
:
time
(
0.0
),
stepCount
(
0
),
numParticles
(
system
.
getNumParticles
())
{
ReferencePlatform
::
PlatformData
::
PlatformData
(
const
System
&
system
)
:
time
(
0.0
),
stepCount
(
0
),
numParticles
(
system
.
getNumParticles
())
{
positions
=
new
vector
<
Real
Vec
>
(
numParticles
);
positions
=
new
vector
<
Vec
3
>
(
numParticles
);
velocities
=
new
vector
<
Real
Vec
>
(
numParticles
);
velocities
=
new
vector
<
Vec
3
>
(
numParticles
);
forces
=
new
vector
<
Real
Vec
>
(
numParticles
);
forces
=
new
vector
<
Vec
3
>
(
numParticles
);
periodicBoxSize
=
new
Real
Vec
();
periodicBoxSize
=
new
Vec
3
();
periodicBoxVectors
=
new
Real
Vec
[
3
];
periodicBoxVectors
=
new
Vec
3
[
3
];
constraints
=
new
ReferenceConstraints
(
system
);
constraints
=
new
ReferenceConstraints
(
system
);
energyParameterDerivatives
=
new
map
<
string
,
double
>
();
energyParameterDerivatives
=
new
map
<
string
,
double
>
();
}
}
ReferencePlatform
::
PlatformData
::~
PlatformData
()
{
ReferencePlatform
::
PlatformData
::~
PlatformData
()
{
delete
(
vector
<
Real
Vec
>*
)
positions
;
delete
(
vector
<
Vec
3
>*
)
positions
;
delete
(
vector
<
Real
Vec
>*
)
velocities
;
delete
(
vector
<
Vec
3
>*
)
velocities
;
delete
(
vector
<
Real
Vec
>*
)
forces
;
delete
(
vector
<
Vec
3
>*
)
forces
;
delete
(
Real
Vec
*
)
periodicBoxSize
;
delete
(
Vec
3
*
)
periodicBoxSize
;
delete
[]
(
Real
Vec
*
)
periodicBoxVectors
;
delete
[]
(
Vec
3
*
)
periodicBoxVectors
;
delete
(
ReferenceConstraints
*
)
constraints
;
delete
(
ReferenceConstraints
*
)
constraints
;
delete
(
map
<
string
,
double
>*
)
energyParameterDerivatives
;
delete
(
map
<
string
,
double
>*
)
energyParameterDerivatives
;
}
}
platforms/reference/src/SimTKReference/ObcParameters.cpp
View file @
a783b996
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "openmm/OpenMMException.h"
#include "openmm/OpenMMException.h"
#include "ObcParameters.h"
#include "ObcParameters.h"
#include "SimTKOpenMMRealType.h"
using
std
::
vector
;
using
std
::
vector
;
using
namespace
OpenMM
;
using
namespace
OpenMM
;
...
@@ -121,7 +122,7 @@ void ObcParameters::setObcTypeParameters(ObcParameters::ObcType obcType) {
...
@@ -121,7 +122,7 @@ void ObcParameters::setObcTypeParameters(ObcParameters::ObcType obcType) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getDielectricOffset
()
const
{
double
ObcParameters
::
getDielectricOffset
()
const
{
return
_dielectricOffset
;
return
_dielectricOffset
;
}
}
...
@@ -133,7 +134,7 @@ RealOpenMM ObcParameters::getDielectricOffset() const {
...
@@ -133,7 +134,7 @@ RealOpenMM ObcParameters::getDielectricOffset() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getAlphaObc
()
const
{
double
ObcParameters
::
getAlphaObc
()
const
{
return
_alphaObc
;
return
_alphaObc
;
}
}
...
@@ -145,7 +146,7 @@ RealOpenMM ObcParameters::getAlphaObc() const {
...
@@ -145,7 +146,7 @@ RealOpenMM ObcParameters::getAlphaObc() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getBetaObc
()
const
{
double
ObcParameters
::
getBetaObc
()
const
{
return
_betaObc
;
return
_betaObc
;
}
}
...
@@ -157,7 +158,7 @@ RealOpenMM ObcParameters::getBetaObc() const {
...
@@ -157,7 +158,7 @@ RealOpenMM ObcParameters::getBetaObc() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getGammaObc
()
const
{
double
ObcParameters
::
getGammaObc
()
const
{
return
_gammaObc
;
return
_gammaObc
;
}
}
...
@@ -169,7 +170,7 @@ RealOpenMM ObcParameters::getGammaObc() const {
...
@@ -169,7 +170,7 @@ RealOpenMM ObcParameters::getGammaObc() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getSolventDielectric
()
const
{
double
ObcParameters
::
getSolventDielectric
()
const
{
return
_solventDielectric
;
return
_solventDielectric
;
}
}
...
@@ -181,7 +182,7 @@ RealOpenMM ObcParameters::getSolventDielectric() const {
...
@@ -181,7 +182,7 @@ RealOpenMM ObcParameters::getSolventDielectric() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setSolventDielectric
(
RealOpenMM
solventDielectric
)
{
void
ObcParameters
::
setSolventDielectric
(
double
solventDielectric
)
{
_solventDielectric
=
solventDielectric
;
_solventDielectric
=
solventDielectric
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -192,7 +193,7 @@ void ObcParameters::setSolventDielectric(RealOpenMM solventDielectric) {
...
@@ -192,7 +193,7 @@ void ObcParameters::setSolventDielectric(RealOpenMM solventDielectric) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getSoluteDielectric
()
const
{
double
ObcParameters
::
getSoluteDielectric
()
const
{
return
_soluteDielectric
;
return
_soluteDielectric
;
}
}
...
@@ -204,7 +205,7 @@ RealOpenMM ObcParameters::getSoluteDielectric() const {
...
@@ -204,7 +205,7 @@ RealOpenMM ObcParameters::getSoluteDielectric() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setSoluteDielectric
(
RealOpenMM
soluteDielectric
)
{
void
ObcParameters
::
setSoluteDielectric
(
double
soluteDielectric
)
{
_soluteDielectric
=
soluteDielectric
;
_soluteDielectric
=
soluteDielectric
;
}
}
...
@@ -216,7 +217,7 @@ void ObcParameters::setSoluteDielectric(RealOpenMM soluteDielectric) {
...
@@ -216,7 +217,7 @@ void ObcParameters::setSoluteDielectric(RealOpenMM soluteDielectric) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getElectricConstant
()
const
{
double
ObcParameters
::
getElectricConstant
()
const
{
return
_electricConstant
;
return
_electricConstant
;
}
}
...
@@ -228,7 +229,7 @@ RealOpenMM ObcParameters::getElectricConstant() const {
...
@@ -228,7 +229,7 @@ RealOpenMM ObcParameters::getElectricConstant() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getProbeRadius
()
const
{
double
ObcParameters
::
getProbeRadius
()
const
{
return
_probeRadius
;
return
_probeRadius
;
}
}
...
@@ -240,25 +241,25 @@ RealOpenMM ObcParameters::getProbeRadius() const {
...
@@ -240,25 +241,25 @@ RealOpenMM ObcParameters::getProbeRadius() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setProbeRadius
(
RealOpenMM
probeRadius
)
{
void
ObcParameters
::
setProbeRadius
(
double
probeRadius
)
{
_probeRadius
=
probeRadius
;
_probeRadius
=
probeRadius
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Get pi*4*Asolv: used in ACE approximation for nonpolar term
Get pi*4*Asolv: used in ACE approximation for nonpolar term
((RealOpenMM)
M_PI
)
*4.0f*0.0049*1000.0; (Still)
M_PI*4.0f*0.0049*1000.0; (Still)
((RealOpenMM)
M_PI
)
*4.0f*0.0054*1000.0; (OBC)
M_PI*4.0f*0.0054*1000.0; (OBC)
@return pi4Asolv
@return pi4Asolv
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getPi4Asolv
()
const
{
double
ObcParameters
::
getPi4Asolv
()
const
{
return
_pi4Asolv
;
return
_pi4Asolv
;
}
}
void
ObcParameters
::
setPi4Asolv
(
RealOpenMM
pi4Asolv
)
{
void
ObcParameters
::
setPi4Asolv
(
double
pi4Asolv
)
{
_pi4Asolv
=
pi4Asolv
;
_pi4Asolv
=
pi4Asolv
;
}
}
...
@@ -270,7 +271,7 @@ void ObcParameters::setPi4Asolv(RealOpenMM pi4Asolv) {
...
@@ -270,7 +271,7 @@ void ObcParameters::setPi4Asolv(RealOpenMM pi4Asolv) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
const
vector
<
RealOpenMM
>&
ObcParameters
::
getAtomicRadii
()
const
{
const
vector
<
double
>&
ObcParameters
::
getAtomicRadii
()
const
{
return
_atomicRadii
;
return
_atomicRadii
;
}
}
...
@@ -282,7 +283,7 @@ const vector<RealOpenMM>& ObcParameters::getAtomicRadii() const {
...
@@ -282,7 +283,7 @@ const vector<RealOpenMM>& ObcParameters::getAtomicRadii() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setAtomicRadii
(
const
vector
<
RealOpenMM
>&
atomicRadii
)
{
void
ObcParameters
::
setAtomicRadii
(
const
vector
<
double
>&
atomicRadii
)
{
if
(
atomicRadii
.
size
()
==
_atomicRadii
.
size
())
{
if
(
atomicRadii
.
size
()
==
_atomicRadii
.
size
())
{
for
(
unsigned
int
ii
=
0
;
ii
<
atomicRadii
.
size
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
atomicRadii
.
size
();
ii
++
)
{
...
@@ -306,7 +307,7 @@ void ObcParameters::setAtomicRadii(const vector<RealOpenMM>& atomicRadii) {
...
@@ -306,7 +307,7 @@ void ObcParameters::setAtomicRadii(const vector<RealOpenMM>& atomicRadii) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
const
vector
<
RealOpenMM
>&
ObcParameters
::
getScaledRadiusFactors
()
const
{
const
vector
<
double
>&
ObcParameters
::
getScaledRadiusFactors
()
const
{
return
_scaledRadiusFactors
;
return
_scaledRadiusFactors
;
}
}
...
@@ -318,7 +319,7 @@ const vector<RealOpenMM>& ObcParameters::getScaledRadiusFactors() const {
...
@@ -318,7 +319,7 @@ const vector<RealOpenMM>& ObcParameters::getScaledRadiusFactors() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setScaledRadiusFactors
(
const
vector
<
RealOpenMM
>&
scaledRadiusFactors
)
{
void
ObcParameters
::
setScaledRadiusFactors
(
const
vector
<
double
>&
scaledRadiusFactors
)
{
if
(
scaledRadiusFactors
.
size
()
==
_scaledRadiusFactors
.
size
())
{
if
(
scaledRadiusFactors
.
size
()
==
_scaledRadiusFactors
.
size
())
{
for
(
unsigned
int
ii
=
0
;
ii
<
scaledRadiusFactors
.
size
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
scaledRadiusFactors
.
size
();
ii
++
)
{
...
@@ -342,7 +343,7 @@ void ObcParameters::setScaledRadiusFactors(const vector<RealOpenMM>& scaledRadiu
...
@@ -342,7 +343,7 @@ void ObcParameters::setScaledRadiusFactors(const vector<RealOpenMM>& scaledRadiu
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setUseCutoff
(
RealOpenMM
distance
)
{
void
ObcParameters
::
setUseCutoff
(
double
distance
)
{
_cutoff
=
true
;
_cutoff
=
true
;
_cutoffDistance
=
distance
;
_cutoffDistance
=
distance
;
...
@@ -364,7 +365,7 @@ bool ObcParameters::getUseCutoff() const {
...
@@ -364,7 +365,7 @@ bool ObcParameters::getUseCutoff() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
RealOpenMM
ObcParameters
::
getCutoffDistance
()
const
{
double
ObcParameters
::
getCutoffDistance
()
const
{
return
_cutoffDistance
;
return
_cutoffDistance
;
}
}
...
@@ -378,7 +379,7 @@ RealOpenMM ObcParameters::getCutoffDistance() const {
...
@@ -378,7 +379,7 @@ RealOpenMM ObcParameters::getCutoffDistance() const {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ObcParameters
::
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
)
{
void
ObcParameters
::
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
)
{
assert
(
_cutoff
);
assert
(
_cutoff
);
...
@@ -408,6 +409,6 @@ bool ObcParameters::getPeriodic() {
...
@@ -408,6 +409,6 @@ bool ObcParameters::getPeriodic() {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
const
OpenMM
::
Real
Vec
*
ObcParameters
::
getPeriodicBox
()
{
const
OpenMM
::
Vec
3
*
ObcParameters
::
getPeriodicBox
()
{
return
_periodicBoxVectors
;
return
_periodicBoxVectors
;
}
}
platforms/reference/src/SimTKReference/ReferenceAndersenThermostat.cpp
View file @
a783b996
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
*/
#include <cmath>
#include <string.h>
#include <string.h>
#include <sstream>
#include <sstream>
...
@@ -61,10 +62,10 @@ using namespace OpenMM;
...
@@ -61,10 +62,10 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAndersenThermostat
::
applyThermostat
(
const
vector
<
vector
<
int
>
>&
atomGroups
,
vector
<
Real
Vec
>&
atomVelocities
,
vector
<
RealOpenMM
>&
atomMasses
,
void
ReferenceAndersenThermostat
::
applyThermostat
(
const
vector
<
vector
<
int
>
>&
atomGroups
,
vector
<
Vec
3
>&
atomVelocities
,
vector
<
double
>&
atomMasses
,
RealOpenMM
temperature
,
RealOpenMM
collisionFrequency
,
RealOpenMM
stepSize
)
const
{
double
temperature
,
double
collisionFrequency
,
double
stepSize
)
const
{
const
RealOpenMM
collisionProbability
=
1.0
f
-
EXP
(
-
collisionFrequency
*
stepSize
);
const
double
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
)
{
if
(
SimTKOpenMMUtilities
::
getUniformlyDistributedRandomNumber
()
<
collisionProbability
)
{
if
(
SimTKOpenMMUtilities
::
getUniformlyDistributedRandomNumber
()
<
collisionProbability
)
{
...
@@ -73,7 +74,7 @@ using namespace OpenMM;
...
@@ -73,7 +74,7 @@ using namespace OpenMM;
for
(
int
j
=
0
;
j
<
(
int
)
atomGroups
[
i
].
size
();
j
++
)
{
for
(
int
j
=
0
;
j
<
(
int
)
atomGroups
[
i
].
size
();
j
++
)
{
int
atom
=
atomGroups
[
i
][
j
];
int
atom
=
atomGroups
[
i
][
j
];
if
(
atomMasses
[
atom
]
!=
0
)
{
if
(
atomMasses
[
atom
]
!=
0
)
{
const
RealOpenMM
velocityScale
=
static_cast
<
RealOpenMM
>
(
sqrt
(
BOLTZ
*
temperature
/
atomMasses
[
atom
]));
const
double
velocityScale
=
static_cast
<
double
>
(
sqrt
(
BOLTZ
*
temperature
/
atomMasses
[
atom
]));
atomVelocities
[
atom
][
0
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
0
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
1
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
1
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
2
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
atomVelocities
[
atom
][
2
]
=
velocityScale
*
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
();
...
...
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
View file @
a783b996
...
@@ -39,13 +39,6 @@ using namespace OpenMM;
...
@@ -39,13 +39,6 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn
::
ReferenceAngleBondIxn
()
:
usePeriodic
(
false
)
{
ReferenceAngleBondIxn
::
ReferenceAngleBondIxn
()
:
usePeriodic
(
false
)
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceAngleBondIxn::ReferenceAngleBondIxn";
// ---------------------------------------------------------------------------------------
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -55,16 +48,9 @@ ReferenceAngleBondIxn::ReferenceAngleBondIxn() : usePeriodic(false) {
...
@@ -55,16 +48,9 @@ ReferenceAngleBondIxn::ReferenceAngleBondIxn() : usePeriodic(false) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn
::~
ReferenceAngleBondIxn
()
{
ReferenceAngleBondIxn
::~
ReferenceAngleBondIxn
()
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceAngleBondIxn::~ReferenceAngleBondIxn";
// ---------------------------------------------------------------------------------------
}
}
void
ReferenceAngleBondIxn
::
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
)
{
void
ReferenceAngleBondIxn
::
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
)
{
usePeriodic
=
true
;
usePeriodic
=
true
;
boxVectors
[
0
]
=
vectors
[
0
];
boxVectors
[
0
]
=
vectors
[
0
];
boxVectors
[
1
]
=
vectors
[
1
];
boxVectors
[
1
]
=
vectors
[
1
];
...
@@ -83,32 +69,22 @@ void ReferenceAngleBondIxn::setPeriodic(OpenMM::RealVec* vectors) {
...
@@ -83,32 +69,22 @@ void ReferenceAngleBondIxn::setPeriodic(OpenMM::RealVec* vectors) {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
void
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
double
cosine
,
double
*
angleParameters
,
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
{
double
*
dEdR
,
double
*
energyTerm
)
const
{
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nReferenceAngleBondIxn::getPrefactorsGivenAngleCosine";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
half
=
0.5
;
// ---------------------------------------------------------------------------------------
double
angle
;
if
(
cosine
>=
1.0
)
{
RealOpenMM
angle
;
angle
=
0.0
;
if
(
cosine
>=
one
)
{
}
else
if
(
cosine
<=
-
1.0
)
{
angle
=
zero
;
}
else
if
(
cosine
<=
-
one
)
{
angle
=
PI_M
;
angle
=
PI_M
;
}
else
{
}
else
{
angle
=
ACOS
(
cosine
);
angle
=
acos
(
cosine
);
}
}
RealOpenMM
deltaIdeal
=
angle
-
angleParameters
[
0
];
double
deltaIdeal
=
angle
-
angleParameters
[
0
];
RealOpenMM
deltaIdeal2
=
deltaIdeal
*
deltaIdeal
;
double
deltaIdeal2
=
deltaIdeal
*
deltaIdeal
;
*
dEdR
=
angleParameters
[
1
]
*
deltaIdeal
;
*
dEdR
=
angleParameters
[
1
]
*
deltaIdeal
;
*
energyTerm
=
half
*
angleParameters
[
1
]
*
deltaIdeal2
;
*
energyTerm
=
0.5
*
angleParameters
[
1
]
*
deltaIdeal2
;
}
}
...
@@ -126,24 +102,14 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine(RealOpenMM cosine, Rea
...
@@ -126,24 +102,14 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine(RealOpenMM cosine, Rea
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceAngleBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
void
ReferenceAngleBondIxn
::
calculateBondIxn
(
int
*
atomIndices
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
Vec3
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
double
*
parameters
,
vector
<
RealVec
>&
forces
,
vector
<
Vec3
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
)
{
double
*
totalEnergy
,
double
*
energyParamDerivs
)
{
// constants -- reduce Visual Studio warnings regarding conversions between float & double
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
two
=
2.0
;
static
const
RealOpenMM
three
=
3.0
;
static
const
RealOpenMM
oneM
=
-
1.0
;
static
const
int
threeI
=
3
;
static
const
int
LastAtomIndex
=
3
;
static
const
int
LastAtomIndex
=
3
;
RealOpenMM
deltaR
[
2
][
ReferenceForce
::
LastDeltaRIndex
];
double
deltaR
[
2
][
ReferenceForce
::
LastDeltaRIndex
];
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -161,37 +127,36 @@ void ReferenceAngleBondIxn::calculateBondIxn(int* atomIndices,
...
@@ -161,37 +127,36 @@ void ReferenceAngleBondIxn::calculateBondIxn(int* atomIndices,
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomCIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
1
]);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomCIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
[
1
]);
}
}
RealOpenMM
pVector
[
threeI
];
double
pVector
[
3
];
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
deltaR
[
1
],
pVector
);
SimTKOpenMMUtilities
::
crossProductVector3
(
deltaR
[
0
],
deltaR
[
1
],
pVector
);
RealOpenMM
rp
=
DOT3
(
pVector
,
pVector
);
double
rp
=
sqrt
(
DOT3
(
pVector
,
pVector
));
rp
=
SQRT
(
rp
);
if
(
rp
<
1.0e-06
)
{
if
(
rp
<
1.0e-06
)
{
rp
=
(
RealOpenMM
)
1.0e-06
;
rp
=
1.0e-06
;
}
}
RealOpenMM
dot
=
DOT3
(
deltaR
[
0
],
deltaR
[
1
]);
double
dot
=
DOT3
(
deltaR
[
0
],
deltaR
[
1
]);
RealOpenMM
cosine
=
dot
/
SQRT
((
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
deltaR
[
1
][
ReferenceForce
::
R2Index
]));
double
cosine
=
dot
/
sqrt
((
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
deltaR
[
1
][
ReferenceForce
::
R2Index
]));
RealOpenMM
dEdR
;
double
dEdR
;
RealOpenMM
energy
;
double
energy
;
getPrefactorsGivenAngleCosine
(
cosine
,
parameters
,
&
dEdR
,
&
energy
);
getPrefactorsGivenAngleCosine
(
cosine
,
parameters
,
&
dEdR
,
&
energy
);
RealOpenMM
termA
=
dEdR
/
(
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
rp
);
double
termA
=
dEdR
/
(
deltaR
[
0
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
termC
=
-
dEdR
/
(
deltaR
[
1
][
ReferenceForce
::
R2Index
]
*
rp
);
double
termC
=
-
dEdR
/
(
deltaR
[
1
][
ReferenceForce
::
R2Index
]
*
rp
);
RealOpenMM
deltaCrossP
[
LastAtomIndex
][
threeI
];
double
deltaCrossP
[
LastAtomIndex
][
3
];
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
<
3
;
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
]
=
-
(
deltaCrossP
[
0
][
ii
]
+
deltaCrossP
[
2
][
ii
]);
}
}
// 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
<
3
;
ii
++
)
{
forces
[
atomIndices
[
jj
]][
ii
]
+=
deltaCrossP
[
jj
][
ii
];
forces
[
atomIndices
[
jj
]][
ii
]
+=
deltaCrossP
[
jj
][
ii
];
}
}
}
}
...
...
platforms/reference/src/SimTKReference/ReferenceBondForce.cpp
View file @
a783b996
...
@@ -38,13 +38,6 @@ using namespace OpenMM;
...
@@ -38,13 +38,6 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondForce
::
ReferenceBondForce
()
{
ReferenceBondForce
::
ReferenceBondForce
()
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceBondForce::ReferenceBondForce";
// ---------------------------------------------------------------------------------------
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -54,13 +47,6 @@ ReferenceBondForce::ReferenceBondForce() {
...
@@ -54,13 +47,6 @@ ReferenceBondForce::ReferenceBondForce() {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
ReferenceBondForce
::~
ReferenceBondForce
()
{
ReferenceBondForce
::~
ReferenceBondForce
()
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceBondForce::~ReferenceBondForce";
// ---------------------------------------------------------------------------------------
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -79,19 +65,12 @@ ReferenceBondForce::~ReferenceBondForce() {
...
@@ -79,19 +65,12 @@ ReferenceBondForce::~ReferenceBondForce() {
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
void
ReferenceBondForce
::
calculateForce
(
int
numberOfBonds
,
int
**
atomIndices
,
void
ReferenceBondForce
::
calculateForce
(
int
numberOfBonds
,
int
**
atomIndices
,
vector
<
Real
Vec
>&
atomCoordinates
,
vector
<
Vec
3
>&
atomCoordinates
,
RealOpenMM
**
parameters
,
double
**
parameters
,
vector
<
Real
Vec
>&
forces
,
vector
<
Vec
3
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
totalEnergy
,
ReferenceBondIxn
&
referenceBondIxn
)
{
ReferenceBondIxn
&
referenceBondIxn
)
{
// ---------------------------------------------------------------------------------------
static
const
char
*
methodName
=
"
\n
ReferenceBondForce::calculateForce"
;
// ---------------------------------------------------------------------------------------
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
)
{
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
)
{
// calculate bond ixn
// calculate bond ixn
...
...
platforms/reference/src/SimTKReference/ReferenceBondIxn.cpp
View file @
a783b996
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
View file @
a783b996
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
View file @
a783b996
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
View file @
a783b996
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
7
8
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