move VtkTemperatureModule parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 8b860aac07
commit e388125e6d
2 changed files with 6 additions and 17 deletions

View File

@ -57,7 +57,9 @@ namespace Opm::Properties {
//! The generic type tag for problems using the immiscible multi-phase model //! The generic type tag for problems using the immiscible multi-phase model
// Create new type tags // Create new type tags
namespace TTag { namespace TTag {
struct MultiPhaseBaseModel { using InheritsFrom = std::tuple<VtkTemperature>; };
struct MultiPhaseBaseModel {};
} // end namespace TTag } // end namespace TTag
//! Specify the splices of the MultiPhaseBaseModel type tag //! Specify the splices of the MultiPhaseBaseModel type tag

View File

@ -37,23 +37,10 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK temperature output
struct VtkTemperature {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the temperature module
template<class TypeTag, class MyTypeTag>
struct VtkWriteTemperature { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteTemperature { static constexpr bool value = true; };
struct VtkWriteTemperature<TypeTag, Properties::TTag::VtkTemperature>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -91,7 +78,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteTemperature> Parameters::Register<Parameters::VtkWriteTemperature>
("Include the temperature in the VTK output files"); ("Include the temperature in the VTK output files");
} }
@ -143,7 +130,7 @@ public:
private: private:
static bool temperatureOutput_() static bool temperatureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTemperature>(); static bool val = Parameters::Get<Parameters::VtkWriteTemperature>();
return val; return val;
} }