changed: move the ParameterFile parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-06-28 12:16:28 +02:00
parent 4cce7022bb
commit cea13e4b96
3 changed files with 12 additions and 11 deletions

View File

@ -37,6 +37,11 @@ namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct GridGlobalRefinements { using type = Properties::UndefinedProperty; };
//! Property provides the name of the file from which the additional runtime
//! parameters should to be loaded from
template<class TypeTag, class MyTypeTag>
struct ParameterFile { using type = Properties::UndefinedProperty; };
} // namespace Opm:Parameters
#endif

View File

@ -99,11 +99,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
//! Property provides the name of the file from which the additional runtime
//! parameters should to be loaded from
template<class TypeTag, class MyTypeTag>
struct ParameterFile { using type = UndefinedProperty; };
/*!
* \brief Print all properties on startup?
*
@ -223,10 +218,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! Set a value for the ParameterFile property
template<class TypeTag>
struct ParameterFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
@ -274,6 +265,11 @@ template<class TypeTag>
struct GridGlobalRefinements<TypeTag, Properties::TTag::NumericModel>
{ static constexpr unsigned value = 0; };
//! Set a value for the ParameterFile property
template<class TypeTag>
struct ParameterFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
}
#endif

View File

@ -78,7 +78,7 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>;
Parameters::registerParam<TypeTag, Properties::ParameterFile>
Parameters::registerParam<TypeTag, Parameters::ParameterFile>
("An .ini file which contains a set of run-time parameters");
Parameters::registerParam<TypeTag, Properties::PrintProperties>
("Print the values of the compile time properties at "
@ -150,7 +150,7 @@ static inline int setupParameters_(int argc,
return status;
}
const std::string paramFileName = Parameters::get<TypeTag, Properties::ParameterFile>(false);
const std::string paramFileName = Parameters::get<TypeTag, Parameters::ParameterFile>(false);
if (!paramFileName.empty()) {
////////////////////////////////////////////////////////////
// add the parameters specified using an .ini file