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
a4020466
Commit
a4020466
authored
Jul 14, 2009
by
Peter Eastman
Browse files
Renamed OpenMMContext to Context
parent
95b8dbd6
Changes
139
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
86 additions
and
86 deletions
+86
-86
platforms/reference/src/ReferenceKernels.h
platforms/reference/src/ReferenceKernels.h
+25
-25
platforms/reference/src/ReferencePlatform.cpp
platforms/reference/src/ReferencePlatform.cpp
+3
-3
platforms/reference/src/ReferenceStreamFactory.cpp
platforms/reference/src/ReferenceStreamFactory.cpp
+1
-1
platforms/reference/tests/TestReferenceAndersenThermostat.cpp
...forms/reference/tests/TestReferenceAndersenThermostat.cpp
+3
-3
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
...forms/reference/tests/TestReferenceBrownianIntegrator.cpp
+5
-5
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
+2
-2
platforms/reference/tests/TestReferenceEwald.cpp
platforms/reference/tests/TestReferenceEwald.cpp
+3
-3
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
+4
-4
platforms/reference/tests/TestReferenceGBVIForce.cpp
platforms/reference/tests/TestReferenceGBVIForce.cpp
+5
-5
platforms/reference/tests/TestReferenceHarmonicAngleForce.cpp
...forms/reference/tests/TestReferenceHarmonicAngleForce.cpp
+2
-2
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
+2
-2
platforms/reference/tests/TestReferenceKineticEnergy.cpp
platforms/reference/tests/TestReferenceKineticEnergy.cpp
+2
-2
platforms/reference/tests/TestReferenceLangevinIntegrator.cpp
...forms/reference/tests/TestReferenceLangevinIntegrator.cpp
+5
-5
platforms/reference/tests/TestReferenceNonbondedForce.cpp
platforms/reference/tests/TestReferenceNonbondedForce.cpp
+7
-7
platforms/reference/tests/TestReferencePeriodicTorsionForce.cpp
...rms/reference/tests/TestReferencePeriodicTorsionForce.cpp
+2
-2
platforms/reference/tests/TestReferenceRBTorsionForce.cpp
platforms/reference/tests/TestReferenceRBTorsionForce.cpp
+2
-2
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
...ference/tests/TestReferenceVariableLangevinIntegrator.cpp
+5
-5
platforms/reference/tests/TestReferenceVariableVerletIntegrator.cpp
...reference/tests/TestReferenceVariableVerletIntegrator.cpp
+4
-4
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
+4
-4
No files found.
platforms/reference/src/ReferenceKernels.h
View file @
a4020466
...
...
@@ -67,7 +67,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
execute
(
OpenMM
ContextImpl
&
context
);
void
execute
(
ContextImpl
&
context
);
};
/**
...
...
@@ -88,13 +88,13 @@ public:
*
* @param context the context in which to execute this kernel
*/
double
getTime
(
const
OpenMM
ContextImpl
&
context
)
const
;
double
getTime
(
const
ContextImpl
&
context
)
const
;
/**
* Set the current time (in picoseconds).
*
* @param context the context in which to execute this kernel
*/
void
setTime
(
OpenMM
ContextImpl
&
context
,
double
time
);
void
setTime
(
ContextImpl
&
context
,
double
time
);
private:
ReferencePlatform
::
PlatformData
&
data
;
};
...
...
@@ -119,14 +119,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicBondForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
int
numBonds
;
int
**
bondIndexArray
;
...
...
@@ -153,14 +153,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicAngleForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
int
numAngles
;
int
**
angleIndexArray
;
...
...
@@ -187,14 +187,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the PeriodicTorsionForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
int
numTorsions
;
int
**
torsionIndexArray
;
...
...
@@ -221,14 +221,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the RBTorsionForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
int
numTorsions
;
int
**
torsionIndexArray
;
...
...
@@ -255,14 +255,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the NonbondedForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
int
numParticles
,
num14
;
int
**
exclusionArray
,
**
bonded14IndexArray
;
...
...
@@ -294,14 +294,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
CpuObc
*
obc
;
std
::
vector
<
RealOpenMM
>
charges
;
...
...
@@ -328,14 +328,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBVIForce
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
private:
CpuGBVI
*
gbvi
;
std
::
vector
<
RealOpenMM
>
charges
;
...
...
@@ -363,7 +363,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the VerletIntegrator this kernel is being used for
*/
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VerletIntegrator
&
integrator
);
void
execute
(
ContextImpl
&
context
,
const
VerletIntegrator
&
integrator
);
private:
ReferencePlatform
::
PlatformData
&
data
;
ReferenceVerletDynamics
*
dynamics
;
...
...
@@ -397,7 +397,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the LangevinIntegrator this kernel is being used for
*/
void
execute
(
OpenMM
ContextImpl
&
context
,
const
LangevinIntegrator
&
integrator
);
void
execute
(
ContextImpl
&
context
,
const
LangevinIntegrator
&
integrator
);
private:
ReferencePlatform
::
PlatformData
&
data
;
ReferenceStochasticDynamics
*
dynamics
;
...
...
@@ -431,7 +431,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the BrownianIntegrator this kernel is being used for
*/
void
execute
(
OpenMM
ContextImpl
&
context
,
const
BrownianIntegrator
&
integrator
);
void
execute
(
ContextImpl
&
context
,
const
BrownianIntegrator
&
integrator
);
private:
ReferencePlatform
::
PlatformData
&
data
;
ReferenceBrownianDynamics
*
dynamics
;
...
...
@@ -466,7 +466,7 @@ public:
* @param integrator the LangevinIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VariableLangevinIntegrator
&
integrator
,
double
maxTime
);
void
execute
(
ContextImpl
&
context
,
const
VariableLangevinIntegrator
&
integrator
,
double
maxTime
);
private:
ReferencePlatform
::
PlatformData
&
data
;
ReferenceVariableStochasticDynamics
*
dynamics
;
...
...
@@ -501,7 +501,7 @@ public:
* @param integrator the VerletIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VariableVerletIntegrator
&
integrator
,
double
maxTime
);
void
execute
(
ContextImpl
&
context
,
const
VariableVerletIntegrator
&
integrator
,
double
maxTime
);
private:
ReferencePlatform
::
PlatformData
&
data
;
ReferenceVariableVerletDynamics
*
dynamics
;
...
...
@@ -533,7 +533,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
execute
(
OpenMM
ContextImpl
&
context
);
void
execute
(
ContextImpl
&
context
);
private:
ReferenceAndersenThermostat
*
thermostat
;
RealOpenMM
*
masses
;
...
...
@@ -557,7 +557,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
double
execute
(
OpenMM
ContextImpl
&
context
);
double
execute
(
ContextImpl
&
context
);
private:
std
::
vector
<
double
>
masses
;
};
...
...
@@ -581,7 +581,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void
execute
(
OpenMM
ContextImpl
&
context
);
void
execute
(
ContextImpl
&
context
);
private:
ReferencePlatform
::
PlatformData
&
data
;
std
::
vector
<
double
>
masses
;
...
...
platforms/reference/src/ReferencePlatform.cpp
View file @
a4020466
...
...
@@ -32,7 +32,7 @@
#include "ReferencePlatform.h"
#include "ReferenceKernelFactory.h"
#include "ReferenceKernels.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "SimTKUtilities/SimTKOpenMMRealType.h"
using
namespace
OpenMM
;
...
...
@@ -66,11 +66,11 @@ const StreamFactory& ReferencePlatform::getDefaultStreamFactory() const {
return
defaultStreamFactory
;
}
void
ReferencePlatform
::
contextCreated
(
OpenMM
ContextImpl
&
context
)
const
{
void
ReferencePlatform
::
contextCreated
(
ContextImpl
&
context
)
const
{
context
.
setPlatformData
(
new
PlatformData
());
}
void
ReferencePlatform
::
contextDestroyed
(
OpenMM
ContextImpl
&
context
)
const
{
void
ReferencePlatform
::
contextDestroyed
(
ContextImpl
&
context
)
const
{
PlatformData
*
data
=
reinterpret_cast
<
PlatformData
*>
(
context
.
getPlatformData
());
delete
data
;
}
platforms/reference/src/ReferenceStreamFactory.cpp
View file @
a4020466
...
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
StreamImpl
*
ReferenceStreamFactory
::
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
OpenMM
ContextImpl
&
context
)
const
{
StreamImpl
*
ReferenceStreamFactory
::
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
{
switch
(
type
)
{
case
Stream
::
Float
:
case
Stream
::
Float2
:
...
...
platforms/reference/tests/TestReferenceAndersenThermostat.cpp
View file @
a4020466
...
...
@@ -35,7 +35,7 @@
#include "../../../tests/AssertionUtilities.h"
#include "openmm/AndersenThermostat.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
...
...
@@ -63,7 +63,7 @@ void testTemperature() {
system
.
addForce
(
forceField
);
AndersenThermostat
*
thermstat
=
new
AndersenThermostat
(
temp
,
collisionFreq
);
system
.
addForce
(
thermstat
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
positions
[
i
]
=
Vec3
((
i
%
2
==
0
?
2
:
-
2
),
(
i
%
4
<
2
?
2
:
-
2
),
(
i
<
4
?
2
:
-
2
));
...
...
@@ -111,7 +111,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
thermostat
->
setRandomNumberSeed
(
5
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setVelocities
(
velocities
);
integrator
.
step
(
10
);
...
...
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -60,7 +60,7 @@ void testSingleBond() {
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
forceField
->
addBond
(
0
,
1
,
1.5
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -98,7 +98,7 @@ void testTemperature() {
for
(
int
i
=
0
;
i
<
numBonds
;
++
i
)
forceField
->
addBond
(
i
,
i
+
1
,
1.0
,
5.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
positions
[
i
]
=
Vec3
(
i
,
0
,
0
);
...
...
@@ -137,7 +137,7 @@ void testConstraints() {
for
(
int
i
=
0
;
i
<
numParticles
-
1
;
++
i
)
system
.
addConstraint
(
i
,
i
+
1
,
1.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
@@ -185,7 +185,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator
.
setRandomNumberSeed
(
5
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setVelocities
(
velocities
);
integrator
.
step
(
10
);
...
...
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
View file @
a4020466
...
...
@@ -35,7 +35,7 @@
#include "../../../tests/AssertionUtilities.h"
#include "openmm/CMMotionRemover.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -77,7 +77,7 @@ void testMotionRemoval() {
system
.
addForce
(
nonbonded
);
CMMotionRemover
*
remover
=
new
CMMotionRemover
();
system
.
addForce
(
remover
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
platforms/reference/tests/TestReferenceEwald.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
...
...
@@ -64,7 +64,7 @@ void testEwald() {
nonbonded
->
setPeriodicBoxVectors
(
Vec3
(
6
,
0
,
0
),
Vec3
(
0
,
6
,
0
),
Vec3
(
0
,
0
,
6
));
nonbonded
->
setEwaldErrorTolerance
(
TOL
);
system
.
addForce
(
nonbonded
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
3.048000
,
2.764000
,
3.156000
);
positions
[
1
]
=
Vec3
(
2.809000
,
2.888000
,
2.571000
);
...
...
@@ -99,7 +99,7 @@ void testPME() {
nonbonded
->
setPeriodicBoxVectors
(
Vec3
(
1.86206
,
0
,
0
),
Vec3
(
0
,
1.86206
,
0
),
Vec3
(
0
,
0
,
1.86206
));
nonbonded
->
setEwaldErrorTolerance
(
TOL
);
system
.
addForce
(
nonbonded
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
42
);
positions
[
0
]
=
Vec3
(
0.23
,
0.628
,
0.113
);
positions
[
1
]
=
Vec3
(
0.137
,
0.626
,
0.15
);
...
...
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/GBSAOBCForce.h"
#include "openmm/System.h"
...
...
@@ -58,7 +58,7 @@ void testSingleParticle() {
GBSAOBCForce
*
forceField
=
new
GBSAOBCForce
();
forceField
->
addParticle
(
0.5
,
0.15
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
1
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
context
.
setPositions
(
positions
);
...
...
@@ -96,7 +96,7 @@ void testCutoffAndPeriodic() {
// Calculate the forces for both cutoff and periodic with two different atom positions.
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffNonPeriodic
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
State
state1
=
context
.
getState
(
State
::
Forces
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
...
...
@@ -134,7 +134,7 @@ void testForce() {
forceField
->
addParticle
(
i
%
2
==
0
?
-
1
:
1
,
0.15
,
1
);
}
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
// Set random positions for all the particles.
...
...
platforms/reference/tests/TestReferenceGBVIForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/GBVIForce.h"
...
...
@@ -66,7 +66,7 @@ void testSingleParticle() {
forceField
->
addParticle
(
charge
,
radius
,
gamma
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
1
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
context
.
setPositions
(
positions
);
...
...
@@ -111,7 +111,7 @@ void testCutoffAndPeriodic() {
// Calculate the forces for both cutoff and periodic with two different atom positions.
nonbonded->setNonbondedMethod(NonbondedForce::CutoffNonPeriodic);
OpenMM
Context context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
State state1 = context.getState(State::Forces);
nonbonded->setNonbondedMethod(NonbondedForce::CutoffPeriodic);
...
...
@@ -204,7 +204,7 @@ void testEnergyEthane() {
system
.
addForce
(
forceField
);
}
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
/*
0.5480 1.7661 0.0000 H 0 0 0 0 0 0 0 0 0
...
...
@@ -314,7 +314,7 @@ void testEnergyTwoParticle() {
system
.
addForce
(
forceField
);
}
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
positions
[
0
]
=
Vec3
(
0.0000
,
0.0000
,
0.0000
);
...
...
platforms/reference/tests/TestReferenceHarmonicAngleForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicAngleForce.h"
#include "openmm/System.h"
...
...
@@ -60,7 +60,7 @@ void testAngles() {
forceField
->
addAngle
(
0
,
1
,
2
,
PI_M
/
3
,
1.1
);
forceField
->
addAngle
(
1
,
2
,
3
,
PI_M
/
2
,
1.2
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
4
);
positions
[
0
]
=
Vec3
(
0
,
1
,
0
);
positions
[
1
]
=
Vec3
(
0
,
0
,
0
);
...
...
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/System.h"
...
...
@@ -59,7 +59,7 @@ void testBonds() {
forceField
->
addBond
(
0
,
1
,
1.5
,
0.8
);
forceField
->
addBond
(
1
,
2
,
1.2
,
0.7
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
3
);
positions
[
0
]
=
Vec3
(
0
,
2
,
0
);
positions
[
1
]
=
Vec3
(
0
,
0
,
0
);
...
...
platforms/reference/tests/TestReferenceKineticEnergy.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
...
...
@@ -52,7 +52,7 @@ void testCalcKE() {
for
(
int
i
=
0
;
i
<
4
;
++
i
)
system
.
addParticle
(
i
+
1
);
VerletIntegrator
integrator
(
0.01
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
velocities
(
4
);
velocities
[
0
]
=
Vec3
(
1
,
0
,
0
);
velocities
[
1
]
=
Vec3
(
0
,
1
,
0
);
...
...
platforms/reference/tests/TestReferenceLangevinIntegrator.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
forceField
->
addBond
(
0
,
1
,
1.5
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -106,7 +106,7 @@ void testTemperature() {
forceField
->
addParticle
((
i
%
2
==
0
?
1.0
:
-
1.0
),
1.0
,
5.0
);
}
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
positions
[
i
]
=
Vec3
((
i
%
2
==
0
?
2
:
-
2
),
(
i
%
4
<
2
?
2
:
-
2
),
(
i
<
4
?
2
:
-
2
));
...
...
@@ -144,7 +144,7 @@ void testConstraints() {
for
(
int
i
=
0
;
i
<
numParticles
-
1
;
++
i
)
system
.
addConstraint
(
i
,
i
+
1
,
1.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
@@ -192,7 +192,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator
.
setRandomNumberSeed
(
5
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setVelocities
(
velocities
);
integrator
.
step
(
10
);
...
...
platforms/reference/tests/TestReferenceNonbondedForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
...
...
@@ -59,7 +59,7 @@ void testCoulomb() {
forceField
->
addParticle
(
0.5
,
1
,
0
);
forceField
->
addParticle
(
-
1.5
,
1
,
0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
2
,
0
,
0
);
...
...
@@ -82,7 +82,7 @@ void testLJ() {
forceField
->
addParticle
(
0
,
1.2
,
1
);
forceField
->
addParticle
(
0
,
1.4
,
2
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
2
,
0
,
0
);
...
...
@@ -123,7 +123,7 @@ void testExclusionsAnd14() {
second14
=
i
;
}
system
.
addForce
(
nonbonded
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
for
(
int
i
=
1
;
i
<
5
;
++
i
)
{
// Test LJ forces
...
...
@@ -202,7 +202,7 @@ void testCutoff() {
const
double
eps
=
50.0
;
forceField
->
setReactionFieldDielectric
(
eps
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
3
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
0
,
2
,
0
);
...
...
@@ -253,7 +253,7 @@ void testCutoff14() {
second14
=
i
;
}
system
.
addForce
(
nonbonded
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
5
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -337,7 +337,7 @@ void testPeriodic() {
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setPeriodicBoxVectors
(
Vec3
(
4
,
0
,
0
),
Vec3
(
0
,
4
,
0
),
Vec3
(
0
,
0
,
4
));
system
.
addForce
(
nonbonded
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
3
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
2
,
0
,
0
);
...
...
platforms/reference/tests/TestReferencePeriodicTorsionForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/System.h"
...
...
@@ -59,7 +59,7 @@ void testPeriodicTorsions() {
PeriodicTorsionForce
*
forceField
=
new
PeriodicTorsionForce
();
forceField
->
addTorsion
(
0
,
1
,
2
,
3
,
2
,
PI_M
/
3
,
1.1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
4
);
positions
[
0
]
=
Vec3
(
0
,
1
,
0
);
positions
[
1
]
=
Vec3
(
0
,
0
,
0
);
...
...
platforms/reference/tests/TestReferenceRBTorsionForce.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/RBTorsionForce.h"
#include "openmm/System.h"
...
...
@@ -59,7 +59,7 @@ void testRBTorsions() {
RBTorsionForce
*
forceField
=
new
RBTorsionForce
();
forceField
->
addTorsion
(
0
,
1
,
2
,
3
,
0.1
,
0.2
,
0.3
,
0.4
,
0.5
,
0.6
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
4
);
positions
[
0
]
=
Vec3
(
0
,
1
,
0
);
positions
[
1
]
=
Vec3
(
0
,
0
,
0
);
...
...
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
forceField
->
addBond
(
0
,
1
,
1.5
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -106,7 +106,7 @@ void testTemperature() {
forceField
->
addParticle
((
i
%
2
==
0
?
1.0
:
-
1.0
),
1.0
,
5.0
);
}
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
positions
[
i
]
=
Vec3
((
i
%
2
==
0
?
2
:
-
2
),
(
i
%
4
<
2
?
2
:
-
2
),
(
i
<
4
?
2
:
-
2
));
...
...
@@ -145,7 +145,7 @@ void testConstraints() {
for
(
int
i
=
0
;
i
<
numParticles
-
1
;
++
i
)
system
.
addConstraint
(
i
,
i
+
1
,
1.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
@@ -192,7 +192,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator
.
setRandomNumberSeed
(
5
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setVelocities
(
velocities
);
integrator
.
step
(
10
);
...
...
platforms/reference/tests/TestReferenceVariableVerletIntegrator.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
forceField
->
addBond
(
0
,
1
,
1.5
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -101,7 +101,7 @@ void testConstraints() {
for
(
int
i
=
0
;
i
<
numParticles
-
1
;
++
i
)
system
.
addConstraint
(
i
,
i
+
1
,
1.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
@@ -166,7 +166,7 @@ void testConstrainedClusters() {
system
.
addConstraint
(
3
,
4
,
sqrt
(
2.0
));
system
.
addConstraint
(
5
,
6
,
sqrt
(
2.0
));
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
View file @
a4020466
...
...
@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
...
...
@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
forceField
->
addBond
(
0
,
1
,
1.5
,
1
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
@@ -100,7 +100,7 @@ void testConstraints() {
for
(
int
i
=
0
;
i
<
numParticles
-
1
;
++
i
)
system
.
addConstraint
(
i
,
i
+
1
,
1.0
);
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
velocities
(
numParticles
);
init_gen_rand
(
0
);
...
...
@@ -157,7 +157,7 @@ void testConstrainedClusters() {
system
.
addConstraint
(
3
,
4
,
sqrt
(
2.0
));
system
.
addConstraint
(
5
,
6
,
sqrt
(
2.0
));
system
.
addForce
(
forceField
);
OpenMM
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
positions
[
0
]
=
Vec3
(
0
,
0
,
0
);
positions
[
1
]
=
Vec3
(
1
,
0
,
0
);
...
...
Prev
1
…
3
4
5
6
7
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