Closed ofoofoo closed 1 year ago
You can set the collision_resolve_keep_sorted
flag to 1 which should do what you're looking for.
Where should this go? I added the flag to my integration setup but it seems like the issue still persists:
It's a flag in struct reb_simulation
.
Ah, I see, thank you!
I'm trying to implement a custom collision function similar to the my_merge function here: https://rebound.readthedocs.io/en/latest/ipython_examples/User_Defined_Collision_Resolve/
However, when you move to a system with more than 2 planets, the indices of the particles in the simulation get a little jumbled:
Preferably, I would like it so that after particle three merges into particle 2, all of the other particles in the simulation shift down by one. Rather, it instead looks like what is currently happening is that particle 3 becomes the new particle 6.
To be more specific, I'm wondering if the following is possible:
Force the merging to always merge a higher index particle into the lower index one + once the merge occurs, all particles with an index greater than the higher index particle shifts up by one.