changed: move the PrintProperties parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 10:20:05 +02:00
parent 1a5476c873
commit fda381c349
3 changed files with 16 additions and 15 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 properties on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintProperties { using type = Properties::UndefinedProperty; };
} // namespace Opm:Parameters
#endif

View File

@ -105,15 +105,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
/*!
* \brief Print all properties on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintProperties { using type = UndefinedProperty; };
/*!
* \brief Print all parameters on startup?
*
@ -224,10 +215,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
//! 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; };
@ -278,6 +265,11 @@ template<class TypeTag>
struct ParameterFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, Properties::TTag::NumericModel>
{ static constexpr int value = 2; };
}
#endif

View File

@ -80,7 +80,7 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
Parameters::registerParam<TypeTag, Parameters::ParameterFile>
("An .ini file which contains a set of run-time parameters");
Parameters::registerParam<TypeTag, Properties::PrintProperties>
Parameters::registerParam<TypeTag, Parameters::PrintProperties>
("Print the values of the compile time properties at "
"the start of the simulation");
Parameters::registerParam<TypeTag, Properties::PrintParameters>
@ -378,7 +378,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the properties if requested
int printProps = Parameters::get<TypeTag, Properties::PrintProperties>();
int printProps = Parameters::get<TypeTag, Parameters::PrintProperties>();
if (printProps && myRank == 0) {
if (printProps == 1 || !isatty(fileno(stdout)))
Properties::printValues<TypeTag>(std::cout);