CustomManyParticleForce exclusions

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Michal Krompiec
Posts: 21
Joined: Tue Jul 02, 2019 1:17 pm

CustomManyParticleForce exclusions

Post by Michal Krompiec » Tue Dec 24, 2019 3:56 am

Hi, Im using CustomManyParticleForce to implement a three-body potential. Is it possible to specify exclusions in such a way that this force is evaluated only for intermolecular interactions? I mean excluding all (p1, p2, p3) where p1, p2 and p3 are in the same molecule.

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

Re: CustomManyParticleForce exclusions

Post by Peter Eastman » Tue Dec 24, 2019 12:15 pm

Yes. Just call addExclusion() on the force for each pair of particles that shouldn't interact. See http://docs.openmm.org/latest/api-c++/g ... clusionEii.

User avatar
Michal Krompiec
Posts: 21
Joined: Tue Jul 02, 2019 1:17 pm

Re: CustomManyParticleForce exclusions

Post by Michal Krompiec » Thu Dec 26, 2019 3:44 am

But I would like to keep interactions between two atoms from the same molecule and a third atom from another. Pairwise definition of exclusions would not allow it. I mean if p1 and p2 belong to the same molecule, (p1,p2,p3) is always excluded, regardless of whether p3 belongs to the same molecule (when the interaction should disappear indeed) or not (when it should be kept). Or am I missing something here?
Anyway, the reason I am considering this is only to reduce computational cost - and I am not so sure it is really worth the effort as intermolecular triplets are a tiny fraction of all triplets within the cutoff...

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

Re: CustomManyParticleForce exclusions

Post by Peter Eastman » Fri Jan 10, 2020 12:33 pm

Sorry for the delay. I'm catching up on things after the holidays.

You're correct, using exclusions will exclude all interactions involving a particular pair, even if the third particle is in a different molecule. Also, because of the way the force is implemented, adding exclusions is unlikely to ever improve performance much and could sometimes even slow it down a little. So if this is just about performance, you're better off not worrying about exclusions.

POST REPLY