-
Notifications
You must be signed in to change notification settings - Fork 62
improve ancestor_id #1903
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: enhancement-standalone_type_uint8
Are you sure you want to change the base?
improve ancestor_id #1903
Conversation
246f6bc to
ef8e8b6
Compare
f219b33 to
2fd0b6a
Compare
ef8e8b6 to
ced49cb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## enhancement-standalone_type_uint8 #1903 +/- ##
==================================================================
Coverage 76.15% 76.16%
==================================================================
Files 103 103
Lines 19424 19430 +6
==================================================================
+ Hits 14792 14798 +6
Misses 4632 4632 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
11f2a9b to
bb8e4e4
Compare
holke
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 to me.
Would love to have some comments to explain the computation.
Also suggested a minor change.
| int child_id; | ||
| if constexpr (T8_ELEMENT_NUM_EQUATIONS[TEclass]) { | ||
| u_int8_t type = element_compute_type_at_level (el, level); | ||
| child_id = t8_element_type_cubeid_to_Iloc<TEclass>[type][cube_id]; | ||
| } | ||
| else { | ||
| child_id = cube_id; | ||
| } | ||
| return child_id; |
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.
| int child_id; | |
| if constexpr (T8_ELEMENT_NUM_EQUATIONS[TEclass]) { | |
| u_int8_t type = element_compute_type_at_level (el, level); | |
| child_id = t8_element_type_cubeid_to_Iloc<TEclass>[type][cube_id]; | |
| } | |
| else { | |
| child_id = cube_id; | |
| } | |
| return child_id; | |
| if constexpr (T8_ELEMENT_NUM_EQUATIONS[TEclass]) { | |
| u_int8_t type = element_compute_type_at_level (el, level); | |
| return t8_element_type_cubeid_to_Iloc<TEclass>[type][cube_id]; | |
| } | |
| else { | |
| return cube_id; | |
| } |
| element_get_ancestor (el, level, &ancestor); | ||
| return element_get_child_id ((const t8_element_t *) &ancestor); | ||
| int cube_id = 0; | ||
| for (int idim = 0; idim < T8_ELEMENT_DIM[TEclass]; idim++) { |
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.
Could you please add some comments to explain the formula?
Closes #1905
Describe your changes here:
Improve the calculation of the ancestor id by avoiding computing all information in the ancestor
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.scpto check the indentation of these files.License
doc/(or already has one).