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
cc3c4b54
Unverified
Commit
cc3c4b54
authored
Jul 30, 2020
by
peastman
Committed by
GitHub
Jul 30, 2020
Browse files
Merge pull request #2790 from peastman/integratorparams
States can save integrator parameters
parents
03861778
16b6e4aa
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
wrappers/python/simtk/openmm/app/simulation.py
wrappers/python/simtk/openmm/app/simulation.py
+1
-1
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+6
-1
No files found.
wrappers/python/simtk/openmm/app/simulation.py
View file @
cc3c4b54
...
@@ -312,7 +312,7 @@ class Simulation(object):
...
@@ -312,7 +312,7 @@ class Simulation(object):
a File-like object to write the state to, or alternatively a
a File-like object to write the state to, or alternatively a
filename
filename
"""
"""
state
=
self
.
context
.
getState
(
getPositions
=
True
,
getVelocities
=
True
,
getParameters
=
True
)
state
=
self
.
context
.
getState
(
getPositions
=
True
,
getVelocities
=
True
,
getParameters
=
True
,
getIntegratorParameters
=
True
)
xml
=
mm
.
XmlSerializer
.
serialize
(
state
)
xml
=
mm
.
XmlSerializer
.
serialize
(
state
)
if
isinstance
(
file
,
str
):
if
isinstance
(
file
,
str
):
with
open
(
file
,
'w'
)
as
f
:
with
open
(
file
,
'w'
)
as
f
:
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
cc3c4b54
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
def
getState
(
self
,
getPositions
=
False
,
getVelocities
=
False
,
def
getState
(
self
,
getPositions
=
False
,
getVelocities
=
False
,
getForces
=
False
,
getEnergy
=
False
,
getParameters
=
False
,
getForces
=
False
,
getEnergy
=
False
,
getParameters
=
False
,
getParameterDerivatives
=
False
,
enforcePeriodicBox
=
False
,
groups
=-
1
)
:
getParameterDerivatives
=
False
,
getIntegratorParameters
=
False
,
enforcePeriodicBox
=
False
,
groups
=-
1
)
:
"""Get a State object recording the current state information stored in this context.
"""Get a State object recording the current state information stored in this context.
Parameters
Parameters
...
@@ -28,6 +29,8 @@
...
@@ -28,6 +29,8 @@
whether to store context parameters in the State
whether to store context parameters in the State
getParameterDerivatives : bool=False
getParameterDerivatives : bool=False
whether to store parameter derivatives in the State
whether to store parameter derivatives in the State
getIntegratorParameters : bool=False
whether to store integrator parameters in the State
enforcePeriodicBox : bool=False
enforcePeriodicBox : bool=False
if false, the position of each particle will be whatever position
if false, the position of each particle will be whatever position
is stored in the Context, regardless of periodic boundary conditions.
is stored in the Context, regardless of periodic boundary conditions.
...
@@ -64,6 +67,8 @@
...
@@ -64,6 +67,8 @@
types
+=
State
.
Parameters
types
+=
State
.
Parameters
if
getParameterDerivatives
:
if
getParameterDerivatives
:
types
+=
State
.
ParameterDerivatives
types
+=
State
.
ParameterDerivatives
if
getIntegratorParameters
:
types
+=
State
.
IntegratorParameters
state
=
_openmm
.
Context_getState
(
self
,
types
,
enforcePeriodicBox
,
groups_mask
)
state
=
_openmm
.
Context_getState
(
self
,
types
,
enforcePeriodicBox
,
groups_mask
)
return
state
return
state
...
...
Prev
1
2
Next
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