]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reorder statements to avoid some computations when not necessary.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 26 Sep 2017 21:23:25 +0000 (15:23 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 27 Sep 2017 14:49:44 +0000 (08:49 -0600)
source/dofs/dof_tools_constraints.cc

index c443e69afa52c30c5939c76a46e5766450ddf16e..5ad12727345444f17b8ec05e832bdd1b6b9c09d7 100644 (file)
@@ -1476,14 +1476,15 @@ namespace DoFTools
                         cell->face(face)->get_dof_indices (master_dofs,
                                                            cell->active_fe_index ());
 
-                        slave_dofs.resize (neighbor->get_fe().dofs_per_face);
-                        cell->face(face)->get_dof_indices (slave_dofs,
-                                                           neighbor->active_fe_index ());
-
                         // break if the n_master_dofs == 0, because we are
                         // attempting to constrain to an element that has
                         // no face dofs
-                        if (master_dofs.size() == 0) break;
+                        if (master_dofs.size() == 0)
+                          break;
+
+                        slave_dofs.resize (neighbor->get_fe().dofs_per_face);
+                        cell->face(face)->get_dof_indices (slave_dofs,
+                                                           neighbor->active_fe_index ());
 
                         // make sure the element constraints for this face
                         // are available

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.