Page 1 of 1

About "All Forces must have identical exceptions"

Posted: Fri Apr 10, 2020 10:18 pm
by huanxi
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

Re: About "All Forces must have identical exceptions"

Posted: Sat Apr 11, 2020 9:18 am
by peastman
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.

Re: About "All Forces must have identical exceptions"

Posted: Sat Apr 11, 2020 11:38 pm
by huanxi
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" .

Re: About "All Forces must have identical exceptions"

Posted: Sun Apr 12, 2020 9:10 am
by peastman
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.

Re: About "All Forces must have identical exceptions"

Posted: Mon Apr 13, 2020 2:15 am
by huanxi
I understand it. In my system, there is another Force for calculate electrostatic term. Thank you for your answer!