Skip to content
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

Fix two small things in FiniteElement. #14692

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions source/fe/fe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,18 +679,16 @@ FiniteElement<dim, spacedim>::adjust_quad_dof_index_for_face_orientation(
AssertIndexRange(index, this->n_dofs_per_quad(face));
Assert(adjust_quad_dof_index_for_face_orientation_table
[this->n_unique_quads() == 1 ? 0 : face]
.n_elements() == (this->reference_cell().face_reference_cell(
face) == ReferenceCells::Quadrilateral ?
8 :
6) *
this->n_dofs_per_quad(face),
.n_elements() ==
(this->reference_cell().n_face_orientations(face)) *
this->n_dofs_per_quad(face),
ExcInternalError());
return index +
adjust_quad_dof_index_for_face_orientation_table
[this->n_unique_quads() == 1 ? 0 : face](index,
(face_orientation ? 4 : 0) +
(face_flip ? 2 : 0) +
(face_rotation ? 1 : 0));
(face_orientation ? 1 : 0) +
(face_rotation ? 2 : 0) +
(face_flip ? 4 : 0));
Copy link
Member

Choose a reason for hiding this comment

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

This is apparently not the same encoding used in other places in this class -- judging by the fact that a number of tests fail. You're completely correct that we ought to not do the en/decoding of these flags by hand, but using the corresponding functions in ReferenceCell. Maybe the right step would be to just search through the entire file for face_flip or some such, and replace all of these hand encodings by what ReferenceCell offers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely - this would be a good time to simultaneously make our encodings uniform and do the follow-ups listed in #12878. We have at least three different orientation conventions in the library and I would much rather have one.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, three is too many when there are really only 6 possible (reasonable) encodings of three bits of information...

}


Expand Down