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