mirror of
https://github.com/Findus23/rebound-collisions.git
synced 2024-09-19 15:53:48 +02:00
only check bound orbits
This commit is contained in:
parent
2d6639247c
commit
c1043b0613
1 changed files with 5 additions and 2 deletions
|
@ -55,7 +55,10 @@ void heartbeat(struct reb_simulation *sim) {
|
|||
hb_escape_index++;
|
||||
needs_synchronize = 1;
|
||||
} else if (distance_squared < min_distance_from_sun_squared ||
|
||||
perihelion_dist * perihelion_dist < min_distance_from_sun_squared) {
|
||||
(tmp_orbit.e < 1.0 &&
|
||||
perihelion_dist * perihelion_dist <
|
||||
min_distance_from_sun_squared)
|
||||
) {
|
||||
printf("remove %u at t=%f (min)\n", p.hash, sim->t);
|
||||
double mass = p.m;
|
||||
reb_remove_by_hash(sim, p.hash, 1);
|
||||
|
@ -69,7 +72,7 @@ void heartbeat(struct reb_simulation *sim) {
|
|||
|
||||
hb_sun_collision_index++;
|
||||
needs_synchronize = 1;
|
||||
} else if (perihelion_dist > 11.) {
|
||||
} else if (tmp_orbit.e < 1.0 && perihelion_dist > 11.) {
|
||||
// remove bodies if their perihel distance is above 11AU
|
||||
printf("remove %u at t=%f (max)\n", p.hash, sim->t);
|
||||
reb_remove_by_hash(sim, p.hash, 1);
|
||||
|
|
Loading…
Reference in a new issue