Commit aac559c1 by Peter Eastman

Fixed bug that sometimes caused exclusions to be added twice

parent d35c4723
...@@ -147,10 +147,13 @@ nb = mm.CustomNonbondedForce('1/((r/0.2)^4+1)') ...@@ -147,10 +147,13 @@ nb = mm.CustomNonbondedForce('1/((r/0.2)^4+1)')
sys.addForce(nb) sys.addForce(nb)
for i in range(sys.getNumParticles()): for i in range(sys.getNumParticles()):
nb.addParticle([]) nb.addParticle([])
exclusions = set()
for bond in data.bonds: for bond in data.bonds:
nb.addExclusion(bond.atom1, bond.atom2) exclusions.add((min(bond.atom1, bond.atom2), max(bond.atom1, bond.atom2)))
for angle in data.angles: for angle in data.angles:
nb.addExclusion(angle[0], angle[2])""" exclusions.add((min(angle[0], angle[2]), max(angle[0], angle[2])))
for a1, a2 in exclusions:
nb.addExclusion(a1, a2)"""
print ' </Script>' print ' </Script>'
print '</ForceField>' print '</ForceField>'
\ No newline at end of file
...@@ -4496,9 +4496,12 @@ nb = mm.CustomNonbondedForce('1/((r/0.2)^4+1)') ...@@ -4496,9 +4496,12 @@ nb = mm.CustomNonbondedForce('1/((r/0.2)^4+1)')
sys.addForce(nb) sys.addForce(nb)
for i in range(sys.getNumParticles()): for i in range(sys.getNumParticles()):
nb.addParticle([]) nb.addParticle([])
exclusions = set()
for bond in data.bonds: for bond in data.bonds:
nb.addExclusion(bond.atom1, bond.atom2) exclusions.add((min(bond.atom1, bond.atom2), max(bond.atom1, bond.atom2)))
for angle in data.angles: for angle in data.angles:
nb.addExclusion(angle[0], angle[2]) exclusions.add((min(angle[0], angle[2]), max(angle[0], angle[2])))
for a1, a2 in exclusions:
nb.addExclusion(a1, a2)
</Script> </Script>
</ForceField> </ForceField>
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