|
|
> Here's a question: The derivative is based on the forces applied to the
> current particle. The only way these forces change is when a particle
> collides with other particles (or ceases to collide).
>
> So, for each of the above, am I to run a full collision detection?
Yes, inside the "acceleration" function, which is called from each
"evaluate" you put your code for calculating the acceleration. This, in
your case, would presumably call the routine to check for collisions and
work out the forces for all the particles.
Note that you need to put all the positions and velocities for every
particle inside some state block and evaluate them in parallel using this
algorithm - you can't do one at a time it doesn't work like that.
You may say that this is 4x as much work per integration step, but it will
allow your time-step to be far more than 4x bigger and still be completely
stable.
Post a reply to this message
|
|