move VtkPrimaryVars parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 185b4d90d5
commit bd582e8150
2 changed files with 10 additions and 36 deletions

View File

@ -36,7 +36,6 @@ namespace Opm::Properties {
namespace TTag {
struct FvBaseNewtonMethod;
struct VtkPrimaryVars;
struct FiniteDifferenceLocalLinearizer;
struct ParallelBiCGStabLinearSolver;
}
@ -45,7 +44,7 @@ namespace TTag {
//! The type tag for models based on the finite volume schemes
struct FvBaseDiscretization
{ using InheritsFrom = std::tuple<VtkPrimaryVars, FvBaseNewtonMethod, ImplicitModel>; };
{ using InheritsFrom = std::tuple<FvBaseNewtonMethod, ImplicitModel>; };
} // namespace TTag

View File

@ -35,36 +35,11 @@
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK primary variables output
struct VtkPrimaryVars {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters {
// create the property tags needed for the primary variables module
template<class TypeTag, class MyTypeTag>
struct VtkWritePrimaryVars { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteProcessRank { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteDofIndex { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct VtkWritePrimaryVars<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteProcessRank<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteDofIndex<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
struct VtkWritePrimaryVars { static constexpr bool value = false; };
struct VtkWriteProcessRank { static constexpr bool value = false; };
struct VtkWriteDofIndex { static constexpr bool value = false; };
} // namespace Opm::Properties
@ -102,11 +77,11 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Parameters::VtkWritePrimaryVars>
Parameters::Register<Parameters::VtkWritePrimaryVars>
("Include the primary variables into the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteProcessRank>
Parameters::Register<Parameters::VtkWriteProcessRank>
("Include the MPI process rank into the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteDofIndex>
Parameters::Register<Parameters::VtkWriteDofIndex>
("Include the index of the degrees of freedom into the VTK output files");
}
@ -178,17 +153,17 @@ public:
private:
static bool primaryVarsOutput_()
{
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePrimaryVars>();
static bool val = Parameters::Get<Parameters::VtkWritePrimaryVars>();
return val;
}
static bool processRankOutput_()
{
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteProcessRank>();
static bool val = Parameters::Get<Parameters::VtkWriteProcessRank>();
return val;
}
static bool dofIndexOutput_()
{
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteDofIndex>();
static bool val = Parameters::Get<Parameters::VtkWriteDofIndex>();
return val;
}