From: Peter Munch Date: Sun, 24 Nov 2024 20:38:08 +0000 (+0100) Subject: Add assert X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17886%2Fhead;p=dealii.git Add assert --- 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();