From 1096353c171c350807d7deb154fec66caecb0ebc Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 17 Jun 2017 19:18:55 -0600 Subject: [PATCH] Make control flow more obvious. --- source/dofs/dof_handler.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 32d36747ce..a8faedbd54 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1557,18 +1557,18 @@ void DoFHandler::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::invalid_dof_index); + indices = new types::global_dof_index[n_indices]; + std::fill (indices, indices+n_indices, DoFHandler::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; + } } -- 2.39.5