-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ForceField with no Electrostatics tag can be used to make a system #716
Comments
Could you elaborate on the issue here? It looks like partial charges are populated in the system (unless I'm mis-estimating what that XML means). Would the solution here just be to error out if trying to call |
Ah,sorry to be vague. The issue is with the line:
This has a nonbonded cutoff (1 nm) that was set by the vdWHandler, but is also used for the system's electrostatics. These should, in theory, be separate cutoffs. But the OpenMM system model lumps together vdW and ES into the NonbondedForce, and all we do is have the vdWHandler run first, and then the ElectrostaticsHandler runs second and raises an error if the vdWHandler set the NonBondedForce's cutoff to a different value than it would have used. Instead, what happens here is that the ElectrostaticsHandler just doesn't exist, so it can't actually verify the cutoff set by the vdWHandler, and the System is made assuming that the electrostatics cutoff is the same as the vdW cutoff. The desired behavior would be to raise an exception if the ESHandler doesn't exist, but the system has partial charges that will interact. |
I ran into this again today (and now better understand the issue) - should |
I think the answer to your last question is probably yes; and shouldn't we always have an electrostatics tag in the final force field we are applying? |
I think @SimonBoothroyd has some niche use cases in which things are split out across separate force fields, but I don't remember too well. I could be confusing it with the need to allow force fields without electrostatics at all. Fortunately this specific issue is |
Interchange now attempts to error out in this case. |
Describe the bug
A
ForceField
with noElectrostatics
tag can be used to create an OpenMMSystem
with arbitrarily-set electrostatics.To Reproduce
The text was updated successfully, but these errors were encountered: