Upgrade to FOF to treat some types differently
- Supersedes !1798 (closed).
- Implements #820 (closed).
- Implements #872 (closed).
- Fixes an old bug in the calculation of the linking length when the DM particle masses are not constant.
- Fixes an old bug which would crash the code at the end of a stand-alone FOF call.
Some important changes to the FOF algorithm.
We create two kinds of particles: linkable
and attachable
:
- The linkable ones behave as before. They build groups with each other.
- The attachable ones can only be linked to a linkable. (i.e. no attach-to-attach links allowed). They can't be root. They attach to the nearest linkable. Max distance for search is set by the linking length.
The two categories are specified at runtime in the parameter file.
The use case is to run FOF on the DM only and then attach the gas/stars/BHs to the nearest DM particle they find. With some minor caveats, this is what other FOF codes do.
The strategy is as follows:
- Perform a regular FOF search only involving the linkables.
- Same over MPI and construct the array of possible links.
- Launch a new pass over the particle where each attachable identifies the nearest linkable. Store that info.
- Once the pass is done, loop over the local attachables and act:
- If the nearest linkable is also local --> update the arrays
- If the nearest linkable is foreign --> create a new link
- Process all the links as before
- Compute group properties.
Additional improvements:
- Do not attempt to write subgrid info in the snapshots produced as it hasn't been read in.
Todo:
-
#872 (closed). -
Can we skip the regular engine_maketasks()
in the firstengine_rebuild()
? --> No. Need the comms. -
Update all relevant parameter files. -
Threadpoolize some of the new loops. -
Update the docs.
Edited by Matthieu Schaller