Inconsistent neighbour counts for stars when comparing density and feedback loop
@bvandenbroucke , @matthieu : I mentioned this in the meeting yesterday that I've encountered this issue a while ago. I've been able to find a reproducible example.
I've set it up on the reproduce_star_smoothing_length_issues
branch.
Compile with
--with-hydro=gizmo-mfv --with-riemann-solver=hllc --with-rt=debug --with-stars=basic --with-feedback=none --enable-optimization=no
run the examples/RadiativeTransferTests/RandomizedBox_3D
as-is.
If you do a quick diff to the master branch, you should see the approx. 7 lines I added to count neighbours in the star density and the feedback loops. I call an error if the counter in the feedback loop finds more interacting neighbours than there were in the star density loop.
It crashes for me reproduceably on step 1308:
1307 3.588867e-02 1.0000000 0.0000000 4.882813e-05 45 45 1 1 0 0 0 1.743 0 0.851
[00059.6] ./rt/debug/rt_iact.h:runner_iact_rt_inject():94: Star has more interactions in feedback loop vs density loop: 46, 45
Back then I convinced myself that this happens due to roundoff errors for particles very close to the compact support radius for the given star's smoothing length. But you asked to see for yourself, so here you go.