Non periodic BCs: Correct particle treatment
Implements #342 (closed):
- In the drift task, when not using periodic BCs, particles that are drifted outside of the box are inhibited and flagged for proper removal using the newly implemented mechanism.
- Add a few more checks in the rebuild to verify that this worked.
- Undo the check for non-zero masses when constructing multipoles.
- Small cosmetic changes related to the periodic flag.
Merge request reports
Activity
@jkeger could you verify that this works correctly for your planetary impact cases?
added 1 commit
- 9e1492a1 - Print particles that are removed from a non-periodic box
All good for me, though I would still like to print the particle info when one is removed. Could put it in an "if planetary" if you prefer? Both to flag up if something goes wrong and particles are ejected when you don't expect, and to help see if they're unbound etc. (even if there's no potential in default gravity).
btw why set
p->gpart->type = swift_type_dark_matter;
?The
gpart
is removed just underneath incell_remove_gpart
. However, that function is designed to only remove stand-alone gparts. Each of the cell_remove_xxx functions is designed to work on only one of the particle types.Plus, the most basic star formation model (e.g. quick Lyman-alpha codes) just turn over-dense gas into dark matter particles.
In general SWIFT is unhappy if there is a gpart of type different from dark matter that is not linked to something. So to be clean, we turn into a DM-type particle.
added 1 commit
- eba1f78a - Added a function to the hydro scheme to be called when a particle gets removed…
mentioned in commit 3fc43c40