Is it OK to have two copies of the same force?
- Maxim Imakaev
- Posts: 87
- Joined: Sun Oct 24, 2010 2:03 pm
Is it OK to have two copies of the same force?
In our polymer simulation library, we may end up in a situation where we have two copies of the same bondforce (e.g. Harmonic Bond Force), with some of the bonds defined in one copy and other bonds in another copy. Could this lead to any collisions inside OpenMM, or to a noticeable slowdown?
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Is it OK to have two copies of the same force?
That's fine. Just make sure you don't include the same bond in both of them, or you'll get a double strength bond.
- Maxim Imakaev
- Posts: 87
- Joined: Sun Oct 24, 2010 2:03 pm
Re: Is it OK to have two copies of the same force?
Thanks, Peter! That makes sense.
Speaking of repeated bonds... in the past we've actually managed to add the same bond several times into the same force. We've also managed to create a bond of a particle with itself. Both were fine with OpenMM, but now we have some input checks on bonds and angles in our library.
Max
Speaking of repeated bonds... in the past we've actually managed to add the same bond several times into the same force. We've also managed to create a bond of a particle with itself. Both were fine with OpenMM, but now we have some input checks on bonds and angles in our library.
Max
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Is it OK to have two copies of the same force?
Multiple bonds for the same atoms are legal and sometimes useful. For example, you often want multiple torsions for the same atoms with different periodicities. But you do need to be careful that you only do it intentionally, not by accident.