]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use ReferenceCell::n_face_orientations() in a few more places. 14694/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 17 Jan 2023 18:18:27 +0000 (13:18 -0500)
committerDavid Wells <drwells@email.unc.edu>
Tue, 17 Jan 2023 18:18:58 +0000 (13:18 -0500)
source/fe/fe.cc
source/fe/fe_poly_tensor.cc
source/fe/fe_q_base.cc

index c913633c25c1f58fb59a16fc32b646f2d0a7c041..43a902996d6e0d199dad6f9ef390363be69a3fd1 100644 (file)
@@ -677,20 +677,16 @@ FiniteElement<dim, spacedim>::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));
 }
 
 
index cf6bdb13777879025df6c9567bdd7ff8ebfe097d..343efc62264a94b389199ef6cf20a2bad03cfccd 100644 (file)
@@ -206,10 +206,7 @@ FE_PolyTensor<dim, spacedim>::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<dim, spacedim>::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
index 651670c48da1f39729c9a2b44d9cdc1991105642..4744bc38fb2096671edbd502d3bbe5101e5cfa14 100644 (file)
@@ -1027,9 +1027,11 @@ FE_Q_Base<dim, spacedim>::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());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.