changed: move the PrintParameters parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 10:20:05 +02:00
parent fda381c349
commit 78cd842193
3 changed files with 17 additions and 16 deletions

View File

@ -42,6 +42,15 @@ struct GridGlobalRefinements { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct ParameterFile { using type = Properties::UndefinedProperty; };
/*!
* \brief Print all parameters on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintParameters { using type = Properties::UndefinedProperty; };
/*!
* \brief Print all properties on startup?
*

View File

@ -105,15 +105,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
/*!
* \brief Print all parameters on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintParameters { using type = UndefinedProperty; };
//! The default value for the simulation's end time
template<class TypeTag, class MyTypeTag>
struct EndTime { using type = UndefinedProperty; };
@ -215,10 +206,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! By default, print the values of the run-time parameters on startup
template<class TypeTag>
struct PrintParameters<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
//! The default value for the simulation's end time
template<class TypeTag>
struct EndTime<TypeTag, TTag::NumericModel>
@ -265,11 +252,16 @@ template<class TypeTag>
struct ParameterFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
//! By default, print the values of the run-time parameters on startup
template<class TypeTag>
struct PrintParameters<TypeTag, Properties::TTag::NumericModel>
{ static constexpr int value = 2; };
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, Properties::TTag::NumericModel>
{ static constexpr int value = 2; };
}
} // namespace Opm::Parameters
#endif

View File

@ -83,7 +83,7 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
Parameters::registerParam<TypeTag, Parameters::PrintProperties>
("Print the values of the compile time properties at "
"the start of the simulation");
Parameters::registerParam<TypeTag, Properties::PrintParameters>
Parameters::registerParam<TypeTag, Parameters::PrintParameters>
("Print the values of the run-time parameters at the "
"start of the simulation");
@ -354,7 +354,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the parameters if requested
int printParams = Parameters::get<TypeTag, Properties::PrintParameters>();
int printParams = Parameters::get<TypeTag, Parameters::PrintParameters>();
if (myRank == 0) {
std::string endParametersSeparator("# [end of parameters]\n");
if (printParams) {