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
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
58 additions
and
18 deletions
+58
-18
serialization/src/AndersenThermostatProxy.cpp
serialization/src/AndersenThermostatProxy.cpp
+3
-1
serialization/src/CMAPTorsionForceProxy.cpp
serialization/src/CMAPTorsionForceProxy.cpp
+3
-1
serialization/src/CMMotionRemoverProxy.cpp
serialization/src/CMMotionRemoverProxy.cpp
+3
-1
serialization/src/CustomAngleForceProxy.cpp
serialization/src/CustomAngleForceProxy.cpp
+3
-1
serialization/src/CustomBondForceProxy.cpp
serialization/src/CustomBondForceProxy.cpp
+3
-1
serialization/src/CustomCompoundBondForceProxy.cpp
serialization/src/CustomCompoundBondForceProxy.cpp
+3
-1
serialization/src/CustomExternalForceProxy.cpp
serialization/src/CustomExternalForceProxy.cpp
+3
-1
serialization/src/CustomGBForceProxy.cpp
serialization/src/CustomGBForceProxy.cpp
+3
-1
serialization/src/CustomHbondForceProxy.cpp
serialization/src/CustomHbondForceProxy.cpp
+3
-1
serialization/src/CustomNonbondedForceProxy.cpp
serialization/src/CustomNonbondedForceProxy.cpp
+2
-0
serialization/src/CustomTorsionForceProxy.cpp
serialization/src/CustomTorsionForceProxy.cpp
+3
-1
serialization/src/GBSAOBCForceProxy.cpp
serialization/src/GBSAOBCForceProxy.cpp
+3
-1
serialization/src/GBVIForceProxy.cpp
serialization/src/GBVIForceProxy.cpp
+3
-1
serialization/src/HarmonicAngleForceProxy.cpp
serialization/src/HarmonicAngleForceProxy.cpp
+3
-1
serialization/src/HarmonicBondForceProxy.cpp
serialization/src/HarmonicBondForceProxy.cpp
+3
-1
serialization/src/MonteCarloBarostatProxy.cpp
serialization/src/MonteCarloBarostatProxy.cpp
+3
-1
serialization/src/NonbondedForceProxy.cpp
serialization/src/NonbondedForceProxy.cpp
+2
-0
serialization/src/PeriodicTorsionForceProxy.cpp
serialization/src/PeriodicTorsionForceProxy.cpp
+3
-1
serialization/src/RBTorsionForceProxy.cpp
serialization/src/RBTorsionForceProxy.cpp
+3
-1
serialization/tests/TestSerializeAndersenThermostat.cpp
serialization/tests/TestSerializeAndersenThermostat.cpp
+3
-1
No files found.
serialization/src/AndersenThermostatProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -47,6 +47,7 @@ void AndersenThermostatProxy::serialize(const void* object, SerializationNode& n
...
@@ -47,6 +47,7 @@ void AndersenThermostatProxy::serialize(const void* object, SerializationNode& n
node
.
setDoubleProperty
(
"temperature"
,
force
.
getDefaultTemperature
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getDefaultTemperature
());
node
.
setDoubleProperty
(
"frequency"
,
force
.
getDefaultCollisionFrequency
());
node
.
setDoubleProperty
(
"frequency"
,
force
.
getDefaultCollisionFrequency
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
node
.
setIntProperty
(
"randomSeed"
,
force
.
getRandomNumberSeed
());
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
}
}
void
*
AndersenThermostatProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
AndersenThermostatProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
...
@@ -55,6 +56,7 @@ void* AndersenThermostatProxy::deserialize(const SerializationNode& node) const
...
@@ -55,6 +56,7 @@ void* AndersenThermostatProxy::deserialize(const SerializationNode& node) const
AndersenThermostat
*
force
=
NULL
;
AndersenThermostat
*
force
=
NULL
;
try
{
try
{
AndersenThermostat
*
force
=
new
AndersenThermostat
(
node
.
getDoubleProperty
(
"temperature"
),
node
.
getDoubleProperty
(
"frequency"
));
AndersenThermostat
*
force
=
new
AndersenThermostat
(
node
.
getDoubleProperty
(
"temperature"
),
node
.
getDoubleProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
return
force
;
return
force
;
}
}
...
...
serialization/src/CMAPTorsionForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CMAPTorsionForceProxy::CMAPTorsionForceProxy() : SerializationProxy("CMAPTorsion
...
@@ -44,6 +44,7 @@ CMAPTorsionForceProxy::CMAPTorsionForceProxy() : SerializationProxy("CMAPTorsion
void
CMAPTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CMAPTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CMAPTorsionForce
&
force
=
*
reinterpret_cast
<
const
CMAPTorsionForce
*>
(
object
);
const
CMAPTorsionForce
&
force
=
*
reinterpret_cast
<
const
CMAPTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
SerializationNode
&
maps
=
node
.
createChildNode
(
"Maps"
);
SerializationNode
&
maps
=
node
.
createChildNode
(
"Maps"
);
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
int
size
;
int
size
;
...
@@ -66,6 +67,7 @@ void* CMAPTorsionForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -66,6 +67,7 @@ void* CMAPTorsionForceProxy::deserialize(const SerializationNode& node) const {
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
CMAPTorsionForce
*
force
=
new
CMAPTorsionForce
();
CMAPTorsionForce
*
force
=
new
CMAPTorsionForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
const
SerializationNode
&
maps
=
node
.
getChildNode
(
"Maps"
);
const
SerializationNode
&
maps
=
node
.
getChildNode
(
"Maps"
);
for
(
int
i
=
0
;
i
<
(
int
)
maps
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
maps
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
map
=
maps
.
getChildren
()[
i
];
const
SerializationNode
&
map
=
maps
.
getChildren
()[
i
];
...
...
serialization/src/CMMotionRemoverProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CMMotionRemoverProxy::CMMotionRemoverProxy() : SerializationProxy("CMMotionRemov
...
@@ -44,6 +44,7 @@ CMMotionRemoverProxy::CMMotionRemoverProxy() : SerializationProxy("CMMotionRemov
void
CMMotionRemoverProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CMMotionRemoverProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CMMotionRemover
&
force
=
*
reinterpret_cast
<
const
CMMotionRemover
*>
(
object
);
const
CMMotionRemover
&
force
=
*
reinterpret_cast
<
const
CMMotionRemover
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
}
}
...
@@ -53,6 +54,7 @@ void* CMMotionRemoverProxy::deserialize(const SerializationNode& node) const {
...
@@ -53,6 +54,7 @@ void* CMMotionRemoverProxy::deserialize(const SerializationNode& node) const {
CMMotionRemover
*
force
=
NULL
;
CMMotionRemover
*
force
=
NULL
;
try
{
try
{
CMMotionRemover
*
force
=
new
CMMotionRemover
(
node
.
getIntProperty
(
"frequency"
));
CMMotionRemover
*
force
=
new
CMMotionRemover
(
node
.
getIntProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
return
force
;
return
force
;
}
}
catch
(...)
{
catch
(...)
{
...
...
serialization/src/CustomAngleForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomAngleForceProxy::CustomAngleForceProxy() : SerializationProxy("CustomAngle
...
@@ -44,6 +44,7 @@ CustomAngleForceProxy::CustomAngleForceProxy() : SerializationProxy("CustomAngle
void
CustomAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomAngleForce
&
force
=
*
reinterpret_cast
<
const
CustomAngleForce
*>
(
object
);
const
CustomAngleForce
&
force
=
*
reinterpret_cast
<
const
CustomAngleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perAngleParams
=
node
.
createChildNode
(
"PerAngleParameters"
);
SerializationNode
&
perAngleParams
=
node
.
createChildNode
(
"PerAngleParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerAngleParameters
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumPerAngleParameters
();
i
++
)
{
...
@@ -74,6 +75,7 @@ void* CustomAngleForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -74,6 +75,7 @@ void* CustomAngleForceProxy::deserialize(const SerializationNode& node) const {
CustomAngleForce
*
force
=
NULL
;
CustomAngleForce
*
force
=
NULL
;
try
{
try
{
CustomAngleForce
*
force
=
new
CustomAngleForce
(
node
.
getStringProperty
(
"energy"
));
CustomAngleForce
*
force
=
new
CustomAngleForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
const
SerializationNode
&
perAngleParams
=
node
.
getChildNode
(
"PerAngleParameters"
);
const
SerializationNode
&
perAngleParams
=
node
.
getChildNode
(
"PerAngleParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perAngleParams
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
perAngleParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perAngleParams
.
getChildren
()[
i
];
const
SerializationNode
&
parameter
=
perAngleParams
.
getChildren
()[
i
];
...
...
serialization/src/CustomBondForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomBondForceProxy::CustomBondForceProxy() : SerializationProxy("CustomBondFor
...
@@ -44,6 +44,7 @@ CustomBondForceProxy::CustomBondForceProxy() : SerializationProxy("CustomBondFor
void
CustomBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomBondForce
&
force
=
*
reinterpret_cast
<
const
CustomBondForce
*>
(
object
);
const
CustomBondForce
&
force
=
*
reinterpret_cast
<
const
CustomBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerBondParameters
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumPerBondParameters
();
i
++
)
{
...
@@ -74,6 +75,7 @@ void* CustomBondForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -74,6 +75,7 @@ void* CustomBondForceProxy::deserialize(const SerializationNode& node) const {
CustomBondForce
*
force
=
NULL
;
CustomBondForce
*
force
=
NULL
;
try
{
try
{
CustomBondForce
*
force
=
new
CustomBondForce
(
node
.
getStringProperty
(
"energy"
));
CustomBondForce
*
force
=
new
CustomBondForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
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 @
ede48b85
...
@@ -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
2
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomCompoundBondForceProxy::CustomCompoundBondForceProxy() : SerializationProx
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
CustomCompoundBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCompoundBondForce
*>
(
object
);
const
CustomCompoundBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCompoundBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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"
);
...
@@ -84,6 +85,7 @@ void* CustomCompoundBondForceProxy::deserialize(const SerializationNode& node) c
...
@@ -84,6 +85,7 @@ void* CustomCompoundBondForceProxy::deserialize(const SerializationNode& node) c
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
));
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/CustomExternalForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomExternalForceProxy::CustomExternalForceProxy() : SerializationProxy("Custo
...
@@ -44,6 +44,7 @@ CustomExternalForceProxy::CustomExternalForceProxy() : SerializationProxy("Custo
void
CustomExternalForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomExternalForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomExternalForce
&
force
=
*
reinterpret_cast
<
const
CustomExternalForce
*>
(
object
);
const
CustomExternalForce
&
force
=
*
reinterpret_cast
<
const
CustomExternalForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerParticleParameters
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumPerParticleParameters
();
i
++
)
{
...
@@ -74,6 +75,7 @@ void* CustomExternalForceProxy::deserialize(const SerializationNode& node) const
...
@@ -74,6 +75,7 @@ void* CustomExternalForceProxy::deserialize(const SerializationNode& node) const
CustomExternalForce
*
force
=
NULL
;
CustomExternalForce
*
force
=
NULL
;
try
{
try
{
CustomExternalForce
*
force
=
new
CustomExternalForce
(
node
.
getStringProperty
(
"energy"
));
CustomExternalForce
*
force
=
new
CustomExternalForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perParticleParams
.
getChildren
().
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
perParticleParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perParticleParams
.
getChildren
()[
i
];
const
SerializationNode
&
parameter
=
perParticleParams
.
getChildren
()[
i
];
...
...
serialization/src/CustomGBForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomGBForceProxy::CustomGBForceProxy() : SerializationProxy("CustomGBForce") {
...
@@ -44,6 +44,7 @@ CustomGBForceProxy::CustomGBForceProxy() : SerializationProxy("CustomGBForce") {
void
CustomGBForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomGBForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomGBForce
&
force
=
*
reinterpret_cast
<
const
CustomGBForce
*>
(
object
);
const
CustomGBForce
&
force
=
*
reinterpret_cast
<
const
CustomGBForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
...
@@ -97,6 +98,7 @@ void* CustomGBForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -97,6 +98,7 @@ void* CustomGBForceProxy::deserialize(const SerializationNode& node) const {
CustomGBForce
*
force
=
NULL
;
CustomGBForce
*
force
=
NULL
;
try
{
try
{
CustomGBForce
*
force
=
new
CustomGBForce
();
CustomGBForce
*
force
=
new
CustomGBForce
();
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
CustomGBForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
CustomGBForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
...
...
serialization/src/CustomHbondForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomHbondForceProxy::CustomHbondForceProxy() : SerializationProxy("CustomHbond
...
@@ -44,6 +44,7 @@ CustomHbondForceProxy::CustomHbondForceProxy() : SerializationProxy("CustomHbond
void
CustomHbondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomHbondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomHbondForce
&
force
=
*
reinterpret_cast
<
const
CustomHbondForce
*>
(
object
);
const
CustomHbondForce
&
force
=
*
reinterpret_cast
<
const
CustomHbondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
...
@@ -102,6 +103,7 @@ void* CustomHbondForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -102,6 +103,7 @@ void* CustomHbondForceProxy::deserialize(const SerializationNode& node) const {
CustomHbondForce
*
force
=
NULL
;
CustomHbondForce
*
force
=
NULL
;
try
{
try
{
CustomHbondForce
*
force
=
new
CustomHbondForce
(
node
.
getStringProperty
(
"energy"
));
CustomHbondForce
*
force
=
new
CustomHbondForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
CustomHbondForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
CustomHbondForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
const
SerializationNode
&
perDonorParams
=
node
.
getChildNode
(
"PerDonorParameters"
);
const
SerializationNode
&
perDonorParams
=
node
.
getChildNode
(
"PerDonorParameters"
);
...
...
serialization/src/CustomNonbondedForceProxy.cpp
View file @
ede48b85
...
@@ -44,6 +44,7 @@ CustomNonbondedForceProxy::CustomNonbondedForceProxy() : SerializationProxy("Cus
...
@@ -44,6 +44,7 @@ CustomNonbondedForceProxy::CustomNonbondedForceProxy() : SerializationProxy("Cus
void
CustomNonbondedForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
CustomNonbondedForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
CustomNonbondedForce
&
force
=
*
reinterpret_cast
<
const
CustomNonbondedForce
*>
(
object
);
const
CustomNonbondedForce
&
force
=
*
reinterpret_cast
<
const
CustomNonbondedForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
...
@@ -101,6 +102,7 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
...
@@ -101,6 +102,7 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
CustomNonbondedForce
*
force
=
NULL
;
CustomNonbondedForce
*
force
=
NULL
;
try
{
try
{
CustomNonbondedForce
*
force
=
new
CustomNonbondedForce
(
node
.
getStringProperty
(
"energy"
));
CustomNonbondedForce
*
force
=
new
CustomNonbondedForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
CustomNonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
CustomNonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
...
...
serialization/src/CustomTorsionForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ CustomTorsionForceProxy::CustomTorsionForceProxy() : SerializationProxy("CustomT
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
CustomTorsionForce
&
force
=
*
reinterpret_cast
<
const
CustomTorsionForce
*>
(
object
);
const
CustomTorsionForce
&
force
=
*
reinterpret_cast
<
const
CustomTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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
++
)
{
...
@@ -74,6 +75,7 @@ void* CustomTorsionForceProxy::deserialize(const SerializationNode& node) const
...
@@ -74,6 +75,7 @@ void* CustomTorsionForceProxy::deserialize(const SerializationNode& node) const
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
));
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/GBSAOBCForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ GBSAOBCForceProxy::GBSAOBCForceProxy() : SerializationProxy("GBSAOBCForce") {
...
@@ -44,6 +44,7 @@ GBSAOBCForceProxy::GBSAOBCForceProxy() : SerializationProxy("GBSAOBCForce") {
void
GBSAOBCForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
GBSAOBCForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
GBSAOBCForce
&
force
=
*
reinterpret_cast
<
const
GBSAOBCForce
*>
(
object
);
const
GBSAOBCForce
&
force
=
*
reinterpret_cast
<
const
GBSAOBCForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"soluteDielectric"
,
force
.
getSoluteDielectric
());
node
.
setDoubleProperty
(
"soluteDielectric"
,
force
.
getSoluteDielectric
());
...
@@ -61,6 +62,7 @@ void* GBSAOBCForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -61,6 +62,7 @@ void* GBSAOBCForceProxy::deserialize(const SerializationNode& node) const {
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
GBSAOBCForce
*
force
=
new
GBSAOBCForce
();
GBSAOBCForce
*
force
=
new
GBSAOBCForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
GBSAOBCForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
GBSAOBCForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"soluteDielectric"
));
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"soluteDielectric"
));
...
...
serialization/src/GBVIForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ GBVIForceProxy::GBVIForceProxy() : SerializationProxy("GBVIForce") {
...
@@ -44,6 +44,7 @@ GBVIForceProxy::GBVIForceProxy() : SerializationProxy("GBVIForce") {
void
GBVIForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
GBVIForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
2
);
node
.
setIntProperty
(
"version"
,
2
);
const
GBVIForce
&
force
=
*
reinterpret_cast
<
const
GBVIForce
*>
(
object
);
const
GBVIForce
&
force
=
*
reinterpret_cast
<
const
GBVIForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"scalingMethod"
,
(
int
)
force
.
getBornRadiusScalingMethod
());
node
.
setIntProperty
(
"scalingMethod"
,
(
int
)
force
.
getBornRadiusScalingMethod
());
node
.
setDoubleProperty
(
"quinticLowerLimitFactor"
,
force
.
getQuinticLowerLimitFactor
());
node
.
setDoubleProperty
(
"quinticLowerLimitFactor"
,
force
.
getQuinticLowerLimitFactor
());
...
@@ -71,6 +72,7 @@ void* GBVIForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -71,6 +72,7 @@ void* GBVIForceProxy::deserialize(const SerializationNode& node) const {
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
GBVIForce
*
force
=
new
GBVIForce
();
GBVIForce
*
force
=
new
GBVIForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
GBVIForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
GBVIForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"soluteDielectric"
));
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"soluteDielectric"
));
...
...
serialization/src/HarmonicAngleForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ HarmonicAngleForceProxy::HarmonicAngleForceProxy() : SerializationProxy("Harmoni
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
HarmonicAngleForce
&
force
=
*
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
object
);
const
HarmonicAngleForce
&
force
=
*
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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
;
...
@@ -58,6 +59,7 @@ void* HarmonicAngleForceProxy::deserialize(const SerializationNode& node) const
...
@@ -58,6 +59,7 @@ void* HarmonicAngleForceProxy::deserialize(const SerializationNode& node) const
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
));
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 @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ HarmonicBondForceProxy::HarmonicBondForceProxy() : SerializationProxy("HarmonicB
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
HarmonicBondForce
&
force
=
*
reinterpret_cast
<
const
HarmonicBondForce
*>
(
object
);
const
HarmonicBondForce
&
force
=
*
reinterpret_cast
<
const
HarmonicBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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
;
...
@@ -58,6 +59,7 @@ void* HarmonicBondForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -58,6 +59,7 @@ void* HarmonicBondForceProxy::deserialize(const SerializationNode& node) const {
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
));
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/MonteCarloBarostatProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ MonteCarloBarostatProxy::MonteCarloBarostatProxy() : SerializationProxy("MonteCa
...
@@ -44,6 +44,7 @@ MonteCarloBarostatProxy::MonteCarloBarostatProxy() : SerializationProxy("MonteCa
void
MonteCarloBarostatProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
MonteCarloBarostatProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
MonteCarloBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloBarostat
*>
(
object
);
const
MonteCarloBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloBarostat
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getTemperature
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getTemperature
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
...
@@ -56,6 +57,7 @@ void* MonteCarloBarostatProxy::deserialize(const SerializationNode& node) const
...
@@ -56,6 +57,7 @@ void* MonteCarloBarostatProxy::deserialize(const SerializationNode& node) const
MonteCarloBarostat
*
force
=
NULL
;
MonteCarloBarostat
*
force
=
NULL
;
try
{
try
{
MonteCarloBarostat
*
force
=
new
MonteCarloBarostat
(
node
.
getDoubleProperty
(
"pressure"
),
node
.
getDoubleProperty
(
"temperature"
),
node
.
getIntProperty
(
"frequency"
));
MonteCarloBarostat
*
force
=
new
MonteCarloBarostat
(
node
.
getDoubleProperty
(
"pressure"
),
node
.
getDoubleProperty
(
"temperature"
),
node
.
getIntProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
return
force
;
return
force
;
}
}
...
...
serialization/src/NonbondedForceProxy.cpp
View file @
ede48b85
...
@@ -44,6 +44,7 @@ NonbondedForceProxy::NonbondedForceProxy() : SerializationProxy("NonbondedForce"
...
@@ -44,6 +44,7 @@ NonbondedForceProxy::NonbondedForceProxy() : SerializationProxy("NonbondedForce"
void
NonbondedForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
NonbondedForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
NonbondedForce
&
force
=
*
reinterpret_cast
<
const
NonbondedForce
*>
(
object
);
const
NonbondedForce
&
force
=
*
reinterpret_cast
<
const
NonbondedForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setBoolProperty
(
"useSwitchingFunction"
,
force
.
getUseSwitchingFunction
());
node
.
setBoolProperty
(
"useSwitchingFunction"
,
force
.
getUseSwitchingFunction
());
...
@@ -79,6 +80,7 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -79,6 +80,7 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
throw
OpenMMException
(
"Unsupported version number"
);
throw
OpenMMException
(
"Unsupported version number"
);
NonbondedForce
*
force
=
new
NonbondedForce
();
NonbondedForce
*
force
=
new
NonbondedForce
();
try
{
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setNonbondedMethod
((
NonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setNonbondedMethod
((
NonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
...
...
serialization/src/PeriodicTorsionForceProxy.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ PeriodicTorsionForceProxy::PeriodicTorsionForceProxy() : SerializationProxy("Per
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
PeriodicTorsionForce
&
force
=
*
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
object
);
const
PeriodicTorsionForce
&
force
=
*
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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
;
...
@@ -58,6 +59,7 @@ void* PeriodicTorsionForceProxy::deserialize(const SerializationNode& node) cons
...
@@ -58,6 +59,7 @@ void* PeriodicTorsionForceProxy::deserialize(const SerializationNode& node) cons
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
));
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 @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -44,6 +44,7 @@ RBTorsionForceProxy::RBTorsionForceProxy() : SerializationProxy("RBTorsionForce"
...
@@ -44,6 +44,7 @@ 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"
,
1
);
const
RBTorsionForce
&
force
=
*
reinterpret_cast
<
const
RBTorsionForce
*>
(
object
);
const
RBTorsionForce
&
force
=
*
reinterpret_cast
<
const
RBTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
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
;
...
@@ -58,6 +59,7 @@ void* RBTorsionForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -58,6 +59,7 @@ void* RBTorsionForceProxy::deserialize(const SerializationNode& node) const {
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
));
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/TestSerializeAndersenThermostat.cpp
View file @
ede48b85
...
@@ -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 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -42,6 +42,7 @@ void testSerialization() {
...
@@ -42,6 +42,7 @@ void testSerialization() {
// Create a Force.
// Create a Force.
AndersenThermostat
force
(
250.0
,
0.2
);
AndersenThermostat
force
(
250.0
,
0.2
);
force
.
setForceGroup
(
3
);
force
.
setRandomNumberSeed
(
3
);
force
.
setRandomNumberSeed
(
3
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
@@ -53,6 +54,7 @@ void testSerialization() {
...
@@ -53,6 +54,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
// Compare the two forces to see if they are identical.
AndersenThermostat
&
force2
=
*
copy
;
AndersenThermostat
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force
.
getDefaultTemperature
(),
force2
.
getDefaultTemperature
());
ASSERT_EQUAL
(
force
.
getDefaultTemperature
(),
force2
.
getDefaultTemperature
());
ASSERT_EQUAL
(
force
.
getDefaultCollisionFrequency
(),
force2
.
getDefaultCollisionFrequency
());
ASSERT_EQUAL
(
force
.
getDefaultCollisionFrequency
(),
force2
.
getDefaultCollisionFrequency
());
ASSERT_EQUAL
(
force
.
getRandomNumberSeed
(),
force2
.
getRandomNumberSeed
());
ASSERT_EQUAL
(
force
.
getRandomNumberSeed
(),
force2
.
getRandomNumberSeed
());
...
...
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