1
0
Fork 0
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:
Lukas Winkler 2021-08-20 18:05:14 +02:00
parent 2d6639247c
commit c1043b0613
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -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);