From a5629bc429a2ff5cdd4343b31df28cd381570304 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sun, 19 Jan 2020 08:29:19 +0100 Subject: [PATCH] Add assert to prevent floating point exception --- include/deal.II/base/mpi_compute_index_owner_internal.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.39.5