]> https://gitweb.dealii.org/ - dealii.git/commitdiff
DoFTools::make_periodicity_constraints move asserts 14091/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 4 Jul 2022 17:21:02 +0000 (19:21 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 4 Jul 2022 17:21:02 +0000 (19:21 +0200)
source/dofs/dof_tools_constraints.cc

index 478f3628e739c3a0c990d719e9da923846d0d839..00e35675a77324bc2c96fdb62eb176aec699916d 100644 (file)
@@ -2298,14 +2298,6 @@ namespace DoFTools
     const std::vector<unsigned int> &            first_vector_components,
     const number                                 periodicity_factor)
   {
-    // TODO: the implementation makes the assumption that all faces have the
-    // same number of dofs
-    AssertDimension(
-      face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1);
-    AssertDimension(
-      face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1);
-    const unsigned int face_no = 0;
-
     static const int dim      = FaceIterator::AccessorType::dimension;
     static const int spacedim = FaceIterator::AccessorType::space_dimension;
 
@@ -2339,6 +2331,12 @@ namespace DoFTools
 #ifdef DEBUG
     if (!face_1->has_children())
       {
+        // TODO: the implementation makes the assumption that all faces have the
+        // same number of dofs
+        AssertDimension(
+          face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1);
+        const unsigned int face_no = 0;
+
         Assert(face_1->n_active_fe_indices() == 1, ExcInternalError());
         const unsigned int n_dofs_per_face =
           face_1->get_fe(face_1->nth_active_fe_index(0))
@@ -2357,6 +2355,12 @@ namespace DoFTools
 
     if (!face_2->has_children())
       {
+        // TODO: the implementation makes the assumption that all faces have the
+        // same number of dofs
+        AssertDimension(
+          face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1);
+        const unsigned int face_no = 0;
+
         Assert(face_2->n_active_fe_indices() == 1, ExcInternalError());
         const unsigned int n_dofs_per_face =
           face_2->get_fe(face_2->nth_active_fe_index(0))
@@ -2459,6 +2463,11 @@ namespace DoFTools
             face_2->get_fe(face_2->nth_active_fe_index(0)) :
             face_1->get_fe(face_1->nth_active_fe_index(0));
 
+        // TODO: the implementation makes the assumption that all faces have the
+        // same number of dofs
+        AssertDimension(fe.n_unique_faces(), 1);
+        const unsigned int face_no = 0;
+
         const unsigned int n_dofs_per_face = fe.n_dofs_per_face(face_no);
 
         // Sometimes we just have nothing to do (for all finite elements, or

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.