]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Slightly simplify a bit of code.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Sep 2006 18:37:23 +0000 (18:37 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Sep 2006 18:37:23 +0000 (18:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@13791 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_tools.cc

index d7a231fb65a2112ec267ee02a5157b25d001ad62..fb1829ec1569a53bffc16a226395f44f8f40d26d 100644 (file)
@@ -1590,24 +1590,22 @@ namespace internal
 
        for (unsigned int col=0; col!=n_dofs_child; ++col) 
          {
-           bool constrain = true;
-
-                                            // Check if we have a constraint,
-                                            // which is already satisfied.
-           for (unsigned int i=0; i!=n_dofs_mother; ++i)
-             {
-                                                // Check for a value of
-                                                // 1.0
-               if (face_constraints (i,col) == 1.0)
-                 constrain = (dofs_mother[i] != dofs_child[col]);
-             }
-
-                                            // If this constraint is not
-                                            // automatically satisfied by
-                                            // the previous step of removing
-                                            // equivalent DoFs, add this
-                                            // constraint.
-           if (constrain)
+           bool constraint_already_satisfied = false;
+
+                                            // Check if we have an identity
+                                            // constraint, which is already
+                                            // satisfied by unification of
+                                            // the corresponding global dof
+                                            // indices
+           for (unsigned int i=0; i<n_dofs_mother; ++i)
+             if (face_constraints (i,col) == 1.0)
+               if (dofs_mother[i] == dofs_child[col])
+                 {
+                   constraint_already_satisfied = true;
+                   break;
+                 }
+
+           if (constraint_already_satisfied == false)
              { 
                constraints.add_line (dofs_child[col]);
                for (unsigned int i=0; i!=n_dofs_mother; ++i)

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.