]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid using a function in a context in which it makes no sense. 11692/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 5 Feb 2021 16:31:11 +0000 (09:31 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 5 Feb 2021 22:40:55 +0000 (15:40 -0700)
source/grid/tria.cc

index b209875d1716e411fb5bac71c1972c834c0f8094..42c6d73a6afc266b47a280fa392949fce324d838 100644 (file)
@@ -13528,8 +13528,11 @@ template <int dim, int spacedim>
 bool
 Triangulation<dim, spacedim>::all_reference_cells_are_hyper_cube() const
 {
-  return (this->reference_cells.size() == 0) ||
-         (this->reference_cells.size() == 1 &&
+  Assert(this->reference_cells.size() > 0,
+         ExcMessage("You can't ask about the kinds of reference "
+                    "cells used by this triangulation if the "
+                    "triangulation doesn't yet have any cells in it."));
+  return (this->reference_cells.size() == 1 &&
           this->reference_cells[0] == ReferenceCell::get_hypercube<dim>());
 }
 

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.