Skip to content

Commit

Permalink
replace code duplication with macro
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-elsweijer committed Jan 3, 2025
1 parent e6e4fd3 commit e8dae5c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ const int t8_dtet_face_child_id_by_type[6][4][4] = {
{ { 3, 5, 6, 7 }, { 0, 4, 6, 7 }, { 0, 2, 3, 7 }, { 0, 1, 3, 6 } } /* type 5 */
};

const int t8_dtet_face_corner[4][3] = { { 1, 3, 2 }, { 0, 2, 3 }, { 0, 3, 1 }, { 0, 1, 2 } };

const int t8_dtet_parent_type_type_to_face[6][6] = {
{ -1, 0, 2, -1, 1, 3 },
{ 0, -1, 3, 1, -1, 2 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define T8_DTET_CONNECTIVITY_H

#include <t8.h>
#include <t8_eclass.h>

T8_EXTERN_C_BEGIN ();

Expand Down Expand Up @@ -91,7 +92,7 @@ extern const int t8_dtet_face_child_id_by_type[6][4][4];
* The other 2 corner are given in counterclockwise order as seen from
* outside of the tet.
*/
extern const int t8_dtet_face_corner[4][3];
#define t8_dtet_face_corner t8_face_vertex_to_tree_vertex[T8_ECLASS_TET]

/** For each combination parent_type, type with parent_type != type,
* provide the face number of the face of a tet that lies within a face of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ const int t8_dtri_parenttype_Iloc_to_cid[2][4] = {
{ 0, 1, 1, 3 },
{ 0, 2, 2, 3 } };

const int t8_dtri_face_corner[3][2] = {
{ 1, 2 },
{ 0, 2 },
{ 0, 1 } };

const int t8_dtri_corner_face[3][2] = {
{ 1, 2 },
{ 0, 2 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define T8_DTRI_CONNECTIVITY_H

#include <t8_schemes/t8_default/t8_default_tri/t8_dtri.h>
#include <t8_eclass.h>

T8_EXTERN_C_BEGIN ();

Expand Down Expand Up @@ -69,7 +70,7 @@ extern const int t8_dtri_parenttype_Iloc_to_type[2][4];
extern const int t8_dtri_parenttype_Iloc_to_cid[2][4];

/** Store the indices of the corner of each face of a triangle. */
extern const int t8_dtri_face_corner[3][2];
#define t8_dtri_face_corner t8_face_vertex_to_tree_vertex[T8_ECLASS_TRIANGLE]

/** Store the indices of the faces of each corner of a triangle. */
extern const int t8_dtri_corner_face[3][2];
Expand Down

0 comments on commit e8dae5c

Please sign in to comment.