-
Notifications
You must be signed in to change notification settings - Fork 295
Add orientation-dependent caching checks and option to disable caching #4119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
146b45b
Add option to refine the mesh in Vector FE Ex.3
nmnobre 205bd68
Run Vector FE Ex.3 with refinement
nmnobre 90d4140
Update .html for Vector FE Ex.3
nmnobre 87ac97d
Refactor caching code slightly (similar semantics)
nmnobre 40f00e2
Add option to disable caching in FE::reinit()
nmnobre 4ce4ead
Define Elem::face_index_range()
nmnobre 76f0aa4
Check orientation when caching for required families
nmnobre 18e6aae
Rename FE::match() to FE::matches_cache()
nmnobre 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
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
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.
For correctness: shouldn't this be
&=
rather than=
? Likewise in the for loops below?And if that's right, then, for performance: should we bother tracking
m
to return it? If only 99% of cached geometry and orientation matches then we can't reuse cached data, so we might as wellreturn false
as soon as we see any mismatch orreturn true
at the end otherwise.And either way, if I'm right and we don't want to merge this without changes: how about
matches_cache()
for the name?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.
We know
m
is true in the loop bodies, so the assignment is equivalent.Yeah, I thought about that, but I really liked the symmetry with the code in the sister method. Besides, the loops short-circuit if
m
is false. For orientation-independent elements this means the code should be optimal (right?), for orientation-dependent elements, I can checkm
in the if-statement if you think it's needed.I can change the name anyway. :)
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.
Oh, man, I missed the short-circuiting in the for loop parentheses. This is a really weird idiom but yeah, looks correct, and it's basically optimal - if you break out of the first for loop you're still requesting 2 unnecessary tests of m, but I'll bet the optimizer figures that out and gives the same code regardless, and either way you're not doing any unnecessary floating-point.
Damn it, I knew that if I thought I caught you in a correctness error then I must have overlooked something.