-
Notifications
You must be signed in to change notification settings - Fork 61
Feature: extend leaf face neighbor to non-balanced forests and ghosts [Review wanted, but still WIP][2/2] #1736
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: main
Are you sure you want to change the base?
Conversation
…ature-ancestor_search
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.
A very small first batch of comments. Need to have a more detailed look into it for a propper review. But thanks for the addition ;)
t8_forest_leaf_face_neighbors_iterate (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, | ||
int is_leaf, [[maybe_unused]] const t8_element_array_t *const leaf_elements, | ||
t8_locidx_t tree_leaf_index, void *user_data) |
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.
t8_forest_leaf_face_neighbors_iterate (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, | |
int is_leaf, [[maybe_unused]] const t8_element_array_t *const leaf_elements, | |
t8_locidx_t tree_leaf_index, void *user_data) | |
t8_forest_leaf_face_neighbors_iterate (t8_forest_t forest, const t8_locidx_t ltreeid, const t8_element_t *element, const int face, | |
const bool is_leaf, [[maybe_unused]] const t8_element_array_t *const leaf_elements, | |
const t8_locidx_t tree_leaf_index, void *user_data) |
const t8_locidx_t adjusted_tree_id = !is_ghost_tree ? ltreeid : ltreeid - t8_forest_get_num_local_trees (forest); | ||
T8_ASSERT (t8_forest_element_is_leaf_or_ghost (forest, element, adjusted_tree_id, is_ghost_tree)); |
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.
I think there is already a function that returns the tree-id of a local or ghost tree. If so, please use it instead.
void | ||
t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *leaf_or_ghost, | ||
t8_element_t **pneighbor_leaves[], int face, int *dual_faces[], int *num_neighbors, | ||
t8_locidx_t **pelement_indices, t8_eclass_t *pneigh_eclass, t8_gloidx_t *gneigh_tree, | ||
int *orientation) |
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.
void | |
t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *leaf_or_ghost, | |
t8_element_t **pneighbor_leaves[], int face, int *dual_faces[], int *num_neighbors, | |
t8_locidx_t **pelement_indices, t8_eclass_t *pneigh_eclass, t8_gloidx_t *gneigh_tree, | |
int *orientation) | |
void | |
t8_forest_leaf_face_neighbors_ext (t8_forest_t forest, const t8_locidx_t ltreeid, const t8_element_t *leaf_or_ghost, | |
t8_element_t **pneighbor_leaves[], const int face, int *dual_faces[], int *num_neighbors, | |
t8_locidx_t **pelement_indices, t8_eclass_t *pneigh_eclass, t8_gloidx_t *gneigh_tree, | |
int *orientation) |
Closes #1737
Describe your changes here:
This has gotten quite large and will be split up and take some time.
I am putting this up here now to start the review early.
I would like to have a review on this because the algorithm is now working.
The review can focus mostly on the leaf_face_neighbor functionality.
It is still in draft status, because
a) there is still low-level functionality missing to make this work on all element shapes
b) i will split this up into multiple PRs eventually
c) not all tests pass, due to missing low-level functionality
Builds upon #1714
Description
This PR extends the leaf face neighbor computation in two ways simultaneously:
a) extend it to ghosts, thus we can compute neighbors of ghosts and neighbors that are ghosts
b) extend it to non-balanced forests. So far a 2:1 condition was required, this is no longer the case.
The main contributions are
implemented while the lfn function did not work for adaptive forests, need to check whether to extend this function to all forests now) (Should be its own PR)
Edit: The function was so far only tested for quads and hexes due to the missing face ancesor #1738. A first test with lines does fail - i need to investigate what is going on. (t8_gtest_face_neighbors/forest_face_neighbors.test_face_neighbors/t8_cmesh_new_from_class_Line_sc_MPI_COMM_WORLD_default)
What is still open to get this out of draft:
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:
,Bugfix:
,Feature:
,Improvement:
orOther:
.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scp
to check the indentation of these files.License
doc/
(or already has one).