matthewholman / assist

ASSIST is a software package for ephemeris-quality integrations of test particles.
https://assist.readthedocs.io/
GNU General Public License v3.0
24 stars 10 forks source link

Constants and naming #50

Closed hannorein closed 1 year ago

hannorein commented 1 year ago

(I've built this upon #49, so you might want to look at this one later)

1) I've added a new enum ASSIST_BODY. The idea is to use this consistently throughout the code so that we don't need to refer to the sun as 0 or to the earth as 3, which is a bit hard to read. For example, the order in which direct forces are calculated is much easier to understand now (see here). These constants belong to ASSIST and not the ephemeris file. So if the ephemeris file changes, we can update the mapping, but don't need to change any constants in random places in the code. 2) I've renamed the struct _jpl_s to jpl_s and variables of that type from pl to jpl. They are only used internally, but it was a bit inconsistent compared to the struct spk_s. 3) The asteroid ephemeris calculation did includ the calculation of the velocity. But the velocity was never used (not even passed out of assist_spk_calc, so I've commented it out. The code is still there if we ever need the asteroid velocities.

hannorein commented 1 year ago

4) I'm skipping some calculations in the direct force routine which are not needed if not variational particles are present. That gives me an almost 10% speedup.

(We should add a few unit tests and a benchmark for simulations with variational particles)

matthewholman commented 1 year ago

Nice job finding another ~10% speedup!

I agree that we should add benchmarks for initial conditions with variational particles. There are undoubtedly speedup opportunities in the sections of code for the variational equations.