]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an assertion.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 21 Jan 2021 18:53:07 +0000 (11:53 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 Jan 2021 00:11:37 +0000 (17:11 -0700)
source/grid/reference_cell.cc

index f9b9fecb15bbac6a6ce0656c667e1d61109a9e73..b0af4ec88f2e7e6d5b2173bcbca943aa31a56a50 100644 (file)
@@ -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<std::uint8_t>(-1)) || (kind < 8),
+             ExcInternalError());
+
       // Call the private constructor, which we can from here because this
       // function is a 'friend'.
       return dealii::ReferenceCell::Type(kind);

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.