From: Wolfgang Bangerth Date: Fri, 5 Feb 2021 16:31:11 +0000 (-0700) Subject: Avoid using a function in a context in which it makes no sense. X-Git-Tag: v9.3.0-rc1~491^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=125fdbdf4dd174388cf9467e58de7a7c151bad77;p=dealii.git Avoid using a function in a context in which it makes no sense. --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index b209875d17..42c6d73a6a 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -13528,8 +13528,11 @@ template bool Triangulation::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()); }