Closed hannorein closed 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.
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?
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?
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 inassist.c
(600 lines) is the user interface, the data management, and all the logic required to run the integration, do the interpolation, etc.