(This pull requests build on the jpl_calc one. To see the important changes have a look at 4bc5c61c0f4ab7f75310a84f27b05d78a71bc075)
This pull request implements a way to turn on/off different forces. It adds a new variable forces in assist_extras to store which forces are to be included. By default all the force terms are included (using eig_gr). The user can turn off individual terms by doing something like this :
assist->forces ^= ASSIST_FORCE_PLANETS; // turn off contributions form planets
assist->forces ^= ASSIST_FORCE_ASTEROIDS; // turn off contributions form asteroids
assist->forces ^= ASSIST_FORCE_EARTH_HARMONICS; // turn off contributions form higher order harmonics from earth
assist->forces = ASSIST_FORCE_SUN; // Only consider the force from the sun
Implementation details: Basically, I've just added a few if statements in the force routines. The constants ASSIST_FORCE_.. are powers of two. This should not be a problem unless we'll ever have more than 31 different forces. All possible combinations can be achieved using logic operations (^= above is an in-place xor).
(This pull requests build on the jpl_calc one. To see the important changes have a look at 4bc5c61c0f4ab7f75310a84f27b05d78a71bc075)
This pull request implements a way to turn on/off different forces. It adds a new variable
forces
inassist_extras
to store which forces are to be included. By default all the force terms are included (using eig_gr). The user can turn off individual terms by doing something like this :Implementation details: Basically, I've just added a few if statements in the force routines. The constants
ASSIST_FORCE_..
are powers of two. This should not be a problem unless we'll ever have more than 31 different forces. All possible combinations can be achieved using logic operations (^=
above is an in-place xor).