From b3b77ba3f2215c9fa5e33b7ea5aee8797bcbecb3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 21 Jun 2017 03:38:16 -0600 Subject: [PATCH] Rename a variable for greater clarity. --- source/dofs/dof_handler_policy.cc | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index db6e1098c9..d4e88206aa 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -2280,7 +2280,7 @@ namespace internal const unsigned int n_levels = tr->n_global_levels(); for (unsigned int level = 0; level < n_levels; ++level) { - NumberCache &number_cache = number_caches[level]; + NumberCache &level_number_cache = number_caches[level]; //* 1. distribute on own subdomain const unsigned int n_initial_local_dofs = @@ -2325,27 +2325,27 @@ namespace internal // make indices consecutive - number_cache.n_locally_owned_dofs = 0; + level_number_cache.n_locally_owned_dofs = 0; for (std::vector::iterator it=renumbering.begin(); it!=renumbering.end(); ++it) if (*it != DoFHandler::invalid_dof_index) - *it = number_cache.n_locally_owned_dofs++; + *it = level_number_cache.n_locally_owned_dofs++; //* 3. communicate local dofcount and shift ids to make // them unique - number_cache.n_locally_owned_dofs_per_processor.resize(n_cpus); + level_number_cache.n_locally_owned_dofs_per_processor.resize(n_cpus); - int ierr = MPI_Allgather ( &number_cache.n_locally_owned_dofs, + int ierr = MPI_Allgather ( &level_number_cache.n_locally_owned_dofs, 1, DEAL_II_DOF_INDEX_MPI_TYPE, - &number_cache.n_locally_owned_dofs_per_processor[0], + &level_number_cache.n_locally_owned_dofs_per_processor[0], 1, DEAL_II_DOF_INDEX_MPI_TYPE, tr->get_communicator()); AssertThrowMPI(ierr); const dealii::types::global_dof_index - shift = std::accumulate (number_cache + shift = std::accumulate (level_number_cache .n_locally_owned_dofs_per_processor.begin(), - number_cache + level_number_cache .n_locally_owned_dofs_per_processor.begin() + tr->locally_owned_subdomain(), static_cast(0)); @@ -2368,43 +2368,43 @@ namespace internal false); // now a little bit of housekeeping - number_cache.n_global_dofs - = std::accumulate (number_cache + level_number_cache.n_global_dofs + = std::accumulate (level_number_cache .n_locally_owned_dofs_per_processor.begin(), - number_cache + level_number_cache .n_locally_owned_dofs_per_processor.end(), static_cast(0)); - number_cache.locally_owned_dofs = IndexSet(number_cache.n_global_dofs); - number_cache.locally_owned_dofs + level_number_cache.locally_owned_dofs = IndexSet(level_number_cache.n_global_dofs); + level_number_cache.locally_owned_dofs .add_range(shift, - shift+number_cache.n_locally_owned_dofs); - number_cache.locally_owned_dofs.compress(); + shift+level_number_cache.n_locally_owned_dofs); + level_number_cache.locally_owned_dofs.compress(); // fill global_dof_indexsets - number_cache.locally_owned_dofs_per_processor.resize(n_cpus); + level_number_cache.locally_owned_dofs_per_processor.resize(n_cpus); { dealii::types::global_dof_index lshift = 0; for (unsigned int i=0; ilocally_owned_subdomain()].n_elements() == - number_cache.n_locally_owned_dofs, + level_number_cache.n_locally_owned_dofs, ExcInternalError()); - Assert(!number_cache.locally_owned_dofs_per_processor + Assert(!level_number_cache.locally_owned_dofs_per_processor [tr->locally_owned_subdomain()].n_elements() || - number_cache.locally_owned_dofs_per_processor + level_number_cache.locally_owned_dofs_per_processor [tr->locally_owned_subdomain()].nth_index_in_set(0) == shift, ExcInternalError()); -- 2.39.5