Page 1 of 1

CustomManyParticleForce exclusions

Posted: Tue Dec 24, 2019 3:56 am
by mkrompiec
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.

Re: CustomManyParticleForce exclusions

Posted: Tue Dec 24, 2019 12:15 pm
by peastman
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.

Re: CustomManyParticleForce exclusions

Posted: Thu Dec 26, 2019 3:44 am
by mkrompiec
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...

Re: CustomManyParticleForce exclusions

Posted: Fri Jan 10, 2020 12:33 pm
by peastman
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.