Skip to content
Open
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,22 @@ struct t8_standalone_scheme
T8_ASSERT (0 <= level && level <= T8_ELEMENT_MAXLEVEL[TEclass]);

const t8_standalone_element<TEclass> *el = (const t8_standalone_element<TEclass> *) elem;
t8_standalone_element<TEclass> ancestor;
const int length = element_get_len (level);
T8_ASSERT (0 <= el->level && el->level <= T8_ELEMENT_MAXLEVEL[TEclass]);

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++) {
Copy link
Collaborator

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?

cube_id |= (el->coords[idim] & length) ? (1 << idim) : 0;
}
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;
Comment on lines +658 to +666
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}

}

/** Query whether a given set of elements is a family or not.
Expand Down