dtamayo / reboundx

A library for adding additional forces to the REBOUND N-body integration package
GNU General Public License v3.0
80 stars 60 forks source link

fixed clang compiler error and warnings #132

Closed hannorein closed 2 months ago

hannorein commented 2 months ago

This fixes #131 and a few other compiler warnings.

There was quite a bit of unused code in gr_full. I've commented it out - which doesn't change any result - but I'm not sure if gr_full works as expected.

dtamayo commented 2 months ago

Thanks Hanno, will look at gr full when I get in

dtamayo commented 2 months ago

Thanks again Hanno, sorry I was away yesterday. I'm not sure why I wasn't getting that compilation error on my computer or on the github CI.

I think gr_full is working as expected. Here is a run with two 1e-4 planets, plotting the relative error in the GR hamiltonian

image

I modified it to calculate barycentric coordinates as intended, and I pulled out all the constant terms from the iteration loop so the varying corrections are significantly smaller and converge faster.

I think now after the updates to the unit tests, the REBOUNDx tests triggered in the REBOUND actions are also passing

hannorein commented 2 months ago

Great! I think it depends on the compiler. const dotproduct = 3.3 was apparently interpreted as const int dotproduct = 3.3 (which is incorrect!).