void SubdomainPartitioner::_do_partition (MeshBase & mesh,
                                          const unsigned int n)
{
  libmesh_assert_greater (n, 0);

  // Check for an easy return.  If the user has not specified any
  // entries in the chunks vector, we just do a single partitioning.
  if ((n == 1) || chunks.empty())
    {
      this->single_partition (mesh);
      return;
    }

  // Now actually do the partitioning.
  LOG_SCOPE ("_do_partition()", "SubdomainPartitioner");

  // For each chunk, construct an iterator range for the set of
  // subdomains in question, and pass it to the internal Partitioner.
  for (std::size_t c=0; c<chunks.size(); ++c)
    {
      MeshBase::element_iterator
        it = mesh.active_subdomain_set_elements_begin(chunks[c]),
        end = mesh.active_subdomain_set_elements_end(chunks[c]);

      _internal_partitioner->partition_range(mesh, it, end, n);
    }
}