From: Peter Munch Date: Sun, 19 Jan 2020 07:29:19 +0000 (+0100) Subject: Add assert to prevent floating point exception X-Git-Tag: v9.2.0-rc1~636^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9389%2Fhead;p=dealii.git Add assert to prevent floating point exception --- diff --git a/include/deal.II/base/mpi_compute_index_owner_internal.h b/include/deal.II/base/mpi_compute_index_owner_internal.h index ba3b542c25..973dd377ab 100644 --- a/include/deal.II/base/mpi_compute_index_owner_internal.h +++ b/include/deal.II/base/mpi_compute_index_owner_internal.h @@ -499,7 +499,10 @@ namespace Utilities const unsigned int n_procs = n_mpi_processes(comm); const unsigned int my_rank = this_mpi_process(comm); - size = owned_indices.size(); + size = owned_indices.size(); + + Assert(size > 0, ExcNotImplemented()); + dofs_per_process = (size + n_procs - 1) / n_procs; if (dofs_per_process < range_minimum_grain_size) {