Unverified Commit c07c5bd7 authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Fix for patches that affect only bonds, not atoms (#4161)

parent b183e1b6
...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment