From ad16ad2d6a7e7e4408ec8e7e45a996de1542e6a1 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sun, 24 Nov 2024 21:38:08 +0100 Subject: [PATCH] Add assert --- source/grid/tria.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 4a2d365c9c..02305f7aee 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -12857,6 +12857,9 @@ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) void Triangulation::refine_global(const unsigned int times) { + Assert(n_cells() > 0, + ExcMessage("Error: An empty Triangulation can not be refined.")); + for (unsigned int i = 0; i < times; ++i) { set_all_refine_flags(); -- 2.39.5