Feature multilevel - #1106
Closed
sandro-elsweijer wants to merge 7 commits into
Closed
Conversation
lukasdreyer
reviewed
Jun 28, 2024
Comment on lines
+103
to
+141
| t8_dquad_successor (const p4est_quadrant_t *elem, p4est_quadrant_t *succ, const int level, const int multilevel) | ||
| { | ||
| T8_ASSERT (p4est_quadrant_is_extended (elem)); | ||
| T8_ASSERT (0 <= elem->level && succ->level <= P4EST_QMAXLEVEL); | ||
| T8_ASSERT (0 <= level && level <= P4EST_QMAXLEVEL); | ||
| T8_ASSERT (elem->level <= level); | ||
| /* If level not reached, construct child */ | ||
| if (elem->level < level) { | ||
| t8_dquad_child (elem, 0, succ); | ||
| } | ||
| else { | ||
| /* If level reached, construct sibling */ | ||
| const int num_siblings = 4; | ||
| int child_id = p4est_quadrant_child_id (elem); | ||
| T8_ASSERT (0 <= child_id && child_id < num_siblings); | ||
| if (child_id < num_siblings - 1) { | ||
| t8_dquad_sibling (elem, child_id + 1, succ); | ||
| } | ||
| else { | ||
| /* elem is last sibling, go up until elem is not last sibling */ | ||
| t8_dquad_parent (elem, succ); | ||
| child_id = p4est_quadrant_child_id (succ); | ||
| T8_ASSERT (0 <= child_id && child_id < num_siblings); | ||
| while (child_id == num_siblings - 1) { | ||
| t8_dquad_parent (succ, succ); | ||
| child_id = p4est_quadrant_child_id (succ); | ||
| T8_ASSERT (0 <= child_id && child_id < num_siblings); | ||
| } | ||
| /* Construct next sibling */ | ||
| t8_dquad_sibling (succ, child_id + 1, succ); | ||
| } | ||
| } | ||
| if (!multilevel) { | ||
| /* If not multilevel, traverse down the tree */ | ||
| while (succ->level < level) { | ||
| t8_dquad_child (succ, 0, succ); | ||
| } | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
This function can also be implemented in default_common, as no actual element attributes need to be accessed here directly. You can replace elem->level by t8_element_level(elem) and all t8_dquad_*
calls by their respective t8_element_* and this functionality could be available directly for all element types
Member
Author
|
Will be continued here: #1342 |
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.
Describe your changes here:
Implements multilevel capabilities into t8code. Needs a major release.
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
The reviewer executed the new code features at least once and checked the results manually
The code follows the t8code coding guidelines
New source/header files are properly added to the Makefiles
The code is well documented
All function declarations, structs/classes and their members have a proper doxygen documentation
All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue)
Tests
Github action
The code compiles without warning in debugging and release mode, with and without MPI (this should be executed automatically in a github action)
All tests pass (in various configurations, this should be executed automatically in a github action)
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.Licence
doc/(or already has one)