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