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
ede48b85
Commit
ede48b85
authored
Apr 15, 2014
by
peastman
Browse files
Include force groups when serializing forces
parent
7a6f4b2f
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
53 additions
and
17 deletions
+53
-17
serialization/tests/TestSerializeCMAPTorsion.cpp
serialization/tests/TestSerializeCMAPTorsion.cpp
+3
-1
serialization/tests/TestSerializeCMMotionRemover.cpp
serialization/tests/TestSerializeCMMotionRemover.cpp
+3
-1
serialization/tests/TestSerializeCustomAngleForce.cpp
serialization/tests/TestSerializeCustomAngleForce.cpp
+3
-1
serialization/tests/TestSerializeCustomBondForce.cpp
serialization/tests/TestSerializeCustomBondForce.cpp
+3
-1
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
+3
-1
serialization/tests/TestSerializeCustomExternalForce.cpp
serialization/tests/TestSerializeCustomExternalForce.cpp
+3
-1
serialization/tests/TestSerializeCustomGBForce.cpp
serialization/tests/TestSerializeCustomGBForce.cpp
+3
-1
serialization/tests/TestSerializeCustomHbondForce.cpp
serialization/tests/TestSerializeCustomHbondForce.cpp
+3
-1
serialization/tests/TestSerializeCustomNonbondedForce.cpp
serialization/tests/TestSerializeCustomNonbondedForce.cpp
+2
-0
serialization/tests/TestSerializeCustomTorsionForce.cpp
serialization/tests/TestSerializeCustomTorsionForce.cpp
+3
-1
serialization/tests/TestSerializeGBSAOBCForce.cpp
serialization/tests/TestSerializeGBSAOBCForce.cpp
+3
-1
serialization/tests/TestSerializeGBVIForce.cpp
serialization/tests/TestSerializeGBVIForce.cpp
+3
-1
serialization/tests/TestSerializeHarmonicAngleForce.cpp
serialization/tests/TestSerializeHarmonicAngleForce.cpp
+3
-1
serialization/tests/TestSerializeHarmonicBondForce.cpp
serialization/tests/TestSerializeHarmonicBondForce.cpp
+3
-1
serialization/tests/TestSerializeMonteCarloBarostat.cpp
serialization/tests/TestSerializeMonteCarloBarostat.cpp
+3
-1
serialization/tests/TestSerializeNonbondedForce.cpp
serialization/tests/TestSerializeNonbondedForce.cpp
+3
-1
serialization/tests/TestSerializePeriodicTorsionForce.cpp
serialization/tests/TestSerializePeriodicTorsionForce.cpp
+3
-1
serialization/tests/TestSerializeRBTorsionForce.cpp
serialization/tests/TestSerializeRBTorsionForce.cpp
+3
-1
No files found.
serialization/tests/TestSerializeCMAPTorsion.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CMAPTorsionForce
force
;
force
.
setForceGroup
(
3
);
vector
<
double
>
map1
(
9
);
for
(
int
i
=
0
;
i
<
9
;
i
++
)
map1
[
i
]
=
0.1
*
i
;
...
...
@@ -64,6 +65,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CMAPTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumMaps
(),
force2
.
getNumMaps
());
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
int
size1
,
size2
;
...
...
serialization/tests/TestSerializeCMMotionRemover.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CMMotionRemover
force
(
5
);
force
.
setForceGroup
(
3
);
// Serialize and then deserialize it.
...
...
@@ -52,6 +53,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CMMotionRemover
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getFrequency
(),
force2
.
getFrequency
());
}
...
...
serialization/tests/TestSerializeCustomAngleForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomAngleForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
force
.
addGlobalParameter
(
"y"
,
2.221
);
force
.
addPerAngleParameter
(
"z"
);
...
...
@@ -62,6 +63,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNumPerAngleParameters
(),
force2
.
getNumPerAngleParameters
());
for
(
int
i
=
0
;
i
<
force
.
getNumPerAngleParameters
();
i
++
)
...
...
serialization/tests/TestSerializeCustomBondForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomBondForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
force
.
addGlobalParameter
(
"y"
,
2.221
);
force
.
addPerBondParameter
(
"z"
);
...
...
@@ -62,6 +63,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNumPerBondParameters
(),
force2
.
getNumPerBondParameters
());
for
(
int
i
=
0
;
i
<
force
.
getNumPerBondParameters
();
i
++
)
...
...
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomCompoundBondForce
force
(
3
,
"5*sin(distance(p1,p2))^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
force
.
addGlobalParameter
(
"y"
,
2.221
);
force
.
addPerBondParameter
(
"z"
);
...
...
@@ -76,6 +77,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomCompoundBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumParticlesPerBond
(),
force2
.
getNumParticlesPerBond
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNumPerBondParameters
(),
force2
.
getNumPerBondParameters
());
...
...
serialization/tests/TestSerializeCustomExternalForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomExternalForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
force
.
addGlobalParameter
(
"y"
,
2.221
);
force
.
addPerParticleParameter
(
"z"
);
...
...
@@ -62,6 +63,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomExternalForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNumPerParticleParameters
(),
force2
.
getNumPerParticleParameters
());
for
(
int
i
=
0
;
i
<
force
.
getNumPerParticleParameters
();
i
++
)
...
...
serialization/tests/TestSerializeCustomGBForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomGBForce
force
;
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
CustomGBForce
::
CutoffPeriodic
);
force
.
setCutoffDistance
(
2.1
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
...
...
@@ -74,6 +75,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomGBForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
ASSERT_EQUAL
(
force
.
getNumPerParticleParameters
(),
force2
.
getNumPerParticleParameters
());
...
...
serialization/tests/TestSerializeCustomHbondForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomHbondForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
CustomHbondForce
::
CutoffPeriodic
);
force
.
setCutoffDistance
(
2.1
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
...
...
@@ -77,6 +78,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomHbondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
...
...
serialization/tests/TestSerializeCustomNonbondedForce.cpp
View file @
ede48b85
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomNonbondedForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
CustomNonbondedForce
::
CutoffPeriodic
);
force
.
setUseSwitchingFunction
(
true
);
force
.
setUseLongRangeCorrection
(
true
);
...
...
@@ -78,6 +79,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomNonbondedForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
...
...
serialization/tests/TestSerializeCustomTorsionForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
CustomTorsionForce
force
(
"5*sin(x)^2+y*z"
);
force
.
setForceGroup
(
3
);
force
.
addGlobalParameter
(
"x"
,
1.3
);
force
.
addGlobalParameter
(
"y"
,
2.221
);
force
.
addPerTorsionParameter
(
"z"
);
...
...
@@ -62,6 +63,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
CustomTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getEnergyFunction
(),
force2
.
getEnergyFunction
());
ASSERT_EQUAL
(
force
.
getNumPerTorsionParameters
(),
force2
.
getNumPerTorsionParameters
());
for
(
int
i
=
0
;
i
<
force
.
getNumPerTorsionParameters
();
i
++
)
...
...
serialization/tests/TestSerializeGBSAOBCForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
GBSAOBCForce
force
;
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
GBSAOBCForce
::
CutoffPeriodic
);
force
.
setCutoffDistance
(
2.0
);
force
.
setSoluteDielectric
(
5.1
);
...
...
@@ -59,6 +60,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
GBSAOBCForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
ASSERT_EQUAL
(
force
.
getSoluteDielectric
(),
force2
.
getSoluteDielectric
());
...
...
serialization/tests/TestSerializeGBVIForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
GBVIForce
force
;
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
GBVIForce
::
CutoffPeriodic
);
force
.
setBornRadiusScalingMethod
(
GBVIForce
::
QuinticSpline
);
force
.
setQuinticLowerLimitFactor
(
0.123
);
...
...
@@ -64,6 +65,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
GBVIForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
ASSERT_EQUAL
(
force
.
getSoluteDielectric
(),
force2
.
getSoluteDielectric
());
...
...
serialization/tests/TestSerializeHarmonicAngleForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
HarmonicAngleForce
force
;
force
.
setForceGroup
(
3
);
force
.
addAngle
(
0
,
1
,
2
,
1.0
,
2.0
);
force
.
addAngle
(
0
,
2
,
3
,
2.0
,
2.1
);
force
.
addAngle
(
2
,
3
,
4
,
3.0
,
2.2
);
...
...
@@ -56,6 +57,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
HarmonicAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumAngles
(),
force2
.
getNumAngles
());
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
int
a1
,
a2
,
a3
,
b1
,
b2
,
b3
;
...
...
serialization/tests/TestSerializeHarmonicBondForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
HarmonicBondForce
force
;
force
.
setForceGroup
(
3
);
force
.
addBond
(
0
,
1
,
1.0
,
2.0
);
force
.
addBond
(
0
,
2
,
2.0
,
2.1
);
force
.
addBond
(
2
,
3
,
3.0
,
2.2
);
...
...
@@ -56,6 +57,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
HarmonicBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
int
a1
,
a2
,
b1
,
b2
;
...
...
serialization/tests/TestSerializeMonteCarloBarostat.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
MonteCarloBarostat
force
(
25.5
,
250.0
,
14
);
force
.
setForceGroup
(
3
);
force
.
setRandomNumberSeed
(
3
);
// Serialize and then deserialize it.
...
...
@@ -53,6 +54,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
MonteCarloBarostat
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getDefaultPressure
(),
force2
.
getDefaultPressure
());
ASSERT_EQUAL
(
force
.
getTemperature
(),
force2
.
getTemperature
());
ASSERT_EQUAL
(
force
.
getFrequency
(),
force2
.
getFrequency
());
...
...
serialization/tests/TestSerializeNonbondedForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
NonbondedForce
force
;
force
.
setForceGroup
(
3
);
force
.
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
force
.
setSwitchingDistance
(
1.5
);
force
.
setUseSwitchingFunction
(
true
);
...
...
@@ -67,6 +68,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
NonbondedForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getSwitchingDistance
(),
force2
.
getSwitchingDistance
());
ASSERT_EQUAL
(
force
.
getUseSwitchingFunction
(),
force2
.
getUseSwitchingFunction
());
...
...
serialization/tests/TestSerializePeriodicTorsionForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
PeriodicTorsionForce
force
;
force
.
setForceGroup
(
3
);
force
.
addTorsion
(
0
,
1
,
2
,
3
,
2
,
1.0
,
2.0
);
force
.
addTorsion
(
0
,
2
,
3
,
4
,
2
,
2.0
,
2.1
);
force
.
addTorsion
(
2
,
3
,
4
,
7
,
1
,
3.0
,
2.2
);
...
...
@@ -56,6 +57,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
PeriodicTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumTorsions
(),
force2
.
getNumTorsions
());
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
int
a1
,
a2
,
a3
,
a4
,
b1
,
b2
,
b3
,
b4
,
perioda
,
periodb
;
...
...
serialization/tests/TestSerializeRBTorsionForce.cpp
View file @
ede48b85
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
RBTorsionForce
force
;
force
.
setForceGroup
(
3
);
force
.
addTorsion
(
0
,
1
,
2
,
3
,
0.1
,
0.2
,
0.3
,
0.4
,
0.5
,
0.6
);
force
.
addTorsion
(
0
,
2
,
3
,
4
,
0.2
,
0.3
,
0.4
,
0.5
,
0.6
,
0.7
);
force
.
addTorsion
(
2
,
3
,
4
,
7
,
-
1
,
-
2
,
-
3
,
1.1
,
2.2
,
3.3
);
...
...
@@ -55,6 +56,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
RBTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getNumTorsions
(),
force2
.
getNumTorsions
());
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
int
a1
,
a2
,
a3
,
a4
,
b1
,
b2
,
b3
,
b4
;
...
...
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