Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Permutation computation refactoring #3223

Merged
merged 7 commits into from
May 20, 2024

Conversation

chrisrichardson
Copy link
Contributor

@chrisrichardson chrisrichardson commented May 18, 2024

Generalise face permutation computation to get ready for mixed topology meshes.

  • reduce duplicated code in face permutation computation for tet, hex
  • adds computation for prism, (should work for pyramid too)

@chrisrichardson chrisrichardson requested a review from jpdean May 18, 2024 08:52
@chrisrichardson
Copy link
Contributor Author

Would be good to add a test - if anyone can think of a good one @mscroggs @jpdean ?


// If min_v is 2 or 3, swap. Why?
if (min_v == 2 or min_v == 3)
min_v = 5 - min_v;
Copy link
Member

Choose a reason for hiding this comment

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

To answer the why: min_v wants to be the number of vertices anticlockwise away the minimum numbered vertex is. If the vertices were numbered:

3 -- 2
|    |
0 -- 1

We wouldn't need to do the swap, but as we use the numbering:

2 -- 3
|    |
0 -- 1

we therefore need the swap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mscroggs . Maybe you can add something in-line to document this.

@chrisrichardson
Copy link
Contributor Author

Fixes issue #3208

@chrisrichardson chrisrichardson enabled auto-merge May 20, 2024 08:59
@chrisrichardson chrisrichardson added this pull request to the merge queue May 20, 2024
Merged via the queue into main with commit e64178c May 20, 2024
28 checks passed
@chrisrichardson chrisrichardson deleted the chris/permutation-computation-refactoring branch May 20, 2024 09:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants