"vscode:/vscode.git/clone" did not exist on "6e2f213fa70310e6f2ac89bd8aba7a51475f001d"
Unverified Commit 967d89c8 authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Fixed error when using both CustomNonbondedForce and LennardJonesForce (#4508)

parent ea4b6872
......@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012-2022 Stanford University and the Authors.
Portions copyright (c) 2012-2024 Stanford University and the Authors.
Authors: Peter Eastman, Mark Friedrichs
Contributors:
......@@ -3010,8 +3010,9 @@ class CustomNonbondedGenerator(object):
# Create the exclusions.
bondIndices = _findBondsForExclusions(data, sys)
nonbonded = [f for f in sys.getForces() if isinstance(f, mm.CustomNonbondedForce)][0]
nonbonded.createExclusionsFromBonds(bondIndices, self.bondCutoff)
for f in sys.getForces():
if isinstance(f, mm.CustomNonbondedForce) and f.getEnergyFunction() == self.energy:
f.createExclusionsFromBonds(bondIndices, self.bondCutoff)
parsers["CustomNonbondedForce"] = CustomNonbondedGenerator.parseElement
......
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