Output all particles which have ever been the most bound in a VR group whenever VR is invoked on the fly
In order to run the Galform semi-analytic galaxy formation model on a Swift simulation we need the position and velocity of all particles which have ever been the most bound particle in a Velociraptor group. These particles are used to assign positions to galaxies associated with subhalos which are no longer detected in the simulation due to limited resolution or numerical effects.
In a large simulation we can't afford to output a full snapshot at every VR invocation because of the amount of disk space needed so it would be useful to be able to write out just the previously most bound particles. I think this requires the following changes:
- At each invocation, Velociraptor needs to be able to tell Swift which particles are most bound at the current time
- Swift needs to store a flag for each particle which indicates whether it has ever been most bound
- These flags must be updated at each VR invocation so more and more particles are flagged as the simulation proceeds
- After each VR invocation all flagged particles (not just those flagged in the current invocation) must be written out
Identifying the most bound particles and returning them to Swift appears to be straightforward. Regarding the other points I have a couple of questions which maybe someone more familiar with Swift might have some thoughts on:
- Where is a good place to store the flag for each particle? The gpart struct seems like an obvious choice but maybe we don't want to make that any larger?
- What is the best way to output the particles? Can we make use of the existing snapshot I/O code to write out just flagged particles, or is it better to keep it separate for simplicity?