Skip to content

Commit

Permalink
try resetting to DHC after collision, doesn't work yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiger Lu committed Mar 25, 2024
1 parent 18ab0dc commit 3e1d856
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/collision.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ int reb_collision_resolve_merge(struct reb_simulation* const r, struct reb_colli
pi->r = cbrt(pi->r*pi->r*pi->r + pj->r*pj->r*pj->r);
pi->last_collision = r->t;

// Reset to DHC after collision with central body
if (r->integrator == REB_INTEGRATOR_TRACE && i == 0){
reb_integrator_trace_inertial_to_dh(r);
}


// Keeping track of energy offst
if(r->track_energy_offset){
Expand All @@ -868,10 +873,5 @@ int reb_collision_resolve_merge(struct reb_simulation* const r, struct reb_colli
r->energy_offset += Ei - Ef;
}

if (r->integrator == REB_INTEGRATOR_TRACE && i == 0){
reb_integrator_trace_inertial_to_dh(r);
}


return swap?1:2; // Remove particle p2 from simulation
}

0 comments on commit 3e1d856

Please sign in to comment.