-
Notifications
You must be signed in to change notification settings - Fork 44
Ownership for self-bordering blocks #1445
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ namespace parthenon { | |
| block_ownership_t | ||
| DetermineOwnership(const LogicalLocation &main_block, | ||
| const std::vector<forest::NeighborLocation> &allowed_neighbors, | ||
| const std::array<bool, 3> self_border_block, | ||
| const std::unordered_set<LogicalLocation> &newly_refined) { | ||
| block_ownership_t main_owns; | ||
|
|
||
|
|
@@ -63,6 +64,19 @@ DetermineOwnership(const LogicalLocation &main_block, | |
| return a.morton() < b.morton(); | ||
| }; | ||
|
|
||
| // Does this block border itself over this face, and are we on the left side? | ||
| // Then Morton number would say we own the face/edge/corner, but we don't | ||
| // (the right side does). | ||
| auto self_border_left = [self_border_block](int ox1, int ox2, int ox3) { | ||
| // Can take care of each direction independently, corners follow | ||
| if ((self_border_block[0] && ox1 < 0) || (self_border_block[1] && ox2 < 0) || | ||
| (self_border_block[2] && ox3 < 0)) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| }; | ||
|
|
||
| for (int ox1 : {-1, 0, 1}) { | ||
| for (int ox2 : {-1, 0, 1}) { | ||
| for (int ox3 : {-1, 0, 1}) { | ||
|
|
@@ -72,6 +86,10 @@ DetermineOwnership(const LogicalLocation &main_block, | |
| main_block.IsNeighborOfTE(n.origin_loc, {ox1, ox2, ox3})) { | ||
| main_owns(ox1, ox2, ox3) = false; | ||
| break; | ||
| } else if (main_block.level() == 0 && main_block == n.global_loc && | ||
| self_border_left(ox1, ox2, ox3)) { | ||
| main_owns(ox1, ox2, ox3) = false; | ||
| break; | ||
|
Comment on lines
+89
to
+92
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see you are making the comparison here. So why do we need the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main thing I am thinking here is that in a general forest, there can be all sorts of connectivity between a block and itself beyond what a periodic mesh would give.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yeah I get what you mean. |
||
| } | ||
| } | ||
| } | ||
|
|
||
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.
Do we need to actually pass this in or can we just check if the
main_blocklogical location is inallowed_neighbors?