-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zoom Region Snapshots #188
Comments
I will add |
From what I've heard of the zoom code it translates the zoom region to be in the box centre. This is a little bit annoying to compare to the parent box. There are a few ways to address this, but my suggestion after a quick think would be to (1) store some metadata in the snapshot files that contains the offset from the parent box and (2) allow a swiftsimio user to set a flag ( Note that I'd want to be able to both provide input (e.g. specify a region) in my coordinate frame of choice, and receive output (e.g. coordinate arrays) in my frame of choice. Alternatively, it could be decided that the parent box frame is the "true" frame and the recentering of the zoom region becomes an implementation detail that is handled internally. Needs some thought/discussion, I guess. |
The current plan is to automatically shift the coordinates (and zoom region metadata) back to the parent coordinates so the outputs will always be in the same frame as the ICs (including any user-specified shift which is already stored in the snapshots). For me, this is the simplest approach since it removes any questions about the frame. The bigger wrinkle is that a lot of IC generation codes will already perform the shift at which point the information is already lost (at least in my experience, I don't know if this has been addressed on more recent pipelines). |
We forgot to write it here but we will undo any shift that the code adds behind the user's back. This will happen at i/o time and will put back the particles where they belong based on the ICs. I think that would fix the point you bring up? |
Ok, if the snapshots are written in the parent box frame then there's nothing to do in swiftsimio, I think. I just wasn't sure if that was going to be straightforward with the cells involved. |
@JBorrow: We currently already write the cell centre as well as the cell width. If, in the case of a zoom, I write out the centres of the zoom-region cells and their width then we have everything we need. I can add the location of the bottom-left-front corner of the zoom region if it helps. (i.e. the (0,0,0) in the non-zoom case). |
I think we will need the bottom-left-front corner to shift during the cell index look-up? Although that could admittedly be derived from the centres and widths. |
Yeah that bottom left corner will help. We won't be able to get away without any code changes here because of the background particles at the end of the array, but that's ok. |
Ok. I'll add that. There might be little code changes needed to access just the zoom-in region particles though. |
@MatthieuSchaller has made some of the necessary changes (minus those needed in MPI land) on the
I've run a test on this and everything appears to be working as expected. This test can be found here which also shows how to use the |
Zoom regions have a smaller (not-entirely-box-covering) grid. There will also be particles that are outside of any cell.
These will be tracked by:
All other particles will be at the end of the array. We need to be able to read these.
The text was updated successfully, but these errors were encountered: