Skip to content

Commit

Permalink
adapt edge numeration in curved hex geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-elsweijer committed Aug 10, 2023
1 parent e8a4910 commit 498bb69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions src/t8_geometry/t8_geometry_implementations/t8_geometry_occ.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@

/* *INDENT-OFF* */
const int t8_edge_vertex_to_tree_vertex[T8_ECLASS_MAX_EDGES][2] = {
{0, 1}, {2, 3}, {4, 5}, {6, 7}, {0, 2}, {4, 6},
{1, 3}, {5, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7} /* hex */
{0, 1}, {2, 3}, {4, 5}, {6, 7}, {0, 2}, {1, 3},
{4, 6}, {5, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7} /* hex */
};

const int t8_edge_to_face[T8_ECLASS_MAX_EDGES][2] = {
{2, 4}, {3, 4}, {2, 5}, {3, 5}, {0, 4}, {0, 5},
{1, 4}, {1, 5}, {0, 2}, {1, 2}, {0, 3}, {1, 3} /* hex */
{2, 4}, {3, 4}, {2, 5}, {3, 5}, {0, 4}, {1, 4},
{0, 5}, {1, 5}, {0, 2}, {1, 2}, {0, 3}, {1, 3} /* hex */
};

const int
t8_face_edge_to_tree_edge[T8_ECLASS_MAX_FACES][T8_ECLASS_MAX_EDGES_2D] = {
{8, 10, 4, 5}, {9, 11, 6, 7}, {8, 9, 0, 2},
{10, 11, 1, 3}, {4, 6, 0, 1}, {5, 7, 2, 3} /* hex */
{8, 10, 4, 6}, {9, 11, 5, 7}, {8, 9, 0, 2},
{10, 11, 1, 3}, {4, 5, 0, 1}, {6, 7, 2, 3} /* hex */
};
/* *INDENT-ON* */

Expand Down Expand Up @@ -726,14 +726,14 @@ t8_geometry_occ::t8_geom_evaluate_occ_hex (t8_cmesh_t cmesh,
* direction of ref_coord i_edge / 4. Therefore, we can use ref_coords[i_edge / 4] for the interpolation.
* 6 -------E3------- 7
* /| /|
* E5 | E7 |
* E6 | E7 |
* / E10 / E11
* / | / | z y
* 4 -------E2------- 5 | |/
* | | | | x-- x
* | 2 -------E1---|--- 3
* E8 / E9 /
* | E4 | E6
* | E4 | E5
* | / | /
* |/ |/
* 0 -------E0------- 1
Expand Down Expand Up @@ -807,11 +807,13 @@ t8_geometry_occ::t8_geom_evaluate_occ_hex (t8_cmesh_t cmesh,
* The edges are indexed so that all edges which satisfy i_edge % 4 == 0
* have to multiplied with the inversed (1 - ref_coord)
* coordinate. All edges which satisfy i_edge % 4 == 1 have to multiplied with one
* inversed ref_coord and so forth... */
* inversed ref_coord and so forth...
* An exception are edge 5 and 6, which have to be switched */

/* *INDENT-OFF* */
double scaling_factor = 0;
switch (i_edge % 4) {
const int temp_i_edge = i_edge == 5 ? 6 : i_edge == 6 ? 5 : i_edge;
switch (temp_i_edge % 4) {
case 0:
scaling_factor = (1 - ref_coords[(edge_direction + 1) % 3])
* (1 - ref_coords[(edge_direction + 2) % 3]);
Expand Down
4 changes: 2 additions & 2 deletions test/t8_geometry/t8_gtest_geometry_occ.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ TEST (t8_gtest_geometry_occ, linked_edges)
0, M_PI / 2, 0, // Edge 2
0, M_PI, 0, // Edge 3
M_PI / 2, 0, 0, // Edge 4
0, M_PI, -M_PI / 2, // Edge 5
-M_PI / 2, 0, 0, // Edge 6
-M_PI / 2, 0, 0, // Edge 5
0, M_PI, -M_PI / 2, // Edge 6
0, M_PI, M_PI / 2, // Edge 7
-M_PI / 2, M_PI / 2, M_PI / 2, // Edge 8
M_PI / 2, M_PI / 2, -M_PI / 2, // Edge 9
Expand Down

0 comments on commit 498bb69

Please sign in to comment.