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

Moved all force calculations into forces.c #15

Closed hannorein closed 1 year ago

hannorein commented 1 year ago

The assist.c file was getting really long (almost 3000 lines). I think it makes sense to split this up.

With this pull request, all the functions that do the actual force calculations have been moved to forces.c. It's still almost 2000 lines of code! What remains in assist.c (600 lines) is the user interface, the data management, and all the logic required to run the integration, do the interpolation, etc.

matthewholman commented 1 year ago

This makes a lot of sense, Hanno. Indeed, it's a lot of code!

Along that line, there is a fair amount of repeated calculation among all the different contributions. Arya and I opted for simplicity/modularity over efficiency in the code development, but clearly the force evaluation could be made faster.

hannorein commented 1 year ago

I like the simplicity and modularity! I think it's worth a small performance penalty. Do you want to allow the user to switch on/off the various contributions in the long run or is that mainly something you did for testing?

matthewholman commented 1 year ago

We built up the force evaluation code in sections (direct Newtonian gravity, Earth J2-J4, GR, etc) to make it tractable, as well as for testing purposes. The intention has been to allow the user to turn the various contributions on/off, but to have an inclusive default. Do you have a suggestion for how to gracefully allow the user to select contributions?