From 8282eb999ffa8e486ed8d7f6e6c7a2b6ae1dd5b6 Mon Sep 17 00:00:00 2001 From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de> Date: Fri, 21 Dec 2018 11:38:10 +0100 Subject: [PATCH] [macros] Replace further macros --- .../exercise-basic/injection2p2cproblem.hh | 12 ++++++--- .../exercise-basic/injection2pniproblem.hh | 12 ++++++--- .../exercise-basic/injection2pproblem.hh | 12 ++++++--- .../models/ex_models_pmproblem.hh | 6 ++--- exercises/exercise-fluidsystem/2p2cproblem.hh | 12 ++++++--- exercises/exercise-fluidsystem/2pproblem.hh | 12 ++++++--- .../exercise-grids/injection2pproblem.hh | 12 ++++++--- .../injection2pproblem.hh | 12 ++++++--- .../exercise-basic/injection2pniproblem.hh | 26 +++++++++++++++---- .../models/ex_models_pmproblem.hh | 6 ++--- .../exercise-fluidsystem/2p2cproblem.hh | 12 ++++++--- .../exercise-fluidsystem/2pproblem.hh | 12 ++++++--- .../exercise-grids/injection2pproblem.hh | 12 ++++++--- .../injection2pproblem.hh | 12 ++++++--- 14 files changed, 126 insertions(+), 44 deletions(-) diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index d2cc5189..f564bffe 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -55,9 +55,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p2c> { using type = Injection2p2cProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p2c, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p2c> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index 8f0bd5d4..c6ee453a 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -61,9 +61,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2pNITypeTag, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index 49257b12..a4f762b5 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -57,9 +57,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh b/exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh index 31fdc8a3..29402f3e 100644 --- a/exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh +++ b/exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh @@ -70,9 +70,9 @@ template<class TypeTag> struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePNC> { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePNC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>); - +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, DarcyOnePNC> +{ using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the grid type template<class TypeTag> struct Grid<TypeTag, TTag::DarcyOnePNC> { using type = Dune::YaspGrid<2>; }; diff --git a/exercises/exercise-fluidsystem/2p2cproblem.hh b/exercises/exercise-fluidsystem/2p2cproblem.hh index d89d54e1..1a395ad9 100644 --- a/exercises/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/exercise-fluidsystem/2p2cproblem.hh @@ -58,9 +58,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams, - ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; +}; // Set grid and the grid creator to be used template<class TypeTag> diff --git a/exercises/exercise-fluidsystem/2pproblem.hh b/exercises/exercise-fluidsystem/2pproblem.hh index f0f25720..2787cacc 100644 --- a/exercises/exercise-fluidsystem/2pproblem.hh +++ b/exercises/exercise-fluidsystem/2pproblem.hh @@ -72,9 +72,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams, - ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoP> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; +}; // Set grid to be used template<class TypeTag> diff --git a/exercises/exercise-grids/injection2pproblem.hh b/exercises/exercise-grids/injection2pproblem.hh index b99e7eb7..910b2ff8 100644 --- a/exercises/exercise-grids/injection2pproblem.hh +++ b/exercises/exercise-grids/injection2pproblem.hh @@ -60,9 +60,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/exercise-runtimeparams/injection2pproblem.hh b/exercises/exercise-runtimeparams/injection2pproblem.hh index cdae77bf..ea353268 100644 --- a/exercises/exercise-runtimeparams/injection2pproblem.hh +++ b/exercises/exercise-runtimeparams/injection2pproblem.hh @@ -57,9 +57,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 6c9c8358..1a668c7a 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -56,13 +56,29 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2pNITypeTag, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; + +// the fluid system for incompressible tests +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> +{ +private: + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; +}; // Set fluid configuration -SET_TYPE_PROP(Injection2pNITypeTag, FluidSystem, - FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; } // end namespace Properties /*! diff --git a/exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh b/exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh index aec17c64..73771923 100644 --- a/exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh @@ -83,9 +83,9 @@ template<class TypeTag> struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePNC> { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePNC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>); - +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::DarcyOnePNC> +{ using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the grid type template<class TypeTag> struct Grid<TypeTag, TTag::DarcyOnePNC> { using type = Dune::YaspGrid<2>; }; diff --git a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh index 09221c49..0f0602f1 100644 --- a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh @@ -58,9 +58,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams, - ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; +}; // Set grid and the grid creator to be used template<class TypeTag> diff --git a/exercises/solution/exercise-fluidsystem/2pproblem.hh b/exercises/solution/exercise-fluidsystem/2pproblem.hh index e289f9d8..b292a43d 100644 --- a/exercises/solution/exercise-fluidsystem/2pproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2pproblem.hh @@ -72,9 +72,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams, - ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoP> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; +}; // Set grid to be used template<class TypeTag> diff --git a/exercises/solution/exercise-grids/injection2pproblem.hh b/exercises/solution/exercise-grids/injection2pproblem.hh index 91d87015..101c0379 100644 --- a/exercises/solution/exercise-grids/injection2pproblem.hh +++ b/exercises/solution/exercise-grids/injection2pproblem.hh @@ -68,9 +68,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> diff --git a/exercises/solution/exercise-runtimeparams/injection2pproblem.hh b/exercises/solution/exercise-runtimeparams/injection2pproblem.hh index d0ca6596..b2d79304 100644 --- a/exercises/solution/exercise-runtimeparams/injection2pproblem.hh +++ b/exercises/solution/exercise-runtimeparams/injection2pproblem.hh @@ -57,9 +57,15 @@ template<class TypeTag> struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, - GetPropType<TypeTag, Properties::Scalar>>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; // Set fluid configuration template<class TypeTag> -- GitLab