About "All Forces must have identical exceptions"

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Huan Xi
Posts: 10
Joined: Wed Aug 28, 2019 7:00 pm

About "All Forces must have identical exceptions"

Post by Huan Xi » Fri Apr 10, 2020 10:18 pm

Hello,

I want to run neat benzene liquid, I write a xml file about force parameters of benzene. I set the size of box to 35 angstrom, the value of cutoff is 15 angstrom, the value of switch distance is 12 angstrom. But I meet a error--"Exception: All Forces must have identical exceptions".
In this system, there are HarmonicBondForce, HarmonicAngleForce, and NonbondedForce. I saw that other topic mentioned the relationship between CustomNonbondedForce and exceptions. I feel confused. Could you give me suggestion about this question? Thanks!

Huanxi

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: About "All Forces must have identical exceptions"

Post by Peter Eastman » Sat Apr 11, 2020 9:18 am

This relates to nonbonded forces. Exceptions are pairs of atoms whose nonbonded interaction is altered, so they must be excluded from the standard nonbonded calculation. Typically that is done for 1-2, 1-3, and 1-4 bonded pairs. When building forces programmatically, you add them by calling addException() on a NonbondedForce and addExclusion() on a CustomNonbondedForce. When building the System from a ForceField, exceptions are automatically added to the NonbondedForce for all pairs separated by three or fewer bonds. They're added to the CustomNonbondedForce based on the value of the bondCutoff attribute in the XML file

In this case, it sounds like you have both a NonbondedForce and a CustomNonbondedForce, and they exclude different sets of interactions. The CUDA and OpenCL platforms can't handle that, because they compute all nonbonded interactions at the same time in a single kernel. You should specify bondCutoff="3" for the CustomNonbondedForce to match the behavior of the NonbondedForce. That will exclude all 1-2, 1-3, and 1-4 interactions from it. If some of those interactions actually are supposed to be included, you can add a CustomBondForce to compute them.

User avatar
Huan Xi
Posts: 10
Joined: Wed Aug 28, 2019 7:00 pm

Re: About "All Forces must have identical exceptions"

Post by Huan Xi » Sat Apr 11, 2020 11:38 pm

Thank you for your answer! I understand this situation.But there isn't CustomNonBondedForce in my system. In my system, there are HarmonicBondForce, HarmonicAngleForce, and NonbondedForce. In addition, the CUDA and Reference platforms prompt the same error. I can't understand my case.
BTW, I can't attached the xml file. the web show "Error parsing server response" .

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: About "All Forces must have identical exceptions"

Post by Peter Eastman » Sun Apr 12, 2020 9:10 am

Can you post all the files needed to reproduce this? The only way you can get that error message is if you have two nonbonded forces in your system, so there's another one coming from somewhere!

If you're having trouble attaching files here, you can upload them to send.firefox.com and post the link.

User avatar
Huan Xi
Posts: 10
Joined: Wed Aug 28, 2019 7:00 pm

Re: About "All Forces must have identical exceptions"

Post by Huan Xi » Mon Apr 13, 2020 2:15 am

I understand it. In my system, there is another Force for calculate electrostatic term. Thank you for your answer!

POST REPLY