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
c07c5bd7
Unverified
Commit
c07c5bd7
authored
Aug 01, 2023
by
Peter Eastman
Committed by
GitHub
Aug 01, 2023
Browse files
Fix for patches that affect only bonds, not atoms (#4161)
parent
b183e1b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
wrappers/python/openmm/app/forcefield.py
wrappers/python/openmm/app/forcefield.py
+4
-2
No files found.
wrappers/python/openmm/app/forcefield.py
View file @
c07c5bd7
...
@@ -391,9 +391,11 @@ class ForceField(object):
...
@@ -391,9 +391,11 @@ class ForceField(object):
for
bond
in
patch
.
findall
(
'RemoveExternalBond'
):
for
bond
in
patch
.
findall
(
'RemoveExternalBond'
):
atom
=
ForceField
.
_PatchAtomData
(
bond
.
attrib
[
'atomName'
])
atom
=
ForceField
.
_PatchAtomData
(
bond
.
attrib
[
'atomName'
])
patchData
.
deletedExternalBonds
.
append
(
atom
)
patchData
.
deletedExternalBonds
.
append
(
atom
)
atomIndices
=
dict
((
atom
.
name
,
i
)
for
i
,
atom
in
enumerate
(
patchData
.
addedAtoms
[
atomDescription
.
residue
]
+
patchData
.
changedAtoms
[
atomDescription
.
residue
]))
# The following three lines are only correct for single residue patches. Multi-residue patches with
# virtual sites currently don't work correctly. See issue #2848.
atomIndices
=
dict
((
atom
.
name
,
i
)
for
i
,
atom
in
enumerate
(
patchData
.
addedAtoms
[
0
]
+
patchData
.
changedAtoms
[
0
]))
for
site
in
patch
.
findall
(
'VirtualSite'
):
for
site
in
patch
.
findall
(
'VirtualSite'
):
patchData
.
virtualSites
[
atomDescription
.
residue
].
append
(
ForceField
.
_VirtualSiteData
(
site
,
atomIndices
))
patchData
.
virtualSites
[
0
].
append
(
ForceField
.
_VirtualSiteData
(
site
,
atomIndices
))
for
residue
in
patch
.
findall
(
'ApplyToResidue'
):
for
residue
in
patch
.
findall
(
'ApplyToResidue'
):
name
=
residue
.
attrib
[
'name'
]
name
=
residue
.
attrib
[
'name'
]
if
':'
in
name
:
if
':'
in
name
:
...
...
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