Skip to content

Commit

Permalink
Fix MOAB canonical ordering during element splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
connoramoreno committed Oct 10, 2024
1 parent ba23085 commit 64ebcb6
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions parastell/source_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,18 @@ def _create_tets_from_hex(self, s_idx, theta_idx, phi_idx):
]

# Define MOAB canonical ordering of hexahedron vertex indices
# Ordering follows right hand rule such that the fingers curl around
# one side of the tetrahedron and the thumb points to the remaining
# vertex. The vertices are ordered such that those on the side are
# first, ordered clockwise relative to the thumb, followed by the
# remaining vertex at the end of the thumb.
# See Moreno, Bader, Wilson 2024 for hexahedron splitting
hex_canon_ids = [
[idx_list[0], idx_list[3], idx_list[1], idx_list[4]],
[idx_list[7], idx_list[4], idx_list[6], idx_list[3]],
[idx_list[2], idx_list[1], idx_list[3], idx_list[6]],
[idx_list[5], idx_list[6], idx_list[4], idx_list[1]],
[idx_list[3], idx_list[1], idx_list[4], idx_list[6]],
[idx_list[0], idx_list[2], idx_list[1], idx_list[5]],
[idx_list[0], idx_list[3], idx_list[2], idx_list[7]],
[idx_list[0], idx_list[7], idx_list[5], idx_list[4]],
[idx_list[7], idx_list[2], idx_list[5], idx_list[6]],
[idx_list[0], idx_list[2], idx_list[5], idx_list[7]],
]

for vertex_ids in hex_canon_ids:
Expand Down Expand Up @@ -395,10 +401,16 @@ def _create_tets_from_wedge(self, theta_idx, phi_idx):
]

# Define MOAB canonical ordering of wedge vertex indices
# Ordering follows right hand rule such that the fingers curl around
# one side of the tetrahedron and the thumb points to the remaining
# vertex. The vertices are ordered such that those on the side are
# first, ordered clockwise relative to the thumb, followed by the
# remaining vertex at the end of the thumb.
# See Moreno, Bader, Wilson 2024 for wedge splitting
wedge_canon_ids = [
[idx_list[1], idx_list[2], idx_list[4], idx_list[0]],
[idx_list[5], idx_list[4], idx_list[2], idx_list[3]],
[idx_list[0], idx_list[2], idx_list[4], idx_list[3]],
[idx_list[0], idx_list[2], idx_list[1], idx_list[3]],
[idx_list[3], idx_list[2], idx_list[4], idx_list[5]],
[idx_list[3], idx_list[2], idx_list[1], idx_list[4]],
]

for vertex_ids in wedge_canon_ids:
Expand Down

0 comments on commit 64ebcb6

Please sign in to comment.