Closed hannorein closed 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)
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.
(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
tojpl_s
and variables of that type frompl
tojpl
. They are only used internally, but it was a bit inconsistent compared to the structspk_s
. 3) The asteroid ephemeris calculation did includ the calculation of the velocity. But the velocity was never used (not even passed out ofassist_spk_calc
, so I've commented it out. The code is still there if we ever need the asteroid velocities.