move PrintParameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 6c7f40b786
commit 0e3d9604ab
3 changed files with 3 additions and 9 deletions

View File

@ -74,8 +74,7 @@ struct PredeterminedTimeStepsFile { static constexpr auto value = ""; };
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The * 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2. * default is 2.
*/ */
template<class TypeTag, class MyTypeTag> struct PrintParameters { static constexpr int value = 2; };
struct PrintParameters { using type = Properties::UndefinedProperty; };
//! The default value for the simulation's restart time //! The default value for the simulation's restart time
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -195,11 +195,6 @@ struct InitialTimeStepSize<TypeTag, Properties::TTag::NumericModel>
static constexpr type value = -1e35; static constexpr type value = -1e35;
}; };
//! 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; };
//! The default value for the simulation's restart time //! The default value for the simulation's restart time
template<class TypeTag> template<class TypeTag>
struct RestartTime<TypeTag, Properties::TTag::NumericModel> struct RestartTime<TypeTag, Properties::TTag::NumericModel>

View File

@ -80,7 +80,7 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
Parameters::Register<Parameters::ParameterFile> Parameters::Register<Parameters::ParameterFile>
("An .ini file which contains a set of run-time parameters"); ("An .ini file which contains a set of run-time parameters");
Parameters::registerParam<TypeTag, Parameters::PrintParameters> Parameters::Register<Parameters::PrintParameters>
("Print the values of the run-time parameters at the " ("Print the values of the run-time parameters at the "
"start of the simulation"); "start of the simulation");
@ -351,7 +351,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
} }
// print the parameters if requested // print the parameters if requested
int printParams = Parameters::get<TypeTag, Parameters::PrintParameters>(); int printParams = Parameters::Get<Parameters::PrintParameters>();
if (myRank == 0) { if (myRank == 0) {
std::string endParametersSeparator("# [end of parameters]\n"); std::string endParametersSeparator("# [end of parameters]\n");
if (printParams) { if (printParams) {