-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Morton numbers and expand LogicalLocation
functionality
#900
Conversation
planning to review this ASAP. Didn't get a chance today. |
Thanks @Yurlungur. I thought of a couple things I could add to this PR tonight anyway. |
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.
This is a nice addition and I can see it coming in handy both for code extensions and code cleanup going forward.
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.
LGTM!
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 work -- lots of bits flying around.
I only got a couple of clarification questions (though feel free to ignore and merge if you're on a tight schedule).
Similarly (assuming you can spare another 15 min or so), a (very brief) documentation would be great.
I remember that I had a similar question to the Athena++ devs in terms of "What's the best way to get a global index of a cell in an AMR sim?" it would be nice if we have that kind of info readily available in our docs.
@pgrete re-documentation: My plan was to write some comprehensive documentation as a separate PR. I know I say this all the time about updates and never do it, but I think it will be much easier to write a comprehensive document at one time than doing it piecemeal (and I swear I am not lying about eventually doing it). |
PR Summary
In preparation for dealing with topological elements that are shared between blocks, this PR adds some utilities for calculating Morton numbers from logical locations and expands the functionality of
LogicalLocation
. In particular:LogicalLocation
instance now includes its Morton number.LogicalLocation
member variables are private and are accessed through const accessors to prevent the logical location and Morton number from being inconsistent.>
,<
, and==
operators are introduced forLogicalLocation
since the locations have a Morton order.LogicalLocation
is provided so that we can makestd::unordered_map
s andstd::set
s withLogicalLocation
as a key.LogicalLocation
contains, is contained in, or is a neighbor of anotherLogicalLocation
are added.LogicalLocation
s are added.LogicalLocation
s abutting a given topological element are added.A unit test that exercises this new functionality is included. The
LogicalLocation
of a neighbor is now stored in theNeighborBlock
class.PR Checklist