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
73183c61
Commit
73183c61
authored
May 31, 2016
by
ChayaSt
Browse files
resolved conflict
parents
0e218233
32e08b87
Changes
267
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
83 additions
and
39 deletions
+83
-39
serialization/src/CustomCentroidBondForceProxy.cpp
serialization/src/CustomCentroidBondForceProxy.cpp
+7
-3
serialization/src/CustomCompoundBondForceProxy.cpp
serialization/src/CustomCompoundBondForceProxy.cpp
+7
-3
serialization/src/CustomTorsionForceProxy.cpp
serialization/src/CustomTorsionForceProxy.cpp
+7
-3
serialization/src/HarmonicAngleForceProxy.cpp
serialization/src/HarmonicAngleForceProxy.cpp
+7
-3
serialization/src/HarmonicBondForceProxy.cpp
serialization/src/HarmonicBondForceProxy.cpp
+7
-3
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
+2
-2
serialization/src/MonteCarloBarostatProxy.cpp
serialization/src/MonteCarloBarostatProxy.cpp
+2
-2
serialization/src/MonteCarloMembraneBarostatProxy.cpp
serialization/src/MonteCarloMembraneBarostatProxy.cpp
+2
-2
serialization/src/PeriodicTorsionForceProxy.cpp
serialization/src/PeriodicTorsionForceProxy.cpp
+7
-3
serialization/src/RBTorsionForceProxy.cpp
serialization/src/RBTorsionForceProxy.cpp
+7
-3
serialization/tests/TestSerializeCMAPTorsion.cpp
serialization/tests/TestSerializeCMAPTorsion.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/TestSerializeCustomCentroidBondForce.cpp
serialization/tests/TestSerializeCustomCentroidBondForce.cpp
+3
-1
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
+3
-1
serialization/tests/TestSerializeCustomTorsionForce.cpp
serialization/tests/TestSerializeCustomTorsionForce.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/TestSerializeMonteCarloAnisotropicBarostat.cpp
...tion/tests/TestSerializeMonteCarloAnisotropicBarostat.cpp
+2
-2
serialization/tests/TestSerializeMonteCarloBarostat.cpp
serialization/tests/TestSerializeMonteCarloBarostat.cpp
+2
-2
No files found.
serialization/src/CustomCentroidBondForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
5
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ CustomCentroidBondForceProxy::CustomCentroidBondForceProxy() : SerializationProx
...
@@ -42,9 +42,10 @@ CustomCentroidBondForceProxy::CustomCentroidBondForceProxy() : SerializationProx
}
}
void
CustomCentroidBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomCentroidBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CustomCentroidBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCentroidBondForce
*>
(
object
);
const
CustomCentroidBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCentroidBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setIntProperty
(
"groups"
,
force
.
getNumGroupsPerBond
());
node
.
setIntProperty
(
"groups"
,
force
.
getNumGroupsPerBond
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
...
@@ -93,12 +94,15 @@ void CustomCentroidBondForceProxy::serialize(const void* object, SerializationNo
...
@@ -93,12 +94,15 @@ void CustomCentroidBondForceProxy::serialize(const void* object, SerializationNo
}
}
void
*
CustomCentroidBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
CustomCentroidBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
CustomCentroidBondForce
*
force
=
NULL
;
CustomCentroidBondForce
*
force
=
NULL
;
try
{
try
{
CustomCentroidBondForce
*
force
=
new
CustomCentroidBondForce
(
node
.
getIntProperty
(
"groups"
),
node
.
getStringProperty
(
"energy"
));
CustomCentroidBondForce
*
force
=
new
CustomCentroidBondForce
(
node
.
getIntProperty
(
"groups"
),
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perBondParams
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
perBondParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perBondParams
.
getChildren
()[
i
];
const
SerializationNode
&
parameter
=
perBondParams
.
getChildren
()[
i
];
...
...
serialization/src/CustomCompoundBondForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ CustomCompoundBondForceProxy::CustomCompoundBondForceProxy() : SerializationProx
...
@@ -42,9 +42,10 @@ CustomCompoundBondForceProxy::CustomCompoundBondForceProxy() : SerializationProx
}
}
void
CustomCompoundBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomCompoundBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CustomCompoundBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCompoundBondForce
*>
(
object
);
const
CustomCompoundBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCompoundBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setIntProperty
(
"particles"
,
force
.
getNumParticlesPerBond
());
node
.
setIntProperty
(
"particles"
,
force
.
getNumParticlesPerBond
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
...
@@ -80,12 +81,15 @@ void CustomCompoundBondForceProxy::serialize(const void* object, SerializationNo
...
@@ -80,12 +81,15 @@ void CustomCompoundBondForceProxy::serialize(const void* object, SerializationNo
}
}
void
*
CustomCompoundBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
CustomCompoundBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
CustomCompoundBondForce
*
force
=
NULL
;
CustomCompoundBondForce
*
force
=
NULL
;
try
{
try
{
CustomCompoundBondForce
*
force
=
new
CustomCompoundBondForce
(
node
.
getIntProperty
(
"particles"
),
node
.
getStringProperty
(
"energy"
));
CustomCompoundBondForce
*
force
=
new
CustomCompoundBondForce
(
node
.
getIntProperty
(
"particles"
),
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perBondParams
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
perBondParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perBondParams
.
getChildren
()[
i
];
const
SerializationNode
&
parameter
=
perBondParams
.
getChildren
()[
i
];
...
...
serialization/src/CustomTorsionForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ CustomTorsionForceProxy::CustomTorsionForceProxy() : SerializationProxy("CustomT
...
@@ -42,9 +42,10 @@ CustomTorsionForceProxy::CustomTorsionForceProxy() : SerializationProxy("CustomT
}
}
void
CustomTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CustomTorsionForce
&
force
=
*
reinterpret_cast
<
const
CustomTorsionForce
*>
(
object
);
const
CustomTorsionForce
&
force
=
*
reinterpret_cast
<
const
CustomTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perTorsionParams
=
node
.
createChildNode
(
"PerTorsionParameters"
);
SerializationNode
&
perTorsionParams
=
node
.
createChildNode
(
"PerTorsionParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerTorsionParameters
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumPerTorsionParameters
();
i
++
)
{
...
@@ -70,12 +71,15 @@ void CustomTorsionForceProxy::serialize(const void* object, SerializationNode& n
...
@@ -70,12 +71,15 @@ void CustomTorsionForceProxy::serialize(const void* object, SerializationNode& n
}
}
void
*
CustomTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
CustomTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
CustomTorsionForce
*
force
=
NULL
;
CustomTorsionForce
*
force
=
NULL
;
try
{
try
{
CustomTorsionForce
*
force
=
new
CustomTorsionForce
(
node
.
getStringProperty
(
"energy"
));
CustomTorsionForce
*
force
=
new
CustomTorsionForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perTorsionParams
=
node
.
getChildNode
(
"PerTorsionParameters"
);
const
SerializationNode
&
perTorsionParams
=
node
.
getChildNode
(
"PerTorsionParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perTorsionParams
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
perTorsionParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perTorsionParams
.
getChildren
()[
i
];
const
SerializationNode
&
parameter
=
perTorsionParams
.
getChildren
()[
i
];
...
...
serialization/src/HarmonicAngleForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ HarmonicAngleForceProxy::HarmonicAngleForceProxy() : SerializationProxy("Harmoni
...
@@ -42,9 +42,10 @@ HarmonicAngleForceProxy::HarmonicAngleForceProxy() : SerializationProxy("Harmoni
}
}
void
HarmonicAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
HarmonicAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
HarmonicAngleForce
&
force
=
*
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
object
);
const
HarmonicAngleForce
&
force
=
*
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Angles"
);
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Angles"
);
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
int
particle1
,
particle2
,
particle3
;
int
particle1
,
particle2
,
particle3
;
...
@@ -55,11 +56,14 @@ void HarmonicAngleForceProxy::serialize(const void* object, SerializationNode& n
...
@@ -55,11 +56,14 @@ void HarmonicAngleForceProxy::serialize(const void* object, SerializationNode& n
}
}
void
*
HarmonicAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
HarmonicAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
HarmonicAngleForce
*
force
=
new
HarmonicAngleForce
();
HarmonicAngleForce
*
force
=
new
HarmonicAngleForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
angles
=
node
.
getChildNode
(
"Angles"
);
const
SerializationNode
&
angles
=
node
.
getChildNode
(
"Angles"
);
for
(
int
i
=
0
;
i
<
(
int
)
angles
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
angles
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
angle
=
angles
.
getChildren
()[
i
];
const
SerializationNode
&
angle
=
angles
.
getChildren
()[
i
];
...
...
serialization/src/HarmonicBondForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ HarmonicBondForceProxy::HarmonicBondForceProxy() : SerializationProxy("HarmonicB
...
@@ -42,9 +42,10 @@ HarmonicBondForceProxy::HarmonicBondForceProxy() : SerializationProxy("HarmonicB
}
}
void
HarmonicBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
HarmonicBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
HarmonicBondForce
&
force
=
*
reinterpret_cast
<
const
HarmonicBondForce
*>
(
object
);
const
HarmonicBondForce
&
force
=
*
reinterpret_cast
<
const
HarmonicBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Bonds"
);
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Bonds"
);
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
int
particle1
,
particle2
;
int
particle1
,
particle2
;
...
@@ -55,11 +56,14 @@ void HarmonicBondForceProxy::serialize(const void* object, SerializationNode& no
...
@@ -55,11 +56,14 @@ void HarmonicBondForceProxy::serialize(const void* object, SerializationNode& no
}
}
void
*
HarmonicBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
HarmonicBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
HarmonicBondForce
*
force
=
new
HarmonicBondForce
();
HarmonicBondForce
*
force
=
new
HarmonicBondForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
for
(
int
i
=
0
;
i
<
(
int
)
bonds
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
bonds
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
i
];
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
i
];
...
...
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -52,7 +52,7 @@ void MonteCarloAnisotropicBarostatProxy::serialize(const void* object, Serializa
...
@@ -52,7 +52,7 @@ void MonteCarloAnisotropicBarostatProxy::serialize(const void* object, Serializa
node
.
setBoolProperty
(
"scalex"
,
force
.
getScaleX
());
node
.
setBoolProperty
(
"scalex"
,
force
.
getScaleX
());
node
.
setBoolProperty
(
"scaley"
,
force
.
getScaleY
());
node
.
setBoolProperty
(
"scaley"
,
force
.
getScaleY
());
node
.
setBoolProperty
(
"scalez"
,
force
.
getScaleZ
());
node
.
setBoolProperty
(
"scalez"
,
force
.
getScaleZ
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getTemperature
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
get
Default
Temperature
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
}
}
...
...
serialization/src/MonteCarloBarostatProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -46,7 +46,7 @@ void MonteCarloBarostatProxy::serialize(const void* object, SerializationNode& n
...
@@ -46,7 +46,7 @@ void MonteCarloBarostatProxy::serialize(const void* object, SerializationNode& n
const
MonteCarloBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloBarostat
*>
(
object
);
const
MonteCarloBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloBarostat
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getTemperature
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
get
Default
Temperature
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
}
}
...
...
serialization/src/MonteCarloMembraneBarostatProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -47,7 +47,7 @@ void MonteCarloMembraneBarostatProxy::serialize(const void* object, Serializatio
...
@@ -47,7 +47,7 @@ void MonteCarloMembraneBarostatProxy::serialize(const void* object, Serializatio
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"surfaceTension"
,
force
.
getDefaultSurfaceTension
());
node
.
setDoubleProperty
(
"surfaceTension"
,
force
.
getDefaultSurfaceTension
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getTemperature
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
get
Default
Temperature
());
node
.
setIntProperty
(
"xymode"
,
force
.
getXYMode
());
node
.
setIntProperty
(
"xymode"
,
force
.
getXYMode
());
node
.
setIntProperty
(
"zmode"
,
force
.
getZMode
());
node
.
setIntProperty
(
"zmode"
,
force
.
getZMode
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
...
...
serialization/src/PeriodicTorsionForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ PeriodicTorsionForceProxy::PeriodicTorsionForceProxy() : SerializationProxy("Per
...
@@ -42,9 +42,10 @@ PeriodicTorsionForceProxy::PeriodicTorsionForceProxy() : SerializationProxy("Per
}
}
void
PeriodicTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
PeriodicTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
PeriodicTorsionForce
&
force
=
*
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
object
);
const
PeriodicTorsionForce
&
force
=
*
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
;
int
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
;
...
@@ -55,11 +56,14 @@ void PeriodicTorsionForceProxy::serialize(const void* object, SerializationNode&
...
@@ -55,11 +56,14 @@ void PeriodicTorsionForceProxy::serialize(const void* object, SerializationNode&
}
}
void
*
PeriodicTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
PeriodicTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
PeriodicTorsionForce
*
force
=
new
PeriodicTorsionForce
();
PeriodicTorsionForce
*
force
=
new
PeriodicTorsionForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
(
int
)
torsions
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
torsions
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
torsion
=
torsions
.
getChildren
()[
i
];
const
SerializationNode
&
torsion
=
torsions
.
getChildren
()[
i
];
...
...
serialization/src/RBTorsionForceProxy.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,9 +42,10 @@ RBTorsionForceProxy::RBTorsionForceProxy() : SerializationProxy("RBTorsionForce"
...
@@ -42,9 +42,10 @@ RBTorsionForceProxy::RBTorsionForceProxy() : SerializationProxy("RBTorsionForce"
}
}
void
RBTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
RBTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
RBTorsionForce
&
force
=
*
reinterpret_cast
<
const
RBTorsionForce
*>
(
object
);
const
RBTorsionForce
&
force
=
*
reinterpret_cast
<
const
RBTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
int
particle1
,
particle2
,
particle3
,
particle4
;
...
@@ -55,11 +56,14 @@ void RBTorsionForceProxy::serialize(const void* object, SerializationNode& node)
...
@@ -55,11 +56,14 @@ void RBTorsionForceProxy::serialize(const void* object, SerializationNode& node)
}
}
void
*
RBTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
RBTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
RBTorsionForce
*
force
=
new
RBTorsionForce
();
RBTorsionForce
*
force
=
new
RBTorsionForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
(
int
)
torsions
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
torsions
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
torsion
=
torsions
.
getChildren
()[
i
];
const
SerializationNode
&
torsion
=
torsions
.
getChildren
()[
i
];
...
...
serialization/tests/TestSerializeCMAPTorsion.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -55,6 +55,7 @@ void testSerialization() {
...
@@ -55,6 +55,7 @@ void testSerialization() {
force
.
addTorsion
(
0
,
0
,
2
,
3
,
4
,
5
,
6
,
7
,
8
);
force
.
addTorsion
(
0
,
0
,
2
,
3
,
4
,
5
,
6
,
7
,
8
);
force
.
addTorsion
(
1
,
2
,
3
,
4
,
7
,
1
,
2
,
3
,
4
);
force
.
addTorsion
(
1
,
2
,
3
,
4
,
7
,
1
,
2
,
3
,
4
);
force
.
addTorsion
(
1
,
5
,
1
,
2
,
3
,
2
,
3
,
4
,
8
);
force
.
addTorsion
(
1
,
5
,
1
,
2
,
3
,
2
,
3
,
4
,
8
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -66,6 +67,7 @@ void testSerialization() {
...
@@ -66,6 +67,7 @@ void testSerialization() {
CMAPTorsionForce
&
force2
=
*
copy
;
CMAPTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumMaps
(),
force2
.
getNumMaps
());
ASSERT_EQUAL
(
force
.
getNumMaps
(),
force2
.
getNumMaps
());
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
int
size1
,
size2
;
int
size1
,
size2
;
...
...
serialization/tests/TestSerializeCustomAngleForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -53,6 +53,7 @@ void testSerialization() {
...
@@ -53,6 +53,7 @@ void testSerialization() {
force
.
addAngle
(
4
,
0
,
1
,
params
);
force
.
addAngle
(
4
,
0
,
1
,
params
);
params
[
0
]
=
2.1
;
params
[
0
]
=
2.1
;
force
.
addAngle
(
3
,
7
,
6
,
params
);
force
.
addAngle
(
3
,
7
,
6
,
params
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -73,6 +74,7 @@ void testSerialization() {
...
@@ -73,6 +74,7 @@ void testSerialization() {
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
}
}
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumAngles
(),
force2
.
getNumAngles
());
ASSERT_EQUAL
(
force
.
getNumAngles
(),
force2
.
getNumAngles
());
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
int
a1
,
a2
,
b1
,
b2
,
c1
,
c2
;
int
a1
,
a2
,
b1
,
b2
,
c1
,
c2
;
...
...
serialization/tests/TestSerializeCustomBondForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -53,6 +53,7 @@ void testSerialization() {
...
@@ -53,6 +53,7 @@ void testSerialization() {
force
.
addBond
(
4
,
0
,
params
);
force
.
addBond
(
4
,
0
,
params
);
params
[
0
]
=
2.1
;
params
[
0
]
=
2.1
;
force
.
addBond
(
3
,
7
,
params
);
force
.
addBond
(
3
,
7
,
params
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -73,6 +74,7 @@ void testSerialization() {
...
@@ -73,6 +74,7 @@ void testSerialization() {
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
}
}
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
int
a1
,
a2
,
b1
,
b2
;
int
a1
,
a2
,
b1
,
b2
;
...
...
serialization/tests/TestSerializeCustomCentroidBondForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
5
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -77,6 +77,7 @@ void testSerialization() {
...
@@ -77,6 +77,7 @@ void testSerialization() {
for
(
int
i
=
0
;
i
<
10
;
i
++
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
values
[
i
]
=
sin
((
double
)
i
);
values
[
i
]
=
sin
((
double
)
i
);
force
.
addTabulatedFunction
(
"f"
,
new
Continuous1DFunction
(
values
,
0.5
,
1.5
));
force
.
addTabulatedFunction
(
"f"
,
new
Continuous1DFunction
(
values
,
0.5
,
1.5
));
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -98,6 +99,7 @@ void testSerialization() {
...
@@ -98,6 +99,7 @@ void testSerialization() {
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
}
}
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumGroups
(),
force2
.
getNumGroups
());
ASSERT_EQUAL
(
force
.
getNumGroups
(),
force2
.
getNumGroups
());
for
(
int
i
=
0
;
i
<
force
.
getNumGroups
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumGroups
();
i
++
)
{
vector
<
int
>
particles1
,
particles2
;
vector
<
int
>
particles1
,
particles2
;
...
...
serialization/tests/TestSerializeCustomCompoundBondForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -67,6 +67,7 @@ void testSerialization() {
...
@@ -67,6 +67,7 @@ void testSerialization() {
for
(
int
i
=
0
;
i
<
10
;
i
++
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
values
[
i
]
=
sin
((
double
)
i
);
values
[
i
]
=
sin
((
double
)
i
);
force
.
addTabulatedFunction
(
"f"
,
new
Continuous1DFunction
(
values
,
0.5
,
1.5
));
force
.
addTabulatedFunction
(
"f"
,
new
Continuous1DFunction
(
values
,
0.5
,
1.5
));
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -88,6 +89,7 @@ void testSerialization() {
...
@@ -88,6 +89,7 @@ void testSerialization() {
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
}
}
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
vector
<
int
>
particles1
,
particles2
;
vector
<
int
>
particles1
,
particles2
;
...
...
serialization/tests/TestSerializeCustomTorsionForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -53,6 +53,7 @@ void testSerialization() {
...
@@ -53,6 +53,7 @@ void testSerialization() {
force
.
addTorsion
(
4
,
0
,
1
,
5
,
params
);
force
.
addTorsion
(
4
,
0
,
1
,
5
,
params
);
params
[
0
]
=
2.1
;
params
[
0
]
=
2.1
;
force
.
addTorsion
(
3
,
7
,
6
,
8
,
params
);
force
.
addTorsion
(
3
,
7
,
6
,
8
,
params
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -73,6 +74,7 @@ void testSerialization() {
...
@@ -73,6 +74,7 @@ void testSerialization() {
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterName
(
i
),
force2
.
getGlobalParameterName
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
ASSERT_EQUAL
(
force
.
getGlobalParameterDefaultValue
(
i
),
force2
.
getGlobalParameterDefaultValue
(
i
));
}
}
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumTorsions
(),
force2
.
getNumTorsions
());
ASSERT_EQUAL
(
force
.
getNumTorsions
(),
force2
.
getNumTorsions
());
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
int
a1
,
a2
,
b1
,
b2
,
c1
,
c2
,
d1
,
d2
;
int
a1
,
a2
,
b1
,
b2
,
c1
,
c2
,
d1
,
d2
;
...
...
serialization/tests/TestSerializeHarmonicAngleForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -47,6 +47,7 @@ void testSerialization() {
...
@@ -47,6 +47,7 @@ void testSerialization() {
force
.
addAngle
(
0
,
2
,
3
,
2.0
,
2.1
);
force
.
addAngle
(
0
,
2
,
3
,
2.0
,
2.1
);
force
.
addAngle
(
2
,
3
,
4
,
3.0
,
2.2
);
force
.
addAngle
(
2
,
3
,
4
,
3.0
,
2.2
);
force
.
addAngle
(
5
,
1
,
2
,
4.0
,
2.3
);
force
.
addAngle
(
5
,
1
,
2
,
4.0
,
2.3
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -58,6 +59,7 @@ void testSerialization() {
...
@@ -58,6 +59,7 @@ void testSerialization() {
HarmonicAngleForce
&
force2
=
*
copy
;
HarmonicAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumAngles
(),
force2
.
getNumAngles
());
ASSERT_EQUAL
(
force
.
getNumAngles
(),
force2
.
getNumAngles
());
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
int
a1
,
a2
,
a3
,
b1
,
b2
,
b3
;
int
a1
,
a2
,
a3
,
b1
,
b2
,
b3
;
...
...
serialization/tests/TestSerializeHarmonicBondForce.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -47,6 +47,7 @@ void testSerialization() {
...
@@ -47,6 +47,7 @@ void testSerialization() {
force
.
addBond
(
0
,
2
,
2.0
,
2.1
);
force
.
addBond
(
0
,
2
,
2.0
,
2.1
);
force
.
addBond
(
2
,
3
,
3.0
,
2.2
);
force
.
addBond
(
2
,
3
,
3.0
,
2.2
);
force
.
addBond
(
5
,
1
,
4.0
,
2.3
);
force
.
addBond
(
5
,
1
,
4.0
,
2.3
);
force
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -58,6 +59,7 @@ void testSerialization() {
...
@@ -58,6 +59,7 @@ void testSerialization() {
HarmonicBondForce
&
force2
=
*
copy
;
HarmonicBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
ASSERT_EQUAL
(
force
.
getNumBonds
(),
force2
.
getNumBonds
());
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
int
a1
,
a2
,
b1
,
b2
;
int
a1
,
a2
,
b1
,
b2
;
...
...
serialization/tests/TestSerializeMonteCarloAnisotropicBarostat.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -56,7 +56,7 @@ void testSerialization() {
...
@@ -56,7 +56,7 @@ void testSerialization() {
MonteCarloAnisotropicBarostat
&
force2
=
*
copy
;
MonteCarloAnisotropicBarostat
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL_VEC
(
force
.
getDefaultPressure
(),
force2
.
getDefaultPressure
(),
0.0
);
ASSERT_EQUAL_VEC
(
force
.
getDefaultPressure
(),
force2
.
getDefaultPressure
(),
0.0
);
ASSERT_EQUAL
(
force
.
getTemperature
(),
force2
.
getTemperature
());
ASSERT_EQUAL
(
force
.
get
Default
Temperature
(),
force2
.
get
Default
Temperature
());
ASSERT_EQUAL
(
force
.
getScaleX
(),
force2
.
getScaleX
());
ASSERT_EQUAL
(
force
.
getScaleX
(),
force2
.
getScaleX
());
ASSERT_EQUAL
(
force
.
getScaleY
(),
force2
.
getScaleY
());
ASSERT_EQUAL
(
force
.
getScaleY
(),
force2
.
getScaleY
());
ASSERT_EQUAL
(
force
.
getScaleZ
(),
force2
.
getScaleZ
());
ASSERT_EQUAL
(
force
.
getScaleZ
(),
force2
.
getScaleZ
());
...
...
serialization/tests/TestSerializeMonteCarloBarostat.cpp
View file @
73183c61
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -56,7 +56,7 @@ void testSerialization() {
...
@@ -56,7 +56,7 @@ void testSerialization() {
MonteCarloBarostat
&
force2
=
*
copy
;
MonteCarloBarostat
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getDefaultPressure
(),
force2
.
getDefaultPressure
());
ASSERT_EQUAL
(
force
.
getDefaultPressure
(),
force2
.
getDefaultPressure
());
ASSERT_EQUAL
(
force
.
getTemperature
(),
force2
.
getTemperature
());
ASSERT_EQUAL
(
force
.
get
Default
Temperature
(),
force2
.
get
Default
Temperature
());
ASSERT_EQUAL
(
force
.
getFrequency
(),
force2
.
getFrequency
());
ASSERT_EQUAL
(
force
.
getFrequency
(),
force2
.
getFrequency
());
ASSERT_EQUAL
(
force
.
getRandomNumberSeed
(),
force2
.
getRandomNumberSeed
());
ASSERT_EQUAL
(
force
.
getRandomNumberSeed
(),
force2
.
getRandomNumberSeed
());
}
}
...
...
Prev
1
…
8
9
10
11
12
13
14
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