From 52870b8a3c3654d3f5eb65a68e02714b1745e0b3 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Wed, 11 May 2022 13:43:28 +0200 Subject: [PATCH] [grid] Make it fail at compile time if grid manager specialization is missing --- dumux/io/grid/gridmanager_base.hh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dumux/io/grid/gridmanager_base.hh b/dumux/io/grid/gridmanager_base.hh index 9d90cbc6e1..689cdb3371 100644 --- a/dumux/io/grid/gridmanager_base.hh +++ b/dumux/io/grid/gridmanager_base.hh @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -73,10 +74,11 @@ public: */ void init(const std::string& modelParamGroup = "") { - DUNE_THROW(Dune::NotImplemented, - "The header with the GridManager specialization for grid type " << Dune::className() - << " is not included or no specialization has been implemented!" - << " In case of the latter, consider providing your own GridManager."); + static_assert(AlwaysFalse::value, + "The header with the GridManager specialization for your grid type is not included " + "or no specialization has been implemented!" + " In case of the latter, consider providing your own GridManager." + ); } /*! @@ -129,7 +131,7 @@ public: return gridData_; } - + /*! * \brief Check whether there is data associated with the grid */ -- GitLab