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
4c6cf680
Unverified
Commit
4c6cf680
authored
Mar 10, 2021
by
Peter Eastman
Committed by
GitHub
Mar 10, 2021
Browse files
Added name property to Forces (#3049)
parent
7c2e5991
Changes
67
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
40 additions
and
0 deletions
+40
-0
serialization/src/CustomBondForceProxy.cpp
serialization/src/CustomBondForceProxy.cpp
+2
-0
serialization/src/CustomCVForceProxy.cpp
serialization/src/CustomCVForceProxy.cpp
+2
-0
serialization/src/CustomCentroidBondForceProxy.cpp
serialization/src/CustomCentroidBondForceProxy.cpp
+2
-0
serialization/src/CustomCompoundBondForceProxy.cpp
serialization/src/CustomCompoundBondForceProxy.cpp
+2
-0
serialization/src/CustomExternalForceProxy.cpp
serialization/src/CustomExternalForceProxy.cpp
+2
-0
serialization/src/CustomGBForceProxy.cpp
serialization/src/CustomGBForceProxy.cpp
+2
-0
serialization/src/CustomHbondForceProxy.cpp
serialization/src/CustomHbondForceProxy.cpp
+2
-0
serialization/src/CustomManyParticleForceProxy.cpp
serialization/src/CustomManyParticleForceProxy.cpp
+2
-0
serialization/src/CustomNonbondedForceProxy.cpp
serialization/src/CustomNonbondedForceProxy.cpp
+2
-0
serialization/src/CustomTorsionForceProxy.cpp
serialization/src/CustomTorsionForceProxy.cpp
+2
-0
serialization/src/GBSAOBCForceProxy.cpp
serialization/src/GBSAOBCForceProxy.cpp
+2
-0
serialization/src/GayBerneForceProxy.cpp
serialization/src/GayBerneForceProxy.cpp
+2
-0
serialization/src/HarmonicAngleForceProxy.cpp
serialization/src/HarmonicAngleForceProxy.cpp
+2
-0
serialization/src/HarmonicBondForceProxy.cpp
serialization/src/HarmonicBondForceProxy.cpp
+2
-0
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
+2
-0
serialization/src/MonteCarloBarostatProxy.cpp
serialization/src/MonteCarloBarostatProxy.cpp
+2
-0
serialization/src/MonteCarloMembraneBarostatProxy.cpp
serialization/src/MonteCarloMembraneBarostatProxy.cpp
+2
-0
serialization/src/NonbondedForceProxy.cpp
serialization/src/NonbondedForceProxy.cpp
+2
-0
serialization/src/PeriodicTorsionForceProxy.cpp
serialization/src/PeriodicTorsionForceProxy.cpp
+2
-0
serialization/src/RBTorsionForceProxy.cpp
serialization/src/RBTorsionForceProxy.cpp
+2
-0
No files found.
serialization/src/CustomBondForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomBondForceProxy::serialize(const void* object, SerializationNode& node
node
.
setIntProperty
(
"version"
,
3
);
const
CustomBondForce
&
force
=
*
reinterpret_cast
<
const
CustomBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
...
...
@@ -82,6 +83,7 @@ void* CustomBondForceProxy::deserialize(const SerializationNode& node) const {
try
{
CustomBondForce
*
force
=
new
CustomBondForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
...
...
serialization/src/CustomCVForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomCVForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"version"
,
0
);
const
CustomCVForce
&
force
=
*
reinterpret_cast
<
const
CustomCVForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
globalParams
=
node
.
createChildNode
(
"GlobalParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumGlobalParameters
();
i
++
)
{
...
...
@@ -72,6 +73,7 @@ void* CustomCVForceProxy::deserialize(const SerializationNode& node) const {
try
{
CustomCVForce
*
force
=
new
CustomCVForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
const
SerializationNode
&
globalParams
=
node
.
getChildNode
(
"GlobalParameters"
);
for
(
auto
&
parameter
:
globalParams
.
getChildren
())
force
->
addGlobalParameter
(
parameter
.
getStringProperty
(
"name"
),
parameter
.
getDoubleProperty
(
"default"
));
...
...
serialization/src/CustomCentroidBondForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomCentroidBondForceProxy::serialize(const void* object, SerializationNo
node
.
setIntProperty
(
"version"
,
3
);
const
CustomCentroidBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCentroidBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setIntProperty
(
"groups"
,
force
.
getNumGroupsPerBond
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
...
...
@@ -105,6 +106,7 @@ void* CustomCentroidBondForceProxy::deserialize(const SerializationNode& node) c
try
{
CustomCentroidBondForce
*
force
=
new
CustomCentroidBondForce
(
node
.
getIntProperty
(
"groups"
),
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
...
...
serialization/src/CustomCompoundBondForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomCompoundBondForceProxy::serialize(const void* object, SerializationNo
node
.
setIntProperty
(
"version"
,
3
);
const
CustomCompoundBondForce
&
force
=
*
reinterpret_cast
<
const
CustomCompoundBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setIntProperty
(
"particles"
,
force
.
getNumParticlesPerBond
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
...
...
@@ -92,6 +93,7 @@ void* CustomCompoundBondForceProxy::deserialize(const SerializationNode& node) c
try
{
CustomCompoundBondForce
*
force
=
new
CustomCompoundBondForce
(
node
.
getIntProperty
(
"particles"
),
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
...
...
serialization/src/CustomExternalForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomExternalForceProxy::serialize(const void* object, SerializationNode&
node
.
setIntProperty
(
"version"
,
1
);
const
CustomExternalForce
&
force
=
*
reinterpret_cast
<
const
CustomExternalForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerParticleParameters
();
i
++
)
{
...
...
@@ -76,6 +77,7 @@ void* CustomExternalForceProxy::deserialize(const SerializationNode& node) const
try
{
CustomExternalForce
*
force
=
new
CustomExternalForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
for
(
auto
&
parameter
:
perParticleParams
.
getChildren
())
force
->
addPerParticleParameter
(
parameter
.
getStringProperty
(
"name"
));
...
...
serialization/src/CustomGBForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomGBForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"version"
,
2
);
const
CustomGBForce
&
force
=
*
reinterpret_cast
<
const
CustomGBForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
SerializationNode
&
perParticleParams
=
node
.
createChildNode
(
"PerParticleParameters"
);
...
...
@@ -104,6 +105,7 @@ void* CustomGBForceProxy::deserialize(const SerializationNode& node) const {
try
{
CustomGBForce
*
force
=
new
CustomGBForce
();
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
CustomGBForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
...
...
serialization/src/CustomHbondForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomHbondForceProxy::serialize(const void* object, SerializationNode& nod
node
.
setIntProperty
(
"version"
,
1
);
const
CustomHbondForce
&
force
=
*
reinterpret_cast
<
const
CustomHbondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
...
...
@@ -104,6 +105,7 @@ void* CustomHbondForceProxy::deserialize(const SerializationNode& node) const {
try
{
CustomHbondForce
*
force
=
new
CustomHbondForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
CustomHbondForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
const
SerializationNode
&
perDonorParams
=
node
.
getChildNode
(
"PerDonorParameters"
);
...
...
serialization/src/CustomManyParticleForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomManyParticleForceProxy::serialize(const void* object, SerializationNo
node
.
setIntProperty
(
"version"
,
1
);
const
CustomManyParticleForce
&
force
=
*
reinterpret_cast
<
const
CustomManyParticleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setIntProperty
(
"particlesPerSet"
,
force
.
getNumParticlesPerSet
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
...
...
@@ -104,6 +105,7 @@ void* CustomManyParticleForceProxy::deserialize(const SerializationNode& node) c
try
{
CustomManyParticleForce
*
force
=
new
CustomManyParticleForce
(
node
.
getIntProperty
(
"particlesPerSet"
),
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
CustomManyParticleForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setPermutationMode
((
CustomManyParticleForce
::
PermutationMode
)
node
.
getIntProperty
(
"permutationMode"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
...
...
serialization/src/CustomNonbondedForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomNonbondedForceProxy::serialize(const void* object, SerializationNode&
node
.
setIntProperty
(
"version"
,
2
);
const
CustomNonbondedForce
&
force
=
*
reinterpret_cast
<
const
CustomNonbondedForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
...
...
@@ -108,6 +109,7 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
try
{
CustomNonbondedForce
*
force
=
new
CustomNonbondedForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
CustomNonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
...
...
serialization/src/CustomTorsionForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void CustomTorsionForceProxy::serialize(const void* object, SerializationNode& n
node
.
setIntProperty
(
"version"
,
3
);
const
CustomTorsionForce
&
force
=
*
reinterpret_cast
<
const
CustomTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perTorsionParams
=
node
.
createChildNode
(
"PerTorsionParameters"
);
...
...
@@ -82,6 +83,7 @@ void* CustomTorsionForceProxy::deserialize(const SerializationNode& node) const
try
{
CustomTorsionForce
*
force
=
new
CustomTorsionForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perTorsionParams
=
node
.
getChildNode
(
"PerTorsionParameters"
);
...
...
serialization/src/GBSAOBCForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void GBSAOBCForceProxy::serialize(const void* object, SerializationNode& node) c
node
.
setIntProperty
(
"version"
,
2
);
const
GBSAOBCForce
&
force
=
*
reinterpret_cast
<
const
GBSAOBCForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setDoubleProperty
(
"soluteDielectric"
,
force
.
getSoluteDielectric
());
...
...
@@ -65,6 +66,7 @@ void* GBSAOBCForceProxy::deserialize(const SerializationNode& node) const {
GBSAOBCForce
*
force
=
new
GBSAOBCForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
GBSAOBCForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"soluteDielectric"
));
...
...
serialization/src/GayBerneForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void GayBerneForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"version"
,
1
);
const
GayBerneForce
&
force
=
*
reinterpret_cast
<
const
GayBerneForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setBoolProperty
(
"useSwitchingFunction"
,
force
.
getUseSwitchingFunction
());
...
...
@@ -73,6 +74,7 @@ void* GayBerneForceProxy::deserialize(const SerializationNode& node) const {
GayBerneForce
*
force
=
new
GayBerneForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
GayBerneForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
...
...
serialization/src/HarmonicAngleForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void HarmonicAngleForceProxy::serialize(const void* object, SerializationNode& n
node
.
setIntProperty
(
"version"
,
2
);
const
HarmonicAngleForce
&
force
=
*
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Angles"
);
for
(
int
i
=
0
;
i
<
force
.
getNumAngles
();
i
++
)
{
...
...
@@ -62,6 +63,7 @@ void* HarmonicAngleForceProxy::deserialize(const SerializationNode& node) const
HarmonicAngleForce
*
force
=
new
HarmonicAngleForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
angles
=
node
.
getChildNode
(
"Angles"
);
...
...
serialization/src/HarmonicBondForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void HarmonicBondForceProxy::serialize(const void* object, SerializationNode& no
node
.
setIntProperty
(
"version"
,
2
);
const
HarmonicBondForce
&
force
=
*
reinterpret_cast
<
const
HarmonicBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Bonds"
);
for
(
int
i
=
0
;
i
<
force
.
getNumBonds
();
i
++
)
{
...
...
@@ -62,6 +63,7 @@ void* HarmonicBondForceProxy::deserialize(const SerializationNode& node) const {
HarmonicBondForce
*
force
=
new
HarmonicBondForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
...
...
serialization/src/MonteCarloAnisotropicBarostatProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void MonteCarloAnisotropicBarostatProxy::serialize(const void* object, Serializa
node
.
setIntProperty
(
"version"
,
1
);
const
MonteCarloAnisotropicBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloAnisotropicBarostat
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
Vec3
pressure
=
force
.
getDefaultPressure
();
node
.
setDoubleProperty
(
"pressurex"
,
pressure
[
0
]);
node
.
setDoubleProperty
(
"pressurey"
,
pressure
[
1
]);
...
...
@@ -66,6 +67,7 @@ void* MonteCarloAnisotropicBarostatProxy::deserialize(const SerializationNode& n
force
=
new
MonteCarloAnisotropicBarostat
(
pressure
,
node
.
getDoubleProperty
(
"temperature"
),
node
.
getBoolProperty
(
"scalex"
),
node
.
getBoolProperty
(
"scaley"
),
node
.
getBoolProperty
(
"scalez"
),
node
.
getIntProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
return
force
;
}
...
...
serialization/src/MonteCarloBarostatProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void MonteCarloBarostatProxy::serialize(const void* object, SerializationNode& n
node
.
setIntProperty
(
"version"
,
1
);
const
MonteCarloBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloBarostat
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getDefaultTemperature
());
node
.
setIntProperty
(
"frequency"
,
force
.
getFrequency
());
...
...
@@ -58,6 +59,7 @@ void* MonteCarloBarostatProxy::deserialize(const SerializationNode& node) const
try
{
force
=
new
MonteCarloBarostat
(
node
.
getDoubleProperty
(
"pressure"
),
node
.
getDoubleProperty
(
"temperature"
),
node
.
getIntProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
return
force
;
}
...
...
serialization/src/MonteCarloMembraneBarostatProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void MonteCarloMembraneBarostatProxy::serialize(const void* object, Serializatio
node
.
setIntProperty
(
"version"
,
1
);
const
MonteCarloMembraneBarostat
&
force
=
*
reinterpret_cast
<
const
MonteCarloMembraneBarostat
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setDoubleProperty
(
"pressure"
,
force
.
getDefaultPressure
());
node
.
setDoubleProperty
(
"surfaceTension"
,
force
.
getDefaultSurfaceTension
());
node
.
setDoubleProperty
(
"temperature"
,
force
.
getDefaultTemperature
());
...
...
@@ -64,6 +65,7 @@ void* MonteCarloMembraneBarostatProxy::deserialize(const SerializationNode& node
force
=
new
MonteCarloMembraneBarostat
(
node
.
getDoubleProperty
(
"pressure"
),
node
.
getDoubleProperty
(
"surfaceTension"
),
node
.
getDoubleProperty
(
"temperature"
),
xymode
,
zmode
,
node
.
getIntProperty
(
"frequency"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setRandomNumberSeed
(
node
.
getIntProperty
(
"randomSeed"
));
return
force
;
}
...
...
serialization/src/NonbondedForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void NonbondedForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"version"
,
4
);
const
NonbondedForce
&
force
=
*
reinterpret_cast
<
const
NonbondedForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setIntProperty
(
"method"
,
(
int
)
force
.
getNonbondedMethod
());
node
.
setDoubleProperty
(
"cutoff"
,
force
.
getCutoffDistance
());
node
.
setBoolProperty
(
"useSwitchingFunction"
,
force
.
getUseSwitchingFunction
());
...
...
@@ -107,6 +108,7 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
NonbondedForce
*
force
=
new
NonbondedForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
force
->
setNonbondedMethod
((
NonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
...
...
serialization/src/PeriodicTorsionForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void PeriodicTorsionForceProxy::serialize(const void* object, SerializationNode&
node
.
setIntProperty
(
"version"
,
2
);
const
PeriodicTorsionForce
&
force
=
*
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
...
...
@@ -62,6 +63,7 @@ void* PeriodicTorsionForceProxy::deserialize(const SerializationNode& node) cons
PeriodicTorsionForce
*
force
=
new
PeriodicTorsionForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
...
...
serialization/src/RBTorsionForceProxy.cpp
View file @
4c6cf680
...
...
@@ -45,6 +45,7 @@ void RBTorsionForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"version"
,
2
);
const
RBTorsionForce
&
force
=
*
reinterpret_cast
<
const
RBTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setStringProperty
(
"name"
,
force
.
getName
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
torsions
=
node
.
createChildNode
(
"Torsions"
);
for
(
int
i
=
0
;
i
<
force
.
getNumTorsions
();
i
++
)
{
...
...
@@ -62,6 +63,7 @@ void* RBTorsionForceProxy::deserialize(const SerializationNode& node) const {
RBTorsionForce
*
force
=
new
RBTorsionForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
force
->
setName
(
node
.
getStringProperty
(
"name"
,
force
->
getName
()));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
torsions
=
node
.
getChildNode
(
"Torsions"
);
...
...
Prev
1
2
3
4
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