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
a3aa0548
"platforms/vscode:/vscode.git/clone" did not exist on "d24ce6ede89563fed65ecc0fe86e6bb6662b4efe"
Commit
a3aa0548
authored
Apr 12, 2014
by
John Chodera (MSKCC)
Browse files
Changed tabs to spaces.
parent
f015fb7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
serialization/src/CustomNonbondedForceProxy.cpp
serialization/src/CustomNonbondedForceProxy.cpp
+17
-17
No files found.
serialization/src/CustomNonbondedForceProxy.cpp
View file @
a3aa0548
...
...
@@ -88,10 +88,10 @@ void CustomNonbondedForceProxy::serialize(const void* object, SerializationNode&
force
.
getInteractionGroupParameters
(
i
,
set1
,
set2
);
SerializationNode
&
set1node
=
interactionGroup
.
createChildNode
(
"Set1"
);
for
(
std
::
set
<
int
>::
iterator
it
=
set1
.
begin
();
it
!=
set1
.
end
();
++
it
)
set1node
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
*
it
);
set1node
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
*
it
);
SerializationNode
&
set2node
=
interactionGroup
.
createChildNode
(
"Set2"
);
for
(
std
::
set
<
int
>::
iterator
it
=
set2
.
begin
();
it
!=
set2
.
end
();
++
it
)
set2node
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
*
it
);
set2node
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
*
it
);
}
}
...
...
@@ -103,9 +103,9 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
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
->
setUseSwitchingFunction
(
node
.
getBoolProperty
(
"useSwitchingFunction"
));
force
->
setSwitchingDistance
(
node
.
getDoubleProperty
(
"switchingDistance"
));
force
->
setUseLongRangeCorrection
(
node
.
getBoolProperty
(
"useLongRangeCorrection"
));
force
->
setUseLongRangeCorrection
(
node
.
getBoolProperty
(
"useLongRangeCorrection"
));
const
SerializationNode
&
perParticleParams
=
node
.
getChildNode
(
"PerParticleParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perParticleParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perParticleParams
.
getChildren
()[
i
];
...
...
@@ -141,7 +141,7 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
}
else
{
// This is an old file created before TabulatedFunction existed.
const
SerializationNode
&
valuesNode
=
function
.
getChildNode
(
"Values"
);
vector
<
double
>
values
;
for
(
int
j
=
0
;
j
<
(
int
)
valuesNode
.
getChildren
().
size
();
j
++
)
...
...
@@ -152,18 +152,18 @@ void* CustomNonbondedForceProxy::deserialize(const SerializationNode& node) cons
const
SerializationNode
&
interactionGroups
=
node
.
getChildNode
(
"InteractionGroups"
);
for
(
int
i
=
0
;
i
<
(
int
)
interactionGroups
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
interactionGroup
=
interactionGroups
.
getChildren
()[
i
];
// Get set 1.
const
SerializationNode
&
set1node
=
interactionGroup
.
getChildNode
(
"Set1"
);
std
::
set
<
int
>
set1
;
for
(
int
j
=
0
;
j
<
(
int
)
set1node
.
getChildren
().
size
();
j
++
)
set1
.
insert
(
set1node
.
getChildren
()[
j
].
getIntProperty
(
"index"
));
// Get set 2.
const
SerializationNode
&
set2node
=
interactionGroup
.
getChildNode
(
"Set2"
);
std
::
set
<
int
>
set2
;
for
(
int
j
=
0
;
j
<
(
int
)
set2node
.
getChildren
().
size
();
j
++
)
set2
.
insert
(
set2node
.
getChildren
()[
j
].
getIntProperty
(
"index"
));
force
->
addInteractionGroup
(
set1
,
set2
);
}
// Get set 1.
const
SerializationNode
&
set1node
=
interactionGroup
.
getChildNode
(
"Set1"
);
std
::
set
<
int
>
set1
;
for
(
int
j
=
0
;
j
<
(
int
)
set1node
.
getChildren
().
size
();
j
++
)
set1
.
insert
(
set1node
.
getChildren
()[
j
].
getIntProperty
(
"index"
));
// Get set 2.
const
SerializationNode
&
set2node
=
interactionGroup
.
getChildNode
(
"Set2"
);
std
::
set
<
int
>
set2
;
for
(
int
j
=
0
;
j
<
(
int
)
set2node
.
getChildren
().
size
();
j
++
)
set2
.
insert
(
set2node
.
getChildren
()[
j
].
getIntProperty
(
"index"
));
force
->
addInteractionGroup
(
set1
,
set2
);
}
return
force
;
}
catch
(...)
{
...
...
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