-
Notifications
You must be signed in to change notification settings - Fork 168
1874 ravel unravel index #1878
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
1874 ravel unravel index #1878
Conversation
Temporal indexing is left separate from spatial indexing due to the fact that ti was initialized differently from spatial indices on L131 of particleset.py (ti = -1, xi,yi,zi=0). To stick with this convention and to avoid an unforeseen consquences of merging spatial and temporal indexing, I've opted to kep them separate with ei=0 initially and ti=-1 initially. ravel_index/unravel_index methods have been added to the Field class. In this commit, some tests aren't passing as it appears some tests attempt to check the values of the old xi,yi,zi .
for more information, see https://pre-commit.ci
|
It appears there's a good number of notebooks to go through and update.. |
Using the new element index unravel method
erikvansebille
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, clean implementation @fluidnumerics-joe! A few comments/suggestions below
There was only one notebook that failed; I fixed it in 7c5531d |
…rcels into 1874-ravel-unravel-index
VeckoTheGecko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! After the open questions, and a merge with v4-dev I think this will be good to go :)
for more information, see https://pre-commit.ci
…rcels into 1874-ravel-unravel-index
erikvansebille
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good now, but we may want to also merge in #1881 (adding ti to the ravelled index too)
mainfor v3 changes,v4-devfor v4 changes)Notes
ParticleSetnow uses indicesei,tiin place ofzi,yi,xi,ti. The time index is kept separate since it appears that the initialization fortiis a bit different than for spatial indices; I wasn't convinced that combining spatial and temporal indexing wouldn't have unforeseen consequences.Field.ravel_indexandField.unravel_indexhave been added to map betweeneiand(zi,yi,xi)_index_search*methods have been updated to ravel and unravel indices where needed.(zi,yi,xi)and instead rely onunravel_indexwhere needed.