diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index 790098527f172f945830c38383869b308cff43a1..f564bffe04205ab4d8a137a1fd7a255c22bf9886 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -43,7 +43,7 @@ namespace Properties { // Create new type tags namespace TTag { struct Injection2p2c { using InheritsFrom = std::tuple; }; -struct Injection2p2cCC { using InheritsFrom = std::tuple; }; +struct Injection2p2cCC { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the grid type @@ -55,9 +55,15 @@ template struct Problem { using type = Injection2p2cProblem; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p2c, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index 8f0bd5d4ca245806d189621b91c59acef63af23f..7642c96a53db03c2eb80ba88f526f50fed8890ed 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -61,13 +61,23 @@ template struct Problem { using type = InjectionProblem2PNI; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2pNITypeTag, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template -struct FluidSystem { using type = FluidSystems::H2ON2, FluidSystems::H2ON2DefaultPolicy>; }; +struct FluidSystem +{ + using type = FluidSystems::H2ON2, + FluidSystems::H2ON2DefaultPolicy>; +}; } // end namespace Properties /*! diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index 49257b1232682541981047ee238bb3a7a2a39cce..a4f762b51cb01f347ca5cb2dd2815dcbcc2cae78 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -57,9 +57,15 @@ template struct Problem { using type = InjectionProblem2P; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template 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 31fdc8a3383e7c52a5271291133b10d179751568..f25401bf6cb2125000950d50a1795e6e931468c4 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 struct ReplaceCompEqIdx { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePNC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity>); - +template +struct EffectiveDiffusivityModel +{ using type = DiffusivityConstantTortuosity>; }; // Set the grid type template struct Grid { using type = Dune::YaspGrid<2>; }; diff --git a/exercises/exercise-fluidsystem/2p2cproblem.hh b/exercises/exercise-fluidsystem/2p2cproblem.hh index d89d54e12dcab874d79bb8344ba45d9e7f093cb0..0c3082ca1650f529e3a8f3c796f7325208f36bd8 100644 --- a/exercises/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/exercise-fluidsystem/2p2cproblem.hh @@ -50,7 +50,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the "Problem" property @@ -58,9 +58,15 @@ template struct Problem { using type = ExerciseFluidsystemProblemTwoPTwoC; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams, - ExerciseFluidsystemSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = ExerciseFluidsystemSpatialParams; +}; // Set grid and the grid creator to be used template diff --git a/exercises/exercise-fluidsystem/2pproblem.hh b/exercises/exercise-fluidsystem/2pproblem.hh index f0f257204a8f7d7527eb79e3ad23b79a5df0b654..1acfb0ff916b27b4089c92608c6676ebfed3d56a 100644 --- a/exercises/exercise-fluidsystem/2pproblem.hh +++ b/exercises/exercise-fluidsystem/2pproblem.hh @@ -64,7 +64,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the "Problem" property @@ -72,9 +72,15 @@ template struct Problem { using type = ExerciseFluidsystemProblemTwoP; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams, - ExerciseFluidsystemSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = ExerciseFluidsystemSpatialParams; +}; // Set grid to be used template diff --git a/exercises/exercise-fluidsystem/README.md b/exercises/exercise-fluidsystem/README.md index 8ab0cb8e0e339e9c335bb83c9981d24dab86ca35..124002bb0337a047122c477cc096ae14791ad329 100644 --- a/exercises/exercise-fluidsystem/README.md +++ b/exercises/exercise-fluidsystem/README.md @@ -41,7 +41,7 @@ the `TwoP` _TypeTag_ (immiscible two-phase model properties) and the `BoxModel` ```c++ // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; } // end namespace TTag ``` @@ -185,7 +185,7 @@ two-component model properties: ```c++ // Create a new type tag for the problem -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; } // end namespace TTag ``` diff --git a/exercises/exercise-fractures/fractureproblem.hh b/exercises/exercise-fractures/fractureproblem.hh index 38caa0cd591ac0786ddb84a21102dbd9428d0feb..5088241cc9f6c900899ce79e70db7c990f274892 100644 --- a/exercises/exercise-fractures/fractureproblem.hh +++ b/exercises/exercise-fractures/fractureproblem.hh @@ -51,7 +51,7 @@ namespace Properties { // Create new type tag node namespace TTag { -struct FractureProblem { using InheritsFrom = std::tuple; }; +struct FractureProblem { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the grid type diff --git a/exercises/exercise-grids/injection2pproblem.hh b/exercises/exercise-grids/injection2pproblem.hh index b99e7eb79b21a05c0c6f09cc1a6910bdef5d82bd..910b2ff8a5dfebe6ca14442bd7ae7ddc5f3190f6 100644 --- a/exercises/exercise-grids/injection2pproblem.hh +++ b/exercises/exercise-grids/injection2pproblem.hh @@ -60,9 +60,15 @@ template struct Problem { using type = InjectionProblem2P; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template diff --git a/exercises/exercise-properties/mylocalresidual.hh b/exercises/exercise-properties/mylocalresidual.hh index 1a35cf0faa26b8f179d24719f8c5f6c155d04d8d..f47698e5e115969f72df11cd2458b1e2b178afe6 100644 --- a/exercises/exercise-properties/mylocalresidual.hh +++ b/exercises/exercise-properties/mylocalresidual.hh @@ -35,24 +35,24 @@ namespace Dumux * using the n-phase immiscible fully implicit models. */ template -class MyLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class MyLocalResidual : public GetPropType { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType; + using Scalar = GetPropType; + using Problem = GetPropType; + using NumEqVector = GetPropType; + using VolumeVariables = GetPropType; + using ElementVolumeVariables = typename GetPropType::LocalView; + using FluxVariables = GetPropType; + using ElementFluxVariablesCache = typename GetPropType::LocalView; + using FVElementGeometry = typename GetPropType::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType; using Element = typename GridView::template Codim<0>::Entity; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); + using EnergyLocalResidual = GetPropType; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; //!< first index for the mass balance diff --git a/exercises/exercise-runtimeparams/injection2pproblem.hh b/exercises/exercise-runtimeparams/injection2pproblem.hh index cdae77bfb6ea1f566a33dd4c2022423bfc9bf67b..ea353268dfbe27f1bdffed38d1b0d2985dd416d0 100644 --- a/exercises/exercise-runtimeparams/injection2pproblem.hh +++ b/exercises/exercise-runtimeparams/injection2pproblem.hh @@ -57,9 +57,15 @@ template struct Problem { using type = InjectionProblem2P; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 6c9c835857a3bfc1445c5d1b7e46dd56dc4dc33e..8d971152777ecdd89e5b7d1b531bb6578e5e72c2 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -56,13 +56,23 @@ template struct Problem { using type = InjectionProblem2PNI; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2pNITypeTag, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration -SET_TYPE_PROP(Injection2pNITypeTag, FluidSystem, - FluidSystems::H2ON2, FluidSystems::H2ON2DefaultPolicy>); +template +struct FluidSystem +{ + using type = FluidSystems::H2ON2, + FluidSystems::H2ON2DefaultPolicy>; +}; } // end namespace Properties /*! diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_coupling_ff-pm.cc b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_coupling_ff-pm.cc index 812cae47dad7fd9a031794ae6c01560586997d04..868ccc962c0e4119baa4546ebe9961f6c7884e61 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_coupling_ff-pm.cc +++ b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_coupling_ff-pm.cc @@ -53,15 +53,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOneP, CouplingManager) +template +struct CouplingManager { - using Traits = StaggeredMultiDomainTraits; + using Traits = StaggeredMultiDomainTraits; using type = Dumux::StokesDarcyCouplingManager; }; -SET_PROP(DarcyOneP, CouplingManager) +template +struct CouplingManager { - using Traits = StaggeredMultiDomainTraits; + using Traits = StaggeredMultiDomainTraits; using type = Dumux::StokesDarcyCouplingManager; }; @@ -83,17 +85,17 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = TTAG(StokesOneP); - using DarcyTypeTag = TTAG(DarcyOneP); + using StokesTypeTag = Properties::TTag::StokesOneP; + using DarcyTypeTag = Properties::TTag::DarcyOneP; #if EXNUMBER < 3 // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager; + using DarcyGridManager = Dumux::GridManager>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager; + using StokesGridManager = Dumux::GridManager>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -143,10 +145,10 @@ int main(int argc, char** argv) try // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); darcyFvGridGeometry->update(); @@ -162,9 +164,9 @@ int main(int argc, char** argv) try constexpr auto darcyIdx = CouplingManager::darcyIdx; // the problem (initial and boundary conditions) - using StokesProblem = typename GET_PROP_TYPE(StokesTypeTag, Problem); + using StokesProblem = GetPropType; auto stokesProblem = std::make_shared(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType; auto darcyProblem = std::make_shared(darcyFvGridGeometry, couplingManager); // the solution vector @@ -181,10 +183,10 @@ int main(int argc, char** argv) try couplingManager->init(stokesProblem, darcyProblem, sol); // the grid variables - using StokesGridVariables = typename GET_PROP_TYPE(StokesTypeTag, GridVariables); + using StokesGridVariables = GetPropType; auto stokesGridVariables = std::make_shared(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType; auto darcyGridVariables = std::make_shared(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx]); diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_ffproblem.hh b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_ffproblem.hh index 38ff20ac9b44d26adb7dca4148b38eb944c98194..79e7c8ea22269525a26f8706b52d5848c8b17014 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_ffproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_ffproblem.hh @@ -43,20 +43,25 @@ class StokesSubProblem; namespace Properties { -NEW_TYPE_TAG(StokesOneP, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct StokesOneP { using InheritsFrom = std::tuple; }; +} // end namespace TTag // the fluid system -SET_PROP(StokesOneP, FluidSystem) +template +struct FluidSystem { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType; using type = FluidSystems::OnePLiquid > ; }; // Set the grid type -SET_PROP(StokesOneP, Grid) +template +struct Grid { static constexpr auto dim = 2; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType; using TensorGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates >; #if EXNUMBER < 3 // use "normal" grid @@ -68,12 +73,15 @@ SET_PROP(StokesOneP, Grid) }; // Set the problem property -SET_TYPE_PROP(StokesOneP, Problem, Dumux::StokesSubProblem ); - -SET_BOOL_PROP(StokesOneP, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridVolumeVariablesCache, true); - +template +struct Problem { using type = Dumux::StokesSubProblem ; }; + +template +struct EnableFVGridGeometryCache { static constexpr bool value = true; }; +template +struct EnableGridFluxVariablesCache { static constexpr bool value = true; }; +template +struct EnableGridVolumeVariablesCache { static constexpr bool value = true; }; } /*! @@ -84,25 +92,25 @@ class StokesSubProblem : public NavierStokesProblem { using ParentType = NavierStokesProblem; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType; + using Scalar = GetPropType; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using BoundaryTypes = GetPropType; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using PrimaryVariables = GetPropType; + using NumEqVector = GetPropType; + using FluidSystem = GetPropType; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType; public: StokesSubProblem(std::shared_ptr fvGridGeometry, std::shared_ptr couplingManager) diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh index 51e1663c8d66f1379545bb566e8c38336c4632e5..9649b0e90872a90d423c0c526399c025bf4d551b 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh @@ -84,7 +84,6 @@ template struct SpatialParams { using type = OnePSpatialParams, GetPropType>; }; - } // 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 aec17c64c9cd62ea0800480ae8a3e4dee6015c00..73771923b2a2c838df5399b70508df4d0ad5ffb6 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 struct ReplaceCompEqIdx { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePNC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity>); - +template +struct EffectiveDiffusivityModel +{ using type = DiffusivityConstantTortuosity>; }; // Set the grid type template struct Grid { using type = Dune::YaspGrid<2>; }; diff --git a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh index 09221c49e68b0eeb5faac71b70db0cf4a95a04c1..25ae5d6c9939ea9e2509f2ecf07d7455944a8ce1 100644 --- a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh @@ -50,7 +50,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the "Problem" property @@ -58,9 +58,15 @@ template struct Problem { using type = ExerciseFluidsystemProblemTwoPTwoC; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams, - ExerciseFluidsystemSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = ExerciseFluidsystemSpatialParams; +}; // Set grid and the grid creator to be used template diff --git a/exercises/solution/exercise-fluidsystem/2pproblem.hh b/exercises/solution/exercise-fluidsystem/2pproblem.hh index e289f9d8340d2284d2930f34a259907aa16b73eb..fa461792f0ae45a1262d4add2c6c52bcc287db20 100644 --- a/exercises/solution/exercise-fluidsystem/2pproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2pproblem.hh @@ -64,7 +64,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the "Problem" property @@ -72,9 +72,15 @@ template struct Problem { using type = ExerciseFluidsystemProblemTwoP; }; // Set the spatial parameters -SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams, - ExerciseFluidsystemSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = ExerciseFluidsystemSpatialParams; +}; // Set grid to be used template diff --git a/exercises/solution/exercise-fractures/fractureproblem.hh b/exercises/solution/exercise-fractures/fractureproblem.hh index 2fc8aaa92e269b3add24b5ff7beb81b445a55812..1f74f6c656009c41c7fc3d8f65f3d34dbc4f975e 100644 --- a/exercises/solution/exercise-fractures/fractureproblem.hh +++ b/exercises/solution/exercise-fractures/fractureproblem.hh @@ -51,7 +51,7 @@ namespace Properties { // Create new type tag node namespace TTag { -struct FractureProblem { using InheritsFrom = std::tuple; }; +struct FractureProblem { using InheritsFrom = std::tuple; }; } // end namespace TTag // Set the grid type diff --git a/exercises/solution/exercise-grids/injection2pproblem.hh b/exercises/solution/exercise-grids/injection2pproblem.hh index 91d8701572610dc726ab0888d26d0d3c99cdaa48..101c0379150b600d40dbe7404ec669f03e0b3da2 100644 --- a/exercises/solution/exercise-grids/injection2pproblem.hh +++ b/exercises/solution/exercise-grids/injection2pproblem.hh @@ -68,9 +68,15 @@ template struct Problem { using type = InjectionProblem2P; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template diff --git a/exercises/solution/exercise-properties/mylocalresidual.hh b/exercises/solution/exercise-properties/mylocalresidual.hh index 2270f28e38c03e69c4bec6cdbffebfc7dc4598d5..5b80d2e3e5c9122ed0ff08ddb3c67d47b89c4783 100644 --- a/exercises/solution/exercise-properties/mylocalresidual.hh +++ b/exercises/solution/exercise-properties/mylocalresidual.hh @@ -35,24 +35,24 @@ namespace Dumux * using the n-phase immiscible fully implicit models. */ template -class MyLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class MyLocalResidual : public GetPropType { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType; + using Scalar = GetPropType; + using Problem = GetPropType; + using NumEqVector = GetPropType; + using VolumeVariables = GetPropType; + using ElementVolumeVariables = typename GetPropType::LocalView; + using FluxVariables = GetPropType; + using ElementFluxVariablesCache = typename GetPropType::LocalView; + using FVElementGeometry = typename GetPropType::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType; using Element = typename GridView::template Codim<0>::Entity; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); + using EnergyLocalResidual = GetPropType; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType; static constexpr int numPhases = ModelTraits::numFluidPhases(); static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; //!< first index for the mass balance diff --git a/exercises/solution/exercise-runtimeparams/injection2pproblem.hh b/exercises/solution/exercise-runtimeparams/injection2pproblem.hh index d0ca6596626c23491b6b5b026222aec094b2b5c4..b2d79304a3f0a2778f1b075ad5b7b41241c7d30f 100644 --- a/exercises/solution/exercise-runtimeparams/injection2pproblem.hh +++ b/exercises/solution/exercise-runtimeparams/injection2pproblem.hh @@ -57,9 +57,15 @@ template struct Problem { using type = InjectionProblem2P; }; // Set the spatial parameters -SET_TYPE_PROP(Injection2p, SpatialParams, - InjectionSpatialParams, - GetPropType>); +template +struct SpatialParams +{ +private: + using FVGridGeometry = GetPropType; + using Scalar = GetPropType; +public: + using type = InjectionSpatialParams; +}; // Set fluid configuration template