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
6ba168cd
Unverified
Commit
6ba168cd
authored
Apr 05, 2024
by
Peter Eastman
Committed by
GitHub
Apr 05, 2024
Browse files
reinitialize() remembers whether positions have been set (#4501)
parent
daab6862
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
openmmapi/src/Context.cpp
openmmapi/src/Context.cpp
+5
-2
No files found.
openmmapi/src/Context.cpp
View file @
6ba168cd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
24
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -252,12 +252,15 @@ void Context::reinitialize(bool preserveState) {
...
@@ -252,12 +252,15 @@ void Context::reinitialize(bool preserveState) {
stringstream
checkpoint
(
ios_base
::
out
|
ios_base
::
in
|
ios_base
::
binary
);
stringstream
checkpoint
(
ios_base
::
out
|
ios_base
::
in
|
ios_base
::
binary
);
if
(
preserveState
)
if
(
preserveState
)
createCheckpoint
(
checkpoint
);
createCheckpoint
(
checkpoint
);
bool
hasSetPositions
=
impl
->
hasSetPositions
;
integrator
.
cleanup
();
integrator
.
cleanup
();
delete
impl
;
delete
impl
;
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
,
properties
);
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
,
properties
);
impl
->
initialize
();
impl
->
initialize
();
if
(
preserveState
)
if
(
preserveState
)
{
loadCheckpoint
(
checkpoint
);
loadCheckpoint
(
checkpoint
);
impl
->
hasSetPositions
=
hasSetPositions
;
}
}
}
void
Context
::
createCheckpoint
(
ostream
&
stream
)
{
void
Context
::
createCheckpoint
(
ostream
&
stream
)
{
...
...
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