Skip to content

Commit

Permalink
use face_corner lut from eclass
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-elsweijer committed Oct 31, 2024
1 parent f32cf07 commit 7b7ce5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h>
#include <t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h>
#include <t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h>
#include <t8_eclass.h>

typedef int8_t t8_dpyramid_cube_id_t;

Expand Down Expand Up @@ -973,7 +974,7 @@ t8_dpyramid_first_descendant_face (const t8_dpyramid_t *p, const int face, t8_dp
T8_ASSERT (0 <= level && level <= T8_DPYRAMID_MAXLEVEL);
T8_ASSERT (p->pyramid.level <= level);
if (t8_dpyramid_shape (p) == T8_ECLASS_TET) {
const int corner = t8_dtet_face_corner[face][0];
const int corner = t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][0];
t8_dpyramid_corner_descendant (p, first_desc, corner, level);
}
else if (p->pyramid.level == T8_DPYRAMID_MAXLEVEL) {
Expand Down Expand Up @@ -1040,7 +1041,8 @@ t8_dpyramid_last_descendant_face (const t8_dpyramid_t *p, const int face, t8_dpy

if (t8_dpyramid_shape (p) == T8_ECLASS_TET) {
T8_ASSERT (0 <= face && face < T8_DTET_FACES);
const int corner = SC_MAX (t8_dtet_face_corner[face][1], t8_dtet_face_corner[face][2]);
const int corner = SC_MAX (t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][1],
t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][2]);
t8_dpyramid_corner_descendant (p, last_desc, corner, level);
}
else {
Expand Down Expand Up @@ -1395,7 +1397,7 @@ t8_dpyramid_get_face_corner (const t8_dpyramid_t *pyra, int face, int corner)
{
T8_ASSERT (0 <= face && face <= T8_DPYRAMID_FACES);
if (t8_dpyramid_shape (pyra) == T8_ECLASS_TET) {
return t8_dtet_face_corner[face][corner];
return t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][corner];
}
else {
const int corner_number = t8_dpyramid_face_corner[pyra->pyramid.type - T8_DPYRAMID_FIRST_TYPE][face][corner];
Expand Down
8 changes: 5 additions & 3 deletions src/t8_schemes/t8_default/t8_default_tet/t8_default_tet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <t8_schemes/t8_default/t8_default_tet/t8_dtet_bits.h>
#include <t8_schemes/t8_default/t8_default_tri/t8_dtri_bits.h>
#include <t8_schemes/t8_default/t8_default_tet/t8_dtet_connectivity.h>
#include <t8_eclass.h>

/* We want to export the whole implementation to be callable from "C" */
T8_EXTERN_C_BEGIN ();
Expand Down Expand Up @@ -118,7 +119,7 @@ t8_default_scheme_tet_c::t8_element_get_face_corner (const t8_element_t *element
{
T8_ASSERT (0 <= face && face < T8_DTET_FACES);
T8_ASSERT (0 <= corner && corner < 3);
return t8_dtet_face_corner[face][corner];
return t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][corner];
}

void
Expand Down Expand Up @@ -297,7 +298,7 @@ t8_default_scheme_tet_c::t8_element_first_descendant_face (const t8_element_t *e
T8_ASSERT (0 <= level && level <= T8_DTET_MAXLEVEL);

/* Compute the first corner of this face */
corner = t8_dtet_face_corner[face][0];
corner = t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][0];
/* Compute the descendant in this corner */
t8_dtet_corner_descendant ((const t8_dtet_t *) elem, (t8_dtet_t *) first_desc, corner, level);
}
Expand All @@ -311,7 +312,8 @@ t8_default_scheme_tet_c::t8_element_last_descendant_face (const t8_element_t *el
T8_ASSERT (0 <= level && level <= T8_DTET_MAXLEVEL);

/* Compute the last corner of this face */
corner = SC_MAX (t8_dtet_face_corner[face][1], t8_dtet_face_corner[face][2]);
corner = SC_MAX (t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][1],
t8_face_vertex_to_tree_vertex[T8_ECLASS_TET][face][2]);
/* Compute the descendant in this corner */
t8_dtet_corner_descendant ((const t8_dtet_t *) elem, (t8_dtet_t *) last_desc, corner, level);
}
Expand Down
1 change: 0 additions & 1 deletion src/t8_schemes/t8_default/t8_default_tet/t8_dtri_to_dtet.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ T8_EXTERN_C_BEGIN ();
#define t8_dtri_parenttype_Iloc_to_type t8_dtet_parenttype_Iloc_to_type
#define t8_dtri_parenttype_Iloc_to_cid t8_dtet_parenttype_Iloc_to_cid
#define t8_dtri_type_cid_to_Iloc t8_dtet_type_cid_to_Iloc
#define t8_dtri_face_corner t8_dtet_face_corner

/* functions in d8_dtri_bits.h */
#define t8_dtri_is_equal t8_dtet_is_equal
Expand Down

0 comments on commit 7b7ce5f

Please sign in to comment.