CustomManyParticleForce exclusions
- Michal Krompiec
- Posts: 21
- Joined: Tue Jul 02, 2019 1:17 pm
CustomManyParticleForce exclusions
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.
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CustomManyParticleForce exclusions
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.
- Michal Krompiec
- Posts: 21
- Joined: Tue Jul 02, 2019 1:17 pm
Re: CustomManyParticleForce exclusions
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...
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...
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
Re: CustomManyParticleForce exclusions
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.
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.