From 125fdbdf4dd174388cf9467e58de7a7c151bad77 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 5 Feb 2021 09:31:11 -0700 Subject: [PATCH] Avoid using a function in a context in which it makes no sense. --- source/grid/tria.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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()); } -- 2.39.5