Open AshKelly opened 4 years ago
@matthewturk @JBorrow feel free to pitch in ideas or suggestions for this!
I plan to work on this in the #pullrequest-triage on May 8th.
Excellent!!!!
@AshKelly did we ever resolve this? I don't think that we did.
No, we didn't. Though me and Ash did write a paper about this at some point... https://ui.adsabs.harvard.edu/abs/2021arXiv210605281B/abstract
@JBorrow thanks for this--I think on some reasonable time scale we should try implementing this in yt. I skimmed the paper but do you think it would be very difficult or can you think of any potential hangups? I'm happy to take a whack at it myself but I'll probably bug you with questions.
It's very simple, all you're doing is taking the first order integration of the kernel to the grid (e.g. W(r_center_of_pixel, h) being the contribution to that pixel) and turning it into something either higher order, or like I did here just creating more resolution elements to do this first order integration over. It boils down to a case of:
if (pixel_overlap_of_kernel < threshold): create_fake_refined_grid() project_onto_fake_refined_grid() derefine_grid_and_add_to(main_grid)
The code for swiftismio is super simple too, as it's all numba accelerated:
Base case (no refinement): https://github.com/SWIFTSIM/swiftsimio/blob/master/swiftsimio/visualisation/projection_backends/fast.py Subsampled case (with refinement): https://github.com/SWIFTSIM/swiftsimio/blob/master/swiftsimio/visualisation/projection_backends/subsampled.py
Bug report
Bug summary
Robin Kooistra reported in the slack that the density from the mean SPH gather/scatter of gas was way of what it should be e.g. critical density.
The reason for this is that we over-normalize the results of the deposition after we have calculated the density.
Namely, the yt depositon for gas density follows Eq. 3 of the SPLASH method paper, whereas most codes follow Eq. 9. The choice of Eq. 3 leads to two issues:
1) The normalization is done automatically. However, the accuracy of the normalization depends m/h^3 == rho which is not always true for SPH simulations, and in fact, rarely is!
2) As Eq. 3 already returns the normalized field, when we normalize we are normalizing an already normalized field.
SPLASH
I propose we change to the typical choice of Eq. 9 which will involve a few minor changes in
yt.utilities.lib.pixelization_routines.pyx
. I plan to work on this in the #pullrequest-triage on May 8th.Code for reproduction
Version Information