]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add assert 17886/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 24 Nov 2024 20:38:08 +0000 (21:38 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 24 Nov 2024 20:38:08 +0000 (21:38 +0100)
source/grid/tria.cc

index 4a2d365c9c2d0c0b443daf7e5368cc7a4bbe628a..02305f7aee66ae25e4a9094053df1c1021f2d864 100644 (file)
@@ -12857,6 +12857,9 @@ template <int dim, int spacedim>
 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
 void Triangulation<dim, spacedim>::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();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.