Collision Detection

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
User avatar
Peter Eastman
Posts: 2588
Joined: Thu Aug 09, 2007 1:25 pm

Re: Collision Detection

Post by Peter Eastman » Tue Jul 11, 2017 10:11 am

You've added three particle terms. Currently, the first one refers to particle 10, but you could change that:

Code: Select all

force.setParticleParameters(0, 15, params)
Now it refers to particle 15 instead of particle 10.

User avatar
Yan Zhang
Posts: 38
Joined: Mon Dec 19, 2016 2:39 pm

Re: Collision Detection

Post by Yan Zhang » Tue Jul 18, 2017 1:53 pm

Do you mean that I can do

Code: Select all

force.addParticle(10, params)
and then

Code: Select all

force.setParticleParameters(0, 15, params)
and this force is applied to particle 15 instead of 10 after doing these?

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

Re: Collision Detection

Post by Peter Eastman » Tue Jul 18, 2017 1:55 pm

Exactly. Though like all changes, it only applies to newly created Contexts. Modifying a Force after the Context is already created won't affect it.

User avatar
Yan Zhang
Posts: 38
Joined: Mon Dec 19, 2016 2:39 pm

Re: Collision Detection

Post by Yan Zhang » Wed Jul 19, 2017 9:01 am

Thank you very much!

User avatar
web design
Posts: 10
Joined: Fri Aug 18, 2017 12:43 pm

Re: Collision Detection

Post by web design » Fri Aug 18, 2017 1:26 pm

This post was really useful

POST REPLY