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
b7fbe622
Unverified
Commit
b7fbe622
authored
Nov 22, 2017
by
peastman
Committed by
GitHub
Nov 22, 2017
Browse files
Merge pull request #1937 from peastman/propers
Optimized creation of proper torsions
parents
4ffc9e3f
762ffcee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+8
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
b7fbe622
...
...
@@ -2016,11 +2016,17 @@ class PeriodicTorsionGenerator(object):
self
.
ff
=
forcefield
self
.
proper
=
[]
self
.
improper
=
[]
self
.
propersForAtomType
=
defaultdict
(
set
)
def
registerProperTorsion
(
self
,
parameters
):
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
if
torsion
is
not
None
:
index
=
len
(
self
.
proper
)
self
.
proper
.
append
(
torsion
)
for
t
in
torsion
.
types2
:
self
.
propersForAtomType
[
t
].
add
(
index
)
for
t
in
torsion
.
types3
:
self
.
propersForAtomType
[
t
].
add
(
index
)
def
registerImproperTorsion
(
self
,
parameters
,
ordering
=
'default'
):
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
...
...
@@ -2062,7 +2068,8 @@ class PeriodicTorsionGenerator(object):
type3
=
data
.
atomType
[
data
.
atoms
[
torsion
[
2
]]]
type4
=
data
.
atomType
[
data
.
atoms
[
torsion
[
3
]]]
match
=
None
for
tordef
in
self
.
proper
:
for
index
in
self
.
propersForAtomType
[
type2
]:
tordef
=
self
.
proper
[
index
]
types1
=
tordef
.
types1
types2
=
tordef
.
types2
types3
=
tordef
.
types3
...
...
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