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
6d036495
Commit
6d036495
authored
Apr 12, 2014
by
John Chodera (MSKCC)
Browse files
Fixed same issue in NonbondedForce serialization.
parent
8cd01209
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
serialization/src/NonbondedForceProxy.cpp
serialization/src/NonbondedForceProxy.cpp
+4
-0
serialization/tests/TestSerializeNonbondedForce.cpp
serialization/tests/TestSerializeNonbondedForce.cpp
+4
-0
No files found.
serialization/src/NonbondedForceProxy.cpp
View file @
6d036495
...
@@ -46,6 +46,8 @@ void NonbondedForceProxy::serialize(const void* object, SerializationNode& node)
...
@@ -46,6 +46,8 @@ void NonbondedForceProxy::serialize(const void* object, SerializationNode& node)
const
NonbondedForce
&
force
=
*
reinterpret_cast
<
const
NonbondedForce
*>
(
object
);
const
NonbondedForce
&
force
=
*
reinterpret_cast
<
const
NonbondedForce
*>
(
object
);
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
.
setDoubleProperty
(
"switchingDistance"
,
force
.
getSwitchingDistance
());
node
.
setDoubleProperty
(
"ewaldTolerance"
,
force
.
getEwaldErrorTolerance
());
node
.
setDoubleProperty
(
"ewaldTolerance"
,
force
.
getEwaldErrorTolerance
());
node
.
setDoubleProperty
(
"rfDielectric"
,
force
.
getReactionFieldDielectric
());
node
.
setDoubleProperty
(
"rfDielectric"
,
force
.
getReactionFieldDielectric
());
node
.
setIntProperty
(
"dispersionCorrection"
,
force
.
getUseDispersionCorrection
());
node
.
setIntProperty
(
"dispersionCorrection"
,
force
.
getUseDispersionCorrection
());
...
@@ -71,6 +73,8 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
...
@@ -71,6 +73,8 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
try
{
try
{
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
.
getDoubleProperty
(
"useSwitchingFunction"
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
));
force
->
setEwaldErrorTolerance
(
node
.
getDoubleProperty
(
"ewaldTolerance"
));
force
->
setEwaldErrorTolerance
(
node
.
getDoubleProperty
(
"ewaldTolerance"
));
force
->
setReactionFieldDielectric
(
node
.
getDoubleProperty
(
"rfDielectric"
));
force
->
setReactionFieldDielectric
(
node
.
getDoubleProperty
(
"rfDielectric"
));
force
->
setUseDispersionCorrection
(
node
.
getIntProperty
(
"dispersionCorrection"
));
force
->
setUseDispersionCorrection
(
node
.
getIntProperty
(
"dispersionCorrection"
));
...
...
serialization/tests/TestSerializeNonbondedForce.cpp
View file @
6d036495
...
@@ -43,6 +43,8 @@ void testSerialization() {
...
@@ -43,6 +43,8 @@ void testSerialization() {
NonbondedForce
force
;
NonbondedForce
force
;
force
.
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
force
.
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
force
.
setSwitchingDistance
(
1.5
);
force
.
setUseSwitchingFunction
(
true
);
force
.
setCutoffDistance
(
2.0
);
force
.
setCutoffDistance
(
2.0
);
force
.
setEwaldErrorTolerance
(
1e-3
);
force
.
setEwaldErrorTolerance
(
1e-3
);
force
.
setReactionFieldDielectric
(
50.0
);
force
.
setReactionFieldDielectric
(
50.0
);
...
@@ -63,6 +65,8 @@ void testSerialization() {
...
@@ -63,6 +65,8 @@ void testSerialization() {
NonbondedForce
&
force2
=
*
copy
;
NonbondedForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getNonbondedMethod
(),
force2
.
getNonbondedMethod
());
ASSERT_EQUAL
(
force
.
getSwitchingDistance
(),
force2
.
getSwitchingDistance
());
ASSERT_EQUAL
(
force
.
getUseSwitchingFunction
(),
force2
.
getUseSwitchingFunction
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
ASSERT_EQUAL
(
force
.
getCutoffDistance
(),
force2
.
getCutoffDistance
());
ASSERT_EQUAL
(
force
.
getEwaldErrorTolerance
(),
force2
.
getEwaldErrorTolerance
());
ASSERT_EQUAL
(
force
.
getEwaldErrorTolerance
(),
force2
.
getEwaldErrorTolerance
());
ASSERT_EQUAL
(
force
.
getReactionFieldDielectric
(),
force2
.
getReactionFieldDielectric
());
ASSERT_EQUAL
(
force
.
getReactionFieldDielectric
(),
force2
.
getReactionFieldDielectric
());
...
...
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