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
Provide internal function for faster access of 3D cell->line_index #13924
Merged
masterleinad
merged 1 commit into
dealii:master
from
kronbichler:faster_access_to_lines
Jul 13, 2022
Merged
Provide internal function for faster access of 3D cell->line_index #13924
masterleinad
merged 1 commit into
dealii:master
from
kronbichler:faster_access_to_lines
Jul 13, 2022
Conversation
This file contains 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
kronbichler
force-pushed
the
faster_access_to_lines
branch
from
June 8, 2022 06:43
ef4f3fb
to
d4d2cd4
Compare
kronbichler
force-pushed
the
faster_access_to_lines
branch
3 times, most recently
from
June 8, 2022 10:43
ccb91af
to
f749c7f
Compare
This was referenced Jun 9, 2022
This PR should wait for #14066, which introduces the function used here in the appropriate place. |
peterrum
approved these changes
Jun 29, 2022
I now switched to the new function and applied it in a few more places. |
kronbichler
force-pushed
the
faster_access_to_lines
branch
from
June 29, 2022 19:40
f749c7f
to
b0bb30f
Compare
kronbichler
force-pushed
the
faster_access_to_lines
branch
from
June 29, 2022 21:49
b0bb30f
to
21da22a
Compare
peterrum
approved these changes
Jul 3, 2022
@kronbichler You need to fix the merge conflict. |
kronbichler
force-pushed
the
faster_access_to_lines
branch
from
July 4, 2022 10:13
21da22a
to
ab4fc47
Compare
Rebased. |
kronbichler
force-pushed
the
faster_access_to_lines
branch
from
July 4, 2022 10:13
ab4fc47
to
2fea58a
Compare
masterleinad
approved these changes
Jul 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When looking at a profiler, I observed that
cell->line_index(l)
andcell->line(l)
in 3D is pretty expensive. The main reason is that the functiondealii/include/deal.II/grid/tria_accessor.templates.h
Lines 623 to 630 in f262a26
The use of course gets a bit more verbose. There are more places that could be changed in the
tria.cc
file, but I wanted to show three representative cases in this PR and defer other changes to later PRs. The first one is a bad one (but the one actually triggering my investigations), where we look up the lines to set some refinement information: Here, I need to expand the code (and change the indentation, so look at this without whitespace changes) to construct the line iterator from the line index, with which I can finally work. The other two cases are more gentle, all that changes is the fact that I need to allocate an intermediate array (fixed size).This could potentially be used in a number of places, such as theget_dof_indices
function, so I wonder whether we should move theget_line_indices_of_cell
function (or any better name we could think of) intoTriaAccessor
to have it available there.Note that my current attempt only optimizes the case for
hex
reference cells, tetrahedra and similar are still using the old code. I am pretty sure this could be optimized as well, but I have no good cases to look at.