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
abc801dd
Commit
abc801dd
authored
Aug 18, 2016
by
Rafal P. Wiewiora
Browse files
fixes
parent
406105ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+22
-22
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
abc801dd
...
...
@@ -1888,48 +1888,48 @@ class PeriodicTorsionGenerator(object):
for
(
t2
,
t3
,
t4
)
in
itertools
.
permutations
(((
type2
,
1
),
(
type3
,
2
),
(
type4
,
3
))):
if
t2
[
0
]
in
types2
and
t3
[
0
]
in
types3
and
t4
[
0
]
in
types4
:
# topology atom indexes
a
1
=
torsion
[
t2
[
1
]]
a
2
=
torsion
[
t3
[
1
]]
a
2
=
torsion
[
t2
[
1
]]
a
3
=
torsion
[
t3
[
1
]]
a4
=
torsion
[
t4
[
1
]]
# residue indexes
r1
=
data
.
atoms
[
a1
].
residue
.
index
r2
=
data
.
atoms
[
a2
].
residue
.
index
r3
=
data
.
atoms
[
a3
].
residue
.
index
r4
=
data
.
atoms
[
a4
].
residue
.
index
# template atom indexes
ta1
=
data
.
atomTemplateIndexes
[
data
.
atoms
[
a1
]]
ta2
=
data
.
atomTemplateIndexes
[
data
.
atoms
[
a2
]]
ta3
=
data
.
atomTemplateIndexes
[
data
.
atoms
[
a3
]]
ta4
=
data
.
atomTemplateIndexes
[
data
.
atoms
[
a4
]]
# elements
e1
=
data
.
atoms
[
a1
].
element
e2
=
data
.
atoms
[
a2
].
element
e3
=
data
.
atoms
[
a3
].
element
e4
=
data
.
atoms
[
a4
].
element
# the following for AMBER only - TODO: decide how to pass this in ffxml's
if
isAmber
:
if
not
hasWildcard
:
if
t2
[
0
]
==
t4
[
0
]
and
(
r1
>
r4
or
(
r1
==
r4
and
ta1
>
ta4
)):
(
a1
,
a4
)
=
(
a4
,
a1
)
if
t3
[
0
]
==
t4
[
0
]
and
(
r2
>
r4
or
(
r2
==
r4
and
ta2
>
ta4
)):
if
t2
[
0
]
==
t4
[
0
]
and
(
r2
>
r4
or
(
r2
==
r4
and
ta2
>
ta4
)):
(
a2
,
a4
)
=
(
a4
,
a2
)
if
t2
[
0
]
==
t3
[
0
]
and
(
r1
>
r2
or
(
r1
==
r2
and
ta1
>
ta2
)):
(
a1
,
a2
)
=
(
a2
,
a1
)
if
t3
[
0
]
==
t4
[
0
]
and
(
r3
>
r4
or
(
r3
==
r4
and
ta3
>
ta4
)):
(
a3
,
a4
)
=
(
a4
,
a3
)
if
t2
[
0
]
==
t3
[
0
]
and
(
r2
>
r3
or
(
r2
==
r3
and
ta2
>
ta3
)):
(
a2
,
a3
)
=
(
a3
,
a2
)
else
:
if
e1
==
e4
and
(
r1
>
r4
or
(
r1
==
r4
and
ta1
>
ta4
)):
(
a1
,
a4
)
=
(
a4
,
a1
)
if
e2
==
e4
and
(
r2
>
r4
or
(
r2
==
r4
and
ta2
>
ta4
)):
(
a2
,
a4
)
=
(
a4
,
a2
)
if
(
r1
>
r2
or
(
r1
==
r2
and
ta1
>
ta2
)):
(
a1
,
a2
)
=
(
a2
,
a1
)
if
e3
==
e4
and
(
r3
>
r4
or
(
r3
==
r4
and
ta3
>
ta4
)):
(
a3
,
a4
)
=
(
a4
,
a3
)
if
r2
>
r3
or
(
r2
==
r3
and
ta2
>
ta3
):
(
a2
,
a3
)
=
(
a3
,
a2
)
# the following is OpenMM default
else
:
if
t2
[
0
]
==
t4
[
0
]
and
(
r1
>
r4
or
(
r1
==
r4
and
ta1
>
ta4
)):
(
a1
,
a4
)
=
(
a4
,
a1
)
if
t3
[
0
]
==
t4
[
0
]
and
(
r2
>
r4
or
(
r2
==
r4
and
ta2
>
ta4
)):
if
t2
[
0
]
==
t4
[
0
]
and
(
r2
>
r4
or
(
r2
==
r4
and
ta2
>
ta4
)):
(
a2
,
a4
)
=
(
a4
,
a2
)
if
t2
[
0
]
==
t3
[
0
]
and
(
r1
>
r2
or
(
r1
==
r2
and
ta1
>
ta2
)):
(
a1
,
a2
)
=
(
a2
,
a1
)
if
hasTwoWildcards
and
(
r1
>
r2
or
(
r1
==
r2
and
ta1
>
ta2
)):
(
a1
,
a2
)
=
(
a2
,
a1
)
match
=
(
a1
,
a2
,
torsion
[
0
],
a4
,
tordef
)
if
t3
[
0
]
==
t4
[
0
]
and
(
r3
>
r4
or
(
r3
==
r4
and
ta3
>
ta4
)):
(
a3
,
a4
)
=
(
a4
,
a3
)
if
t2
[
0
]
==
t3
[
0
]
and
(
r2
>
r3
or
(
r2
==
r3
and
ta2
>
ta3
)):
(
a2
,
a3
)
=
(
a3
,
a2
)
elif
hasTwoWildcards
and
(
r2
>
r3
or
(
r2
==
r3
and
ta2
>
ta3
)):
(
a2
,
a3
)
=
(
a3
,
a2
)
match
=
(
a2
,
a3
,
torsion
[
0
],
a4
,
tordef
)
break
if
match
is
not
None
:
(
a1
,
a2
,
a3
,
a4
,
tordef
)
=
match
...
...
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