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
f66c9b61
Commit
f66c9b61
authored
Mar 19, 2015
by
peastman
Browse files
Simplification to reference platform tests
parent
2762adf4
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
40 additions
and
90 deletions
+40
-90
platforms/reference/tests/TestReferenceAndersenThermostat.cpp
...forms/reference/tests/TestReferenceAndersenThermostat.cpp
+2
-3
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
...forms/reference/tests/TestReferenceBrownianIntegrator.cpp
+2
-5
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
+2
-1
platforms/reference/tests/TestReferenceCheckpoints.cpp
platforms/reference/tests/TestReferenceCheckpoints.cpp
+2
-2
platforms/reference/tests/TestReferenceCustomAngleForce.cpp
platforms/reference/tests/TestReferenceCustomAngleForce.cpp
+2
-2
platforms/reference/tests/TestReferenceCustomBondForce.cpp
platforms/reference/tests/TestReferenceCustomBondForce.cpp
+2
-1
platforms/reference/tests/TestReferenceCustomCompoundBondForce.cpp
.../reference/tests/TestReferenceCustomCompoundBondForce.cpp
+2
-6
platforms/reference/tests/TestReferenceCustomExternalForce.cpp
...orms/reference/tests/TestReferenceCustomExternalForce.cpp
+2
-1
platforms/reference/tests/TestReferenceCustomGBForce.cpp
platforms/reference/tests/TestReferenceCustomGBForce.cpp
+2
-7
platforms/reference/tests/TestReferenceCustomHbondForce.cpp
platforms/reference/tests/TestReferenceCustomHbondForce.cpp
+2
-5
platforms/reference/tests/TestReferenceCustomIntegrator.cpp
platforms/reference/tests/TestReferenceCustomIntegrator.cpp
+2
-12
platforms/reference/tests/TestReferenceCustomManyParticleForce.cpp
.../reference/tests/TestReferenceCustomManyParticleForce.cpp
+2
-6
platforms/reference/tests/TestReferenceCustomNonbondedForce.cpp
...rms/reference/tests/TestReferenceCustomNonbondedForce.cpp
+2
-18
platforms/reference/tests/TestReferenceCustomTorsionForce.cpp
...forms/reference/tests/TestReferenceCustomTorsionForce.cpp
+2
-3
platforms/reference/tests/TestReferenceEwald.cpp
platforms/reference/tests/TestReferenceEwald.cpp
+2
-8
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
+2
-4
platforms/reference/tests/TestReferenceGBVIForce.cpp
platforms/reference/tests/TestReferenceGBVIForce.cpp
+2
-3
platforms/reference/tests/TestReferenceHarmonicAngleForce.cpp
...forms/reference/tests/TestReferenceHarmonicAngleForce.cpp
+2
-1
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
+2
-1
platforms/reference/tests/TestReferenceKineticEnergy.cpp
platforms/reference/tests/TestReferenceKineticEnergy.cpp
+2
-1
No files found.
platforms/reference/tests/TestReferenceAndersenThermostat.cpp
View file @
f66c9b61
...
@@ -48,12 +48,13 @@
...
@@ -48,12 +48,13 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
void
testTemperature
()
{
void
testTemperature
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
const
int
numSteps
=
5000
;
const
int
numSteps
=
5000
;
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.003
);
VerletIntegrator
integrator
(
0.003
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
@@ -94,7 +95,6 @@ void testConstraints() {
...
@@ -94,7 +95,6 @@ void testConstraints() {
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
const
int
numSteps
=
15000
;
const
int
numSteps
=
15000
;
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.004
);
VerletIntegrator
integrator
(
0.004
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
@@ -147,7 +147,6 @@ void testRandomSeed() {
...
@@ -147,7 +147,6 @@ void testRandomSeed() {
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
...
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
View file @
f66c9b61
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleBond
()
{
void
testSingleBond
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -88,7 +89,6 @@ void testTemperature() {
...
@@ -88,7 +89,6 @@ void testTemperature() {
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
int
numBonds
=
numParticles
-
1
;
const
int
numBonds
=
numParticles
-
1
;
const
double
temp
=
10.0
;
const
double
temp
=
10.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.01
);
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.01
);
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
HarmonicBondForce
*
forceField
=
new
HarmonicBondForce
();
...
@@ -125,7 +125,6 @@ void testTemperature() {
...
@@ -125,7 +125,6 @@ void testTemperature() {
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.001
);
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.001
);
integrator
.
setConstraintTolerance
(
1e-5
);
integrator
.
setConstraintTolerance
(
1e-5
);
...
@@ -165,7 +164,6 @@ void testConstraints() {
...
@@ -165,7 +164,6 @@ void testConstraints() {
}
}
void
testConstrainedMasslessParticles
()
{
void
testConstrainedMasslessParticles
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
0.0
);
system
.
addParticle
(
0.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -200,7 +198,6 @@ void testRandomSeed() {
...
@@ -200,7 +198,6 @@ void testRandomSeed() {
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.001
);
BrownianIntegrator
integrator
(
temp
,
2.0
,
0.001
);
NonbondedForce
*
forceField
=
new
NonbondedForce
();
NonbondedForce
*
forceField
=
new
NonbondedForce
();
...
...
platforms/reference/tests/TestReferenceCMMotionRemover.cpp
View file @
f66c9b61
...
@@ -49,6 +49,8 @@
...
@@ -49,6 +49,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
Vec3
calcCM
(
const
vector
<
Vec3
>&
values
,
System
&
system
)
{
Vec3
calcCM
(
const
vector
<
Vec3
>&
values
,
System
&
system
)
{
Vec3
cm
;
Vec3
cm
;
for
(
int
j
=
0
;
j
<
system
.
getNumParticles
();
++
j
)
{
for
(
int
j
=
0
;
j
<
system
.
getNumParticles
();
++
j
)
{
...
@@ -63,7 +65,6 @@ void testMotionRemoval() {
...
@@ -63,7 +65,6 @@ void testMotionRemoval() {
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
HarmonicBondForce
*
bonds
=
new
HarmonicBondForce
();
HarmonicBondForce
*
bonds
=
new
HarmonicBondForce
();
...
...
platforms/reference/tests/TestReferenceCheckpoints.cpp
View file @
f66c9b61
...
@@ -48,6 +48,8 @@
...
@@ -48,6 +48,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
compareStates
(
State
&
s1
,
State
&
s2
)
{
void
compareStates
(
State
&
s1
,
State
&
s2
)
{
...
@@ -71,7 +73,6 @@ void testCheckpoint() {
...
@@ -71,7 +73,6 @@ void testCheckpoint() {
const
int
numParticles
=
10
;
const
int
numParticles
=
10
;
const
double
boxSize
=
3.0
;
const
double
boxSize
=
3.0
;
const
double
temperature
=
200.0
;
const
double
temperature
=
200.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addForce
(
new
AndersenThermostat
(
0.0
,
100.0
));
system
.
addForce
(
new
AndersenThermostat
(
0.0
,
100.0
));
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
...
@@ -125,7 +126,6 @@ void testSetState() {
...
@@ -125,7 +126,6 @@ void testSetState() {
const
int
numParticles
=
10
;
const
int
numParticles
=
10
;
const
double
boxSize
=
3.0
;
const
double
boxSize
=
3.0
;
const
double
temperature
=
200.0
;
const
double
temperature
=
200.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addForce
(
new
AndersenThermostat
(
0.0
,
100.0
));
system
.
addForce
(
new
AndersenThermostat
(
0.0
,
100.0
));
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
...
...
platforms/reference/tests/TestReferenceCustomAngleForce.cpp
View file @
f66c9b61
...
@@ -47,11 +47,11 @@
...
@@ -47,11 +47,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testAngles
()
{
void
testAngles
()
{
ReferencePlatform
platform
;
// Create a system using a CustomAngleForce.
// Create a system using a CustomAngleForce.
System
customSystem
;
System
customSystem
;
...
...
platforms/reference/tests/TestReferenceCustomBondForce.cpp
View file @
f66c9b61
...
@@ -46,10 +46,11 @@
...
@@ -46,10 +46,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testBonds
()
{
void
testBonds
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceCustomCompoundBondForce.cpp
View file @
f66c9b61
...
@@ -52,11 +52,11 @@
...
@@ -52,11 +52,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testBond
()
{
void
testBond
()
{
ReferencePlatform
platform
;
// Create a system using a CustomCompoundBondForce.
// Create a system using a CustomCompoundBondForce.
System
customSystem
;
System
customSystem
;
...
@@ -147,7 +147,6 @@ void testBond() {
...
@@ -147,7 +147,6 @@ void testBond() {
}
}
void
testPositionDependence
()
{
void
testPositionDependence
()
{
ReferencePlatform
platform
;
System
customSystem
;
System
customSystem
;
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
...
@@ -179,7 +178,6 @@ void testContinuous2DFunction() {
...
@@ -179,7 +178,6 @@ void testContinuous2DFunction() {
const
double
xmax
=
1.1
;
const
double
xmax
=
1.1
;
const
double
ymin
=
0.0
;
const
double
ymin
=
0.0
;
const
double
ymax
=
0.9
;
const
double
ymax
=
0.9
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
...
@@ -227,7 +225,6 @@ void testContinuous3DFunction() {
...
@@ -227,7 +225,6 @@ void testContinuous3DFunction() {
const
double
ymax
=
0.9
;
const
double
ymax
=
0.9
;
const
double
zmin
=
0.2
;
const
double
zmin
=
0.2
;
const
double
zmax
=
1.3
;
const
double
zmax
=
1.3
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
...
@@ -273,7 +270,6 @@ void testContinuous3DFunction() {
...
@@ -273,7 +270,6 @@ void testContinuous3DFunction() {
void
testMultipleBonds
()
{
void
testMultipleBonds
()
{
// Two compound bonds using Urey-Bradley example from API doc
// Two compound bonds using Urey-Bradley example from API doc
ReferencePlatform
platform
;
System
customSystem
;
System
customSystem
;
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
customSystem
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceCustomExternalForce.cpp
View file @
f66c9b61
...
@@ -46,10 +46,11 @@
...
@@ -46,10 +46,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testForce
()
{
void
testForce
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceCustomGBForce.cpp
View file @
f66c9b61
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testOBC
(
GBSAOBCForce
::
NonbondedMethod
obcMethod
,
CustomGBForce
::
NonbondedMethod
customMethod
)
{
void
testOBC
(
GBSAOBCForce
::
NonbondedMethod
obcMethod
,
CustomGBForce
::
NonbondedMethod
customMethod
)
{
...
@@ -58,7 +60,6 @@ void testOBC(GBSAOBCForce::NonbondedMethod obcMethod, CustomGBForce::NonbondedMe
...
@@ -58,7 +60,6 @@ void testOBC(GBSAOBCForce::NonbondedMethod obcMethod, CustomGBForce::NonbondedMe
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
boxSize
=
10.0
;
const
double
boxSize
=
10.0
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
ReferencePlatform
platform
;
// Create two systems: one with a GBSAOBCForce, and one using a CustomGBForce to implement the same interaction.
// Create two systems: one with a GBSAOBCForce, and one using a CustomGBForce to implement the same interaction.
...
@@ -190,7 +191,6 @@ void testMembrane() {
...
@@ -190,7 +191,6 @@ void testMembrane() {
const
int
numMolecules
=
70
;
const
int
numMolecules
=
70
;
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
boxSize
=
10.0
;
const
double
boxSize
=
10.0
;
ReferencePlatform
platform
;
// Create a system with an implicit membrane.
// Create a system with an implicit membrane.
...
@@ -280,7 +280,6 @@ void testMembrane() {
...
@@ -280,7 +280,6 @@ void testMembrane() {
}
}
void
testTabulatedFunction
()
{
void
testTabulatedFunction
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -313,7 +312,6 @@ void testTabulatedFunction() {
...
@@ -313,7 +312,6 @@ void testTabulatedFunction() {
}
}
void
testMultipleChainRules
()
{
void
testMultipleChainRules
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -341,7 +339,6 @@ void testMultipleChainRules() {
...
@@ -341,7 +339,6 @@ void testMultipleChainRules() {
}
}
void
testPositionDependence
()
{
void
testPositionDependence
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -405,7 +402,6 @@ void testPositionDependence() {
...
@@ -405,7 +402,6 @@ void testPositionDependence() {
}
}
void
testExclusions
()
{
void
testExclusions
()
{
ReferencePlatform
platform
;
for
(
int
i
=
3
;
i
<
4
;
i
++
)
{
for
(
int
i
=
3
;
i
<
4
;
i
++
)
{
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -817,7 +813,6 @@ void testGBVI(GBVIForce::NonbondedMethod gbviMethod, CustomGBForce::NonbondedMet
...
@@ -817,7 +813,6 @@ void testGBVI(GBVIForce::NonbondedMethod gbviMethod, CustomGBForce::NonbondedMet
const
int
numMolecules
=
1
;
const
int
numMolecules
=
1
;
const
double
boxSize
=
10.0
;
const
double
boxSize
=
10.0
;
ReferencePlatform
platform
;
GBVIForce
*
gbvi
=
new
GBVIForce
();
GBVIForce
*
gbvi
=
new
GBVIForce
();
std
::
vector
<
Vec3
>
positions
;
std
::
vector
<
Vec3
>
positions
;
...
...
platforms/reference/tests/TestReferenceCustomHbondForce.cpp
View file @
f66c9b61
...
@@ -49,11 +49,11 @@
...
@@ -49,11 +49,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testHbond
()
{
void
testHbond
()
{
ReferencePlatform
platform
;
// Create a system using a CustomHbondForce.
// Create a system using a CustomHbondForce.
System
customSystem
;
System
customSystem
;
...
@@ -151,7 +151,6 @@ void testHbond() {
...
@@ -151,7 +151,6 @@ void testHbond() {
}
}
void
testExclusions
()
{
void
testExclusions
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -178,7 +177,6 @@ void testExclusions() {
...
@@ -178,7 +177,6 @@ void testExclusions() {
}
}
void
testCutoff
()
{
void
testCutoff
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -206,7 +204,6 @@ void testCutoff() {
...
@@ -206,7 +204,6 @@ void testCutoff() {
}
}
void
testCustomFunctions
()
{
void
testCustomFunctions
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceCustomIntegrator.cpp
View file @
f66c9b61
...
@@ -49,13 +49,14 @@
...
@@ -49,13 +49,14 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
/**
/**
* Test a simple leapfrog integrator on a single bond.
* Test a simple leapfrog integrator on a single bond.
*/
*/
void
testSingleBond
()
{
void
testSingleBond
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -101,7 +102,6 @@ void testSingleBond() {
...
@@ -101,7 +102,6 @@ void testSingleBond() {
void
testConstraints
()
{
void
testConstraints
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
const
double
temp
=
500.0
;
const
double
temp
=
500.0
;
ReferencePlatform
platform
;
System
system
;
System
system
;
CustomIntegrator
integrator
(
0.002
);
CustomIntegrator
integrator
(
0.002
);
integrator
.
addPerDofVariable
(
"oldx"
,
0
);
integrator
.
addPerDofVariable
(
"oldx"
,
0
);
...
@@ -160,7 +160,6 @@ void testConstraints() {
...
@@ -160,7 +160,6 @@ void testConstraints() {
*/
*/
void
testVelocityConstraints
()
{
void
testVelocityConstraints
()
{
const
int
numParticles
=
10
;
const
int
numParticles
=
10
;
ReferencePlatform
platform
;
System
system
;
System
system
;
CustomIntegrator
integrator
(
0.002
);
CustomIntegrator
integrator
(
0.002
);
integrator
.
addPerDofVariable
(
"x1"
,
0
);
integrator
.
addPerDofVariable
(
"x1"
,
0
);
...
@@ -236,7 +235,6 @@ void testVelocityConstraints() {
...
@@ -236,7 +235,6 @@ void testVelocityConstraints() {
}
}
void
testConstrainedMasslessParticles
()
{
void
testConstrainedMasslessParticles
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
0.0
);
system
.
addParticle
(
0.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -282,7 +280,6 @@ void testWithThermostat() {
...
@@ -282,7 +280,6 @@ void testWithThermostat() {
const
double
temp
=
100.0
;
const
double
temp
=
100.0
;
const
double
collisionFreq
=
10.0
;
const
double
collisionFreq
=
10.0
;
const
int
numSteps
=
5000
;
const
int
numSteps
=
5000
;
ReferencePlatform
platform
;
System
system
;
System
system
;
CustomIntegrator
integrator
(
0.003
);
CustomIntegrator
integrator
(
0.003
);
integrator
.
addUpdateContextState
();
integrator
.
addUpdateContextState
();
...
@@ -324,7 +321,6 @@ void testWithThermostat() {
...
@@ -324,7 +321,6 @@ void testWithThermostat() {
* Test a Monte Carlo integrator that uses global variables and depends on energy.
* Test a Monte Carlo integrator that uses global variables and depends on energy.
*/
*/
void
testMonteCarlo
()
{
void
testMonteCarlo
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -379,7 +375,6 @@ void testMonteCarlo() {
...
@@ -379,7 +375,6 @@ void testMonteCarlo() {
void
testSum
()
{
void
testSum
()
{
const
int
numParticles
=
200
;
const
int
numParticles
=
200
;
const
double
boxSize
=
10
;
const
double
boxSize
=
10
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
NonbondedForce
*
nb
=
new
NonbondedForce
();
NonbondedForce
*
nb
=
new
NonbondedForce
();
...
@@ -422,7 +417,6 @@ void testSum() {
...
@@ -422,7 +417,6 @@ void testSum() {
* Test an integrator that both uses and modifies a context parameter.
* Test an integrator that both uses and modifies a context parameter.
*/
*/
void
testParameter
()
{
void
testParameter
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
AndersenThermostat
*
thermostat
=
new
AndersenThermostat
(
0.1
,
0.1
);
AndersenThermostat
*
thermostat
=
new
AndersenThermostat
(
0.1
,
0.1
);
...
@@ -448,7 +442,6 @@ void testRandomDistributions() {
...
@@ -448,7 +442,6 @@ void testRandomDistributions() {
const
int
numParticles
=
100
;
const
int
numParticles
=
100
;
const
int
numBins
=
20
;
const
int
numBins
=
20
;
const
int
numSteps
=
100
;
const
int
numSteps
=
100
;
ReferencePlatform
platform
;
System
system
;
System
system
;
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -516,7 +509,6 @@ void testRandomDistributions() {
...
@@ -516,7 +509,6 @@ void testRandomDistributions() {
void
testPerDofVariables
()
{
void
testPerDofVariables
()
{
const
int
numParticles
=
200
;
const
int
numParticles
=
200
;
const
double
boxSize
=
10
;
const
double
boxSize
=
10
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
NonbondedForce
*
nb
=
new
NonbondedForce
();
NonbondedForce
*
nb
=
new
NonbondedForce
();
...
@@ -571,7 +563,6 @@ void testPerDofVariables() {
...
@@ -571,7 +563,6 @@ void testPerDofVariables() {
* Test evaluating force groups separately.
* Test evaluating force groups separately.
*/
*/
void
testForceGroups
()
{
void
testForceGroups
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
...
@@ -647,7 +638,6 @@ void testForceGroups() {
...
@@ -647,7 +638,6 @@ void testForceGroups() {
*/
*/
void
testRespa
()
{
void
testRespa
()
{
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
4
,
0
,
0
),
Vec3
(
0
,
4
,
0
),
Vec3
(
0
,
0
,
4
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
4
,
0
,
0
),
Vec3
(
0
,
4
,
0
),
Vec3
(
0
,
0
,
4
));
CustomIntegrator
integrator
(
0.002
);
CustomIntegrator
integrator
(
0.002
);
...
...
platforms/reference/tests/TestReferenceCustomManyParticleForce.cpp
View file @
f66c9b61
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
Vec3
computeDelta
(
const
Vec3
&
pos1
,
const
Vec3
&
pos2
,
bool
periodic
,
const
Vec3
*
periodicBoxVectors
)
{
Vec3
computeDelta
(
const
Vec3
&
pos1
,
const
Vec3
&
pos2
,
bool
periodic
,
const
Vec3
*
periodicBoxVectors
)
{
...
@@ -93,7 +95,6 @@ void validateAxilrodTeller(CustomManyParticleForce* force, const vector<Vec3>& p
...
@@ -93,7 +95,6 @@ void validateAxilrodTeller(CustomManyParticleForce* force, const vector<Vec3>& p
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
}
}
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
ReferencePlatform
platform
;
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
State
state1
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
State
state1
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
@@ -155,7 +156,6 @@ void validateStillingerWeber(CustomManyParticleForce* force, const vector<Vec3>&
...
@@ -155,7 +156,6 @@ void validateStillingerWeber(CustomManyParticleForce* force, const vector<Vec3>&
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
addForce
(
force
);
system
.
addForce
(
force
);
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
ReferencePlatform
platform
;
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
State
state1
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
State
state1
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
@@ -340,7 +340,6 @@ void testExclusions() {
...
@@ -340,7 +340,6 @@ void testExclusions() {
void
testAllTerms
()
{
void
testAllTerms
()
{
int
numParticles
=
4
;
int
numParticles
=
4
;
ReferencePlatform
platform
;
// Create a system with a CustomManyParticleForce.
// Create a system with a CustomManyParticleForce.
...
@@ -424,7 +423,6 @@ void testParameters() {
...
@@ -424,7 +423,6 @@ void testParameters() {
}
}
system
.
addForce
(
force
);
system
.
addForce
(
force
);
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
ReferencePlatform
platform
;
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
...
@@ -510,7 +508,6 @@ void testTabulatedFunctions() {
...
@@ -510,7 +508,6 @@ void testTabulatedFunctions() {
}
}
system
.
addForce
(
force
);
system
.
addForce
(
force
);
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
ReferencePlatform
platform
;
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
...
@@ -562,7 +559,6 @@ void testTypeFilters() {
...
@@ -562,7 +559,6 @@ void testTypeFilters() {
force
->
setTypeFilter
(
2
,
f2
);
force
->
setTypeFilter
(
2
,
f2
);
system
.
addForce
(
force
);
system
.
addForce
(
force
);
VerletIntegrator
integrator
(
0.001
);
VerletIntegrator
integrator
(
0.001
);
ReferencePlatform
platform
;
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
...
...
platforms/reference/tests/TestReferenceCustomNonbondedForce.cpp
View file @
f66c9b61
...
@@ -53,10 +53,11 @@
...
@@ -53,10 +53,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSimpleExpression
()
{
void
testSimpleExpression
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -79,7 +80,6 @@ void testSimpleExpression() {
...
@@ -79,7 +80,6 @@ void testSimpleExpression() {
}
}
void
testParameters
()
{
void
testParameters
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -140,7 +140,6 @@ void testParameters() {
...
@@ -140,7 +140,6 @@ void testParameters() {
}
}
void
testExclusions
()
{
void
testExclusions
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"a*r; a=a1+a2"
);
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"a*r; a=a1+a2"
);
...
@@ -171,7 +170,6 @@ void testExclusions() {
...
@@ -171,7 +170,6 @@ void testExclusions() {
}
}
void
testCutoff
()
{
void
testCutoff
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -201,7 +199,6 @@ void testCutoff() {
...
@@ -201,7 +199,6 @@ void testCutoff() {
}
}
void
testPeriodic
()
{
void
testPeriodic
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -232,7 +229,6 @@ void testPeriodic() {
...
@@ -232,7 +229,6 @@ void testPeriodic() {
}
}
void
testTriclinic
()
{
void
testTriclinic
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -292,7 +288,6 @@ void testTriclinic() {
...
@@ -292,7 +288,6 @@ void testTriclinic() {
}
}
void
testContinuous1DFunction
()
{
void
testContinuous1DFunction
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -337,7 +332,6 @@ void testContinuous2DFunction() {
...
@@ -337,7 +332,6 @@ void testContinuous2DFunction() {
const
double
xmax
=
1.5
;
const
double
xmax
=
1.5
;
const
double
ymin
=
0.0
;
const
double
ymin
=
0.0
;
const
double
ymax
=
2.1
;
const
double
ymax
=
2.1
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -389,7 +383,6 @@ void testContinuous3DFunction() {
...
@@ -389,7 +383,6 @@ void testContinuous3DFunction() {
const
double
ymax
=
0.7
;
const
double
ymax
=
0.7
;
const
double
zmin
=
0.2
;
const
double
zmin
=
0.2
;
const
double
zmax
=
0.9
;
const
double
zmax
=
0.9
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -439,7 +432,6 @@ void testContinuous3DFunction() {
...
@@ -439,7 +432,6 @@ void testContinuous3DFunction() {
}
}
void
testDiscrete1DFunction
()
{
void
testDiscrete1DFunction
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -469,7 +461,6 @@ void testDiscrete1DFunction() {
...
@@ -469,7 +461,6 @@ void testDiscrete1DFunction() {
void
testDiscrete2DFunction
()
{
void
testDiscrete2DFunction
()
{
const
int
xsize
=
10
;
const
int
xsize
=
10
;
const
int
ysize
=
5
;
const
int
ysize
=
5
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -503,7 +494,6 @@ void testDiscrete3DFunction() {
...
@@ -503,7 +494,6 @@ void testDiscrete3DFunction() {
const
int
xsize
=
8
;
const
int
xsize
=
8
;
const
int
ysize
=
5
;
const
int
ysize
=
5
;
const
int
zsize
=
6
;
const
int
zsize
=
6
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -540,7 +530,6 @@ void testCoulombLennardJones() {
...
@@ -540,7 +530,6 @@ void testCoulombLennardJones() {
const
int
numMolecules
=
300
;
const
int
numMolecules
=
300
;
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
boxSize
=
20.0
;
const
double
boxSize
=
20.0
;
ReferencePlatform
platform
;
// Create two systems: one with a NonbondedForce, and one using a CustomNonbondedForce to implement the same interaction.
// Create two systems: one with a NonbondedForce, and one using a CustomNonbondedForce to implement the same interaction.
...
@@ -614,7 +603,6 @@ void testCoulombLennardJones() {
...
@@ -614,7 +603,6 @@ void testCoulombLennardJones() {
}
}
void
testSwitchingFunction
()
{
void
testSwitchingFunction
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -673,7 +661,6 @@ void testLongRangeCorrection() {
...
@@ -673,7 +661,6 @@ void testLongRangeCorrection() {
int
numParticles
=
gridSize
*
gridSize
*
gridSize
;
int
numParticles
=
gridSize
*
gridSize
*
gridSize
;
double
boxSize
=
gridSize
*
0.7
;
double
boxSize
=
gridSize
*
0.7
;
double
cutoff
=
boxSize
/
3
;
double
cutoff
=
boxSize
/
3
;
ReferencePlatform
platform
;
System
standardSystem
;
System
standardSystem
;
System
customSystem
;
System
customSystem
;
VerletIntegrator
integrator1
(
0.01
);
VerletIntegrator
integrator1
(
0.01
);
...
@@ -748,7 +735,6 @@ void testLongRangeCorrection() {
...
@@ -748,7 +735,6 @@ void testLongRangeCorrection() {
void
testInteractionGroups
()
{
void
testInteractionGroups
()
{
const
int
numParticles
=
6
;
const
int
numParticles
=
6
;
ReferencePlatform
platform
;
System
system
;
System
system
;
VerletIntegrator
integrator
(
0.01
);
VerletIntegrator
integrator
(
0.01
);
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"v1+v2"
);
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"v1+v2"
);
...
@@ -790,7 +776,6 @@ void testLargeInteractionGroup() {
...
@@ -790,7 +776,6 @@ void testLargeInteractionGroup() {
// Create a large system.
// Create a large system.
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
...
@@ -868,7 +853,6 @@ void testInteractionGroupLongRangeCorrection() {
...
@@ -868,7 +853,6 @@ void testInteractionGroupLongRangeCorrection() {
const
int
numParticles
=
10
;
const
int
numParticles
=
10
;
const
double
boxSize
=
10.0
;
const
double
boxSize
=
10.0
;
const
double
cutoff
=
0.5
;
const
double
cutoff
=
0.5
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"c1*c2*r^-4"
);
CustomNonbondedForce
*
nonbonded
=
new
CustomNonbondedForce
(
"c1*c2*r^-4"
);
...
...
platforms/reference/tests/TestReferenceCustomTorsionForce.cpp
View file @
f66c9b61
...
@@ -50,11 +50,11 @@
...
@@ -50,11 +50,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testTorsions
()
{
void
testTorsions
()
{
ReferencePlatform
platform
;
// Create a system using a CustomTorsionForce.
// Create a system using a CustomTorsionForce.
System
customSystem
;
System
customSystem
;
...
@@ -141,7 +141,6 @@ void testTorsions() {
...
@@ -141,7 +141,6 @@ void testTorsions() {
}
}
void
testRange
()
{
void
testRange
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceEwald.cpp
View file @
f66c9b61
...
@@ -48,6 +48,8 @@
...
@@ -48,6 +48,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
EWALD_TOL
=
1e-5
;
const
double
EWALD_TOL
=
1e-5
;
const
double
PME_TOL
=
5e-5
;
const
double
PME_TOL
=
5e-5
;
...
@@ -59,9 +61,7 @@ void testEwaldExact() {
...
@@ -59,9 +61,7 @@ void testEwaldExact() {
const
double
cutoff
=
1.0
;
const
double
cutoff
=
1.0
;
const
double
boxSize
=
2.82
;
const
double
boxSize
=
2.82
;
ReferencePlatform
platform
;
System
system
;
System
system
;
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
system
.
addParticle
(
22.99
);
system
.
addParticle
(
22.99
);
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
...
@@ -112,7 +112,6 @@ void testEwaldPME() {
...
@@ -112,7 +112,6 @@ void testEwaldPME() {
// Use amorphous NaCl system
// Use amorphous NaCl system
// The particles are simple charges, no VdW interactions
// The particles are simple charges, no VdW interactions
ReferencePlatform
platform
;
System
system
;
System
system
;
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
/
2
;
i
++
)
system
.
addParticle
(
22.99
);
system
.
addParticle
(
22.99
);
...
@@ -217,7 +216,6 @@ void testEwaldPME() {
...
@@ -217,7 +216,6 @@ void testEwaldPME() {
}
}
void
testEwald2Ions
()
{
void
testEwald2Ions
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -244,7 +242,6 @@ void testEwald2Ions() {
...
@@ -244,7 +242,6 @@ void testEwald2Ions() {
}
}
void
testWaterSystem
()
{
void
testWaterSystem
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
static
int
numParticles
=
648
;
static
int
numParticles
=
648
;
const
double
boxSize
=
1.86206
;
const
double
boxSize
=
1.86206
;
...
@@ -305,7 +302,6 @@ void testWaterSystem() {
...
@@ -305,7 +302,6 @@ void testWaterSystem() {
void
testTriclinic
()
{
void
testTriclinic
()
{
// Create a triclinic box containing eight particles.
// Create a triclinic box containing eight particles.
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
2.5
,
0
,
0
),
Vec3
(
0.5
,
3.0
,
0
),
Vec3
(
0.7
,
0.9
,
3.5
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
2.5
,
0
,
0
),
Vec3
(
0.5
,
3.0
,
0
),
Vec3
(
0.7
,
0.9
,
3.5
));
for
(
int
i
=
0
;
i
<
8
;
i
++
)
for
(
int
i
=
0
;
i
<
8
;
i
++
)
...
@@ -373,7 +369,6 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) {
...
@@ -373,7 +369,6 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) {
positions
[
i
]
=
Vec3
(
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
));
positions
[
i
]
=
Vec3
(
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
));
}
}
force
->
setNonbondedMethod
(
method
);
force
->
setNonbondedMethod
(
method
);
ReferencePlatform
platform
;
// For various values of the cutoff and error tolerance, see if the actual error is reasonable.
// For various values of the cutoff and error tolerance, see if the actual error is reasonable.
...
@@ -425,7 +420,6 @@ void testPMEParameters() {
...
@@ -425,7 +420,6 @@ void testPMEParameters() {
positions
[
i
]
=
Vec3
(
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
));
positions
[
i
]
=
Vec3
(
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
),
boxWidth
*
genrand_real2
(
sfmt
));
}
}
force
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
force
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
ReferencePlatform
platform
;
// Compute the energy with an error tolerance of 1e-3.
// Compute the energy with an error tolerance of 1e-3.
...
...
platforms/reference/tests/TestReferenceGBSAOBCForce.cpp
View file @
f66c9b61
...
@@ -48,10 +48,11 @@
...
@@ -48,10 +48,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleParticle
()
{
void
testSingleParticle
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
...
@@ -85,7 +86,6 @@ void testSingleParticle() {
...
@@ -85,7 +86,6 @@ void testSingleParticle() {
}
}
void
testGlobalSettings
()
{
void
testGlobalSettings
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
...
@@ -114,7 +114,6 @@ void testGlobalSettings() {
...
@@ -114,7 +114,6 @@ void testGlobalSettings() {
}
}
void
testCutoffAndPeriodic
()
{
void
testCutoffAndPeriodic
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
@@ -183,7 +182,6 @@ void testCutoffAndPeriodic() {
...
@@ -183,7 +182,6 @@ void testCutoffAndPeriodic() {
}
}
void
testForce
()
{
void
testForce
()
{
ReferencePlatform
platform
;
const
int
numParticles
=
10
;
const
int
numParticles
=
10
;
System
system
;
System
system
;
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
...
...
platforms/reference/tests/TestReferenceGBVIForce.cpp
View file @
f66c9b61
...
@@ -50,10 +50,11 @@
...
@@ -50,10 +50,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testSingleParticle
()
{
void
testSingleParticle
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
2.0
);
system
.
addParticle
(
2.0
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
...
@@ -89,8 +90,6 @@ void testSingleParticle() {
...
@@ -89,8 +90,6 @@ void testSingleParticle() {
}
}
void
testEnergyEthane
(
int
applyBornRadiiScaling
)
{
void
testEnergyEthane
(
int
applyBornRadiiScaling
)
{
ReferencePlatform
platform
;
const
int
numParticles
=
8
;
const
int
numParticles
=
8
;
System
system
;
System
system
;
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
LangevinIntegrator
integrator
(
0
,
0.1
,
0.01
);
...
...
platforms/reference/tests/TestReferenceHarmonicAngleForce.cpp
View file @
f66c9b61
...
@@ -46,10 +46,11 @@
...
@@ -46,10 +46,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testAngles
()
{
void
testAngles
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceHarmonicBondForce.cpp
View file @
f66c9b61
...
@@ -46,10 +46,11 @@
...
@@ -46,10 +46,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testBonds
()
{
void
testBonds
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceKineticEnergy.cpp
View file @
f66c9b61
...
@@ -44,10 +44,11 @@
...
@@ -44,10 +44,11 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ReferencePlatform
platform
;
const
double
TOL
=
1e-5
;
const
double
TOL
=
1e-5
;
void
testCalcKE
()
{
void
testCalcKE
()
{
ReferencePlatform
platform
;
System
system
;
System
system
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
for
(
int
i
=
0
;
i
<
4
;
++
i
)
system
.
addParticle
(
i
+
1
);
system
.
addParticle
(
i
+
1
);
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment