-
Notifications
You must be signed in to change notification settings - Fork 63
Standalone scheme types #1443
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
Open
ole-alb
wants to merge
38
commits into
main
Choose a base branch
from
standalone-scheme-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Standalone scheme types #1443
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
9b30f8b
add lookup tables
ole-alb efff7e3
start impelemting types
ole-alb 055c808
Merge remote-tracking branch 'origin/main' into standalone-scheme-types
ole-alb 9d3ce51
add more type functionality
ole-alb 4f3d26e
add luts
ole-alb 1176bf7
add types to standalone
ole-alb b6c665d
fix type functionality
ole-alb 0993001
rebuild count_leaves test
ole-alb 35eaa8f
add lut for face-corner and corner-face
ole-alb a6cba74
add calculation of standalone pyramid contro volume
ole-alb 3b9b087
new name for helper function
ole-alb 40ffd20
add new test for reference coords
ole-alb c957d1c
fix reference coordinate issues
ole-alb 8b3b0d3
fix reference coords for standalone scheme
ole-alb 3599a72
cleanup
ole-alb 4d82579
add Assertions to check tet coords
ole-alb 02f257d
Merge remote-tracking branch 'origin/main' into standalone-scheme-types
ole-alb 66ef631
delete duplicated test
ole-alb 18ab26d
cleanup
ole-alb ff71c8f
delete duplicated test
ole-alb dc59084
fix debug print error
ole-alb 2822d28
remove unused value
ole-alb 38aff55
remove unused variable
ole-alb f6d5752
fix test
ole-alb 9beb28a
add function get_max_num_children
ole-alb 53ed5b1
Merge remote-tracking branch 'origin/max_num_children' into standalon…
ole-alb 7055935
fix merge error
ole-alb 36b197f
Merge remote-tracking branch 'origin/max_num_children' into standalon…
ole-alb 534a96b
disable test
ole-alb 2dc7999
implement new test logic
ole-alb 3ced503
Merge branch 'main' into standalone-scheme-types
ole-alb 303a496
add maybe_unused
ole-alb 684f4f6
apply suggestions from review
ole-alb 7128129
Merge branch 'main' into standalone-scheme-types
ole-alb 126d1ec
apply review
ole-alb 29fc2e0
switch are_family implementation
ole-alb ada3535
apply review
ole-alb 1aff0a3
Merge branch 'main' into standalone-scheme-types
lukasdreyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,18 +54,109 @@ constexpr uint8_t T8_ELEMENT_NUM_FACES[T8_ECLASS_COUNT] = { 0, 2, 4, 3, 6, 4, 5, | |
|
|
||
| /** Number of face children of the standalone element types */ | ||
| constexpr uint8_t T8_ELEMENT_MAX_NUM_FACECHILDREN[T8_ECLASS_COUNT] = { 0, 1, 2, 2, 4, 4, 4, 4 }; | ||
| constexpr uint8_t T8_ELEMENT_NUM_CORNER_FACES[T8_ECLASS_COUNT] = { 0, 1, 2, 2, 3, 3, 3, 4 }; | ||
| constexpr uint8_t T8_ELEMENT_NUM_FACE_CORNERS[T8_ECLASS_COUNT] = { 0, 2, 2, 2, 4, 3, 4, 4 }; | ||
|
|
||
| constexpr uint8_t T8_ELEMENT_NUM_EQUATIONS[T8_ECLASS_COUNT] = { 0, 0, 0, 1, 0, 3, 1, 2 }; | ||
|
|
||
| /**PARENT CHILD BIJECTION*/ | ||
|
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. All of the following look up tables are basically undocumented. Please improve that. |
||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_element_type_Iloc_to_childtype[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_CHILDREN[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_element_type_Iloc_to_childcubeid[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_CHILDREN[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_element_type_cubeid_to_parenttype[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [1 << T8_ELEMENT_DIM[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_element_type_cubeid_to_Iloc[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][1 << T8_ELEMENT_DIM[TEclass]]; | ||
|
|
||
| /**TYPE EQUATIONS*/ | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_type_edge_equations[T8_ELEMENT_NUM_EQUATIONS[TEclass]][2]; | ||
|
|
||
| /**VERTEX*/ | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_type_vertex_dim_to_binary[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_NUM_CORNERS[TEclass]] | ||
| [T8_ELEMENT_DIM[TEclass]]; | ||
|
|
||
| /**FACE*/ | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_face_internal[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_typebit[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_sign[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_facenormal_dim[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_neighface[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_cubeid_face_to_parentface[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [1 << T8_ELEMENT_DIM[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_is_1_boundary[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_last_facechilds_cubeid[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_facechildid_to_childid[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]] | ||
| [T8_ELEMENT_MAX_NUM_FACECHILDREN[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_childid_face_to_childface[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_CHILDREN[TEclass]] | ||
| [T8_ELEMENT_MAX_NUM_FACECHILDREN[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_face_to_tree_face[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_rootface_dim_to_facedim[T8_ELEMENT_NUM_FACES[TEclass]][T8_ELEMENT_DIM[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_rootface_eq_to_faceeq[T8_ELEMENT_NUM_FACES[TEclass]] | ||
| [T8_ELEMENT_NUM_EQUATIONS[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_type_rootface_to_face[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]] | ||
| [T8_ELEMENT_NUM_FACES[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr t8_eclass t8_standalone_lut_rootface_to_eclass[T8_ELEMENT_NUM_FACES[TEclass]]; | ||
|
|
||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_cornerface[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_NUM_CORNERS[TEclass]] | ||
| [T8_ELEMENT_NUM_CORNER_FACES[TEclass]]; | ||
|
|
||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_facecorner[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_NUM_FACES[TEclass]] | ||
| [T8_ELEMENT_NUM_FACE_CORNERS[TEclass]]; | ||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_transform_coords[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_DIM[TEclass]] | ||
| [T8_ELEMENT_DIM[TEclass]]; | ||
|
|
||
| template <t8_eclass TEclass> | ||
| constexpr int8_t t8_standalone_lut_backtransform_coords[1 << T8_ELEMENT_NUM_EQUATIONS[TEclass]][T8_ELEMENT_DIM[TEclass]] | ||
| [T8_ELEMENT_DIM[TEclass]]; | ||
|
|
||
| #include "t8_standalone_lut/t8_standalone_lut_triangle.hxx" | ||
| #include "t8_standalone_lut/t8_standalone_lut_prism.hxx" | ||
| #include "t8_standalone_lut/t8_standalone_lut_pyra.hxx" | ||
| #include "t8_standalone_lut/t8_standalone_lut_tet.hxx" | ||
|
|
||
| typedef int32_t t8_element_coord; | ||
| typedef uint8_t t8_element_level; | ||
| typedef uint8_t t8_cube_id; | ||
| typedef uint8_t t8_child_id; | ||
|
|
||
| template <t8_eclass_t TEclass> | ||
| template <t8_eclass TEclass> | ||
| using t8_element_type = std::bitset<T8_ELEMENT_NUM_EQUATIONS[TEclass]>; | ||
|
|
||
| template <t8_eclass_t TEclass> | ||
| template <t8_eclass TEclass> | ||
| using t8_element_coords = std::array<t8_element_coord, T8_ELEMENT_DIM[TEclass]>; | ||
|
|
||
| /** The data container describing a refined element in a refined tree, where the root element has class \a TEclass */ | ||
|
|
@@ -76,6 +167,8 @@ struct t8_standalone_element | |
| t8_element_coords<TEclass> coords; | ||
| /** The refinement level of the element relative to the root at level 0. */ | ||
| t8_element_level level; | ||
| /** Bit array: which inequality is fulfilled at which level. */ | ||
| t8_element_type<TEclass> type; | ||
| }; | ||
|
|
||
| #endif /* T8_STANDALONE_ELEMENTS_HXX */ | ||
Oops, something went wrong.
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.
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.
Can we Assert for something fo rthe other tree_classes, too?
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'm not sure if we need that