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
1375899c
Commit
1375899c
authored
Jan 10, 2013
by
Peter Eastman
Browse files
Prevent exception when calling getState() before step() has been called.
parent
30fa6ecb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
+9
-0
No files found.
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
View file @
1375899c
...
@@ -86,6 +86,15 @@ void RPMDIntegrator::setVelocities(int copy, const vector<Vec3>& velocities) {
...
@@ -86,6 +86,15 @@ void RPMDIntegrator::setVelocities(int copy, const vector<Vec3>& velocities) {
}
}
State
RPMDIntegrator
::
getState
(
int
copy
,
int
types
,
bool
enforcePeriodicBox
,
int
groups
)
{
State
RPMDIntegrator
::
getState
(
int
copy
,
int
types
,
bool
enforcePeriodicBox
,
int
groups
)
{
if
(
isFirstStep
)
{
// Call setPositions() on the Context so it doesn't think the user is trying to
// run a simulation without setting positions first. These positions will
// immediately get overwritten by the ones stored in this integrator.
vector
<
Vec3
>
p
(
context
->
getSystem
().
getNumParticles
(),
Vec3
());
context
->
getOwner
().
setPositions
(
p
);
isFirstStep
=
false
;
}
kernel
.
getAs
<
IntegrateRPMDStepKernel
>
().
copyToContext
(
copy
,
*
context
);
kernel
.
getAs
<
IntegrateRPMDStepKernel
>
().
copyToContext
(
copy
,
*
context
);
return
context
->
getOwner
().
getState
(
types
,
enforcePeriodicBox
,
groups
);
return
context
->
getOwner
().
getState
(
types
,
enforcePeriodicBox
,
groups
);
}
}
...
...
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