]> https://gitweb.dealii.org/ - dealii.git/commitdiff
address comments 7614/head
authorMatthias Maier <tamiko@43-1.org>
Sun, 20 Jan 2019 23:24:26 +0000 (17:24 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sun, 20 Jan 2019 23:43:07 +0000 (17:43 -0600)
source/dofs/dof_tools_constraints.cc

index fa4ee20c8d34cf7815c79e21a9ce7bf720d5770d..3c098a614d1ba9bfb1efb6790af046b32e00a44b 100644 (file)
@@ -1839,7 +1839,8 @@ namespace DoFTools
           const unsigned int dofs_per_face =
             face_1->get_fe(face_1->nth_active_fe_index(0)).dofs_per_face;
           FullMatrix<double> child_transformation(dofs_per_face, dofs_per_face);
-          FullMatrix<double> subface_interp(dofs_per_face, dofs_per_face);
+          FullMatrix<double> subface_interpolation(dofs_per_face,
+                                                   dofs_per_face);
 
           for (unsigned int c = 0; c < face_2->n_children(); ++c)
             {
@@ -1847,8 +1848,8 @@ namespace DoFTools
               // interpolated from face_1 to face_2 by multiplying from the left
               // with the one that interpolates from face_2 to its child
               const auto &fe = face_1->get_fe(face_1->nth_active_fe_index(0));
-              fe.get_subface_interpolation_matrix(fe, c, subface_interp);
-              subface_interp.mmult(child_transformation, transformation);
+              fe.get_subface_interpolation_matrix(fe, c, subface_interpolation);
+              subface_interpolation.mmult(child_transformation, transformation);
 
               set_periodicity_constraints(face_1,
                                           face_2->child(c),
@@ -1973,28 +1974,25 @@ namespace DoFTools
           unsigned int target                  = numbers::invalid_unsigned_int;
           double       factor                  = 1.;
 
-          const double eps = 1.e-13;
-          {
-            unsigned int no_entries = 0;
-            for (unsigned int jj = 0; jj < dofs_per_face; ++jj)
-              {
-                const auto entry = transformation(i, jj);
-
-                if (std::abs(entry) > eps)
-                  {
-                    no_entries++;
-                    is_identity_constrained = true;
-                    target                  = jj;
-                    factor                  = entry;
-                  }
-
-                if (no_entries > 1)
-                  {
-                    is_identity_constrained = false;
-                    break;
-                  }
-              }
-          }
+          constexpr double eps = 1.e-13;
+          for (unsigned int jj = 0; jj < dofs_per_face; ++jj)
+            {
+              const auto entry = transformation(i, jj);
+              if (std::abs(entry) > eps)
+                {
+                  if (is_identity_constrained)
+                    {
+                      // We did encounter more than one nonzero entry, so
+                      // the dof is not identity constrained. Set the
+                      // boolean to false and break out of the for loop.
+                      is_identity_constrained = false;
+                      break;
+                    }
+                  is_identity_constrained = true;
+                  target                  = jj;
+                  factor                  = entry;
+                }
+            }
 
           // Next, we work on all constraints that are not identity
           // constraints, i.e., constraints that involve an interpolation
@@ -2043,6 +2041,9 @@ namespace DoFTools
           const auto dof_right = face_2_constrained ? dofs_2[i] : dofs_1[j];
           factor               = face_2_constrained ? 1. / factor : factor;
 
+          // Next, we try to enter the constraint
+          //   dof_left = factor * dof_right;
+
           // If both degrees of freedom are constrained, there is nothing we
           // can do. Simply continue with the next dof.
           if (affine_constraints.is_constrained(dof_left) &&

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.