From 4f6bc9280d3ee92832c4223ce07c90ef4f5c72ce Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 22 Mar 2024 12:14:16 +0100 Subject: [PATCH] remove macro EWOMS_PARAM_IS_SET macro it simplifies nothing, only obscures. remove unused different propTagName and use paramName. --- opm/models/utils/parametersystem.hh | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/opm/models/utils/parametersystem.hh b/opm/models/utils/parametersystem.hh index 0f9a24058..5c055e700 100644 --- a/opm/models/utils/parametersystem.hh +++ b/opm/models/utils/parametersystem.hh @@ -132,17 +132,6 @@ #define EWOMS_GET_PARAM_LISTS(TypeTag, UsedParamList, UnusedParamList) \ (::Opm::Parameters::getLists(UsedParamList, UnusedParamList)) -/*! - * \ingroup Parameter - * - * \brief Returns true if a parameter has been specified at runtime, false - * otherwise. - * - * If the parameter in question has not been registered, this throws an exception. - */ -#define EWOMS_PARAM_IS_SET(TypeTag, ParamType, ParamName) \ - (::Opm::Parameters::isSet(#ParamName, #ParamName)) - namespace Opm { namespace Parameters { @@ -978,9 +967,14 @@ public: ParamsMeta::clear(); } + /*! + * \brief Returns true if a parameter has been specified at runtime, false + * otherwise. + * + * If the parameter in question has not been registered, this throws an exception. + */ template - static bool isSet([[maybe_unused]] const char* propTagName, - [[maybe_unused]] const char* paramName, + static bool isSet(const char* paramName, bool errorIfNotRegistered = true) { @@ -988,7 +982,7 @@ public: // make sure that the parameter is used consistently. since // this is potentially quite expensive, it is only done if // debugging code is not explicitly turned off. - check_(Dune::className(), propTagName, paramName); + check_(Dune::className(), paramName, paramName); #endif if (errorIfNotRegistered) { @@ -1141,10 +1135,9 @@ void reset() } template -bool isSet(const char *propTagName, const char *paramName, bool errorIfNotRegistered = true) +bool isSet(const char* paramName, bool errorIfNotRegistered = true) { - return Param::template isSet(propTagName, - paramName, + return Param::template isSet(paramName, errorIfNotRegistered); }