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
762ffcee
Commit
762ffcee
authored
Nov 22, 2017
by
peastman
Browse files
Optimized creation of proper torsions
parent
4ffc9e3f
Changes
1
Show 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 @
762ffcee
...
@@ -2016,11 +2016,17 @@ class PeriodicTorsionGenerator(object):
...
@@ -2016,11 +2016,17 @@ class PeriodicTorsionGenerator(object):
self
.
ff
=
forcefield
self
.
ff
=
forcefield
self
.
proper
=
[]
self
.
proper
=
[]
self
.
improper
=
[]
self
.
improper
=
[]
self
.
propersForAtomType
=
defaultdict
(
set
)
def
registerProperTorsion
(
self
,
parameters
):
def
registerProperTorsion
(
self
,
parameters
):
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
if
torsion
is
not
None
:
if
torsion
is
not
None
:
index
=
len
(
self
.
proper
)
self
.
proper
.
append
(
torsion
)
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'
):
def
registerImproperTorsion
(
self
,
parameters
,
ordering
=
'default'
):
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
torsion
=
self
.
ff
.
_parseTorsion
(
parameters
)
...
@@ -2062,7 +2068,8 @@ class PeriodicTorsionGenerator(object):
...
@@ -2062,7 +2068,8 @@ class PeriodicTorsionGenerator(object):
type3
=
data
.
atomType
[
data
.
atoms
[
torsion
[
2
]]]
type3
=
data
.
atomType
[
data
.
atoms
[
torsion
[
2
]]]
type4
=
data
.
atomType
[
data
.
atoms
[
torsion
[
3
]]]
type4
=
data
.
atomType
[
data
.
atoms
[
torsion
[
3
]]]
match
=
None
match
=
None
for
tordef
in
self
.
proper
:
for
index
in
self
.
propersForAtomType
[
type2
]:
tordef
=
self
.
proper
[
index
]
types1
=
tordef
.
types1
types1
=
tordef
.
types1
types2
=
tordef
.
types2
types2
=
tordef
.
types2
types3
=
tordef
.
types3
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