From 76c3ff69b5cf4aeda6a26820b512de7bfccd23d6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 11:53:07 -0700 Subject: [PATCH] Add an assertion. --- source/grid/reference_cell.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index f9b9fecb15..b0af4ec88f 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -38,6 +38,11 @@ namespace ReferenceCell dealii::ReferenceCell::Type make_reference_cell_from_int(const std::uint8_t kind) { + // Make sure these are the only indices from which objects can be + // created. + Assert((kind == static_cast(-1)) || (kind < 8), + ExcInternalError()); + // Call the private constructor, which we can from here because this // function is a 'friend'. return dealii::ReferenceCell::Type(kind); -- 2.39.5