improve ancestor_id#1903
Open
lukasdreyer wants to merge 2 commits intoenhancement-standalone_type_uint8from
Open
improve ancestor_id#1903lukasdreyer wants to merge 2 commits intoenhancement-standalone_type_uint8from
lukasdreyer wants to merge 2 commits intoenhancement-standalone_type_uint8from
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
requested changes
Nov 18, 2025
Collaborator
holke
left a comment
There was a problem hiding this comment.
Looks good to me.
Would love to have some comments to explain the computation.
Also suggested a minor change.
Comment on lines
+658
to
+666
| 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; |
Collaborator
There was a problem hiding this comment.
Suggested 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; | |
| 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++) { |
Collaborator
There was a problem hiding this comment.
Could you please add some comments to explain the formula?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).