From 428a4fa2496dd500bc70b44b5b9fd00ccc0db18c Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 17 Jan 2023 13:18:27 -0500 Subject: [PATCH] Use ReferenceCell::n_face_orientations() in a few more places. --- source/fe/fe.cc | 24 ++++++++++-------------- source/fe/fe_poly_tensor.cc | 13 ++++--------- source/fe/fe_q_base.cc | 8 +++++--- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/source/fe/fe.cc b/source/fe/fe.cc index c913633c25..43a902996d 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -677,20 +677,16 @@ FiniteElement::adjust_quad_dof_index_for_face_orientation( // the function should also not have been // called 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), - 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)); + const auto table_n = this->n_unique_quads() == 1 ? 0 : face; + Assert( + adjust_quad_dof_index_for_face_orientation_table[table_n].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[table_n]( + index, + (face_orientation ? 4 : 0) + (face_flip ? 2 : 0) + + (face_rotation ? 1 : 0)); } diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index cf6bdb1377..343efc6226 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -206,10 +206,7 @@ FE_PolyTensor::FE_PolyTensor( { adjust_quad_dof_sign_for_face_orientation_table[f] = Table<2, bool>(this->n_dofs_per_quad(f), - this->reference_cell().face_reference_cell(f) == - ReferenceCells::Quadrilateral ? - 8 : - 6); + this->reference_cell().n_face_orientations(f)); adjust_quad_dof_sign_for_face_orientation_table[f].fill(false); } } @@ -259,11 +256,9 @@ FE_PolyTensor::adjust_quad_dof_sign_for_face_orientation( AssertIndexRange(index, this->n_dofs_per_quad(face)); Assert(adjust_quad_dof_sign_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 adjust_quad_dof_sign_for_face_orientation_table diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 651670c48d..4744bc38fb 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -1027,9 +1027,11 @@ FE_Q_Base::initialize_quad_dof_index_permutation() AssertDimension(this->n_unique_faces(), 1); const unsigned int face_no = 0; - Assert(this->adjust_quad_dof_index_for_face_orientation_table[0] - .n_elements() == 8 * this->n_dofs_per_quad(face_no), - ExcInternalError()); + Assert( + this->adjust_quad_dof_index_for_face_orientation_table[0].n_elements() == + this->reference_cell().n_face_orientations(face_no) * + this->n_dofs_per_quad(face_no), + ExcInternalError()); const unsigned int n = q_degree - 1; Assert(n * n == this->n_dofs_per_quad(face_no), ExcInternalError()); -- 2.39.5