From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 18:53:07 +0000 (-0700) Subject: Add an assertion. X-Git-Tag: v9.3.0-rc1~583^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76c3ff69b5cf4aeda6a26820b512de7bfccd23d6;p=dealii.git Add an assertion. --- 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);