Skip to content
Open
Show file tree
Hide file tree
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 Feb 28, 2025
efff7e3
start impelemting types
ole-alb Apr 10, 2025
055c808
Merge remote-tracking branch 'origin/main' into standalone-scheme-types
ole-alb Apr 10, 2025
9d3ce51
add more type functionality
ole-alb Apr 11, 2025
4f3d26e
add luts
ole-alb Apr 11, 2025
1176bf7
add types to standalone
ole-alb Apr 11, 2025
b6c665d
fix type functionality
ole-alb Apr 15, 2025
0993001
rebuild count_leaves test
ole-alb Apr 16, 2025
35eaa8f
add lut for face-corner and corner-face
ole-alb Apr 23, 2025
a6cba74
add calculation of standalone pyramid contro volume
ole-alb Apr 25, 2025
3b9b087
new name for helper function
ole-alb Apr 25, 2025
40ffd20
add new test for reference coords
ole-alb Apr 25, 2025
c957d1c
fix reference coordinate issues
ole-alb Apr 25, 2025
8b3b0d3
fix reference coords for standalone scheme
ole-alb May 9, 2025
3599a72
cleanup
ole-alb May 9, 2025
4d82579
add Assertions to check tet coords
ole-alb May 9, 2025
02f257d
Merge remote-tracking branch 'origin/main' into standalone-scheme-types
ole-alb May 9, 2025
66ef631
delete duplicated test
ole-alb May 9, 2025
18ab26d
cleanup
ole-alb May 9, 2025
ff71c8f
delete duplicated test
ole-alb May 9, 2025
dc59084
fix debug print error
ole-alb May 9, 2025
2822d28
remove unused value
ole-alb May 9, 2025
38aff55
remove unused variable
ole-alb May 9, 2025
f6d5752
fix test
ole-alb May 12, 2025
9beb28a
add function get_max_num_children
ole-alb May 14, 2025
53ed5b1
Merge remote-tracking branch 'origin/max_num_children' into standalon…
ole-alb May 15, 2025
7055935
fix merge error
ole-alb May 15, 2025
36b197f
Merge remote-tracking branch 'origin/max_num_children' into standalon…
ole-alb May 15, 2025
534a96b
disable test
ole-alb May 15, 2025
2dc7999
implement new test logic
ole-alb May 20, 2025
3ced503
Merge branch 'main' into standalone-scheme-types
ole-alb May 20, 2025
303a496
add maybe_unused
ole-alb May 20, 2025
684f4f6
apply suggestions from review
ole-alb May 21, 2025
7128129
Merge branch 'main' into standalone-scheme-types
ole-alb May 21, 2025
126d1ec
apply review
ole-alb May 21, 2025
29fc2e0
switch are_family implementation
ole-alb May 26, 2025
ada3535
apply review
ole-alb Aug 19, 2025
1aff0a3
Merge branch 'main' into standalone-scheme-types
lukasdreyer Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/t8_forest/t8_forest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,14 @@ t8_forest_element_coordinate (t8_forest_t forest, t8_locidx_t ltree_id, const t8
const t8_gloidx_t gtreeid = t8_forest_global_tree_id (forest, ltree_id);
/* Get the cmesh */
const t8_cmesh_t cmesh = t8_forest_get_cmesh (forest);
#if T8_ENABLE_DEBUG
if (tree_class == T8_ECLASS_TET) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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

T8_ASSERT (vertex_coords[1] >= 0.0);
T8_ASSERT (vertex_coords[2] >= vertex_coords[1]);
T8_ASSERT (vertex_coords[0] >= vertex_coords[2]);
T8_ASSERT (vertex_coords[0] <= 1.0);
}
#endif
/* Evaluate the geometry */
t8_geometry_evaluate (cmesh, gtreeid, vertex_coords, 1, coordinates);
}
Expand Down
6 changes: 5 additions & 1 deletion src/t8_schemes/t8_scheme.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ class t8_scheme {
t8_standalone_scheme<T8_ECLASS_VERTEX>,
t8_standalone_scheme<T8_ECLASS_LINE>,
t8_standalone_scheme<T8_ECLASS_QUAD>,
t8_standalone_scheme<T8_ECLASS_HEX>
t8_standalone_scheme<T8_ECLASS_TRIANGLE>,
t8_standalone_scheme<T8_ECLASS_HEX>,
t8_standalone_scheme<T8_ECLASS_TET>,
t8_standalone_scheme<T8_ECLASS_PRISM>,
t8_standalone_scheme<T8_ECLASS_PYRAMID>
>;
/* clang-format on */

Expand Down
8 changes: 4 additions & 4 deletions src/t8_schemes/t8_standalone/t8_standalone.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ t8_scheme_new_standalone (void)
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_VERTEX>> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_LINE>> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_QUAD>> ();
builder.add_eclass_scheme<t8_default_scheme_tri> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_TRIANGLE>> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_HEX>> ();
builder.add_eclass_scheme<t8_default_scheme_tet> ();
builder.add_eclass_scheme<t8_default_scheme_prism> ();
builder.add_eclass_scheme<t8_default_scheme_pyramid> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_TET>> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_PRISM>> ();
builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_PYRAMID>> ();
// builder.add_eclass_scheme<t8_standalone_scheme<T8_ECLASS_PYRAMID>> (); //ADD if PYRAMID in "element_get_shape"
return builder.build_scheme ();
}
Expand Down
97 changes: 95 additions & 2 deletions src/t8_schemes/t8_standalone/t8_standalone_elements.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 */
Expand All @@ -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 */
Loading