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
Cleanups in some hp::DoFHandler functions. #7233
Conversation
/run-tests |
Would appreciate a quick turn-around on this one. |
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.
Looks reasonable. I only have minor, cosmetic comments, so we can skip them if you are short on time.
source/hp/dof_handler.cc
Outdated
// allocate offsets for all faces, though only the active | ||
// ones will have a non-invalid value later on | ||
face_dof_offsets = | ||
std::vector<unsigned int>(dof_handler.tria->n_raw_faces(), | ||
(unsigned int)(-1)); | ||
static_cast<unsigned int>(-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.
Would it be better to use numbers::invalid_unsigned_int
here?
// 1 times dofs_per_face dofs, and one stop index | ||
n_face_slots += | ||
1 + | ||
dof_handler.get_fe(cell->active_fe_index()) | ||
.template n_dofs_per_object<dim - 1>() + | ||
1; | ||
|
||
// otherwise we do indeed need two sets, i.e. two | ||
// Otherwise we do indeed need two sets, i.e. two | ||
// active_fe_indices, two sets of dofs, and one stop | ||
// index: | ||
else |
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.
Would you mind adding the same comments here?
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.
(that is, lines 454-460)
// allocate offsets for all faces, though only the active | ||
// ones will have a non-invalid value later on | ||
face_dof_offsets = | ||
std::vector<unsigned int>(dof_handler.tria->n_raw_faces(), | ||
(unsigned int)(-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.
Should not we use numbers::invalid_unsigned_int?
Also, if you are feeling fancy, we could use
instead of using user flags. |
On 09/26/2018 03:31 PM, David Wells wrote:
Also, if you are feeling fancy, we could use
|for (const auto &face : triangulation.active_face_iterators() |
instead of using user flags.
Nope, I can't do that because I need to get the two adjacent cells to
find out what elements live there. There is no way to go from faces to
cells :-(
|
Aw rats, you're right. |
I made the requested changes and also created a small array to hold the two This passes all |
// Store the two indices we will have to deal with. | ||
unsigned int active_fe_indices[2] = { | ||
cell->active_fe_index(), | ||
cell->neighbor(face)->active_fe_index()}; |
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.
👍
/run-tests |
This is in preparation for a patch to resolve #7162 after
@marcfehling explained the bug to me. That patch is coming
next but I thought I'd get the clean-ups out of the way
already given that these cleanups significantly obscure
what the real patch is going to be.
In pursuance of #3511.