Is it OK to have two copies of the same force?

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Maxim Imakaev
Posts: 87
Joined: Sun Oct 24, 2010 2:03 pm

Is it OK to have two copies of the same force?

Post by Maxim Imakaev » Wed Apr 15, 2020 8:46 am

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?

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

Re: Is it OK to have two copies of the same force?

Post by Peter Eastman » Wed Apr 15, 2020 9:33 am

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.

User avatar
Maxim Imakaev
Posts: 87
Joined: Sun Oct 24, 2010 2:03 pm

Re: Is it OK to have two copies of the same force?

Post by Maxim Imakaev » Wed Apr 15, 2020 10:44 am

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

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

Re: Is it OK to have two copies of the same force?

Post by Peter Eastman » Wed Apr 15, 2020 11:26 am

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.

POST REPLY