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
9a83528b
"platforms/cuda/vscode:/vscode.git/clone" did not exist on "6aa03ec8001fb75b6359b3dec94bd8b2ac34af4f"
Commit
9a83528b
authored
Apr 14, 2014
by
John Chodera (MSKCC)
Browse files
Added defaults for backward compatibility.
parent
f755a61a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
+22
-17
serialization/src/CustomNonbondedForceProxy.cpp
serialization/src/CustomNonbondedForceProxy.cpp
+11
-6
serialization/src/NonbondedForceProxy.cpp
serialization/src/NonbondedForceProxy.cpp
+11
-11
No files found.
serialization/src/CustomNonbondedForceProxy.cpp
View file @
9a83528b
...
...
@@ -102,10 +102,10 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
try
{
CustomNonbondedForce
*
force
=
new
CustomNonbondedForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setNonbondedMethod
((
CustomNonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
));
force
->
setUseLongRangeCorrection
(
node
.
getBoolProperty
(
"useLongRangeCorrection"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
,
1.0
));
force
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
,
false
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
,
-
1.0
));
force
->
setUseLongRangeCorrection
(
node
.
getBoolProperty
(
"useLongRangeCorrection"
,
false
));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perParticleParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perParticleParams
.
getChildren
()[
i
];
...
...
@@ -149,6 +149,8 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
force
->
addTabulatedFunction
(
function
.
getStringProperty
(
"name"
),
new
Continuous1DFunction
(
values
,
function
.
getDoubleProperty
(
"min"
),
function
.
getDoubleProperty
(
"max"
)));
}
}
// Catch exceptions if InteractionGroups node is missing, in order to give backwards compatibility.
try
{
const
SerializationNode
&
interactionGroups
=
node
.
getChildNode
(
"InteractionGroups"
);
for
(
int
i
=
0
;
i
<
(
int
)
interactionGroups
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
interactionGroup
=
interactionGroups
.
getChildren
()[
i
];
...
...
@@ -164,6 +166,9 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
set2
.
insert
(
set2node
.
getChildren
()[
j
].
getIntProperty
(
"index"
));
force
->
addInteractionGroup
(
set1
,
set2
);
}
}
catch
(...)
{
// do nothing to allow backwards-compatibility
}
return
force
;
}
catch
(...)
{
...
...
serialization/src/NonbondedForceProxy.cpp
View file @
9a83528b
...
...
@@ -80,20 +80,20 @@ void* NonbondedForceProxy::deserialize(const SerializationNode& node) const {
NonbondedForce
*
force
=
new
NonbondedForce
();
try
{
force
->
setNonbondedMethod
((
NonbondedForce
::
NonbondedMethod
)
node
.
getIntProperty
(
"method"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
));
force
->
setUseSwitchingFunction
(
node
.
getDoubleProperty
(
"useSwitchingFunction"
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
));
force
->
setEwaldErrorTolerance
(
node
.
getDoubleProperty
(
"ewaldTolerance"
));
force
->
setReactionFieldDielectric
(
node
.
getDoubleProperty
(
"rfDielectric"
));
force
->
setUseDispersionCorrection
(
node
.
getIntProperty
(
"dispersionCorrection"
));
force
->
setCutoffDistance
(
node
.
getDoubleProperty
(
"cutoff"
,
1.0
));
force
->
setUseSwitchingFunction
(
node
.
getDoubleProperty
(
"useSwitchingFunction"
,
false
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
,
-
1.0
));
force
->
setEwaldErrorTolerance
(
node
.
getDoubleProperty
(
"ewaldTolerance"
,
5e-4
));
force
->
setReactionFieldDielectric
(
node
.
getDoubleProperty
(
"rfDielectric"
,
78.3
));
force
->
setUseDispersionCorrection
(
node
.
getIntProperty
(
"dispersionCorrection"
,
true
));
double
alpha
;
int
nx
,
ny
,
nz
;
alpha
=
node
.
getDoubleProperty
(
"alpha"
);
nx
=
node
.
getIntProperty
(
"nx"
);
ny
=
node
.
getIntProperty
(
"ny"
);
nz
=
node
.
getIntProperty
(
"nz"
);
alpha
=
node
.
getDoubleProperty
(
"alpha"
,
0.0
);
nx
=
node
.
getIntProperty
(
"nx"
,
0
);
ny
=
node
.
getIntProperty
(
"ny"
,
0
);
nz
=
node
.
getIntProperty
(
"nz"
,
0
);
force
->
setPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
force
->
setReciprocalSpaceForceGroup
(
node
.
getIntProperty
(
"recipForceGroup"
));
force
->
setReciprocalSpaceForceGroup
(
node
.
getIntProperty
(
"recipForceGroup"
,
-
1
));
const
SerializationNode
&
particles
=
node
.
getChildNode
(
"Particles"
);
for
(
int
i
=
0
;
i
<
(
int
)
particles
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
particle
=
particles
.
getChildren
()[
i
];
...
...
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