From bbf00ddd3bc9f87d216d55615d048b5e9712cf48 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 4 Dec 2014 13:57:06 -0600 Subject: [PATCH] DoFRenumbering::Cuthill_McKee failed in parallel when a processor had no dofs. --- doc/news/changes.h | 7 +++++++ source/dofs/dof_renumbering.cc | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index 17af13643f..8feeb75a28 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -340,6 +340,13 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: Calling DoFRenumbering::Cuthill_McKee threw an exception + whenever one of the processors of a parallel triangulation did not own + any degrees of freedom. +
    + (Michal Wichrowski, Wolfgang Bangerth, 2014/12/04) +
  2. +
  3. Fixed: Serializing an object of type DoFHandler did not work without including additional header files.
    diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index a5085e250a..f1f986a5de 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -378,6 +378,13 @@ namespace DoFRenumbering const bool use_constraints, const std::vector &starting_indices) { + // see if there is anything to do at all or whether we can skip the work on this processor + if (dof_handler.locally_owned_dofs().n_elements() == 0) + { + Assert (new_indices.size() == 0, ExcInternalError()); + return; + } + // make the connection graph. in 2d/3d use an intermediate compressed // sparsity pattern since the we don't have very good estimates for // max_couplings_between_dofs() in 3d and this then leads to excessive @@ -392,7 +399,9 @@ namespace DoFRenumbering IndexSet locally_owned = dof_handler.locally_owned_dofs(); SparsityPattern sparsity; - if (DH::dimension < 2) + + // otherwise compute the Cuthill-McKee permutation + if (DH::dimension == 1) { sparsity.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(), -- 2.39.5