]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make control flow more obvious.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 18 Jun 2017 01:18:55 +0000 (19:18 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Jun 2017 03:48:48 +0000 (21:48 -0600)
source/dofs/dof_handler.cc

index 32d36747ceaba6e5d4a40bd79675a279ddc3daea..a8faedbd54dc40141235b21758db8c96b8f8d1cd 100644 (file)
@@ -1557,18 +1557,18 @@ void DoFHandler<dim, spacedim>::MGVertexDoFs::init (const unsigned int cl,
   coarsest_level = cl;
   finest_level   = fl;
 
-  if (cl > fl)
-    return;
-
-  const unsigned int n_levels = finest_level - coarsest_level + 1;
-  const unsigned int n_indices = n_levels * dofs_per_vertex;
+  if (coarsest_level <= finest_level)
+    {
+      const unsigned int n_levels = finest_level - coarsest_level + 1;
+      const unsigned int n_indices = n_levels * dofs_per_vertex;
 
-  indices = new types::global_dof_index[n_indices];
-  std::fill (indices, indices+n_indices, DoFHandler<dim,spacedim>::invalid_dof_index);
+      indices = new types::global_dof_index[n_indices];
+      std::fill (indices, indices+n_indices, DoFHandler<dim,spacedim>::invalid_dof_index);
 
-  indices_offset = new types::global_dof_index[n_levels];
-  for (unsigned int i = 0; i < n_levels; ++i)
-    indices_offset[i] = i * dofs_per_vertex;
+      indices_offset = new types::global_dof_index[n_levels];
+      for (unsigned int i = 0; i < n_levels; ++i)
+        indices_offset[i] = i * dofs_per_vertex;
+    }
 }
 
 

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.