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
9a1b72ff
Commit
9a1b72ff
authored
Nov 28, 2011
by
Peter Eastman
Browse files
When creating a System, add a CMMotionRemover by default
parent
2586776f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
wrappers/python/simtk/openmm/app/amberprmtopfile.py
wrappers/python/simtk/openmm/app/amberprmtopfile.py
+8
-3
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+4
-1
No files found.
wrappers/python/simtk/openmm/app/amberprmtopfile.py
View file @
9a1b72ff
...
@@ -9,6 +9,7 @@ from simtk.openmm.app.internal import amber_file_parser
...
@@ -9,6 +9,7 @@ from simtk.openmm.app.internal import amber_file_parser
import
forcefield
as
ff
import
forcefield
as
ff
import
element
as
elem
import
element
as
elem
import
simtk.unit
as
unit
import
simtk.unit
as
unit
import
simtk.openmm
as
mm
# Enumerated values for implicit solvent model
# Enumerated values for implicit solvent model
...
@@ -63,7 +64,7 @@ class AmberPrmtopFile(object):
...
@@ -63,7 +64,7 @@ class AmberPrmtopFile(object):
top
.
addBond
(
bond
[
0
],
bond
[
1
])
top
.
addBond
(
bond
[
0
],
bond
[
1
])
def
createSystem
(
self
,
nonbondedMethod
=
ff
.
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
def
createSystem
(
self
,
nonbondedMethod
=
ff
.
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
constraints
=
None
,
rigidWater
=
True
,
implicitSolvent
=
None
):
constraints
=
None
,
rigidWater
=
True
,
implicitSolvent
=
None
,
removeCMMotion
=
True
):
"""Construct an OpenMM System representing the topology described by this prmtop file.
"""Construct an OpenMM System representing the topology described by this prmtop file.
Parameters:
Parameters:
...
@@ -74,6 +75,7 @@ class AmberPrmtopFile(object):
...
@@ -74,6 +75,7 @@ class AmberPrmtopFile(object):
Allowed values are None, HBonds, AllBonds, or HAngles.
Allowed values are None, HBonds, AllBonds, or HAngles.
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument
- implicitSolvent (object=None) If not None, the implicit solvent model to use
- implicitSolvent (object=None) If not None, the implicit solvent model to use
- removeCMMotion (boolean=True) If true, a CMMotionRemover will be added to the System
Returns: the newly created System
Returns: the newly created System
"""
"""
methodMap
=
{
ff
.
NoCutoff
:
'NoCutoff'
,
methodMap
=
{
ff
.
NoCutoff
:
'NoCutoff'
,
...
@@ -103,5 +105,8 @@ class AmberPrmtopFile(object):
...
@@ -103,5 +105,8 @@ class AmberPrmtopFile(object):
implicitString
=
'OBC'
implicitString
=
'OBC'
else
:
else
:
raise
ValueError
(
'Illegal value for implicit solvent model'
)
raise
ValueError
(
'Illegal value for implicit solvent model'
)
return
amber_file_parser
.
readAmberSystem
(
prmtop_loader
=
self
.
prmtop
,
shake
=
constraintString
,
nonbondedCutoff
=
nonbondedCutoff
,
sys
=
amber_file_parser
.
readAmberSystem
(
prmtop_loader
=
self
.
prmtop
,
shake
=
constraintString
,
nonbondedCutoff
=
nonbondedCutoff
,
nonbondedMethod
=
methodMap
[
nonbondedMethod
],
flexibleConstraints
=
False
,
gbmodel
=
implicitString
)
nonbondedMethod
=
methodMap
[
nonbondedMethod
],
flexibleConstraints
=
False
,
gbmodel
=
implicitString
)
if
removeCMMotion
:
sys
.
addForce
(
mm
.
CMMotionRemover
())
return
sys
\ No newline at end of file
wrappers/python/simtk/openmm/app/forcefield.py
View file @
9a1b72ff
...
@@ -177,7 +177,7 @@ class ForceField(object):
...
@@ -177,7 +177,7 @@ class ForceField(object):
self
.
length
=
0.0
self
.
length
=
0.0
def
createSystem
(
self
,
topology
,
nonbondedMethod
=
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
def
createSystem
(
self
,
topology
,
nonbondedMethod
=
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
constraints
=
None
,
rigidWater
=
True
,
**
args
):
constraints
=
None
,
rigidWater
=
True
,
removeCMMotion
=
True
,
**
args
):
"""Construct an OpenMM System representing a Topology with this force field.
"""Construct an OpenMM System representing a Topology with this force field.
Parameters:
Parameters:
...
@@ -188,6 +188,7 @@ class ForceField(object):
...
@@ -188,6 +188,7 @@ class ForceField(object):
- constraints (object=None) Specifies which bonds angles should be implemented with constraints.
- constraints (object=None) Specifies which bonds angles should be implemented with constraints.
Allowed values are None, HBonds, AllBonds, or HAngles.
Allowed values are None, HBonds, AllBonds, or HAngles.
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument
- removeCMMotion (boolean=True) If true, a CMMotionRemover will be added to the System
- Arbitrary additional keyword arguments may also be specified. This allows extra parameters to be specified that are specific to
- Arbitrary additional keyword arguments may also be specified. This allows extra parameters to be specified that are specific to
particular force fields.
particular force fields.
Returns: the newly created System
Returns: the newly created System
...
@@ -341,6 +342,8 @@ class ForceField(object):
...
@@ -341,6 +342,8 @@ class ForceField(object):
for
force
in
self
.
_forces
:
for
force
in
self
.
_forces
:
force
.
createForce
(
sys
,
data
,
nonbondedMethod
,
nonbondedCutoff
,
args
)
force
.
createForce
(
sys
,
data
,
nonbondedMethod
,
nonbondedCutoff
,
args
)
if
removeCMMotion
:
sys
.
addForce
(
mm
.
CMMotionRemover
())
return
sys
return
sys
...
...
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