-
Notifications
You must be signed in to change notification settings - Fork 102
Update usage of {Path,Surface}OrientationInfo #1196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gijswl
wants to merge
8
commits into
Ferrite-FEM:master
Choose a base branch
from
gijswl:facedofs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
993ca90
Use OrientationInfo instead of {Path,Surface}OrientationInfo everywhere
gijswl bcea5d1
Update devdocs
gijswl 68fb8a7
Revert "Update devdocs"
gijswl 2cf0c52
Use {Path,Surface}OrientationInfo instead of OrientationInfo
gijswl 099af61
Runic
gijswl 8ede638
Correctly return face orientation in sortface
gijswl a1befed
Unit tests for orientations
gijswl a47ad6a
Review feedback
gijswl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| @testset "Orientations" begin | ||
| @testset "PathOrientationInfo" begin | ||
| # Path [a, b], flipped | ||
| test_paths = [ | ||
| ((1, 2), false), # 1 -> 2, regular | ||
| ((2, 1), true), # 2 -> 1, inverted | ||
| ((5, 1), true), # 5 -> 1, inverted | ||
| ((3, 5), false), # 3 -> 5, regular | ||
| ] | ||
|
|
||
| for (path, flipped) in test_paths | ||
| orientation = Ferrite.PathOrientationInfo(path) | ||
|
|
||
| @test orientation.flipped == flipped | ||
| end | ||
| end | ||
|
|
||
| @testset "SurfaceOrientationInfo" begin | ||
| # Surface [facenodes], flipped, shift_index | ||
| test_surfaces = [ | ||
| # 2 | ||
| # | \ | ||
| # 3 - 1, regular, rotation = 0 deg | ||
| ((1, 2, 3), false, 0), | ||
| # 1 | ||
| # | \ | ||
| # 2 - 3, regular, rotation = 120 deg | ||
| ((3, 1, 2), false, 1), | ||
| # 3 | ||
| # | \ | ||
| # 1 - 2, regular, rotation = 240 deg | ||
| ((2, 3, 1), false, 2), | ||
| # 3 | ||
| # | \ | ||
| # 2 - 1, inverted, rotation = 0 deg | ||
| ((1, 3, 2), true, 0), | ||
| # 1 | ||
| # | \ | ||
| # 3 - 2, inverted, rotation = 120 deg | ||
| ((2, 1, 3), true, 1), | ||
| # 2 | ||
| # | \ | ||
| # 1 - 3, inverted, rotation = 240 deg | ||
| ((3, 2, 1), true, 2), | ||
| # 4 - 3 | ||
| # | | | ||
| # 1 - 2, regular, rotation = 0 deg | ||
| ((1, 2, 3, 4), false, 0), | ||
| # 2 - 3 | ||
| # | | | ||
| # 1 - 4, inverted, rotation = 0 deg | ||
| ((1, 4, 3, 2), true, 0), | ||
| # 3 - 2 | ||
| # | | | ||
| # 4 - 1, regular, rotation = 90 deg | ||
| ((4, 1, 2, 3), false, 1), | ||
| # 1 - 2 | ||
| # | | | ||
| # 4 - 3, inverted, rotation = 270 deg | ||
| ((4, 3, 2, 1), true, 3), | ||
| ] | ||
|
|
||
|
|
||
| for (surface, flipped, shift_index) in test_surfaces | ||
| orientation = Ferrite.SurfaceOrientationInfo(surface) | ||
|
|
||
| @test orientation.flipped == flipped | ||
| @test orientation.shift_index == shift_index | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it is less straight forward to store if the edge is flipped, than if it is
regular. Personally, I would preferpositive, or perhaps we even can save simply asand return
Int8fromget_face_directionandget_edge_direction. Probably, we won't see any significant performance difference by usingInt8vsInt, don't recall the profiles of the dof distribution now if this logic takes some significant portion of the time...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reagardng the dof distribution time, it is mostly spend in the hash table lookups, as we do not materialize the mesh entities explicitly. But I think just a boolean is clearer here. Also, I would expect that
flipped = truewould mean2--->1.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A "flip" is indeed the terminology used in the Scroggs paper to indicate that the nodes are swapped compared to the "normal" orientation. So,
1 --> 2isflipped = false2 --> 1isflipped = trueThis is the same way
OrientationInfoalready worked and in line with the paper. The previous definition ofregular::Boolwas opposite, of course. Can you check whether the tests make sense following this definition?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now that the docstring was not updated yet.
Refer to the latest commit for the corrected definition.