diff --git a/dumux/adaptive/initializationindicator.hh b/dumux/adaptive/initializationindicator.hh index 27efe5348e78f5852ef225ce7d1214eeb92027f9..26959d08a5daf10efaffffe18035bcfa5a049ffa 100644 --- a/dumux/adaptive/initializationindicator.hh +++ b/dumux/adaptive/initializationindicator.hh @@ -42,16 +42,16 @@ namespace Dumux { template<class TypeTag> class GridAdaptInitializationIndicator { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::Traits::template Codim<0>::Entity; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box; public: diff --git a/dumux/assembly/boxlocalassembler.hh b/dumux/assembly/boxlocalassembler.hh index f44d65f29c08783cec072e3ca5e9328fb9cb02c2..30227211d2f6c1466b764379140b2fcf2b148fd3 100644 --- a/dumux/assembly/boxlocalassembler.hh +++ b/dumux/assembly/boxlocalassembler.hh @@ -53,12 +53,12 @@ template<class TypeTag, class Assembler, class Implementation, bool implicit> class BoxLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit> { using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit>; - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; public: @@ -256,17 +256,17 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/tr { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>; using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; - enum { dim = GET_PROP_TYPE(TypeTag, GridView)::dimension }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; + enum { dim = GetPropType<TypeTag, Properties::GridView>::dimension }; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); public: @@ -375,15 +375,15 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/fa { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>; using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; - enum { dim = GET_PROP_TYPE(TypeTag, GridView)::dimension }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; + enum { dim = GetPropType<TypeTag, Properties::GridView>::dimension }; public: @@ -486,9 +486,9 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/t { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, true>; using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; public: @@ -605,9 +605,9 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/f { using ThisType = BoxLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, false>; using ParentType = BoxLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; public: diff --git a/dumux/assembly/boxlocalresidual.hh b/dumux/assembly/boxlocalresidual.hh index 9f105cabc40ed8c3603efc35ede617f0fdb4f428..20c0091ae15105e7ae9b880139dd96304a978767 100644 --- a/dumux/assembly/boxlocalresidual.hh +++ b/dumux/assembly/boxlocalresidual.hh @@ -43,16 +43,16 @@ template<class TypeTag> class BoxLocalResidual : public FVLocalResidual<TypeTag> { using ParentType = FVLocalResidual<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: using ElementResidualVector = typename ParentType::ElementResidualVector; diff --git a/dumux/assembly/cclocalassembler.hh b/dumux/assembly/cclocalassembler.hh index e2fe7fa307a4e1883325b5e4d131f7708b5313f4..94d09a759383527f4ba9bb5c49f10fe47d113db7 100644 --- a/dumux/assembly/cclocalassembler.hh +++ b/dumux/assembly/cclocalassembler.hh @@ -56,12 +56,12 @@ template<class TypeTag, class Assembler, class Implementation, bool implicit> class CCLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit> { using ParentType = FVLocalAssemblerBase<TypeTag, Assembler, Implementation, implicit>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: @@ -132,20 +132,20 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/tru { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, true>; using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Element = typename GetPropType<TypeTag, Properties::GridView>::template Codim<0>::Entity; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; - enum { dim = GET_PROP_TYPE(TypeTag, GridView)::dimension }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; + enum { dim = GetPropType<TypeTag, Properties::GridView>::dimension }; using FluxStencil = Dumux::FluxStencil<FVElementGeometry>; static constexpr int maxElementStencilSize = FVGridGeometry::maxElementStencilSize; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); public: @@ -313,13 +313,13 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/fal { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, false>; using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Element = typename GetPropType<TypeTag, Properties::GridView>::template Codim<0>::Entity; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; public: using ParentType::ParentType; @@ -424,9 +424,9 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/tr { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, true>; using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, true>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; public: using ParentType::ParentType; @@ -503,9 +503,9 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/fa { using ThisType = CCLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, false>; using ParentType = CCLocalAssemblerBase<TypeTag, Assembler, ThisType, false>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; public: using ParentType::ParentType; diff --git a/dumux/assembly/cclocalresidual.hh b/dumux/assembly/cclocalresidual.hh index f78a759d21d5a38960dabe6424e7efe4ba2c6782..a32a46fcc5b4733ec551ad0b30417cf4f491c694 100644 --- a/dumux/assembly/cclocalresidual.hh +++ b/dumux/assembly/cclocalresidual.hh @@ -40,13 +40,13 @@ template<class TypeTag> class CCLocalResidual : public FVLocalResidual<TypeTag> { using ParentType = FVLocalResidual<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Element = typename GetPropType<TypeTag, Properties::GridView>::template Codim<0>::Entity; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; public: diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh index 8c8950825099de150737f6e61b3e92a7d82f9fca..d26121d52cba464655d356239284f1bdf0405378 100644 --- a/dumux/assembly/fvassembler.hh +++ b/dumux/assembly/fvassembler.hh @@ -50,14 +50,14 @@ namespace Dumux { template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true> class FVAssembler { - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using Element = typename GridView::template Codim<0>::Entity; - using TimeLoop = TimeLoopBase<typename GET_PROP_TYPE(TypeTag, Scalar)>; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using TimeLoop = TimeLoopBase<GetPropType<TypeTag, Properties::Scalar>>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - static constexpr DiscretizationMethod discMethod = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod; + static constexpr DiscretizationMethod discMethod = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod; static constexpr bool isBox = discMethod == DiscretizationMethod::box; using ThisType = FVAssembler<TypeTag, diffMethod, isImplicit>; @@ -65,10 +65,10 @@ class FVAssembler CCLocalAssembler<TypeTag, ThisType, diffMethod, isImplicit>>; public: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using ResidualType = SolutionVector; diff --git a/dumux/assembly/fvlocalassemblerbase.hh b/dumux/assembly/fvlocalassemblerbase.hh index 974678036b35391b00e6c449c06168f155f262d0..3535b3fe1939ae48604b9bb1b220af962efd3499 100644 --- a/dumux/assembly/fvlocalassemblerbase.hh +++ b/dumux/assembly/fvlocalassemblerbase.hh @@ -46,24 +46,24 @@ namespace Dumux { template<class TypeTag, class Assembler, class Implementation, bool useImplicitAssembly> class FVLocalAssemblerBase { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using SolutionVector = typename Assembler::ResidualType; - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; + using GridVolumeVariables = GetPropType<TypeTag, Properties::GridVolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; using Element = typename GridView::template Codim<0>::Entity; public: - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; /*! @@ -285,11 +285,11 @@ protected: const Implementation &asImp_() const { return *static_cast<const Implementation*>(this); } - template<class T = TypeTag, typename std::enable_if_t<!GET_PROP_VALUE(T, EnableGridVolumeVariablesCache), int> = 0> + template<class T = TypeTag, typename std::enable_if_t<!getPropValue<T, Properties::EnableGridVolumeVariablesCache>(), int> = 0> VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv) { return elemVolVars[scv]; } - template<class T = TypeTag, typename std::enable_if_t<GET_PROP_VALUE(T, EnableGridVolumeVariablesCache), int> = 0> + template<class T = TypeTag, typename std::enable_if_t<getPropValue<T, Properties::EnableGridVolumeVariablesCache>(), int> = 0> VolumeVariables& getVolVarAccess(GridVolumeVariables& gridVolVars, ElementVolumeVariables& elemVolVars, const SubControlVolume& scv) { return gridVolVars.volVars(scv); } diff --git a/dumux/assembly/fvlocalresidual.hh b/dumux/assembly/fvlocalresidual.hh index aa23d93a5bf915658e119853f9b8d68bc8074cf5..6f82a83d4e93b89a802319d224599f2d4ee6e65b 100644 --- a/dumux/assembly/fvlocalresidual.hh +++ b/dumux/assembly/fvlocalresidual.hh @@ -44,22 +44,22 @@ namespace Dumux { template<class TypeTag> class FVLocalResidual { - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using TimeLoop = TimeLoopBase<Scalar>; public: @@ -495,7 +495,7 @@ public: //! Compute the derivative of the flux residual template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod != DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod != DiscretizationMethod::box, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -509,7 +509,7 @@ public: //! Compute the derivative of the flux residual for the box method template<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, diff --git a/dumux/assembly/staggeredfvassembler.hh b/dumux/assembly/staggeredfvassembler.hh index 12d0aa9b2ee8487eab4507844866b0b5369b7ea1..9e8948ac0930998829d061b4da0a97da3f01bf50 100644 --- a/dumux/assembly/staggeredfvassembler.hh +++ b/dumux/assembly/staggeredfvassembler.hh @@ -60,12 +60,12 @@ class StaggeredFVAssembler: public MultiDomainFVAssembler<StaggeredMultiDomainTr StaggeredCouplingManager<StaggeredMultiDomainTraits<TypeTag, TypeTag>>, diffMethod>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using TimeLoop = TimeLoopBase<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using TimeLoop = TimeLoopBase<GetPropType<TypeTag, Properties::Scalar>>; public: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using CouplingManager = typename ParentType::CouplingManager; //! The constructor for stationary problems diff --git a/dumux/assembly/staggeredlocalresidual.hh b/dumux/assembly/staggeredlocalresidual.hh index 421fc6955b41bfedcea9d6425a0df54c544794c1..ac810a0859734c668c30fbb90e108577e5628b65 100644 --- a/dumux/assembly/staggeredlocalresidual.hh +++ b/dumux/assembly/staggeredlocalresidual.hh @@ -38,30 +38,30 @@ namespace Dumux { template<class TypeTag> class StaggeredLocalResidual { - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - using CellCenterResidual = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FaceResidual = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using CellCenterResidual = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FaceResidual = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using TimeLoop = TimeLoopBase<Scalar>; public: - using CellCenterResidualValue = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FaceResidualValue = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterResidualValue = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FaceResidualValue = GetPropType<TypeTag, Properties::FacePrimaryVariables>; using ElementResidualVector = CellCenterResidualValue; //! the constructor diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index dd7ad79922b8f1a49087a1f3d398103141e04751..bf6113b7c0aee1f315895ceb03043797dcf5b9e6 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -48,21 +48,21 @@ namespace Dumux { template<class TypeTag> class FVProblem { - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Implementation = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using PointSourceHelper = typename GET_PROP_TYPE(TypeTag, PointSourceHelper); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using PointSourceHelper = GetPropType<TypeTag, Properties::PointSourceHelper>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; enum { dim = GridView::dimension @@ -71,8 +71,8 @@ class FVProblem using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; - static constexpr bool isStaggered = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::staggered; + static constexpr bool isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box; + static constexpr bool isStaggered = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::staggered; using PointSourceMap = std::map<std::pair<std::size_t, std::size_t>, std::vector<PointSource> >; diff --git a/dumux/common/pointsource.hh b/dumux/common/pointsource.hh index 265b5ec65f4b92212a51ea3edce2445eaa6e7a7b..6040143bc3df9e1c1a235f358223912572ca6c34 100644 --- a/dumux/common/pointsource.hh +++ b/dumux/common/pointsource.hh @@ -203,15 +203,15 @@ private: * \brief A point source class for time dependent point sources */ template<class TypeTag> -class SolDependentPointSource : public PointSource<Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, GridView)::ctype, - GET_PROP_TYPE(TypeTag, GridView)::dimensionworld>, - typename GET_PROP_TYPE(TypeTag, NumEqVector)> +class SolDependentPointSource : public PointSource<Dune::FieldVector<typename GetPropType<TypeTag, Properties::GridView>::ctype, + GetPropType<TypeTag, Properties::GridView>::dimensionworld>, + GetPropType<TypeTag, Properties::NumEqVector>> { - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using SourceValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using SourceValues = GetPropType<TypeTag, Properties::NumEqVector>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using Element = typename GridView::template Codim<0>::Entity; diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index dafc61396f82e5f55cae93f0f56a5b2f18eb65de..deb4b7904b720fae2a28e097f98faf39481c8e10 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -29,7 +29,6 @@ #ifndef DUMUX_PROPERTY_SYSTEM_HH #include <dumux/common/properties/propertysystem.hh> -#include <dumux/common/properties/propertysystemmacros.hh> // remove this once all macros are gone #endif namespace Dumux { @@ -38,171 +37,263 @@ namespace Properties { /////////////////////////////////////// // Basic properties of numeric models: /////////////////////////////////////// -NEW_PROP_TAG(Scalar); //!< Property to specify the type of scalar values. -NEW_PROP_TAG(ModelDefaultParameters); //!< Property which defines the group that is queried for parameters by default -NEW_PROP_TAG(Grid); //!< The DUNE grid type -NEW_PROP_TAG(PrimaryVariables); //!< A vector of primary variables -NEW_PROP_TAG(NumEqVector); //!< A vector of size number equations that can be used for Neumann fluxes, sources, residuals, ... -NEW_PROP_TAG(GridView); //!< The type of the grid view according to the grid type -NEW_PROP_TAG(ModelTraits); //!< Traits class encapsulating model specifications -NEW_PROP_TAG(BaseModelTraits); //!< Model traits to be used as a base for nonisothermal, mineralization ... models -NEW_PROP_TAG(Problem); //!< Property to specify the type of a problem which has to be solved -NEW_PROP_TAG(PointSource); //!< Property defining the type of point source used -NEW_PROP_TAG(PointSourceHelper); //!< Property defining the class that computes which sub control volume point sources belong to +template<class TypeTag, class MyTypeTag> +struct Scalar { using type = UndefinedProperty; }; //!< Property to specify the type of scalar values. +template<class TypeTag, class MyTypeTag> +struct ModelDefaultParameters { using type = UndefinedProperty; }; //!< Property which defines the group that is queried for parameters by default +template<class TypeTag, class MyTypeTag> +struct Grid { using type = UndefinedProperty; }; //!< The DUNE grid type +template<class TypeTag, class MyTypeTag> +struct PrimaryVariables { using type = UndefinedProperty; }; //!< A vector of primary variables +template<class TypeTag, class MyTypeTag> +struct NumEqVector { using type = UndefinedProperty; }; //!< A vector of size number equations that can be used for Neumann fluxes, sources, residuals, ... +template<class TypeTag, class MyTypeTag> +struct GridView { using type = UndefinedProperty; }; //!< The type of the grid view according to the grid type +template<class TypeTag, class MyTypeTag> +struct ModelTraits { using type = UndefinedProperty; }; //!< Traits class encapsulating model specifications +template<class TypeTag, class MyTypeTag> +struct BaseModelTraits { using type = UndefinedProperty; }; //!< Model traits to be used as a base for nonisothermal, mineralization ... models +template<class TypeTag, class MyTypeTag> +struct Problem { using type = UndefinedProperty; }; //!< Property to specify the type of a problem which has to be solved +template<class TypeTag, class MyTypeTag> +struct PointSource { using type = UndefinedProperty; }; //!< Property defining the type of point source used +template<class TypeTag, class MyTypeTag> +struct PointSourceHelper { using type = UndefinedProperty; }; //!< Property defining the class that computes which sub control volume point sources belong to // TODO: Remove deprecated property VtkOutputFields -NEW_PROP_TAG(VtkOutputFields); //!< A class helping models to define default vtk output parameters -NEW_PROP_TAG(IOFields); //!< A class helping models to define input and output fields -NEW_PROP_TAG(BaseLocalResidual); //!< The type of the base class of the local residual (specific to a discretization scheme) -NEW_PROP_TAG(JacobianMatrix); //!< Type of the global jacobian matrix -NEW_PROP_TAG(SolutionVector); //!< Vector containing all primary variable vector of the grid -NEW_PROP_TAG(BoundaryTypes); //!< Stores the boundary types of a single degree of freedom +template<class TypeTag, class MyTypeTag> +struct VtkOutputFields { using type = UndefinedProperty; }; //!< A class helping models to define default vtk output parameters +template<class TypeTag, class MyTypeTag> +struct IOFields { using type = UndefinedProperty; }; //!< A class helping models to define input and output fields +template<class TypeTag, class MyTypeTag> +struct BaseLocalResidual { using type = UndefinedProperty; }; //!< The type of the base class of the local residual (specific to a discretization scheme) +template<class TypeTag, class MyTypeTag> +struct JacobianMatrix { using type = UndefinedProperty; }; //!< Type of the global jacobian matrix +template<class TypeTag, class MyTypeTag> +struct SolutionVector { using type = UndefinedProperty; }; //!< Vector containing all primary variable vector of the grid +template<class TypeTag, class MyTypeTag> +struct BoundaryTypes { using type = UndefinedProperty; }; //!< Stores the boundary types of a single degree of freedom //! The type of the local residual function, i.e. the equation to be solved. Must inherit //! from the BaseLocalResidual property and fulfill its interfaces. -NEW_PROP_TAG(LocalResidual); +template<class TypeTag, class MyTypeTag> +struct LocalResidual { using type = UndefinedProperty; }; //! TODO: Remove this property as soon as the decoupled models are integrated -NEW_PROP_TAG(LinearSolver); +template<class TypeTag, class MyTypeTag> +struct LinearSolver { using type = UndefinedProperty; }; //////////////////////////////////////////////// // Basic properties regarding balance equations ///////////////////////////////////////////////// // TODO: Integrate UseMoles into BalanceEqOpts -NEW_PROP_TAG(UseMoles); //!< Property whether to use moles or kg as amount unit for balance equations -NEW_PROP_TAG(ReplaceCompEqIdx); //!< The component balance index that should be replaced by the total mass/mole balance -NEW_PROP_TAG(BalanceEqOpts); //!< A class that collects options for the evaluation of the balance equations +template<class TypeTag, class MyTypeTag> +struct UseMoles { using type = UndefinedProperty; }; //!< Property whether to use moles or kg as amount unit for balance equations +template<class TypeTag, class MyTypeTag> +struct ReplaceCompEqIdx { using type = UndefinedProperty; }; //!< The component balance index that should be replaced by the total mass/mole balance +template<class TypeTag, class MyTypeTag> +struct BalanceEqOpts { using type = UndefinedProperty; }; //!< A class that collects options for the evaluation of the balance equations ///////////////////////////////////////////// // Properties used by finite volume schemes: ///////////////////////////////////////////// -NEW_PROP_TAG(ElementBoundaryTypes); //!< Stores the boundary types on an element +template<class TypeTag, class MyTypeTag> +struct ElementBoundaryTypes { using type = UndefinedProperty; }; //!< Stores the boundary types on an element -NEW_PROP_TAG(FVGridGeometry); //!< The type of the global finite volume geometry -NEW_PROP_TAG(EnableFVGridGeometryCache); //!< specifies if geometric data is saved (faster, but more memory consuming) +template<class TypeTag, class MyTypeTag> +struct FVGridGeometry { using type = UndefinedProperty; }; //!< The type of the global finite volume geometry +template<class TypeTag, class MyTypeTag> +struct EnableFVGridGeometryCache { using type = UndefinedProperty; }; //!< specifies if geometric data is saved (faster, but more memory consuming) -NEW_PROP_TAG(VolumeVariables); //!< The secondary variables within a sub-control volume -NEW_PROP_TAG(GridVolumeVariables); //!< The type for a global container for the volume variables -NEW_PROP_TAG(EnableGridVolumeVariablesCache); //!< If disabled, the volume variables are not stored (reduces memory, but is slower) -NEW_PROP_TAG(FluxVariables); //!< Container storing the different types of flux variables -NEW_PROP_TAG(FluxVariablesCache); //!< Stores data associated with flux vars -NEW_PROP_TAG(GridFluxVariablesCache); //!< The global vector of flux variable containers -NEW_PROP_TAG(EnableGridFluxVariablesCache); //!< specifies if data on flux vars should be saved (faster, but more memory consuming) -NEW_PROP_TAG(GridVariables); //!< The grid variables object managing variable data on the grid (volvars/fluxvars cache) +template<class TypeTag, class MyTypeTag> +struct VolumeVariables { using type = UndefinedProperty; }; //!< The secondary variables within a sub-control volume +template<class TypeTag, class MyTypeTag> +struct GridVolumeVariables { using type = UndefinedProperty; }; //!< The type for a global container for the volume variables +template<class TypeTag, class MyTypeTag> +struct EnableGridVolumeVariablesCache { using type = UndefinedProperty; }; //!< If disabled, the volume variables are not stored (reduces memory, but is slower) +template<class TypeTag, class MyTypeTag> +struct FluxVariables { using type = UndefinedProperty; }; //!< Container storing the different types of flux variables +template<class TypeTag, class MyTypeTag> +struct FluxVariablesCache { using type = UndefinedProperty; }; //!< Stores data associated with flux vars +template<class TypeTag, class MyTypeTag> +struct GridFluxVariablesCache { using type = UndefinedProperty; }; //!< The global vector of flux variable containers +template<class TypeTag, class MyTypeTag> +struct EnableGridFluxVariablesCache { using type = UndefinedProperty; }; //!< specifies if data on flux vars should be saved (faster, but more memory consuming) +template<class TypeTag, class MyTypeTag> +struct GridVariables { using type = UndefinedProperty; }; //!< The grid variables object managing variable data on the grid (volvars/fluxvars cache) ///////////////////////////////////////////////////////////////// // Additional properties used by the cell-centered mpfa schemes: ///////////////////////////////////////////////////////////////// -NEW_PROP_TAG(PrimaryInteractionVolume); //!< The primary interaction volume type -NEW_PROP_TAG(SecondaryInteractionVolume); //!< The secondary interaction volume type used e.g. on the boundaries -NEW_PROP_TAG(DualGridNodalIndexSet); //!< The type used for the nodal index sets of the dual grid +template<class TypeTag, class MyTypeTag> +struct PrimaryInteractionVolume { using type = UndefinedProperty; }; //!< The primary interaction volume type +template<class TypeTag, class MyTypeTag> +struct SecondaryInteractionVolume { using type = UndefinedProperty; }; //!< The secondary interaction volume type used e.g. on the boundaries +template<class TypeTag, class MyTypeTag> +struct DualGridNodalIndexSet { using type = UndefinedProperty; }; //!< The type used for the nodal index sets of the dual grid ///////////////////////////////////////////////////////////// // Properties used by models involving flow in porous media: ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(EnergyLocalResidual); //!< The local residual of the energy equation -NEW_PROP_TAG(AdvectionType); //!< The type for the calculation the advective fluxes -NEW_PROP_TAG(SolutionDependentAdvection); //!< specifies if the parameters for the advective fluxes depend on the solution -NEW_PROP_TAG(MolecularDiffusionType); //!< The type for the calculation of the molecular diffusion fluxes -NEW_PROP_TAG(SolutionDependentMolecularDiffusion); //!< specifies if the parameters for the diffusive fluxes depend on the solution -NEW_PROP_TAG(HeatConductionType); //!< The type for the calculation of the heat conduction fluxes -NEW_PROP_TAG(SolutionDependentHeatConduction); //!< specifies if the parameters for the heat conduction fluxes depend on the solution - -NEW_PROP_TAG(SpatialParams); //!< The type of the spatial parameters object -NEW_PROP_TAG(FluidSystem); //!< The type of the fluid system to use -NEW_PROP_TAG(FluidState); //!< The type of the fluid state to use -NEW_PROP_TAG(SolidSystem); //!< The type of the solid system to use -NEW_PROP_TAG(SolidState); //!< The type of the solid state to use -NEW_PROP_TAG(PrimaryVariableSwitch); //!< The primary variable switch needed for compositional models -NEW_PROP_TAG(EffectiveDiffusivityModel); //!< The employed model for the computation of the effective diffusivity -NEW_PROP_TAG(ThermalConductivityModel); //!< Model to be used for the calculation of the effective conductivity -NEW_PROP_TAG(VelocityOutput); //!< specifies the velocity calculation module to be used -NEW_PROP_TAG(Formulation); //!< The formulation of the model +template<class TypeTag, class MyTypeTag> +struct EnergyLocalResidual { using type = UndefinedProperty; }; //!< The local residual of the energy equation +template<class TypeTag, class MyTypeTag> +struct AdvectionType { using type = UndefinedProperty; }; //!< The type for the calculation the advective fluxes +template<class TypeTag, class MyTypeTag> +struct SolutionDependentAdvection { using type = UndefinedProperty; }; //!< specifies if the parameters for the advective fluxes depend on the solution +template<class TypeTag, class MyTypeTag> +struct MolecularDiffusionType { using type = UndefinedProperty; }; //!< The type for the calculation of the molecular diffusion fluxes +template<class TypeTag, class MyTypeTag> +struct SolutionDependentMolecularDiffusion { using type = UndefinedProperty; }; //!< specifies if the parameters for the diffusive fluxes depend on the solution +template<class TypeTag, class MyTypeTag> +struct HeatConductionType { using type = UndefinedProperty; }; //!< The type for the calculation of the heat conduction fluxes +template<class TypeTag, class MyTypeTag> +struct SolutionDependentHeatConduction { using type = UndefinedProperty; }; //!< specifies if the parameters for the heat conduction fluxes depend on the solution + +template<class TypeTag, class MyTypeTag> +struct SpatialParams { using type = UndefinedProperty; }; //!< The type of the spatial parameters object +template<class TypeTag, class MyTypeTag> +struct FluidSystem { using type = UndefinedProperty; }; //!< The type of the fluid system to use +template<class TypeTag, class MyTypeTag> +struct FluidState { using type = UndefinedProperty; }; //!< The type of the fluid state to use +template<class TypeTag, class MyTypeTag> +struct SolidSystem { using type = UndefinedProperty; }; //!< The type of the solid system to use +template<class TypeTag, class MyTypeTag> +struct SolidState { using type = UndefinedProperty; }; //!< The type of the solid state to use +template<class TypeTag, class MyTypeTag> +struct PrimaryVariableSwitch { using type = UndefinedProperty; }; //!< The primary variable switch needed for compositional models +template<class TypeTag, class MyTypeTag> +struct EffectiveDiffusivityModel { using type = UndefinedProperty; }; //!< The employed model for the computation of the effective diffusivity +template<class TypeTag, class MyTypeTag> +struct ThermalConductivityModel { using type = UndefinedProperty; }; //!< Model to be used for the calculation of the effective conductivity +template<class TypeTag, class MyTypeTag> +struct VelocityOutput { using type = UndefinedProperty; }; //!< specifies the velocity calculation module to be used +template<class TypeTag, class MyTypeTag> +struct Formulation { using type = UndefinedProperty; }; //!< The formulation of the model // TODO: is this useful? -> everything is a constraint solver just a different type -NEW_PROP_TAG(UseConstraintSolver); //!< Whether to use a contraint solver for computing the secondary variables +template<class TypeTag, class MyTypeTag> +struct UseConstraintSolver { using type = UndefinedProperty; }; //!< Whether to use a contraint solver for computing the secondary variables // When using the box method in a multi-phase context, an interface solver might be necessary -NEW_PROP_TAG(EnableBoxInterfaceSolver); +template<class TypeTag, class MyTypeTag> +struct EnableBoxInterfaceSolver { using type = UndefinedProperty; }; ////////////////////////////////////////////////////////////// // Additional properties used by the 2pnc and 2pncmin models: ////////////////////////////////////////////////////////////// -NEW_PROP_TAG(Chemistry); //!< The chemistry class with which solves equlibrium reactions -NEW_PROP_TAG(SetMoleFractionsForFirstPhase); //!< Set the mole fraction in the wetting or non-wetting phase +template<class TypeTag, class MyTypeTag> +struct Chemistry { using type = UndefinedProperty; }; //!< The chemistry class with which solves equlibrium reactions +template<class TypeTag, class MyTypeTag> +struct SetMoleFractionsForFirstPhase { using type = UndefinedProperty; }; //!< Set the mole fraction in the wetting or non-wetting phase ////////////////////////////////////////////////////////////// // Additional properties used by the richards model ////////////////////////////////////////////////////////////// -NEW_PROP_TAG(EnableWaterDiffusionInAir); //!< Property for turning Richards into extended Richards +template<class TypeTag, class MyTypeTag> +struct EnableWaterDiffusionInAir { using type = UndefinedProperty; }; //!< Property for turning Richards into extended Richards ////////////////////////////////////////////////////////////// // Additional properties used by the 3pwateroil model: ////////////////////////////////////////////////////////////// -NEW_PROP_TAG(OnlyGasPhaseCanDisappear); //!< reduces the phasestates to threePhases and wnPhaseOnly +template<class TypeTag, class MyTypeTag> +struct OnlyGasPhaseCanDisappear { using type = UndefinedProperty; }; //!< reduces the phasestates to threePhases and wnPhaseOnly ///////////////////////////////////////////////////////////// // Properties used by geomechanical models: ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(StressType); //!< The type used for the evaluation of stress tensors and forces +template<class TypeTag, class MyTypeTag> +struct StressType { using type = UndefinedProperty; }; //!< The type used for the evaluation of stress tensors and forces ///////////////////////////////////////////////////////////// // Properties used by the staggered-grid discretization method ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(NumEqCellCenter); //!< The number of equations for cell-centered dofs -NEW_PROP_TAG(NumEqFace); //!< The number of equations for face dofs -NEW_PROP_TAG(CellCenterSolutionVector); //!< The solution vector type for cell-centered dofs -NEW_PROP_TAG(FaceSolutionVector); //!< The solution vector type for face dofs -NEW_PROP_TAG(GridFaceVariables); //!< Global vector containing face-related data -NEW_PROP_TAG(CellCenterPrimaryVariables); //!< The primary variables container type for cell-centered dofs -NEW_PROP_TAG(FacePrimaryVariables); //!< The primary variables container type for face dofs -NEW_PROP_TAG(IntersectionMapper); //!< Specifies the intersection mapper -NEW_PROP_TAG(StaggeredPrimaryVariables); //!< The hybrid primary variables container type -NEW_PROP_TAG(BaseEpsilon); //!< A base epsilon for numerical differentiation, can contain multiple values -NEW_PROP_TAG(FaceVariables); //!< Class containing local face-related data -NEW_PROP_TAG(BoundaryValues); //!< Class containing local boundary data -NEW_PROP_TAG(StaggeredFaceSolution); //!< A vector containing the solution for a face (similar to ElementSolution) -NEW_PROP_TAG(EnableGridFaceVariablesCache); //!< Switch on/off caching of face variables +template<class TypeTag, class MyTypeTag> +struct NumEqCellCenter { using type = UndefinedProperty; }; //!< The number of equations for cell-centered dofs +template<class TypeTag, class MyTypeTag> +struct NumEqFace { using type = UndefinedProperty; }; //!< The number of equations for face dofs +template<class TypeTag, class MyTypeTag> +struct CellCenterSolutionVector { using type = UndefinedProperty; }; //!< The solution vector type for cell-centered dofs +template<class TypeTag, class MyTypeTag> +struct FaceSolutionVector { using type = UndefinedProperty; }; //!< The solution vector type for face dofs +template<class TypeTag, class MyTypeTag> +struct GridFaceVariables { using type = UndefinedProperty; }; //!< Global vector containing face-related data +template<class TypeTag, class MyTypeTag> +struct CellCenterPrimaryVariables { using type = UndefinedProperty; }; //!< The primary variables container type for cell-centered dofs +template<class TypeTag, class MyTypeTag> +struct FacePrimaryVariables { using type = UndefinedProperty; }; //!< The primary variables container type for face dofs +template<class TypeTag, class MyTypeTag> +struct IntersectionMapper { using type = UndefinedProperty; }; //!< Specifies the intersection mapper +template<class TypeTag, class MyTypeTag> +struct StaggeredPrimaryVariables { using type = UndefinedProperty; }; //!< The hybrid primary variables container type +template<class TypeTag, class MyTypeTag> +struct BaseEpsilon { using type = UndefinedProperty; }; //!< A base epsilon for numerical differentiation, can contain multiple values +template<class TypeTag, class MyTypeTag> +struct FaceVariables { using type = UndefinedProperty; }; //!< Class containing local face-related data +template<class TypeTag, class MyTypeTag> +struct BoundaryValues { using type = UndefinedProperty; }; //!< Class containing local boundary data +template<class TypeTag, class MyTypeTag> +struct StaggeredFaceSolution { using type = UndefinedProperty; }; //!< A vector containing the solution for a face (similar to ElementSolution) +template<class TypeTag, class MyTypeTag> +struct EnableGridFaceVariablesCache { using type = UndefinedProperty; }; //!< Switch on/off caching of face variables ///////////////////////////////////////////////////////////// // Properties used by the mpnc model ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(PressureFormulation); //! the formulation of the pressure e.g most wetting first +template<class TypeTag, class MyTypeTag> +struct PressureFormulation { using type = UndefinedProperty; }; //! the formulation of the pressure e.g most wetting first ///////////////////////////////////////////////////////////// // Properties used by the nonequilibrium model ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(EquilibriumModelTraits); -NEW_PROP_TAG(EquilibriumLocalResidual); -NEW_PROP_TAG(EquilibriumIndices); -NEW_PROP_TAG(EquilibriumIOFields); -NEW_PROP_TAG(NumEqBalance); -NEW_PROP_TAG(EnableThermalNonEquilibrium); -NEW_PROP_TAG(EnableChemicalNonEquilibrium); -NEW_PROP_TAG(NumEnergyEqFluid); -NEW_PROP_TAG(NumEnergyEqSolid); - -NEW_PROP_TAG(AwnSurface); -NEW_PROP_TAG(AwsSurface); -NEW_PROP_TAG(AnsSurface); -NEW_PROP_TAG(NusseltFormulation); -NEW_PROP_TAG(SherwoodFormulation); +template<class TypeTag, class MyTypeTag> +struct EquilibriumModelTraits { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct EquilibriumLocalResidual { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct EquilibriumIndices { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct EquilibriumIOFields { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct NumEqBalance { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct EnableThermalNonEquilibrium { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct EnableChemicalNonEquilibrium { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct NumEnergyEqFluid { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct NumEnergyEqSolid { using type = UndefinedProperty; }; + +template<class TypeTag, class MyTypeTag> +struct AwnSurface { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct AwsSurface { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct AnsSurface { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct NusseltFormulation { using type = UndefinedProperty; }; +template<class TypeTag, class MyTypeTag> +struct SherwoodFormulation { using type = UndefinedProperty; }; ///////////////////////////////////////////////////////////// // Properties used by free flow models ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(NormalizePressure); //!< Returns whether to normalize the pressure term in the momentum balance or not +template<class TypeTag, class MyTypeTag> +struct NormalizePressure { using type = UndefinedProperty; }; //!< Returns whether to normalize the pressure term in the momentum balance or not ///////////////////////////////////////////////////////////// // Properties used by multidomain simulations ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(CouplingManager); +template<class TypeTag, class MyTypeTag> +struct CouplingManager { using type = UndefinedProperty; }; /////////////////////////////////////// // Basic properties of sequential models: /////////////////////////////////////// -NEW_PROP_TAG(TimeManager); +template<class TypeTag, class MyTypeTag> +struct TimeManager { using type = UndefinedProperty; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/common/properties/grid.hh b/dumux/common/properties/grid.hh index 97a97fa946be1e2d58eb0822ea11cf572e37268e..fba2cb7498933e67179fc26b80706b4901fd55e4 100644 --- a/dumux/common/properties/grid.hh +++ b/dumux/common/properties/grid.hh @@ -32,25 +32,30 @@ namespace Dumux { namespace Properties { +namespace TTag { //! Type tag for numeric models. -NEW_TYPE_TAG(GridProperties); +struct GridProperties {}; +} //! Use the leaf grid view if not defined otherwise -SET_TYPE_PROP(GridProperties, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView); +template<class TypeTag> +struct GridView<TypeTag, TTag::GridProperties> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; }; //! Use the minimal point source implementation as default -SET_PROP(GridProperties, PointSource) +template<class TypeTag> +struct PointSource<TypeTag, TTag::GridProperties> { private: - using SourceValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using SourceValues = GetPropType<TypeTag, Properties::NumEqVector>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using GlobalPosition = typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>; public: using type = Dumux::PointSource<GlobalPosition, SourceValues>; }; //! Use the point source helper using the bounding box tree as a default -SET_TYPE_PROP(GridProperties, PointSourceHelper, BoundingBoxTreePointSourceHelper); +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::GridProperties> { using type = BoundingBoxTreePointSourceHelper; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/common/properties/model.hh b/dumux/common/properties/model.hh index ce267a1174f6efe856f573673426be2c5dd0480f..c26c1782b2fb3c12d3949fb9d7d064a15474255b 100644 --- a/dumux/common/properties/model.hh +++ b/dumux/common/properties/model.hh @@ -38,33 +38,42 @@ namespace Dumux { namespace Properties { //! Type tag for numeric models. -NEW_TYPE_TAG(ModelProperties); +namespace TTag { +struct ModelProperties {}; +} //! Set the default type of scalar values to double -SET_TYPE_PROP(ModelProperties, Scalar, double); +template<class TypeTag> +struct Scalar<TypeTag, TTag::ModelProperties> { using type = double; }; //! Set the default vector with size number of equations to a field vector -SET_TYPE_PROP(ModelProperties, NumEqVector, Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>); +template<class TypeTag> +struct NumEqVector<TypeTag, TTag::ModelProperties> { using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }; //! Set the default primary variable vector to a vector of size of number of equations -SET_TYPE_PROP(ModelProperties, PrimaryVariables, typename GET_PROP_TYPE(TypeTag, NumEqVector)); +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::ModelProperties> { using type = GetPropType<TypeTag, Properties::NumEqVector>; }; //! do not specific any model-specific default parameters here -SET_PROP(ModelProperties, ModelDefaultParameters) +template<class TypeTag> +struct ModelDefaultParameters<TypeTag, TTag::ModelProperties> { static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { } }; //! \todo this property is deprecated use IOFields instead! -SET_PROP(ModelProperties, VtkOutputFields) { - using type DUNE_DEPRECATED_MSG("This property is deprecated use property IOFields instead") = typename GET_PROP_TYPE(TypeTag, IOFields); +template<class TypeTag> +struct VtkOutputFields<TypeTag, TTag::ModelProperties> { + using type DUNE_DEPRECATED_MSG("This property is deprecated use property IOFields instead") = GetPropType<TypeTag, Properties::IOFields>; }; //! Set the default to an implementation throwing a NotImplemented error -SET_TYPE_PROP(ModelProperties, IOFields, DefaultIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ModelProperties> { using type = DefaultIOFields; }; //! Set the default class for the balance equation options -SET_TYPE_PROP(ModelProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>); +template<class TypeTag> +struct BalanceEqOpts<TypeTag, TTag::ModelProperties> { using type = BalanceEquationOptions<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/common/properties/propertysystemmacros.hh b/dumux/common/properties/propertysystemmacros.hh index 2cde0ca86851b91279a13fe15c01e52302e57016..9360b2123f1fae53979f0bef263b16640b2840db 100644 --- a/dumux/common/properties/propertysystemmacros.hh +++ b/dumux/common/properties/propertysystemmacros.hh @@ -39,7 +39,6 @@ #ifndef DUMUX_PROPERTY_SYSTEM_MACROS_HH #define DUMUX_PROPERTY_SYSTEM_MACROS_HH -#warning "The property system macros are deprecated -- use the property system without the macros." #include <dumux/common/properties/propertysystem.hh> namespace Dumux { diff --git a/dumux/common/staggeredfvproblem.hh b/dumux/common/staggeredfvproblem.hh index 53ca83709ba777ea040a761aecf7d21a64bf92ff..337d13553ae261608024153cbc3f9ba5cbeab7d6 100644 --- a/dumux/common/staggeredfvproblem.hh +++ b/dumux/common/staggeredfvproblem.hh @@ -45,23 +45,23 @@ template<class TypeTag> class StaggeredFVProblem : public FVProblem<TypeTag> { using ParentType = FVProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Implementation = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using CoordScalar = typename GridView::ctype; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -69,8 +69,8 @@ class StaggeredFVProblem : public FVProblem<TypeTag> static constexpr auto cellCenterIdx = FVGridGeometry::cellCenterIdx(); static constexpr auto faceIdx = FVGridGeometry::faceIdx(); - static constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); - static constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace); + static constexpr auto numEqCellCenter = getPropValue<TypeTag, Properties::NumEqCellCenter>(); + static constexpr auto numEqFace = getPropValue<TypeTag, Properties::NumEqFace>(); public: /*! diff --git a/dumux/common/start.hh b/dumux/common/start.hh index 50a29864221f063aae08efd89f30f89c349f7adb..df5b9cc09ac77e5c000bb5d9d69c2fd035b95b89 100644 --- a/dumux/common/start.hh +++ b/dumux/common/start.hh @@ -58,9 +58,9 @@ int start_(int argc, void (*usage)(const char *, const std::string &)) { // some aliases for better readability - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using TimeManager = GetPropType<TypeTag, Properties::TimeManager>; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -73,14 +73,14 @@ int start_(int argc, // parse the command line arguments and input file //////////////////////////////////////////////////////////// - auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TypeTag, ModelDefaultParameters)::defaultParams(p);}; + auto defaultParams = [] (Dune::ParameterTree& p) {GetProp<TypeTag, Properties::ModelDefaultParameters>::defaultParams(p);}; Parameters::init(argc, argv, defaultParams, usage); ////////////////////////////////////////////////////////////////////// // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); ////////////////////////////////////////////////////////////////////// diff --git a/dumux/common/timemanager.hh b/dumux/common/timemanager.hh index df85af76f94b6e0f58e710de6cebb39a19603586..35cf3ae10fa837ce0c5ec6ce6c2213c68ab4c99a 100644 --- a/dumux/common/timemanager.hh +++ b/dumux/common/timemanager.hh @@ -61,8 +61,8 @@ namespace Dumux { template <class TypeTag> class TimeManager { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; TimeManager(const TimeManager&) {} diff --git a/dumux/discretization/box/darcyslaw.hh b/dumux/discretization/box/darcyslaw.hh index 6dc0b1a274f195baef260949c2fed0f60676c14c..deaff1df78de4963e17a5ea914ae29ea4fbc5b00 100644 --- a/dumux/discretization/box/darcyslaw.hh +++ b/dumux/discretization/box/darcyslaw.hh @@ -46,7 +46,7 @@ class BoxDarcysLaw; */ template<class TypeTag> class DarcysLawImplementation<TypeTag, DiscretizationMethod::box> -: public BoxDarcysLaw<typename GET_PROP_TYPE(TypeTag, Scalar), typename GET_PROP_TYPE(TypeTag, FVGridGeometry)> +: public BoxDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::FVGridGeometry>> { }; /*! diff --git a/dumux/discretization/box/fickslaw.hh b/dumux/discretization/box/fickslaw.hh index a0b169c5dca5622e316f4f562be4651c15f6025f..8acf0826b6bd13f204e9da958fe9561432ba1d61 100644 --- a/dumux/discretization/box/fickslaw.hh +++ b/dumux/discretization/box/fickslaw.hh @@ -41,22 +41,22 @@ class FicksLawImplementation; template <class TypeTag> class FicksLawImplementation<TypeTag, DiscretizationMethod::box> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVarCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using BalanceEqOpts = typename GET_PROP_TYPE(TypeTag, BalanceEqOpts); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVarCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using BalanceEqOpts = GetPropType<TypeTag, Properties::BalanceEqOpts>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using IndexType = typename GridView::IndexSet::IndexType; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum { dim = GridView::dimension} ; @@ -100,7 +100,7 @@ public: continue; // effective diffusion tensors - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; auto insideD = EffDiffModel::effectiveDiffusivity(insideVolVars.porosity(), insideVolVars.saturation(phaseIdx), insideVolVars.diffusionCoefficient(phaseIdx, compIdx)); @@ -153,7 +153,7 @@ public: continue; // effective diffusion tensors - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; auto insideD = EffDiffModel::effectiveDiffusivity(insideVolVars.porosity(), insideVolVars.saturation(phaseIdx), insideVolVars.diffusionCoefficient(phaseIdx, compIdx)); diff --git a/dumux/discretization/box/fourierslaw.hh b/dumux/discretization/box/fourierslaw.hh index 61a6055556981f862cae5d994ceaf680420a9eee..3378e20680b291c6792546ea820516f6bd3896fe 100644 --- a/dumux/discretization/box/fourierslaw.hh +++ b/dumux/discretization/box/fourierslaw.hh @@ -41,26 +41,26 @@ class FouriersLawImplementation; template <class TypeTag> class FouriersLawImplementation<TypeTag, DiscretizationMethod::box> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; using Element = typename GridView::template Codim<0>::Entity; enum { dim = GridView::dimension} ; enum { dimWorld = GridView::dimensionworld} ; - enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()} ; + enum { numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases()} ; using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; diff --git a/dumux/discretization/box/fourierslawnonequilibrium.hh b/dumux/discretization/box/fourierslawnonequilibrium.hh index 4b6cff87aa567964273cbe2d9032bc82487003fa..ee9fca8d306c40d8f5a1b3c805fd0816b84c3e3f 100644 --- a/dumux/discretization/box/fourierslawnonequilibrium.hh +++ b/dumux/discretization/box/fourierslawnonequilibrium.hh @@ -44,27 +44,27 @@ class FouriersLawNonEquilibriumImplementation; template <class TypeTag> class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::box> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; using Element = typename GridView::template Codim<0>::Entity; enum { dim = GridView::dimension} ; enum { dimWorld = GridView::dimensionworld} ; - enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()} ; - enum { numEnergyEqFluid = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid) }; + enum { numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases()} ; + enum { numEnergyEqFluid = getPropValue<TypeTag, Properties::NumEnergyEqFluid>() }; enum {sPhaseIdx = FluidSystem::numPhases}; using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; diff --git a/dumux/discretization/box/maxwellstefanslaw.hh b/dumux/discretization/box/maxwellstefanslaw.hh index 31ad92455e917cf2227604258ce258ecf82d9f2b..3b1287a62dbd5e016c04b36d8496318e31677bd7 100644 --- a/dumux/discretization/box/maxwellstefanslaw.hh +++ b/dumux/discretization/box/maxwellstefanslaw.hh @@ -45,19 +45,19 @@ class MaxwellStefansLawImplementation; template <class TypeTag> class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::box > { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -65,8 +65,8 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::box > enum { dimWorld = GridView::dimensionworld} ; enum { - numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(), - numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() + numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), + numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents() }; using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; @@ -159,7 +159,7 @@ private: for (int compIIdx = 0; compIIdx < numComponents-1; compIIdx++) { // effective diffusion tensors - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; const auto xi = moleFrac[compIIdx]; @@ -209,7 +209,7 @@ private: } private: - template <class T = TypeTag, typename std::enable_if_t<GET_PROP_TYPE(T, FluidSystem)::isTracerFluidSystem(), int> =0 > + template <class T = TypeTag, typename std::enable_if_t<GetPropType<T, Properties::FluidSystem>::isTracerFluidSystem(), int> =0 > static Scalar getDiffusionCoefficient(const int phaseIdx, const int compIIdx, const int compJIdx, @@ -225,7 +225,7 @@ private: scv); } - template <class T = TypeTag, typename std::enable_if_t<!GET_PROP_TYPE(T, FluidSystem)::isTracerFluidSystem(), int> =0 > + template <class T = TypeTag, typename std::enable_if_t<!GetPropType<T, Properties::FluidSystem>::isTracerFluidSystem(), int> =0 > static Scalar getDiffusionCoefficient(const int phaseIdx, const int compIIdx, const int compJIdx, diff --git a/dumux/discretization/box/properties.hh b/dumux/discretization/box/properties.hh index 32a0bccda46b5a9eaf799923d2ce33d4d6194886..ce2a57f18193e9094ee5a78bfc0548759b61cdff 100644 --- a/dumux/discretization/box/properties.hh +++ b/dumux/discretization/box/properties.hh @@ -47,46 +47,54 @@ namespace Dumux { namespace Properties { //! Type tag for the box scheme. -NEW_TYPE_TAG(BoxModel, INHERITS_FROM(FiniteVolumeModel)); +// Create new type tags +namespace TTag { +struct BoxModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; }; +} // end namespace TTag //! Set the default for the global finite volume geometry -SET_PROP(BoxModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::BoxModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = BoxFVGridGeometry<Scalar, GridView, enableCache>; }; //! The grid volume variables vector class -SET_PROP(BoxModel, GridVolumeVariables) +template<class TypeTag> +struct GridVolumeVariables<TypeTag, TTag::BoxModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; public: using type = BoxGridVolumeVariables<Problem, VolumeVariables, enableCache>; }; //! The grid flux variables cache vector class -SET_PROP(BoxModel, GridFluxVariablesCache) +template<class TypeTag> +struct GridFluxVariablesCache<TypeTag, TTag::BoxModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; public: using type = BoxGridFluxVariablesCache<Problem, FluxVariablesCache, enableCache>; }; //! Set the default for the ElementBoundaryTypes -SET_TYPE_PROP(BoxModel, ElementBoundaryTypes, BoxElementBoundaryTypes<typename GET_PROP_TYPE(TypeTag, BoundaryTypes)>); +template<class TypeTag> +struct ElementBoundaryTypes<TypeTag, TTag::BoxModel> { using type = BoxElementBoundaryTypes<GetPropType<TypeTag, Properties::BoundaryTypes>>; }; //! Set the BaseLocalResidual to BoxLocalResidual -SET_TYPE_PROP(BoxModel, BaseLocalResidual, BoxLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::BoxModel> { using type = BoxLocalResidual<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh index b821ce3cfee70caf3859a9edfad5db74da9b3bdc..fd18b34195c4f965928a8051d2bb57d69178917d 100644 --- a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh @@ -45,17 +45,17 @@ class DarcysLawImplementation; template<class TypeTag> class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; //! Class that fills the cache corresponding to mpfa Darcy's Law class MpfaDarcysLawCacheFiller @@ -93,21 +93,21 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> { static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; - static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); + static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); - using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); + using DualGridNodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using Stencil = typename DualGridNodalIndexSet::NodalGridStencilType; using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); - using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); + using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; using PrimaryIvDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; - using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; using SecondaryIvDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; diff --git a/dumux/discretization/cellcentered/mpfa/fickslaw.hh b/dumux/discretization/cellcentered/mpfa/fickslaw.hh index 6918cdbf32e541ed5fa90e2890cb626edf622226..d9afded35c0da64b34acb164e3cf66c40058a9fb 100644 --- a/dumux/discretization/cellcentered/mpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fickslaw.hh @@ -41,21 +41,21 @@ class FicksLawImplementation; template <class TypeTag> class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using BalanceEqOpts = typename GET_PROP_TYPE(TypeTag, BalanceEqOpts); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using BalanceEqOpts = GetPropType<TypeTag, Properties::BalanceEqOpts>; - static constexpr int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); + static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; //! Class that fills the cache corresponding to mpfa Fick's Law @@ -91,19 +91,19 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> //! The cache used in conjunction with the mpfa Fick's Law class MpfaFicksLawCache { - using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); + using DualGridNodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using Stencil = typename DualGridNodalIndexSet::NodalGridStencilType; using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); - using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); + using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; using PrimaryIvDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; - using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; using SecondaryIvDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; @@ -111,7 +111,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> static constexpr int dim = GridView::dimension; static constexpr int dimWorld = GridView::dimensionworld; - static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); + static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); public: // export filler type @@ -308,7 +308,7 @@ private: const SubControlVolumeFace& scvf, const unsigned int phaseIdx) { - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; // use the harmonic mean between inside and outside const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()]; diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index b0fdbd3f90568d0be9e37a631123fddb5022e5eb..8d8b4968a906578f3dbfee41c7ee425f738c96c8 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -42,23 +42,23 @@ namespace Dumux template<class TypeTag> class CCMpfaFluxVariablesCacheFiller { - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using MpfaHelper = typename FVGridGeometry::MpfaHelper; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); + using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; using PrimaryDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle; using PrimaryLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; - using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; using SecondaryDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle; using SecondaryLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; @@ -69,9 +69,9 @@ class CCMpfaFluxVariablesCacheFiller static constexpr bool doDiffusion = ModelTraits::enableMolecularDiffusion(); static constexpr bool doHeatConduction = ModelTraits::enableEnergyBalance(); - static constexpr bool soldependentAdvection = GET_PROP_VALUE(TypeTag, SolutionDependentAdvection); - static constexpr bool soldependentDiffusion = GET_PROP_VALUE(TypeTag, SolutionDependentMolecularDiffusion); - static constexpr bool soldependentHeatConduction = GET_PROP_VALUE(TypeTag, SolutionDependentHeatConduction); + static constexpr bool soldependentAdvection = getPropValue<TypeTag, Properties::SolutionDependentAdvection>(); + static constexpr bool soldependentDiffusion = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>(); + static constexpr bool soldependentHeatConduction = getPropValue<TypeTag, Properties::SolutionDependentHeatConduction>(); public: //! This cache filler is always solution-dependent, as it updates the @@ -252,7 +252,7 @@ private: const std::vector<FluxVariablesCache*>& ivFluxVarCaches, bool forceUpdateAll = false) { - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; using AdvectionFiller = typename AdvectionType::Cache::Filler; // fill data in the handle @@ -308,7 +308,7 @@ private: const std::vector<FluxVariablesCache*>& ivFluxVarCaches, bool forceUpdateAll = false) { - using DiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); + using DiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; using DiffusionFiller = typename DiffusionType::Cache::Filler; static constexpr int numPhases = ModelTraits::numPhases(); @@ -318,7 +318,7 @@ private: { for (unsigned int compIdx = 0; compIdx < numComponents; ++compIdx) { - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; if (compIdx == FluidSystem::getMainComponent(phaseIdx)) continue; @@ -379,7 +379,7 @@ private: const std::vector<FluxVariablesCache*>& ivFluxVarCaches, bool forceUpdateAll = false) { - using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); + using HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>; using HeatConductionFiller = typename HeatConductionType::Cache::Filler; // prepare data in handle @@ -427,7 +427,7 @@ private: //! prepares the quantities necessary for advective fluxes in the handle template< class InteractionVolume, class DataHandle, - class AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType), + class AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>, typename std::enable_if_t<AdvectionType::discMethod == DiscretizationMethod::ccmpfa, int> = 0 > void fillAdvectionHandle(InteractionVolume& iv, DataHandle& handle, bool forceUpdateAll) { @@ -509,7 +509,7 @@ private: //! prepares the quantities necessary for diffusive fluxes in the handle template< class InteractionVolume, class DataHandle, - class DiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType), + class DiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>, typename std::enable_if_t<DiffusionType::discMethod == DiscretizationMethod::ccmpfa, int> = 0 > void fillDiffusionHandle(InteractionVolume& iv, DataHandle& handle, @@ -551,7 +551,7 @@ private: //! prepares the quantities necessary for conductive fluxes in the handle template< class InteractionVolume, class DataHandle, - class HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType), + class HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>, typename std::enable_if_t<HeatConductionType::discMethod == DiscretizationMethod::ccmpfa, int> = 0 > void fillHeatConductionHandle(InteractionVolume& iv, DataHandle& handle, bool forceUpdateAll) { @@ -568,11 +568,11 @@ private: localAssembler.assemble( handle.heatConductionTout(), handle.heatConductionT(), iv, - LambdaFactory::template getHeatConductionLambda<typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel)>() ); + LambdaFactory::template getHeatConductionLambda<GetPropType<TypeTag, Properties::ThermalConductivityModel>>() ); else localAssembler.assemble( handle.heatConductionT(), iv, - LambdaFactory::template getHeatConductionLambda<typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel)>() ); + LambdaFactory::template getHeatConductionLambda<GetPropType<TypeTag, Properties::ThermalConductivityModel>>() ); } // assemble vector of temperatures @@ -584,21 +584,21 @@ private: //! fill handle only when advection uses mpfa template< class InteractionVolume, class DataHandle, - class AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType), + class AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>, typename std::enable_if_t<AdvectionType::discMethod != DiscretizationMethod::ccmpfa, int> = 0 > void fillAdvectionHandle(InteractionVolume& iv, DataHandle& handle, bool forceUpdateAll) {} //! fill handle only when diffusion uses mpfa template< class InteractionVolume, class DataHandle, - class DiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType), + class DiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>, typename std::enable_if_t<DiffusionType::discMethod != DiscretizationMethod::ccmpfa, int> = 0 > void fillDiffusionHandle(InteractionVolume& iv, DataHandle& handle, bool forceUpdateAll, int phaseIdx, int compIdx) {} //! fill handle only when heat conduction uses mpfa template< class InteractionVolume, class DataHandle, - class HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType), + class HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>, typename std::enable_if_t<HeatConductionType::discMethod != DiscretizationMethod::ccmpfa, int> = 0 > void fillHeatConductionHandle(InteractionVolume& iv, DataHandle& handle, bool forceUpdateAll) {} diff --git a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh index 5172118bf0fdc4bda3452633218d3b42088717bd..db27fa6202ed1c534e10289f50a3f6a700c5f2c3 100644 --- a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh @@ -43,18 +43,18 @@ class FouriersLawImplementation; template <class TypeTag> class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVarsCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVarsCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; //! Class that fills the cache corresponding to mpfa Darcy's Law class MpfaFouriersLawCacheFiller @@ -88,19 +88,19 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> //! The cache used in conjunction with the mpfa Fourier's Law class MpfaFouriersLawCache { - using DualGridNodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); + using DualGridNodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using Stencil = typename DualGridNodalIndexSet::NodalGridStencilType; using MpfaHelper = typename FVGridGeometry::MpfaHelper; static constexpr bool considerSecondaryIVs = MpfaHelper::considerSecondaryIVs(); - using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); + using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; using PrimaryIvLocalFaceData = typename PrimaryInteractionVolume::Traits::LocalFaceData; using PrimaryIvDataHandle = typename ElementFluxVarsCache::PrimaryIvDataHandle; using PrimaryIvCellVector = typename PrimaryInteractionVolume::Traits::MatVecTraits::CellVector; using PrimaryIvTij = typename PrimaryInteractionVolume::Traits::MatVecTraits::TMatrix::row_type; - using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; using SecondaryIvLocalFaceData = typename SecondaryInteractionVolume::Traits::LocalFaceData; using SecondaryIvDataHandle = typename ElementFluxVarsCache::SecondaryIvDataHandle; using SecondaryIvCellVector = typename SecondaryInteractionVolume::Traits::MatVecTraits::CellVector; diff --git a/dumux/discretization/cellcentered/mpfa/properties.hh b/dumux/discretization/cellcentered/mpfa/properties.hh index eaae8dab1c04cab18a882ccb77ca7f62e723806d..9741f71c65fdcb923d4505d11d578be6adc1f46a 100644 --- a/dumux/discretization/cellcentered/mpfa/properties.hh +++ b/dumux/discretization/cellcentered/mpfa/properties.hh @@ -52,13 +52,17 @@ namespace Dumux { namespace Properties { //! Type tag for the cell-centered mpfa scheme. -NEW_TYPE_TAG(CCMpfaModel, INHERITS_FROM(FiniteVolumeModel)); +// Create new type tags +namespace TTag { +struct CCMpfaModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; }; +} // end namespace TTag //! Set the index set type used on the dual grid nodes -SET_PROP(CCMpfaModel, DualGridNodalIndexSet) +template<class TypeTag> +struct DualGridNodalIndexSet<TypeTag, TTag::CCMpfaModel> { private: - using GV = typename GET_PROP_TYPE(TypeTag, GridView); + using GV = GetPropType<TypeTag, Properties::GridView>; using Traits = NodalIndexSetDefaultTraits< GV >; public: @@ -66,18 +70,20 @@ public: }; //! Per default, we use the dynamic mpfa-o interaction volume -SET_PROP(CCMpfaModel, PrimaryInteractionVolume) +template<class TypeTag> +struct PrimaryInteractionVolume<TypeTag, TTag::CCMpfaModel> { public: - using type = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using type = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; }; //! Per default, we use the dynamic mpfa-o interaction volume on boundaries -SET_PROP(CCMpfaModel, SecondaryInteractionVolume) +template<class TypeTag> +struct SecondaryInteractionVolume<TypeTag, TTag::CCMpfaModel> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; // use the default traits using Traits = CCMpfaODefaultInteractionVolumeTraits< NodalIndexSet, Scalar >; @@ -86,42 +92,45 @@ public: }; //! Set the default for the global finite volume geometry -SET_PROP(CCMpfaModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::CCMpfaModel> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using PrimaryIV = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); - using SecondaryIV = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); - using NodalIndexSet = typename GET_PROP_TYPE(TypeTag, DualGridNodalIndexSet); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using PrimaryIV = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; + using SecondaryIV = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; + using NodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using Traits = CCMpfaFVGridGeometryTraits<GridView, NodalIndexSet, PrimaryIV, SecondaryIV>; public: - using type = CCMpfaFVGridGeometry<GridView, Traits, GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache)>; + using type = CCMpfaFVGridGeometry<GridView, Traits, getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>()>; }; //! The grid volume variables vector class -SET_PROP(CCMpfaModel, GridVolumeVariables) +template<class TypeTag> +struct GridVolumeVariables<TypeTag, TTag::CCMpfaModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; public: using type = CCMpfaGridVolumeVariables<Problem, VolumeVariables, enableCache>; }; //! The grid volume variables vector class -SET_PROP(CCMpfaModel, GridFluxVariablesCache) +template<class TypeTag> +struct GridFluxVariablesCache<TypeTag, TTag::CCMpfaModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; using FluxVariablesCacheFiller = CCMpfaFluxVariablesCacheFiller<TypeTag>; - using PrimaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, PrimaryInteractionVolume); - using SecondaryInteractionVolume = typename GET_PROP_TYPE(TypeTag, SecondaryInteractionVolume); + using PrimaryInteractionVolume = GetPropType<TypeTag, Properties::PrimaryInteractionVolume>; + using SecondaryInteractionVolume = GetPropType<TypeTag, Properties::SecondaryInteractionVolume>; - using PhysicsTraits = IvDataHandlePhysicsTraits<typename GET_PROP_TYPE(TypeTag, ModelTraits)>; + using PhysicsTraits = IvDataHandlePhysicsTraits<GetPropType<TypeTag, Properties::ModelTraits>>; using PrimaryMatVecTraits = typename PrimaryInteractionVolume::Traits::MatVecTraits; using SecondaryMatVecTraits = typename SecondaryInteractionVolume::Traits::MatVecTraits; @@ -137,10 +146,12 @@ public: }; //! Set the default for the ElementBoundaryTypes -SET_TYPE_PROP(CCMpfaModel, ElementBoundaryTypes, CCElementBoundaryTypes); +template<class TypeTag> +struct ElementBoundaryTypes<TypeTag, TTag::CCMpfaModel> { using type = CCElementBoundaryTypes; }; //! Set the BaseLocalResidual to CCLocalResidual -SET_TYPE_PROP(CCMpfaModel, BaseLocalResidual, CCLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::CCMpfaModel> { using type = CCLocalResidual<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/discretization/cellcentered/tpfa/darcyslaw.hh b/dumux/discretization/cellcentered/tpfa/darcyslaw.hh index 34b6da1e608d8029e3ac68a7b3f483370352e4ee..0632af88dfbd09eef7c6f01b802c3fffdf4b2f2e 100644 --- a/dumux/discretization/cellcentered/tpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/darcyslaw.hh @@ -55,9 +55,9 @@ class CCTpfaDarcysLaw; */ template <class TypeTag> class DarcysLawImplementation<TypeTag, DiscretizationMethod::cctpfa> -: public CCTpfaDarcysLaw<typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - (GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView::dimension < GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView::dimensionworld)> +: public CCTpfaDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry>, + (GetPropType<TypeTag, Properties::FVGridGeometry>::GridView::dimension < GetPropType<TypeTag, Properties::FVGridGeometry>::GridView::dimensionworld)> {}; /*! diff --git a/dumux/discretization/cellcentered/tpfa/fickslaw.hh b/dumux/discretization/cellcentered/tpfa/fickslaw.hh index 40f02dfb6936d4fa64aea6f82d968471cfee598c..c0f47995a946c58540d66431ac5d99cabee1d746 100644 --- a/dumux/discretization/cellcentered/tpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/fickslaw.hh @@ -44,22 +44,22 @@ template <class TypeTag> class FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa> { using Implementation = FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename GridView::template Codim<0>::Entity; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BalanceEqOpts = typename GET_PROP_TYPE(TypeTag, BalanceEqOpts); + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BalanceEqOpts = GetPropType<TypeTag, Properties::BalanceEqOpts>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; static const int dim = GridView::dimension; @@ -175,7 +175,7 @@ public: const auto& insideScv = fvGeometry.scv(insideScvIdx); const auto& insideVolVars = elemVolVars[insideScvIdx]; - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; const auto insideD = EffDiffModel::effectiveDiffusivity(insideVolVars.porosity(), insideVolVars.saturation(phaseIdx), insideVolVars.diffusionCoefficient(phaseIdx, compIdx)); diff --git a/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh index 1e20f6d34c4c05fd83d324722932402580861fc4..0948f9b3a0a054459a609f1c4825d01ee15c3266 100644 --- a/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh @@ -36,14 +36,14 @@ namespace Dumux { template<class TypeTag> class CCTpfaFluxVariablesCacheFiller { - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; using Element = typename GridView::template Codim<0>::Entity; @@ -51,9 +51,9 @@ class CCTpfaFluxVariablesCacheFiller static constexpr bool doDiffusion = ModelTraits::enableMolecularDiffusion(); static constexpr bool doHeatConduction = ModelTraits::enableEnergyBalance(); - static constexpr bool soldependentAdvection = GET_PROP_VALUE(TypeTag, SolutionDependentAdvection); - static constexpr bool soldependentDiffusion = GET_PROP_VALUE(TypeTag, SolutionDependentMolecularDiffusion); - static constexpr bool soldependentHeatConduction = GET_PROP_VALUE(TypeTag, SolutionDependentHeatConduction); + static constexpr bool soldependentAdvection = getPropValue<TypeTag, Properties::SolutionDependentAdvection>(); + static constexpr bool soldependentDiffusion = getPropValue<TypeTag, Properties::SolutionDependentMolecularDiffusion>(); + static constexpr bool soldependentHeatConduction = getPropValue<TypeTag, Properties::SolutionDependentHeatConduction>(); public: static constexpr bool isSolDependent = (doAdvection && soldependentAdvection) || @@ -115,7 +115,7 @@ private: const ElementVolumeVariables& elemVolVars, const SubControlVolumeFace& scvf) { - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; using AdvectionFiller = typename AdvectionType::Cache::Filler; // forward to the filler for the advective quantities @@ -141,9 +141,9 @@ private: const ElementVolumeVariables& elemVolVars, const SubControlVolumeFace& scvf) { - using DiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); + using DiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; using DiffusionFiller = typename DiffusionType::Cache::Filler; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int numComponents = ModelTraits::numComponents(); @@ -174,7 +174,7 @@ private: const ElementVolumeVariables& elemVolVars, const SubControlVolumeFace& scvf) { - using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); + using HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>; using HeatConductionFiller = typename HeatConductionType::Cache::Filler; // forward to the filler of the diffusive quantities diff --git a/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh b/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh index 422a96cd8d159ffc678a9944d2beb93dac973008..214dc17aaad3ade064a5ebc8fa594301f1a8ce37 100644 --- a/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh @@ -59,9 +59,9 @@ class CCTpfaForchheimersLaw; */ template <class TypeTag> class ForchheimersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> -: public CCTpfaForchheimersLaw<typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - (GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView::dimension < GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView::dimensionworld)> +: public CCTpfaForchheimersLaw<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry>, + (GetPropType<TypeTag, Properties::FVGridGeometry>::GridView::dimension < GetPropType<TypeTag, Properties::FVGridGeometry>::GridView::dimensionworld)> {}; /*! diff --git a/dumux/discretization/cellcentered/tpfa/fourierslaw.hh b/dumux/discretization/cellcentered/tpfa/fourierslaw.hh index cc7aae09b841cdeb765b350296c2dfc0c6730459..3e7d9d708ef5a64b9211ceea34645514fcd74224 100644 --- a/dumux/discretization/cellcentered/tpfa/fourierslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/fourierslaw.hh @@ -44,24 +44,24 @@ template <class TypeTag> class FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa> { using Implementation = FouriersLawImplementation<TypeTag, DiscretizationMethod::cctpfa>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename GridView::template Codim<0>::Entity; - using ElementFluxVarsCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + using ElementFluxVarsCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; //! Class that fills the cache corresponding to tpfa Fick's Law class TpfaFouriersLawCacheFiller diff --git a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh index cd3aa7160e0788e532e204b48a2772789577f428..2da51ac99dfa833f994cca0a4ec2406667da181d 100644 --- a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh @@ -45,26 +45,26 @@ class MaxwellStefansLawImplementation; template <class TypeTag> class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::cctpfa > { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using EffDiffModel = GetPropType<TypeTag, Properties::EffectiveDiffusivityModel>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename GridView::template Codim<0>::Entity; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - static const int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); - static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); + static const int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; @@ -241,7 +241,7 @@ private: return reducedDiffusionMatrix; } - template <class T = TypeTag, typename std::enable_if_t<GET_PROP_TYPE(T, FluidSystem)::isTracerFluidSystem(), int> =0 > + template <class T = TypeTag, typename std::enable_if_t<GetPropType<T, Properties::FluidSystem>::isTracerFluidSystem(), int> =0 > static Scalar getDiffusionCoefficient(const int phaseIdx, const int compIIdx, const int compJIdx, @@ -257,7 +257,7 @@ private: scv); } - template <class T = TypeTag, typename std::enable_if_t<!GET_PROP_TYPE(T, FluidSystem)::isTracerFluidSystem(), int> =0 > + template <class T = TypeTag, typename std::enable_if_t<!GetPropType<T, Properties::FluidSystem>::isTracerFluidSystem(), int> =0 > static Scalar getDiffusionCoefficient(const int phaseIdx, const int compIIdx, const int compJIdx, diff --git a/dumux/discretization/cellcentered/tpfa/properties.hh b/dumux/discretization/cellcentered/tpfa/properties.hh index 777a3b66f9c78315c57063d8ba3e2575eaa73809..e96067e70f0ff259959c23e6ddef42119791ab60 100644 --- a/dumux/discretization/cellcentered/tpfa/properties.hh +++ b/dumux/discretization/cellcentered/tpfa/properties.hh @@ -46,46 +46,54 @@ namespace Dumux { namespace Properties { //! Type tag for the cell-centered tpfa scheme. -NEW_TYPE_TAG(CCTpfaModel, INHERITS_FROM(FiniteVolumeModel)); +// Create new type tags +namespace TTag { +struct CCTpfaModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; }; +} // end namespace TTag //! Set the default for the global finite volume geometry -SET_PROP(CCTpfaModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::CCTpfaModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; public: using type = CCTpfaFVGridGeometry<GridView, enableCache>; }; //! The grid volume variables vector class -SET_PROP(CCTpfaModel, GridVolumeVariables) +template<class TypeTag> +struct GridVolumeVariables<TypeTag, TTag::CCTpfaModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; public: using type = CCTpfaGridVolumeVariables<Problem, VolumeVariables, enableCache>; }; //! The grid flux variables cache vector class -SET_PROP(CCTpfaModel, GridFluxVariablesCache) +template<class TypeTag> +struct GridFluxVariablesCache<TypeTag, TTag::CCTpfaModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; using FluxVariablesCacheFiller = CCTpfaFluxVariablesCacheFiller<TypeTag>; public: using type = CCTpfaGridFluxVariablesCache<Problem, FluxVariablesCache, FluxVariablesCacheFiller, enableCache>; }; //! Set the default for the ElementBoundaryTypes -SET_TYPE_PROP(CCTpfaModel, ElementBoundaryTypes, CCElementBoundaryTypes); +template<class TypeTag> +struct ElementBoundaryTypes<TypeTag, TTag::CCTpfaModel> { using type = CCElementBoundaryTypes; }; //! Set the BaseLocalResidual to CCLocalResidual -SET_TYPE_PROP(CCTpfaModel, BaseLocalResidual, CCLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::CCTpfaModel> { using type = CCLocalResidual<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/discretization/darcyslaw.hh b/dumux/discretization/darcyslaw.hh index a424ef90343dd816ae0664bb610e58a834b92e5d..939686a6cedf397bed691c6670045bfbf2af03d4 100644 --- a/dumux/discretization/darcyslaw.hh +++ b/dumux/discretization/darcyslaw.hh @@ -44,7 +44,7 @@ class DarcysLawImplementation * These specializations are found in the headers included below. */ template <class TypeTag> -using DarcysLaw = DarcysLawImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using DarcysLaw = DarcysLawImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace Dumux diff --git a/dumux/discretization/fickslaw.hh b/dumux/discretization/fickslaw.hh index 66f370f134b9359ca061cb43f74bdcfec78b8d8f..3a40c70a4c5062bfd056867f72f9d328dbef7062 100644 --- a/dumux/discretization/fickslaw.hh +++ b/dumux/discretization/fickslaw.hh @@ -40,7 +40,7 @@ class FicksLawImplementation; * \brief Evaluates the diffusive mass flux according to Fick's law */ template <class TypeTag> -using FicksLaw = FicksLawImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FicksLaw = FicksLawImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace Dumux diff --git a/dumux/discretization/forchheimerslaw.hh b/dumux/discretization/forchheimerslaw.hh index a4053fae2b246c38770e3796e8f9221febca7719..ea82cd9bf4e74777f99119822d86c41ad4217033 100644 --- a/dumux/discretization/forchheimerslaw.hh +++ b/dumux/discretization/forchheimerslaw.hh @@ -46,7 +46,7 @@ class ForchheimersLawImplementation * These specializations are found in the headers included below. */ template <class TypeTag> -using ForchheimersLaw = ForchheimersLawImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using ForchheimersLaw = ForchheimersLawImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace Dumux diff --git a/dumux/discretization/fourierslaw.hh b/dumux/discretization/fourierslaw.hh index 05e85a7fcc8e5933e35ec1cff05997d5dff9fd8e..4c6858f7379fb8398c69da550899a361941b3b7c 100644 --- a/dumux/discretization/fourierslaw.hh +++ b/dumux/discretization/fourierslaw.hh @@ -41,7 +41,7 @@ class FouriersLawImplementation * \brief Evaluates the heat conduction flux according to Fouriers's law */ template <class TypeTag> -using FouriersLaw = FouriersLawImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FouriersLaw = FouriersLawImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace Dumux diff --git a/dumux/discretization/fourierslawnonequilibrium.hh b/dumux/discretization/fourierslawnonequilibrium.hh index 02a9228f45ec02e42ec847fa343bdeb36f146d7f..cbd9c38946d9d29decd08e89b7f6cc2795383d20 100644 --- a/dumux/discretization/fourierslawnonequilibrium.hh +++ b/dumux/discretization/fourierslawnonequilibrium.hh @@ -39,7 +39,7 @@ class FouriersLawNonEquilibriumImplementation * \brief Evaluates the heat conduction flux according to Fouriers's law */ template <class TypeTag> -using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FouriersLawNonEquilibrium = FouriersLawNonEquilibriumImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace Dumux diff --git a/dumux/discretization/fvproperties.hh b/dumux/discretization/fvproperties.hh index 477ecf134a321490415dc0a7c36fef4eb20edef8..e0008341c8f98fd39644e8f9f6cb3f8471130cc7 100644 --- a/dumux/discretization/fvproperties.hh +++ b/dumux/discretization/fvproperties.hh @@ -38,43 +38,53 @@ namespace Dumux { namespace Properties { //! Type tag for finite-volume schemes. -NEW_TYPE_TAG(FiniteVolumeModel, INHERITS_FROM(GridProperties)); +// Create new type tags +namespace TTag { +struct FiniteVolumeModel { using InheritsFrom = std::tuple<GridProperties>; }; +} // end namespace TTag //! The grid variables -SET_PROP(FiniteVolumeModel, GridVariables) +template<class TypeTag> +struct GridVariables<TypeTag, TTag::FiniteVolumeModel> { private: - using GG = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GVV = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables); - using GFVC = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache); + using GG = GetPropType<TypeTag, Properties::FVGridGeometry>; + using GVV = GetPropType<TypeTag, Properties::GridVolumeVariables>; + using GFVC = GetPropType<TypeTag, Properties::GridFluxVariablesCache>; public: using type = FVGridVariables<GG, GVV, GFVC>; }; //! We do not store the FVGeometry by default -SET_BOOL_PROP(FiniteVolumeModel, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; }; //! We do not store the volume variables by default -SET_BOOL_PROP(FiniteVolumeModel, EnableGridVolumeVariablesCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; }; //! disable flux variables data caching by default -SET_BOOL_PROP(FiniteVolumeModel, EnableGridFluxVariablesCache, false); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; }; //! Boundary types at a single degree of freedom -SET_TYPE_PROP(FiniteVolumeModel, BoundaryTypes, Dumux::BoundaryTypes<GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>); +template<class TypeTag> +struct BoundaryTypes<TypeTag, TTag::FiniteVolumeModel> { using type = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }; // TODO: bundle SolutionVector, JacobianMatrix // in LinearAlgebra traits //! The type of a solution for the whole grid at a fixed time TODO: move to LinearAlgebra traits -SET_TYPE_PROP(FiniteVolumeModel, SolutionVector, Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>); +template<class TypeTag> +struct SolutionVector<TypeTag, TTag::FiniteVolumeModel> { using type = Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariables>>; }; //! Set the type of a global jacobian matrix from the solution types TODO: move to LinearAlgebra traits -SET_PROP(FiniteVolumeModel, JacobianMatrix) +template<class TypeTag> +struct JacobianMatrix<TypeTag, TTag::FiniteVolumeModel> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; using MatrixBlock = typename Dune::FieldMatrix<Scalar, numEq, numEq>; public: using type = typename Dune::BCRSMatrix<MatrixBlock>; diff --git a/dumux/discretization/maxwellstefanslaw.hh b/dumux/discretization/maxwellstefanslaw.hh index 1d1a96315cc23b66cd2798a4708ec566d2b96463..3c79e3988497f9851c3d1269d1975e2618a6f7e3 100644 --- a/dumux/discretization/maxwellstefanslaw.hh +++ b/dumux/discretization/maxwellstefanslaw.hh @@ -39,7 +39,7 @@ class MaxwellStefansLawImplementation * \brief Evaluates the diffusive mass flux according to Maxwell Stafan's law */ template <class TypeTag> -using MaxwellStefansLaw = MaxwellStefansLawImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using MaxwellStefansLaw = MaxwellStefansLawImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/discretization/staggered/freeflow/fickslaw.hh b/dumux/discretization/staggered/freeflow/fickslaw.hh index a9ecaeafd1deaa3e6c7cdadefd694f5d15f890b5..b60a7941f0ac3cf45a61ea534bfe79eba0b5323d 100644 --- a/dumux/discretization/staggered/freeflow/fickslaw.hh +++ b/dumux/discretization/staggered/freeflow/fickslaw.hh @@ -47,16 +47,16 @@ class FicksLawImplementation; template <class TypeTag> class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered > { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = ModelTraits::numComponents(); using NumEqVector = Dune::FieldVector<Scalar, numComponents>; diff --git a/dumux/discretization/staggered/freeflow/fourierslaw.hh b/dumux/discretization/staggered/freeflow/fourierslaw.hh index 8a7cad13947403c607c38ec69c0570a96a2e72f4..87190ee824927afbd23d45145b75a0f86f8332fe 100644 --- a/dumux/discretization/staggered/freeflow/fourierslaw.hh +++ b/dumux/discretization/staggered/freeflow/fourierslaw.hh @@ -43,13 +43,13 @@ class FouriersLawImplementation; template <class TypeTag> class FouriersLawImplementation<TypeTag, DiscretizationMethod::staggered> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; public: // state the discretization method this implementation belongs to diff --git a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh index 8c30ed552576f70c5da46102d64b45a57f6337ae..db4019e618d49e2aad28ed8de4210f45216b52b3 100644 --- a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh +++ b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh @@ -45,27 +45,27 @@ class MaxwellStefansLawImplementation; template <class TypeTag> class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered > { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static const int numComponents = ModelTraits::numComponents(); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using ReducedComponentVector = Dune::FieldVector<Scalar, numComponents-1>; using ReducedComponentMatrix = Dune::FieldMatrix<Scalar, numComponents-1, numComponents-1>; diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 14c484bf72ec590c733fea8b6ed6611419ff640d..463ad490d5204f009d090211e49a416c09207a9d 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -49,13 +49,17 @@ namespace Properties { //! Type tag for the staggered scheme specialized for free flow. -NEW_TYPE_TAG(StaggeredFreeFlowModel, INHERITS_FROM(StaggeredModel)); +// Create new type tags +namespace TTag { +struct StaggeredFreeFlowModel { using InheritsFrom = std::tuple<StaggeredModel>; }; +} // end namespace TTag /*! * \brief Set the number of equations on the faces to 1. We only consider scalar values because the velocity vector * is normal to the face. */ -SET_INT_PROP(StaggeredFreeFlowModel, NumEqFace, 1); +template<class TypeTag> +struct NumEqFace<TypeTag, TTag::StaggeredFreeFlowModel> { static constexpr int value = 1; }; /*! * \brief For free flow models, we take the number of "physical" equations @@ -63,11 +67,12 @@ SET_INT_PROP(StaggeredFreeFlowModel, NumEqFace, 1); * and substract the number of dimensions. This yields the number of equations to be * solved on the cell centers. Works also for non-isothermal models. */ -SET_PROP(StaggeredFreeFlowModel, NumEqCellCenter) +template<class TypeTag> +struct NumEqCellCenter<TypeTag, TTag::StaggeredFreeFlowModel> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr auto dim = GridView::dimension; static constexpr auto numEq = ModelTraits::numEq(); public: @@ -75,33 +80,36 @@ public: }; //! The default fv grid geometry -SET_PROP(StaggeredFreeFlowModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::StaggeredFreeFlowModel> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Traits = StaggeredFreeFlowDefaultFVGridGeometryTraits<GridView>; - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); public: using type = StaggeredFVGridGeometry<GridView, enableCache, Traits>; }; //! The variables living on the faces -SET_PROP(StaggeredFreeFlowModel, FaceVariables) +template<class TypeTag> +struct FaceVariables<TypeTag, TTag::StaggeredFreeFlowModel> { private: - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using GridView = GetPropType<TypeTag, Properties::GridView>; public: using type = StaggeredFaceVariables<FacePrimaryVariables, GridView::dimension>; }; //! Set the default global volume variables cache vector class -SET_PROP(StaggeredFreeFlowModel, GridVolumeVariables) +template<class TypeTag> +struct GridVolumeVariables<TypeTag, TTag::StaggeredFreeFlowModel> { private: - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - static constexpr auto enableCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + static constexpr auto enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); using Traits = StaggeredGridDefaultGridVolumeVariablesTraits<Problem, VolumeVariables>; public: using type = StaggeredGridVolumeVariables<Traits, enableCache>; @@ -109,15 +117,19 @@ public: //! Boundary types at a single degree of freedom -SET_PROP(StaggeredFreeFlowModel, BoundaryTypes) +template<class TypeTag> +struct BoundaryTypes<TypeTag, TTag::StaggeredFreeFlowModel> { - using type = StaggeredFreeFlowBoundaryTypes<GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using type = StaggeredFreeFlowBoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }; //! The velocity output -SET_TYPE_PROP(StaggeredFreeFlowModel, VelocityOutput, - StaggeredFreeFlowVelocityOutput<typename GET_PROP_TYPE(TypeTag, GridVariables), - typename GET_PROP_TYPE(TypeTag, SolutionVector)>); +template<class TypeTag> +struct VelocityOutput<TypeTag, TTag::StaggeredFreeFlowModel> +{ + using type = StaggeredFreeFlowVelocityOutput<GetPropType<TypeTag, Properties::GridVariables>, + GetPropType<TypeTag, Properties::SolutionVector>>; +}; } // namespace Properties } // namespace Dumux diff --git a/dumux/discretization/staggered/properties.hh b/dumux/discretization/staggered/properties.hh index ee6efa6794d9a2aca6ffd6a1a676792176552eba..7eda80d69421b1358740f4a300a00f864b6cb419 100644 --- a/dumux/discretization/staggered/properties.hh +++ b/dumux/discretization/staggered/properties.hh @@ -56,107 +56,124 @@ class CCElementBoundaryTypes; namespace Properties { //! Type tag for the staggered scheme. -NEW_TYPE_TAG(StaggeredModel, INHERITS_FROM(FiniteVolumeModel)); +// Create new type tags +namespace TTag { +struct StaggeredModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; }; +} // end namespace TTag //! Set the default global face variables cache vector class -SET_PROP(StaggeredModel, GridFaceVariables) +template<class TypeTag> +struct GridFaceVariables<TypeTag, TTag::StaggeredModel> { private: - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FaceVariables = typename GET_PROP_TYPE(TypeTag, FaceVariables); - static constexpr auto enableCache = GET_PROP_VALUE(TypeTag, EnableGridFaceVariablesCache); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FaceVariables = GetPropType<TypeTag, Properties::FaceVariables>; + static constexpr auto enableCache = getPropValue<TypeTag, Properties::EnableGridFaceVariablesCache>(); public: using type = StaggeredGridFaceVariables<Problem, FaceVariables, enableCache>; }; //! Cache the face variables per default -SET_BOOL_PROP(StaggeredModel, EnableGridFaceVariablesCache, true); +template<class TypeTag> +struct EnableGridFaceVariablesCache<TypeTag, TTag::StaggeredModel> { static constexpr bool value = true; }; //! Set the global flux variables cache vector class -SET_PROP(StaggeredModel, GridFluxVariablesCache) +template<class TypeTag> +struct GridFluxVariablesCache<TypeTag, TTag::StaggeredModel> { private: - static constexpr auto enableCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); + static constexpr auto enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; using FluxVariablesCacheFiller = FluxVariablesCaching::EmptyCacheFiller; public: using type = StaggeredGridFluxVariablesCache<Problem, FluxVariablesCache, FluxVariablesCacheFiller, enableCache>; }; //! Set the face solution type -SET_PROP(StaggeredModel, StaggeredFaceSolution) +template<class TypeTag> +struct StaggeredFaceSolution<TypeTag, TTag::StaggeredModel> { private: - using FaceSolutionVector = typename GET_PROP_TYPE(TypeTag, FaceSolutionVector); + using FaceSolutionVector = GetPropType<TypeTag, Properties::FaceSolutionVector>; public: using type = Dumux::StaggeredFaceSolution<FaceSolutionVector>; }; //! Set the grid variables (volume, flux and face variables) -SET_PROP(StaggeredModel, GridVariables) +template<class TypeTag> +struct GridVariables<TypeTag, TTag::StaggeredModel> { private: - using GG = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GVV = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables); - using GFVC = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache); - using GFV = typename GET_PROP_TYPE(TypeTag, GridFaceVariables); + using GG = GetPropType<TypeTag, Properties::FVGridGeometry>; + using GVV = GetPropType<TypeTag, Properties::GridVolumeVariables>; + using GFVC = GetPropType<TypeTag, Properties::GridFluxVariablesCache>; + using GFV = GetPropType<TypeTag, Properties::GridFaceVariables>; public: using type = StaggeredGridVariables<GG, GVV, GFVC, GFV>; }; //! Use the cell center element boundary types per default -SET_TYPE_PROP(StaggeredModel, ElementBoundaryTypes, CCElementBoundaryTypes); +template<class TypeTag> +struct ElementBoundaryTypes<TypeTag, TTag::StaggeredModel> { using type = CCElementBoundaryTypes; }; //! Set the BaseLocalResidual to StaggeredLocalResidual -SET_TYPE_PROP(StaggeredModel, BaseLocalResidual, StaggeredLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::StaggeredModel> { using type = StaggeredLocalResidual<TypeTag>; }; //! The cell center primary variables -SET_TYPE_PROP(StaggeredModel, - CellCenterPrimaryVariables, - Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_VALUE(TypeTag, NumEqCellCenter)>); +template<class TypeTag> +struct CellCenterPrimaryVariables<TypeTag, TTag::StaggeredModel> +{ + using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + getPropValue<TypeTag, Properties::NumEqCellCenter>()>; +}; //! The face primary variables -SET_TYPE_PROP(StaggeredModel, - FacePrimaryVariables, - Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_VALUE(TypeTag, NumEqFace)>); +template<class TypeTag> +struct FacePrimaryVariables<TypeTag, TTag::StaggeredModel> +{ + using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + getPropValue<TypeTag, Properties::NumEqFace>()>; +}; //! Boundary types at a single degree of freedom -SET_TYPE_PROP(StaggeredModel, BoundaryTypes, Dumux::BoundaryTypes<GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>); +template<class TypeTag> +struct BoundaryTypes<TypeTag, TTag::StaggeredModel> { using type = Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; }; // TODO: bundle SolutionVector, JacobianMatrix // in LinearAlgebra traits //! The type of a solution for the whole grid at a fixed time TODO: move to LinearAlgebra traits -SET_TYPE_PROP(StaggeredModel, - CellCenterSolutionVector, - Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables)>); +template<class TypeTag> +struct CellCenterSolutionVector<TypeTag, TTag::StaggeredModel> +{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>>; }; //! The type of a solution for the whole grid at a fixed time TODO: move to LinearAlgebra traits -SET_TYPE_PROP(StaggeredModel, - FaceSolutionVector, - Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables)>); +template<class TypeTag> +struct FaceSolutionVector<TypeTag, TTag::StaggeredModel> +{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::FacePrimaryVariables>>; }; //! default property value for the solution vector only used for monolithic solver TODO: move to LinearAlgebra traits -SET_PROP(StaggeredModel, SolutionVector) +template<class TypeTag> +struct SolutionVector<TypeTag, TTag::StaggeredModel> { private: - using CellCenterSolutionVector = typename GET_PROP_TYPE(TypeTag, CellCenterSolutionVector); - using FaceSolutionVector = typename GET_PROP_TYPE(TypeTag, FaceSolutionVector); + using CellCenterSolutionVector = GetPropType<TypeTag, Properties::CellCenterSolutionVector>; + using FaceSolutionVector = GetPropType<TypeTag, Properties::FaceSolutionVector>; public: using type = Dune::MultiTypeBlockVector<CellCenterSolutionVector, FaceSolutionVector>; }; //! Set the type of a global jacobian matrix from the solution types TODO: move to LinearAlgebra traits -SET_PROP(StaggeredModel, JacobianMatrix) +template<class TypeTag> +struct JacobianMatrix<TypeTag, TTag::StaggeredModel> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - static constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter); - static constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace); + static constexpr auto numEqCellCenter = getPropValue<TypeTag, Properties::NumEqCellCenter>(); + static constexpr auto numEqFace = getPropValue<TypeTag, Properties::NumEqFace>(); public: // the sub-blocks diff --git a/dumux/freeflow/compositional/fluxvariables.hh b/dumux/freeflow/compositional/fluxvariables.hh index 89ea6aa83005e180ef63bf294c101e5c0b6b4e56..3a974cdafda95842d75f4b16718550c843aac61c 100644 --- a/dumux/freeflow/compositional/fluxvariables.hh +++ b/dumux/freeflow/compositional/fluxvariables.hh @@ -43,7 +43,7 @@ class FreeflowNCFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 5b2ad1784d40fd91f35e3780fef3805168ab92b4..8aa3b0b7f6c6b3239c741b89556e4a4066833c9a 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -46,8 +46,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component isothermal k-epsilon model -NEW_TYPE_TAG(KEpsilonNC, INHERITS_FROM(NavierStokesNC)); +struct KEpsilonNC { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values @@ -72,27 +75,29 @@ struct KEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMo }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model -SET_PROP(KEpsilonNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KEpsilonNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dimension = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = KEpsilonNCModelTraits<dimension, numComponents, useMoles, replaceCompEqIdx>; }; //! Set the volume variables property -SET_PROP(KEpsilonNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KEpsilonNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -106,7 +111,8 @@ public: }; //! The local residual -SET_PROP(KEpsilonNC, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KEpsilonNC> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -115,7 +121,8 @@ public: }; //! The flux variables -SET_PROP(KEpsilonNC, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KEpsilonNC> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -124,38 +131,44 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(KEpsilonNC, IOFields, FreeflowNCIOFields<KEpsilonIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KEpsilonNC> { using type = FreeflowNCIOFields<KEpsilonIOFields, true/*turbulenceModel*/>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-epsilon model ////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component non-isothermal k-epsilon models -NEW_TYPE_TAG(KEpsilonNCNI, INHERITS_FROM(NavierStokesNCNI)); +struct KEpsilonNCNI { using InheritsFrom = std::tuple<NavierStokesNCNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(KEpsilonNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KEpsilonNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = KEpsilonNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! Set the volume variables property -SET_PROP(KEpsilonNCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KEpsilonNCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -169,7 +182,8 @@ public: }; //! The local residual -SET_PROP(KEpsilonNCNI, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KEpsilonNCNI> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -178,7 +192,8 @@ public: }; //! The flux variables -SET_PROP(KEpsilonNCNI, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KEpsilonNCNI> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -187,7 +202,8 @@ public: }; //! The specific I/O fields -SET_PROP(KEpsilonNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::KEpsilonNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<KEpsilonIOFields, true/*turbulenceModel*/>; diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index 79843e06efc8a06ed52aa60e42874bff522cbb78..b0994f00d3c97ea9fcb0bd720f5c66ab26ee821c 100644 --- a/dumux/freeflow/compositional/komegancmodel.hh +++ b/dumux/freeflow/compositional/komegancmodel.hh @@ -46,8 +46,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component isothermal k-omega model -NEW_TYPE_TAG(KOmegaNC, INHERITS_FROM(NavierStokesNC)); +struct KOmegaNC { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values @@ -90,27 +93,29 @@ struct KOmegaNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMole }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model -SET_PROP(KOmegaNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KOmegaNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dimension = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = KOmegaNCModelTraits<dimension, numComponents, useMoles, replaceCompEqIdx>; }; //! Set the volume variables property -SET_PROP(KOmegaNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KOmegaNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -124,7 +129,8 @@ public: }; //! The local residual -SET_PROP(KOmegaNC, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KOmegaNC> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -133,7 +139,8 @@ public: }; //! The flux variables -SET_PROP(KOmegaNC, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KOmegaNC> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -142,38 +149,44 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(KOmegaNC, IOFields, FreeflowNCIOFields<KOmegaIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KOmegaNC> { using type = FreeflowNCIOFields<KOmegaIOFields, true/*turbulenceModel*/>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-omega model ////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component non-isothermal k-omega models -NEW_TYPE_TAG(KOmegaNCNI, INHERITS_FROM(NavierStokesNCNI)); +struct KOmegaNCNI { using InheritsFrom = std::tuple<NavierStokesNCNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(KOmegaNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KOmegaNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = KOmegaNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! Set the volume variables property -SET_PROP(KOmegaNCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KOmegaNCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -187,7 +200,8 @@ public: }; //! The local residual -SET_PROP(KOmegaNCNI, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KOmegaNCNI> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -196,7 +210,8 @@ public: }; //! The flux variables -SET_PROP(KOmegaNCNI, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KOmegaNCNI> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -205,7 +220,8 @@ public: }; //! The specific I/O fields -SET_PROP(KOmegaNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::KOmegaNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<KOmegaIOFields, true/*turbulenceModel*/>; diff --git a/dumux/freeflow/compositional/localresidual.hh b/dumux/freeflow/compositional/localresidual.hh index 9079a3d4b2058d14318f70dc28a6bb28111ad291..6dae9689f0ff214f74e293268d5c9ce7d99fe765 100644 --- a/dumux/freeflow/compositional/localresidual.hh +++ b/dumux/freeflow/compositional/localresidual.hh @@ -44,7 +44,7 @@ class FreeflowNCResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 5859f653380010cfd7448981dab7f55cc632a727..2bb361528ff29b33c9ecdc4ca690194198e6e745 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -46,8 +46,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component isothermal low-Re k-epsilon model -NEW_TYPE_TAG(LowReKEpsilonNC, INHERITS_FROM(NavierStokesNC)); +struct LowReKEpsilonNC { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values @@ -77,27 +80,29 @@ struct LowReKEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model -SET_PROP(LowReKEpsilonNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::LowReKEpsilonNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dimension = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = LowReKEpsilonNCModelTraits<dimension, numComponents, useMoles, replaceCompEqIdx>; }; //! Set the volume variables property -SET_PROP(LowReKEpsilonNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::LowReKEpsilonNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -111,7 +116,8 @@ public: }; //! The local residual -SET_PROP(LowReKEpsilonNC, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::LowReKEpsilonNC> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -120,7 +126,8 @@ public: }; //! The flux variables -SET_PROP(LowReKEpsilonNC, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::LowReKEpsilonNC> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -129,38 +136,44 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(LowReKEpsilonNC, IOFields, FreeflowNCIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::LowReKEpsilonNC> { using type = FreeflowNCIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component low-Re k-epsilon model ////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component non-isothermal low-Re k-epsilon models -NEW_TYPE_TAG(LowReKEpsilonNCNI, INHERITS_FROM(NavierStokesNCNI)); +struct LowReKEpsilonNCNI { using InheritsFrom = std::tuple<NavierStokesNCNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(LowReKEpsilonNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::LowReKEpsilonNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = LowReKEpsilonNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! Set the volume variables property -SET_PROP(LowReKEpsilonNCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::LowReKEpsilonNCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -174,7 +187,8 @@ public: }; //! The local residual -SET_PROP(LowReKEpsilonNCNI, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::LowReKEpsilonNCNI> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -183,7 +197,8 @@ public: }; //! The flux variables -SET_PROP(LowReKEpsilonNCNI, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::LowReKEpsilonNCNI> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -192,7 +207,8 @@ public: }; //! The specific I/O fields -SET_PROP(LowReKEpsilonNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::LowReKEpsilonNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>; diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index 27b91f3765dee5f705f38da1c7158bb8127caefb..ce3cdc8dc5e06cb0b8dd3e955deffa5077f668ab 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -113,46 +113,55 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, multi-component isothermal free-flow model -NEW_TYPE_TAG(NavierStokesNC, INHERITS_FROM(FreeFlow)); +struct NavierStokesNC { using InheritsFrom = std::tuple<FreeFlow>; }; //! The type tag for the single-phase, multi-component non-isothermal free-flow model -NEW_TYPE_TAG(NavierStokesNCNI, INHERITS_FROM(NavierStokesNC)); +struct NavierStokesNCNI { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values /////////////////////////////////////////////////////////////////////////// //!< states some specifics of the free-flow model -SET_PROP(NavierStokesNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::NavierStokesNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = NavierStokesNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; }; -SET_BOOL_PROP(NavierStokesNC, UseMoles, false); //!< Defines whether molar (true) or mass (false) density is used -SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); //<! Set the ReplaceCompEqIdx to 0 by default -SET_BOOL_PROP(NavierStokesNC, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default +template<class TypeTag> +struct UseMoles<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = false; }; //!< Defines whether molar (true) or mass (false) density is used +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::NavierStokesNC> { static constexpr int value = 0; }; //<! Set the ReplaceCompEqIdx to 0 by default +template<class TypeTag> +struct NormalizePressure<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = true; }; //!< Normalize the pressure term in the momentum balance by default //! The local residual -SET_TYPE_PROP(NavierStokesNC, LocalResidual, FreeflowNCResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::NavierStokesNC> { using type = FreeflowNCResidual<TypeTag>; }; //! Set the volume variables property -SET_PROP(NavierStokesNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::NavierStokesNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -165,13 +174,16 @@ public: }; //! The flux variables -SET_TYPE_PROP(NavierStokesNC, FluxVariables, FreeflowNCFluxVariables<TypeTag>); +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::NavierStokesNC> { using type = FreeflowNCFluxVariables<TypeTag>; }; //! The flux variables cache class, by default the one for free flow -SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>); +template<class TypeTag> +struct FluxVariablesCache<TypeTag, TTag::NavierStokesNC> { using type = FreeFlowFluxVariablesCache<TypeTag>; }; //! The specific I/O fields -SET_TYPE_PROP(NavierStokesNC, IOFields, FreeflowNCIOFields<NavierStokesIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::NavierStokesNC> { using type = FreeflowNCIOFields<NavierStokesIOFields>; }; /*! * \brief The fluid state which is used by the volume variables to @@ -179,39 +191,43 @@ SET_TYPE_PROP(NavierStokesNC, IOFields, FreeflowNCIOFields<NavierStokesIOFields> * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(NavierStokesNC, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::NavierStokesNC> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! Use Fick's law for molecular diffusion per default -SET_TYPE_PROP(NavierStokesNC, MolecularDiffusionType, FicksLaw<TypeTag>); +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::NavierStokesNC> { using type = FicksLaw<TypeTag>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component free-flow model ////////////////////////////////////////////////////////////////////////// //! The model traits of the non-isothermal model -SET_PROP(NavierStokesNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::NavierStokesNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = NavierStokesNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! The non-isothermal I/O fields -SET_PROP(NavierStokesNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::NavierStokesNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<NavierStokesIOFields>; @@ -220,7 +236,8 @@ public: }; //! Use Fourier's Law as default heat conduction type -SET_TYPE_PROP(NavierStokesNCNI, HeatConductionType, FouriersLaw<TypeTag>); +template<class TypeTag> +struct HeatConductionType<TypeTag, TTag::NavierStokesNCNI> { using type = FouriersLaw<TypeTag>; }; // \} } // end namespace Properties diff --git a/dumux/freeflow/compositional/oneeqncmodel.hh b/dumux/freeflow/compositional/oneeqncmodel.hh index 5673309cfce64cda1a5387031280aceaebd9579f..9b7c6eac4c978ee378c35217a0a06eb1aec82cb7 100644 --- a/dumux/freeflow/compositional/oneeqncmodel.hh +++ b/dumux/freeflow/compositional/oneeqncmodel.hh @@ -46,8 +46,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component isothermal one-equation model -NEW_TYPE_TAG(OneEqNC, INHERITS_FROM(NavierStokesNC)); +struct OneEqNC { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values @@ -88,27 +91,29 @@ struct OneEqNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMoles }; //!< states some specifics of the isothermal multi-component one-equation model -SET_PROP(OneEqNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OneEqNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dimension = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = OneEqNCModelTraits<dimension, numComponents, useMoles, replaceCompEqIdx>; }; //! Set the volume variables property -SET_PROP(OneEqNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OneEqNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -122,7 +127,8 @@ public: }; //! The local residual -SET_PROP(OneEqNC, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OneEqNC> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -131,7 +137,8 @@ public: }; //! The flux variables -SET_PROP(OneEqNC, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::OneEqNC> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -140,38 +147,44 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(OneEqNC, IOFields, FreeflowNCIOFields<OneEqIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OneEqNC> { using type = FreeflowNCIOFields<OneEqIOFields, true/*turbulenceModel*/>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component one-equation model ////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component non-isothermal one-equation models -NEW_TYPE_TAG(OneEqNCNI, INHERITS_FROM(NavierStokesNCNI)); +struct OneEqNCNI { using InheritsFrom = std::tuple<NavierStokesNCNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(OneEqNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OneEqNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = OneEqNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! Set the volume variables property -SET_PROP(OneEqNCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OneEqNCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -185,7 +198,8 @@ public: }; //! The local residual -SET_PROP(OneEqNCNI, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OneEqNCNI> { private: using BaseLocalResidual = FreeflowNCResidual<TypeTag>; @@ -194,7 +208,8 @@ public: }; //! The flux variables -SET_PROP(OneEqNCNI, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::OneEqNCNI> { private: using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>; @@ -203,7 +218,8 @@ public: }; //! The specific I/O fields -SET_PROP(OneEqNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::OneEqNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<OneEqIOFields, true/*turbulenceModel*/>; diff --git a/dumux/freeflow/compositional/staggered/fluxvariables.hh b/dumux/freeflow/compositional/staggered/fluxvariables.hh index 9f88711b1d709986fd8361397d824b71f3baf14e..62120ac8c0e920f0c1e947235f1c248b4b1073f1 100644 --- a/dumux/freeflow/compositional/staggered/fluxvariables.hh +++ b/dumux/freeflow/compositional/staggered/fluxvariables.hh @@ -46,19 +46,19 @@ class FreeflowNCFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> : public NavierStokesFluxVariables<TypeTag> { using ParentType = NavierStokesFluxVariables<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; public: static constexpr auto numComponents = ModelTraits::numComponents(); static constexpr bool useMoles = ModelTraits::useMoles(); - using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); + using MolecularDiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; /*! * \brief Computes the flux for the cell center residual. diff --git a/dumux/freeflow/compositional/staggered/localresidual.hh b/dumux/freeflow/compositional/staggered/localresidual.hh index e0f3764d2ac9b293d1461469a68f75604d64967d..7dae74bdace51371e91d7ff97234e4f672fadf36 100644 --- a/dumux/freeflow/compositional/staggered/localresidual.hh +++ b/dumux/freeflow/compositional/staggered/localresidual.hh @@ -44,22 +44,22 @@ class FreeflowNCResidualImpl<TypeTag, DiscretizationMethod::staggered> { using ParentType = NavierStokesResidual<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; using CellCenterResidual = CellCenterPrimaryVariables; static constexpr int numComponents =ModelTraits::numComponents(); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); static constexpr auto cellCenterOffset = ParentType::cellCenterOffset; using EnergyLocalResidual = typename ParentType::EnergyLocalResidual; diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index 8974cf29ae4c69935b3f61681c19aeebe937d9dc..4907d98300b57ea0519a7ff3bf6db0c2643117ab 100644 --- a/dumux/freeflow/compositional/zeroeqncmodel.hh +++ b/dumux/freeflow/compositional/zeroeqncmodel.hh @@ -46,8 +46,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component isothermal ZeroEq model -NEW_TYPE_TAG(ZeroEqNC, INHERITS_FROM(NavierStokesNC)); +struct ZeroEqNC { using InheritsFrom = std::tuple<NavierStokesNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values @@ -65,27 +68,29 @@ struct ZeroEqNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useM, r }; //! The model traits of the isothermal model -SET_PROP(ZeroEqNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ZeroEqNC> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); public: using type = ZeroEqNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; }; //! Set the volume variables property -SET_PROP(ZeroEqNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ZeroEqNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -99,38 +104,44 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(ZeroEqNC, IOFields, FreeflowNCIOFields<RANSIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ZeroEqNC> { using type = FreeflowNCIOFields<RANSIOFields, true/*turbulenceModel*/>; }; ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component ZeroEq model ////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tags for the single-phase, multi-component non-isothermal ZeroEq models -NEW_TYPE_TAG(ZeroEqNCNI, INHERITS_FROM(NavierStokesNCNI)); +struct ZeroEqNCNI { using InheritsFrom = std::tuple<NavierStokesNCNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(ZeroEqNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ZeroEqNCNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int numComponents = FluidSystem::numComponents; - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr int replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static constexpr int replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); using IsothermalModelTraits = ZeroEqNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>; public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; //! Set the volume variables property -SET_PROP(ZeroEqNCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ZeroEqNCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -144,7 +155,8 @@ public: }; //! The specific I/O fields -SET_PROP(ZeroEqNCNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::ZeroEqNCNI> { private: using IsothermalIOFields = FreeflowNCIOFields<RANSIOFields, true/*turbulenceModel*/>; diff --git a/dumux/freeflow/navierstokes/fluxvariables.hh b/dumux/freeflow/navierstokes/fluxvariables.hh index a746f5ef37a8dcbeb193ddd14ccd9e505d00d1f3..4b56d6c7da8823a672755affc1f79e11cdae1058 100644 --- a/dumux/freeflow/navierstokes/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/fluxvariables.hh @@ -43,7 +43,7 @@ class NavierStokesFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using NavierStokesFluxVariables = NavierStokesFluxVariablesImpl<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/navierstokes/fluxvariablescache.hh b/dumux/freeflow/navierstokes/fluxvariablescache.hh index 5c0ff808072e8e271006a7add204c5ae6770eae5..cefa335c94e2efc95a46699e38e815ac159926d8 100644 --- a/dumux/freeflow/navierstokes/fluxvariablescache.hh +++ b/dumux/freeflow/navierstokes/fluxvariablescache.hh @@ -40,7 +40,7 @@ class FreeFlowFluxVariablesCacheImplementation * Store flux stencils and data required for flux calculation */ template<class TypeTag> -using FreeFlowFluxVariablesCache = FreeFlowFluxVariablesCacheImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using FreeFlowFluxVariablesCache = FreeFlowFluxVariablesCacheImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; /*! * \ingroup NavierStokesModel @@ -51,10 +51,10 @@ using FreeFlowFluxVariablesCache = FreeFlowFluxVariablesCacheImplementation<Type template<class TypeTag> class FreeFlowFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::staggered> { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; diff --git a/dumux/freeflow/navierstokes/localresidual.hh b/dumux/freeflow/navierstokes/localresidual.hh index 9a57a526101a7dfe0c21de412e3203ea837e6bce..78ae3014c6c8d1fc49d887311c1af53654ff1099 100644 --- a/dumux/freeflow/navierstokes/localresidual.hh +++ b/dumux/freeflow/navierstokes/localresidual.hh @@ -43,7 +43,7 @@ class NavierStokesResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag> -using NavierStokesResidual = NavierStokesResidualImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using NavierStokesResidual = NavierStokesResidualImpl<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 8ad2e9e6365a33af457a461d592db6c4726a2b18..3fdb573ea2737eeeed5b0c80720fbdcc3af1c904 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -136,22 +136,27 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Navier-Stokes model -NEW_TYPE_TAG(NavierStokes, INHERITS_FROM(FreeFlow)); +struct NavierStokes { using InheritsFrom = std::tuple<FreeFlow>; }; //! The type tag for the corresponding non-isothermal model -NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes)); +struct NavierStokesNI { using InheritsFrom = std::tuple<NavierStokes>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_BOOL_PROP(NavierStokes, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default +template<class TypeTag> +struct NormalizePressure<TypeTag, TTag::NavierStokes> { static constexpr bool value = true; }; //!< Normalize the pressure term in the momentum balance by default //!< states some specifics of the Navier-Stokes model -SET_PROP(NavierStokes, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::NavierStokes> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr auto dim = GridView::dimension; public: using type = NavierStokesModelTraits<dim>; @@ -163,25 +168,28 @@ public: * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(NavierStokes, FluidState){ +template<class TypeTag> +struct FluidState<TypeTag, TTag::NavierStokes>{ private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = Dumux::ImmiscibleFluidState<Scalar, FluidSystem>; }; //! The local residual -SET_TYPE_PROP(NavierStokes, LocalResidual, NavierStokesResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::NavierStokes> { using type = NavierStokesResidual<TypeTag>; }; //! Set the volume variables property -SET_PROP(NavierStokes, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::NavierStokes> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -193,23 +201,27 @@ public: }; //! The flux variables -SET_TYPE_PROP(NavierStokes, FluxVariables, NavierStokesFluxVariables<TypeTag>); +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::NavierStokes> { using type = NavierStokesFluxVariables<TypeTag>; }; //! The flux variables cache class, by default the one for free flow -SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>); +template<class TypeTag> +struct FluxVariablesCache<TypeTag, TTag::NavierStokes> { using type = FreeFlowFluxVariablesCache<TypeTag>; }; //! The specific I/O fields -SET_TYPE_PROP(NavierStokes, IOFields, NavierStokesIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::NavierStokes> { using type = NavierStokesIOFields; }; ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Navier-Stokes model ////////////////////////////////////////////////////////////////// //! The model traits of the non-isothermal model -SET_PROP(NavierStokesNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::NavierStokesNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr auto dim = GridView::dimension; using IsothermalTraits = NavierStokesModelTraits<dim>; public: @@ -217,7 +229,8 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(NavierStokesNI, IOFields, FreeflowNonIsothermalIOFields<NavierStokesIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::NavierStokesNI> { using type = FreeflowNonIsothermalIOFields<NavierStokesIOFields>; }; // \} } diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh index 3b1ae940688a7e26bdb01657cfb54f33db711d85..aa3e6013e41f1dbabc4fc2ea9e512e7aef317b72 100644 --- a/dumux/freeflow/navierstokes/problem.hh +++ b/dumux/freeflow/navierstokes/problem.hh @@ -45,7 +45,7 @@ struct NavierStokesParentProblemImpl<TypeTag, DiscretizationMethod::staggered> template<class TypeTag> using NavierStokesParentProblem = typename NavierStokesParentProblemImpl<TypeTag, - GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>::type; + GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>::type; /*! * \ingroup NavierStokesModel @@ -59,24 +59,24 @@ template<class TypeTag> class NavierStokesProblem : public NavierStokesParentProblem<TypeTag> { using ParentType = NavierStokesParentProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dim = GridView::dimension, diff --git a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh index bdcb150f67cbb9f517355c7e39223cc4eb4a4626..dce407c072567d3d684bbf59fb7cf5edf8692985 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh @@ -49,17 +49,17 @@ namespace Dumux { template <class TypeTag> class FluxOverSurface { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; enum { @@ -248,7 +248,7 @@ public: */ void calculateVolumeFluxes() { - const auto isCompositional = std::integral_constant<bool, (GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents() > 1) >(); + const auto isCompositional = std::integral_constant<bool, (GetPropType<TypeTag, Properties::ModelTraits>::numComponents() > 1) >(); calculateVolumeFluxesImpl_(isCompositional); } @@ -366,7 +366,7 @@ private: const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()]; const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()]; - constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); const auto density = [useMoles](const auto& volVars) { return useMoles ? volVars.molarDensity() : volVars.density() ; @@ -374,8 +374,8 @@ private: const auto avgDensity = 0.5*density(insideVolVars) + 0.5*density(outsideVolVars); - constexpr auto replaceCompEqIdx = GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx); - constexpr auto numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); + constexpr auto replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); + constexpr auto numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); const Scalar cumulativeFlux = [replaceCompEqIdx, numComponents, &massOrMoleFlux]() { diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index ee4fe2f860dd45dd35ee61efaee5600320a6cdc1..6debed893331eb09b6f1f0d56d3b2682f5ac784f 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -43,12 +43,12 @@ class NavierStokesFluxVariablesImpl; */ template<class TypeTag> class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> -: public FluxVariablesBase<typename GET_PROP_TYPE(TypeTag, Problem), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView, - typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView, - typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView> +: public FluxVariablesBase<GetPropType<TypeTag, Properties::Problem>, + typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView, + typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView, + typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView> { - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -61,20 +61,20 @@ class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> using ElementFaceVariables = typename GridFaceVariables::LocalView; using FaceVariables = typename GridFaceVariables::FaceVariables; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - static constexpr bool normalizePressure = GET_PROP_VALUE(TypeTag, NormalizePressure); + static constexpr bool normalizePressure = getPropValue<TypeTag, Properties::NormalizePressure>(); using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -83,7 +83,7 @@ class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> public: - using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); + using HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>; /*! * \brief Returns the advective flux over a sub control volume face. diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index 6c85c278c24d9211653d285911e5f27b5000ef14..fbcdebd518550474503827b4455bdc64d345f755 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -48,7 +48,7 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered> using ParentType = StaggeredLocalResidual<TypeTag>; friend class StaggeredLocalResidual<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -60,24 +60,24 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered> using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using CellCenterResidual = CellCenterPrimaryVariables; using FaceResidual = FacePrimaryVariables; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance(); static constexpr bool isCompositional = ModelTraits::numComponents() > 1; diff --git a/dumux/freeflow/properties.hh b/dumux/freeflow/properties.hh index eefb288961b7f2027aae4fa722d8863004c964fb..5b9d414f2f24a9f976d79b238082fec421c21262 100644 --- a/dumux/freeflow/properties.hh +++ b/dumux/freeflow/properties.hh @@ -34,10 +34,14 @@ namespace Dumux { namespace Properties { //! Type tag for free-flow models -NEW_TYPE_TAG(FreeFlow, INHERITS_FROM(ModelProperties)); +// Create new type tags +namespace TTag { +struct FreeFlow { using InheritsFrom = std::tuple<ModelProperties>; }; +} // end namespace TTag //! Use Fourier's Law as default heat conduction type -SET_TYPE_PROP(FreeFlow, HeatConductionType, FouriersLaw<TypeTag>); +template<class TypeTag> +struct HeatConductionType<TypeTag, TTag::FreeFlow> { using type = FouriersLaw<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index d03900ccd018a4084d6989d16495713798749062..82143a410aaefdff0d6da7cc0cc26cc7355ccb6a 100644 --- a/dumux/freeflow/rans/model.hh +++ b/dumux/freeflow/rans/model.hh @@ -54,8 +54,11 @@ namespace Properties { // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Reynolds-Averaged Navier-Stokes model -NEW_TYPE_TAG(RANS, INHERITS_FROM(NavierStokes)); +struct RANS { using InheritsFrom = std::tuple<NavierStokes>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // default property values for the isothermal single phase model @@ -74,30 +77,36 @@ struct RANSModelTraits : NavierStokesModelTraits<dimension> }; //! The model traits of the isothermal model -SET_PROP(RANS, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::RANS> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; public: using type = RANSModelTraits<dim>; }; //! The specific I/O fields -SET_TYPE_PROP(RANS, IOFields, RANSIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::RANS> { using type = RANSIOFields; }; ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Reynolds-averaged Navier-Stokes model ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Reynolds-Averaged Navier-Stokes model -NEW_TYPE_TAG(RANSNI, INHERITS_FROM(RANS)); +struct RANSNI { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(RANSNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::RANSNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; using IsothermalTraits = RANSModelTraits<dim>; @@ -106,10 +115,12 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(RANSNI, IOFields, FreeflowNonIsothermalIOFields<RANSIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::RANSNI> { using type = FreeflowNonIsothermalIOFields<RANSIOFields, true/*turbulenceModel*/>; }; //! Use Fourier's Law as default heat conduction type -SET_TYPE_PROP(RANSNI, HeatConductionType, FouriersLaw<TypeTag>); +template<class TypeTag> +struct HeatConductionType<TypeTag, TTag::RANSNI> { using type = FouriersLaw<TypeTag>; }; // \} } // end namespace Properties diff --git a/dumux/freeflow/rans/oneeq/fluxvariables.hh b/dumux/freeflow/rans/oneeq/fluxvariables.hh index 2a4c61232de896100543e678f240b372211bdcfe..3378981317a5db5b1aa02313b639452cd46d5669 100644 --- a/dumux/freeflow/rans/oneeq/fluxvariables.hh +++ b/dumux/freeflow/rans/oneeq/fluxvariables.hh @@ -43,7 +43,7 @@ class OneEqFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using OneEqFluxVariables = OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using OneEqFluxVariables = OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/rans/oneeq/localresidual.hh b/dumux/freeflow/rans/oneeq/localresidual.hh index 2baa569bf510f49fb8f20bf16892c04948e355f1..5da585ceea4e110740e4ad4fba54dd1c8bcd9ca9 100644 --- a/dumux/freeflow/rans/oneeq/localresidual.hh +++ b/dumux/freeflow/rans/oneeq/localresidual.hh @@ -44,7 +44,7 @@ class OneEqResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using OneEqResidual = OneEqResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using OneEqResidual = OneEqResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index 18e8e56c8d1cde1e5a6681fa194a0589e7ca4d88..7123351899dad45db58a1680905866ab6df421ac 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -119,21 +119,26 @@ struct OneEqModelTraits : RANSModelTraits<dimension> // default property values for the isothermal Spalart-Allmaras model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Spalart-Allmaras model -NEW_TYPE_TAG(OneEq, INHERITS_FROM(RANS)); +struct OneEq { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //!< states some specifics of the isothermal Spalart-Allmaras model -SET_PROP(OneEq, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OneEq> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; public: using type = OneEqModelTraits<dim>; }; //! The flux variables -SET_PROP(OneEq, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::OneEq> { private: using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>; @@ -142,7 +147,8 @@ public: }; //! The local residual -SET_PROP(OneEq, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OneEq> { private: using BaseLocalResidual = NavierStokesResidual<TypeTag>; @@ -151,13 +157,14 @@ public: }; //! Set the volume variables property -SET_PROP(OneEq, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OneEq> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -170,20 +177,25 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(OneEq, IOFields, OneEqIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OneEq> { using type = OneEqIOFields; }; ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal Spalart-Allmaras model ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Spalart-Allmaras model -NEW_TYPE_TAG(OneEqNI, INHERITS_FROM(RANSNI)); +struct OneEqNI { using InheritsFrom = std::tuple<RANSNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(OneEqNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OneEqNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; using IsothermalTraits = OneEqModelTraits<dim>; public: @@ -191,13 +203,14 @@ public: }; //! Set the volume variables property -SET_PROP(OneEqNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OneEqNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -210,7 +223,8 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(OneEqNI, IOFields, FreeflowNonIsothermalIOFields<OneEqIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OneEqNI> { using type = FreeflowNonIsothermalIOFields<OneEqIOFields, true/*turbulenceModel*/>; }; // \} } diff --git a/dumux/freeflow/rans/oneeq/problem.hh b/dumux/freeflow/rans/oneeq/problem.hh index a340e4dc719a5cfdb91d0b459238eba5bc9f863b..ddee097d1ed291ff81e126cef921ef1619e4bb65 100644 --- a/dumux/freeflow/rans/oneeq/problem.hh +++ b/dumux/freeflow/rans/oneeq/problem.hh @@ -46,22 +46,22 @@ template<class TypeTag> class OneEqProblem : public RANSProblem<TypeTag> { using ParentType = RANSProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Implementation = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Grid = typename GridView::Grid; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using DimVector = Dune::FieldVector<Scalar, Grid::dimension>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; public: //! The constructor sets the gravity, if desired by the user. diff --git a/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh b/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh index 4b15cb79ca5d5b59334d2caeaebc0ff88f2fcb36..38bab2114e5bdf6fda70ff307a762a9e52bd4060 100644 --- a/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/oneeq/staggered/fluxvariables.hh @@ -49,7 +49,7 @@ class OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::s { using ParentType = BaseFluxVariables; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -62,15 +62,15 @@ class OneEqFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::s using ElementFaceVariables = typename GridFaceVariables::LocalView; using FaceVariables = typename GridFaceVariables::FaceVariables; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; static constexpr int viscosityTildeEqIdx = Indices::viscosityTildeEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/oneeq/staggered/localresidual.hh b/dumux/freeflow/rans/oneeq/staggered/localresidual.hh index 68a4f98766b7a2f24fbffe604f48116a6f6f2e6d..ee640947d412942193278c8e90d3aa58aa3abf59 100644 --- a/dumux/freeflow/rans/oneeq/staggered/localresidual.hh +++ b/dumux/freeflow/rans/oneeq/staggered/localresidual.hh @@ -46,7 +46,7 @@ class OneEqResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::stagge { using ParentType = BaseLocalResidual; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -54,21 +54,21 @@ class OneEqResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::stagge using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache; using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int viscosityTildeEqIdx = Indices::viscosityTildeEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index e27d149c5a7bc9b2e32d3501e190c2ff5da73f50..0c4fecf38ed165d28dbcf18ea174522c6fd2dd73 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -48,21 +48,21 @@ template<class TypeTag> class RANSProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using PrimaryVariables = typename VolumeVariables::PrimaryVariables; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh index ec1000024cefe7f6ae7190e203423d88153100cf..0d18a712580b36a3516bd4b2dd17350a9fb1b41c 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/fluxvariables.hh @@ -42,7 +42,7 @@ class KEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using KEpsilonFluxVariables = KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh index 19242c38ec299e6f10c2e0ab0d931c168e19a8fc..61cd665fd3cdf234aa593f33fc0f71ff52e2a1ac 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/localresidual.hh @@ -44,7 +44,7 @@ class KEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using KEpsilonResidual = KEpsilonResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using KEpsilonResidual = KEpsilonResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index e0ea1338b075f5e412d14fe0e04a45ba507bbd3e..b816cd8612faf9ff3cb1dd6ab54021d7cae835af 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -105,21 +105,26 @@ struct KEpsilonModelTraits : RANSModelTraits<dimension> // default property values for the isothermal k-epsilon model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal k-epsilon model -NEW_TYPE_TAG(KEpsilon, INHERITS_FROM(RANS)); +struct KEpsilon { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //!< states some specifics of the isothermal k-epsilon model -SET_PROP(KEpsilon, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KEpsilon> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; public: using type = KEpsilonModelTraits<dim>; }; //! The flux variables -SET_PROP(KEpsilon, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KEpsilon> { private: using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>; @@ -128,7 +133,8 @@ public: }; //! The local residual -SET_PROP(KEpsilon, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KEpsilon> { private: using BaseLocalResidual = NavierStokesResidual<TypeTag>; @@ -137,13 +143,14 @@ public: }; //! Set the volume variables property -SET_PROP(KEpsilon, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KEpsilon> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -156,20 +163,25 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(KEpsilon, IOFields, KEpsilonIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KEpsilon> { using type = KEpsilonIOFields; }; ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-epsilon model ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal k-epsilon model -NEW_TYPE_TAG(KEpsilonNI, INHERITS_FROM(RANSNI)); +struct KEpsilonNI { using InheritsFrom = std::tuple<RANSNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(KEpsilonNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KEpsilonNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; using IsothermalTraits = KEpsilonModelTraits<dim>; public: @@ -177,13 +189,14 @@ public: }; //! Set the volume variables property -SET_PROP(KEpsilonNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KEpsilonNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -196,7 +209,8 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(KEpsilonNI, IOFields, FreeflowNonIsothermalIOFields<KEpsilonIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KEpsilonNI> { using type = FreeflowNonIsothermalIOFields<KEpsilonIOFields, true/*turbulenceModel*/>; }; // \} } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh index 533d404b864ba23494a4d3863a2dfa480d0f359f..81490d87d6fb7b299e4d03e74e3f162eb9ba7f1d 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh @@ -46,30 +46,30 @@ template<class TypeTag> class KEpsilonProblem : public RANSProblem<TypeTag> { using ParentType = RANSProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance(); diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh index d90b75f0678f64adc7d2c7ef6fd7dda8e8a8370a..1f1bdb4b345a2a1f299d7026f4b2147e8fb77c02 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh @@ -48,7 +48,7 @@ class KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod { using ParentType = BaseFluxVariables; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -61,16 +61,16 @@ class KEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod using ElementFaceVariables = typename GridFaceVariables::LocalView; using FaceVariables = typename GridFaceVariables::FaceVariables; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh index 427d3ac2ffc26959472112dbffdc9273c5169b30..3a0a4ad3e1cca8c84878b384632e153fc891a126 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/staggered/localresidual.hh @@ -46,7 +46,7 @@ class KEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::sta using ParentType = BaseLocalResidual; friend class StaggeredLocalResidual<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -54,21 +54,21 @@ class KEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::sta using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache; using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using CellCenterResidual = CellCenterPrimaryVariables; diff --git a/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh index 1200903307328bb559fbb710fbdb2dd225242e31..24cd0e54ffd3aaf1cd149288b63b5201347d6d2a 100644 --- a/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/fluxvariables.hh @@ -42,7 +42,7 @@ class KOmegaFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using KOmegaFluxVariables = KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using KOmegaFluxVariables = KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/komega/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/localresidual.hh index ea9de50ff01b8b3658f64e6c51c2e6c67686fef5..f1ebc7fa38fd99e876439fc678f7af008323933a 100644 --- a/dumux/freeflow/rans/twoeq/komega/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/komega/localresidual.hh @@ -44,7 +44,7 @@ class KOmegaResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using KOmegaResidual = KOmegaResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using KOmegaResidual = KOmegaResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 7cfebf2463bc07a4cc35b384b528145f30ddeb3e..0c6fe8dc3da5b6a7d88b4492b148a671b667ff89 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -112,21 +112,26 @@ struct KOmegaModelTraits : RANSModelTraits<dimension> // default property values for the isothermal k-omega single phase model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal k-omega model -NEW_TYPE_TAG(KOmega, INHERITS_FROM(RANS)); +struct KOmega { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //! states some specifics of the isothermal k-omega model -SET_PROP(KOmega, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KOmega> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; public: using type = KOmegaModelTraits<dim>; }; //! The flux variables -SET_PROP(KOmega, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::KOmega> { private: using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>; @@ -135,7 +140,8 @@ public: }; //! The local residual -SET_PROP(KOmega, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::KOmega> { private: using BaseLocalResidual = NavierStokesResidual<TypeTag>; @@ -144,13 +150,14 @@ public: }; //! Set the volume variables property -SET_PROP(KOmega, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KOmega> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -163,21 +170,26 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(KOmega, IOFields, KOmegaIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KOmega> { using type = KOmegaIOFields; }; /////////////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-omega single phase model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, non-isothermal k-omega 2-Eq. model -NEW_TYPE_TAG(KOmegaNI, INHERITS_FROM(RANSNI)); +struct KOmegaNI { using InheritsFrom = std::tuple<RANSNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(KOmegaNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::KOmegaNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; using IsothermalTraits = KOmegaModelTraits<dim>; public: @@ -185,13 +197,14 @@ public: }; //! Set the volume variables property -SET_PROP(KOmegaNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::KOmegaNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -204,7 +217,8 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(KOmegaNI, IOFields, FreeflowNonIsothermalIOFields<KOmegaIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::KOmegaNI> { using type = FreeflowNonIsothermalIOFields<KOmegaIOFields, true/*turbulenceModel*/>; }; // \} } diff --git a/dumux/freeflow/rans/twoeq/komega/problem.hh b/dumux/freeflow/rans/twoeq/komega/problem.hh index 77eb243446f4170bb10c9271a59bca59ab77cca1..5caaa4fb5f112e6ab8eb3ecd098c05ee320a87c7 100644 --- a/dumux/freeflow/rans/twoeq/komega/problem.hh +++ b/dumux/freeflow/rans/twoeq/komega/problem.hh @@ -46,18 +46,18 @@ template<class TypeTag> class KOmegaProblem : public RANSProblem<TypeTag> { using ParentType = RANSProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using DimVector = typename Element::Geometry::GlobalCoordinate; diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh index cd72b68be4904888aba016906000c4a5564d79b1..235d6502b56dcf24799689c3aaa03eb93af8c2d8 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh @@ -48,7 +48,7 @@ class KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod:: { using ParentType = BaseFluxVariables; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -61,16 +61,16 @@ class KOmegaFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod:: using ElementFaceVariables = typename GridFaceVariables::LocalView; using FaceVariables = typename GridFaceVariables::FaceVariables; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh index 8bf78bbf8147a3120811ed9919af4d35bf2deb12..ad1c81f912e029520ce01f80b9377a6fc4a361c9 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh @@ -45,7 +45,7 @@ class KOmegaResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::stagg { using ParentType = BaseLocalResidual; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -53,22 +53,22 @@ class KOmegaResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::stagg using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache; using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; using CellCenterResidual = CellCenterPrimaryVariables; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh index f70ac71a1da398a82fdea056f1d6f095675faaaf..86a3d9f72474eed7b6becb67c5bc2e446c99cfae 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/fluxvariables.hh @@ -42,7 +42,7 @@ class LowReKEpsilonFluxVariablesImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseFluxVariables> -using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } // end namespace diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh index 0d2b22cb30bb972690752154c7796179072eb585..8b56655f176770afc8e1b2c3a2b052ed115eb15a 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/localresidual.hh @@ -44,7 +44,7 @@ class LowReKEpsilonResidualImpl; * \note Not all specializations are currently implemented */ template<class TypeTag, class BaseLocalResidual> -using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 6b178aa20f6254c5275ba6f2df4de406a21d468e..112137882328a802f028dcb0a6783c9e953e0e6e 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -121,21 +121,26 @@ struct LowReKEpsilonModelTraits : RANSModelTraits<dimension> // default property values for the isothermal low-Reynolds k-epsilon model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal low-Reynolds k-epsilon model -NEW_TYPE_TAG(LowReKEpsilon, INHERITS_FROM(RANS)); +struct LowReKEpsilon { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //!< states some specifics of the isothermal low-Reynolds k-epsilon model -SET_PROP(LowReKEpsilon, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::LowReKEpsilon> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; public: using type = LowReKEpsilonModelTraits<dim>; }; //! The flux variables -SET_PROP(LowReKEpsilon, FluxVariables) +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::LowReKEpsilon> { private: using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>; @@ -144,7 +149,8 @@ public: }; //! The local residual -SET_PROP(LowReKEpsilon, LocalResidual) +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::LowReKEpsilon> { private: using BaseLocalResidual = NavierStokesResidual<TypeTag>; @@ -153,13 +159,14 @@ public: }; //! Set the volume variables property -SET_PROP(LowReKEpsilon, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::LowReKEpsilon> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -172,20 +179,25 @@ public: }; //! The specific I/O fields -SET_TYPE_PROP(LowReKEpsilon, IOFields, LowReKEpsilonIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::LowReKEpsilon> { using type = LowReKEpsilonIOFields; }; ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal low-Reynolds k-epsilon model ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal low-Reynolds k-epsilon model -NEW_TYPE_TAG(LowReKEpsilonNI, INHERITS_FROM(RANSNI)); +struct LowReKEpsilonNI { using InheritsFrom = std::tuple<RANSNI>; }; +} // end namespace TTag //! The model traits of the non-isothermal model -SET_PROP(LowReKEpsilonNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::LowReKEpsilonNI> { private: - using GridView = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::GridView; + using GridView = typename GetPropType<TypeTag, Properties::FVGridGeometry>::GridView; static constexpr int dim = GridView::dimension; using IsothermalTraits = LowReKEpsilonModelTraits<dim>; public: @@ -193,13 +205,14 @@ public: }; //! Set the volume variables property -SET_PROP(LowReKEpsilonNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::LowReKEpsilonNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -212,7 +225,8 @@ public: }; //! The specific non-isothermal I/O fields -SET_TYPE_PROP(LowReKEpsilonNI, IOFields, FreeflowNonIsothermalIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::LowReKEpsilonNI> { using type = FreeflowNonIsothermalIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>; }; // \} } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh index 746d4b8c18fa533df33cbbbd5c87892c7a124c4a..d2065519f39be68fc72e97b9212299bacdd20d5f 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh @@ -46,18 +46,18 @@ template<class TypeTag> class LowReKEpsilonProblem : public RANSProblem<TypeTag> { using ParentType = RANSProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; public: //! The constructor sets the gravity, if desired by the user. diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh index 8c741d85443c16f88e65e0c3900b521e07e57c93..6037562952b4112c4573c45e0ba99f81fc913747 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh @@ -48,7 +48,7 @@ class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationM { using ParentType = BaseFluxVariables; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -61,16 +61,16 @@ class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationM using ElementFaceVariables = typename GridFaceVariables::LocalView; using FaceVariables = typename GridFaceVariables::FaceVariables; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh index 6d1515f8165a66abac3210ae2b56e6fca5bb50f1..5f6ecaeff6a213a43b7cc8eb0d4f4424fa920142 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh @@ -45,7 +45,7 @@ class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod { using ParentType = BaseLocalResidual; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; @@ -53,21 +53,21 @@ class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache; using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using GridFaceVariables = typename GridVariables::GridFaceVariables; using ElementFaceVariables = typename GridFaceVariables::LocalView; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); diff --git a/dumux/freeflow/rans/zeroeq/model.hh b/dumux/freeflow/rans/zeroeq/model.hh index c084c3c49e675b1a2e84ecbc11721e3f6d743e39..af6e6a816058674cf3978d94ebceab92ce63fe23 100644 --- a/dumux/freeflow/rans/zeroeq/model.hh +++ b/dumux/freeflow/rans/zeroeq/model.hh @@ -50,17 +50,21 @@ namespace Properties { // default property values for the isothermal RANS 0-Eq. model /////////////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Reynolds-Averaged Navier-Stokes 0-Eq. model -NEW_TYPE_TAG(ZeroEq, INHERITS_FROM(RANS)); +struct ZeroEq { using InheritsFrom = std::tuple<RANS>; }; +} // end namespace TTag //! Set the volume variables property -SET_PROP(ZeroEq, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ZeroEq> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); @@ -76,17 +80,21 @@ public: // default property values for the non-isothermal RANS 0-Eq. model ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the single-phase, isothermal Reynolds-Averaged Navier-Stokes model -NEW_TYPE_TAG(ZeroEqNI, INHERITS_FROM(RANSNI)); +struct ZeroEqNI { using InheritsFrom = std::tuple<RANSNI>; }; +} // end namespace TTag //! Set the volume variables property -SET_PROP(ZeroEqNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ZeroEqNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); diff --git a/dumux/freeflow/rans/zeroeq/problem.hh b/dumux/freeflow/rans/zeroeq/problem.hh index d30d66f8fd1141a9ad325e7934188ba60d84c13c..cd8c0e81e908da9e1ce0cde4260940128a3bce71 100644 --- a/dumux/freeflow/rans/zeroeq/problem.hh +++ b/dumux/freeflow/rans/zeroeq/problem.hh @@ -48,20 +48,20 @@ template<class TypeTag> class ZeroEqProblem : public RANSProblem<TypeTag> { using ParentType = RANSProblem<TypeTag>; - using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); + using Implementation = GetPropType<TypeTag, Properties::Problem>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Grid = typename GridView::Grid; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dim = Grid::dimension, diff --git a/dumux/geomechanics/elastic/localresidual.hh b/dumux/geomechanics/elastic/localresidual.hh index a4351fe553aed5ae066bdcb417e9b0480cf4b287..a0dade29ac6a353431d701ae1248c3557bbab50b 100644 --- a/dumux/geomechanics/elastic/localresidual.hh +++ b/dumux/geomechanics/elastic/localresidual.hh @@ -39,25 +39,25 @@ namespace Dumux { * using the elastic model considering linear elasticity. */ template<class TypeTag> -class ElasticLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class ElasticLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual> { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using VolumeVariables = typename ElementVolumeVariables::VolumeVariables; // class assembling the stress tensor - using StressType = typename GET_PROP_TYPE(TypeTag, StressType); + using StressType = GetPropType<TypeTag, Properties::StressType>; public: using ParentType::ParentType; diff --git a/dumux/geomechanics/elastic/model.hh b/dumux/geomechanics/elastic/model.hh index bc59b27fda3b24ad71f4d44bd50ada830319bde5..da9bfbe6951b7c5fe87c3b7aabcdc44e2946e5c5 100644 --- a/dumux/geomechanics/elastic/model.hh +++ b/dumux/geomechanics/elastic/model.hh @@ -86,33 +86,46 @@ struct ElasticVolumeVariablesTraits namespace Properties { //! Type tag for the elastic geomechanical model -NEW_TYPE_TAG(Elastic, INHERITS_FROM(Geomechanics)); +// Create new type tags +namespace TTag { +struct Elastic { using InheritsFrom = std::tuple<Geomechanics>; }; +} // end namespace TTag //! Use the local residual of the elastic model -SET_TYPE_PROP(Elastic, LocalResidual, ElasticLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Elastic> { using type = ElasticLocalResidual<TypeTag>; }; //! The model traits of the elastic model -SET_TYPE_PROP(Elastic, ModelTraits, ElasticModelTraits< GET_PROP_TYPE(TypeTag, GridView)::dimension, - GET_PROP_TYPE(TypeTag, SolidSystem)::numComponents >); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::Elastic> +{ + using type = ElasticModelTraits< GetPropType<TypeTag, Properties::GridView>::dimension, + GetPropType<TypeTag, Properties::SolidSystem>::numComponents >; +}; //! Set the volume variables property -SET_PROP(Elastic, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::Elastic> { private: - static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension; - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); + static constexpr int dim = GetPropType<TypeTag, Properties::GridView>::dimension; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; using DV = Dune::FieldVector<typename PV::value_type, dim>; - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; using Traits = ElasticVolumeVariablesTraits<PV, DV, MT, SST, SSY>; public: using type = ElasticVolumeVariables<Traits>; }; //! By default, we use hooke's law for stress evaluations -SET_TYPE_PROP(Elastic, StressType, HookesLaw< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct StressType<TypeTag, TTag::Elastic> +{ + using type = HookesLaw< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; } // namespace Properties } // namespace Dumux diff --git a/dumux/geomechanics/fvproblem.hh b/dumux/geomechanics/fvproblem.hh index ef3568886eb1fd518a4efb868a6ccf919f6fa242..026f3c780fd9a115814909037228685b90bc52ff 100644 --- a/dumux/geomechanics/fvproblem.hh +++ b/dumux/geomechanics/fvproblem.hh @@ -67,15 +67,15 @@ class GeomechanicsFVProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - static constexpr int numFP = GET_PROP_TYPE(TypeTag, ModelTraits)::numFluidPhases(); + static constexpr int numFP = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); public: //! pull up the constructor of the parent class diff --git a/dumux/geomechanics/poroelastic/couplingmanager.hh b/dumux/geomechanics/poroelastic/couplingmanager.hh index 17164d3a43741e61f5c56faea8caad965086abed..0c42b5265eef6d99a300ad4003b1c05ca97d3ae8 100644 --- a/dumux/geomechanics/poroelastic/couplingmanager.hh +++ b/dumux/geomechanics/poroelastic/couplingmanager.hh @@ -61,10 +61,10 @@ class PoroMechanicsCouplingManager : public virtual CouplingManager< MDTraits > template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; // further types specific to the sub-problems - template<std::size_t id> using Scalar = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Scalar); - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using LocalResidual = typename GET_PROP_TYPE(SubDomainTypeTag<id>, LocalResidual); - template<std::size_t id> using GridVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables); + template<std::size_t id> using Scalar = GetPropType<SubDomainTypeTag<id>, Properties::Scalar>; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; + template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using PrimaryVariables = typename GridVariables<id>::PrimaryVariables; template<std::size_t id> using GridVolumeVariables = typename GridVariables<id>::GridVolumeVariables; template<std::size_t id> using ElementVolumeVariables = typename GridVolumeVariables<id>::LocalView; @@ -88,7 +88,7 @@ class PoroMechanicsCouplingManager : public virtual CouplingManager< MDTraits > "Porous medium flow problem must be discretized with a cell-centered scheme for this coupling manager!"); //! this does not work for enabled grid volume variables caching (update of local view in context has no effect) - static_assert(!GET_PROP_VALUE(SubDomainTypeTag<PMFlowId>, EnableGridVolumeVariablesCache), + static_assert(!getPropValue<SubDomainTypeTag<PMFlowId>, Properties::EnableGridVolumeVariablesCache>(), "Poromechanics framework does not yet work for enabled grid volume variables caching"); //! Types used for coupling stencils diff --git a/dumux/geomechanics/poroelastic/localresidual.hh b/dumux/geomechanics/poroelastic/localresidual.hh index 003b119eb285258c04519eb35ac74693a65abfe8..970b88804ec53b52f31f9d033c0866e467840b3c 100644 --- a/dumux/geomechanics/poroelastic/localresidual.hh +++ b/dumux/geomechanics/poroelastic/localresidual.hh @@ -42,21 +42,21 @@ class PoroElasticLocalResidual: public ElasticLocalResidual<TypeTag> { using ParentType = ElasticLocalResidual<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using VolumeVariables = typename ElementVolumeVariables::VolumeVariables; // class assembling the stress tensor - using StressType = typename GET_PROP_TYPE(TypeTag, StressType); + using StressType = GetPropType<TypeTag, Properties::StressType>; public: using ParentType::ParentType; diff --git a/dumux/geomechanics/poroelastic/model.hh b/dumux/geomechanics/poroelastic/model.hh index e63a4eaf77500935eb56858b36be9b475f2f3cc4..c2eac3e9acc4ca0c366005b244ee022a848f30dd 100644 --- a/dumux/geomechanics/poroelastic/model.hh +++ b/dumux/geomechanics/poroelastic/model.hh @@ -67,37 +67,44 @@ struct PoroElasticModelTraits namespace Properties { //! Type tag for the poro-elastic geomechanical model -NEW_TYPE_TAG(PoroElastic, INHERITS_FROM(Elastic)); +// Create new type tags +namespace TTag { +struct PoroElastic { using InheritsFrom = std::tuple<Elastic>; }; +} // end namespace TTag //! Use the local residual of the poro-elastic model -SET_TYPE_PROP(PoroElastic, LocalResidual, PoroElasticLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::PoroElastic> { using type = PoroElasticLocalResidual<TypeTag>; }; //! default vtk output fields specific to this model -SET_TYPE_PROP(PoroElastic, IOFields, PoroElasticIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::PoroElastic> { using type = PoroElasticIOFields; }; //! The deault model traits of the poro-elastic model -SET_PROP(PoroElastic, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::PoroElastic> { private: - static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension; - static constexpr int numSC = GET_PROP_TYPE(TypeTag, SolidSystem)::numComponents; - static constexpr int numFP = GET_PROP_TYPE(TypeTag, FluidSystem)::numPhases; - static constexpr int numFC = GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents; + static constexpr int dim = GetPropType<TypeTag, Properties::GridView>::dimension; + static constexpr int numSC = GetPropType<TypeTag, Properties::SolidSystem>::numComponents; + static constexpr int numFP = GetPropType<TypeTag, Properties::FluidSystem>::numPhases; + static constexpr int numFC = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; public: using type = PoroElasticModelTraits<dim, numSC, numFP, numFC>; }; //! Set the volume variables property -SET_PROP(PoroElastic, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::PoroElastic> { private: - static constexpr int dim = GET_PROP_TYPE(TypeTag, GridView)::dimension; - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); + static constexpr int dim = GetPropType<TypeTag, Properties::GridView>::dimension; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; using DV = Dune::FieldVector<typename PV::value_type, dim>; - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; // we reuse the elastic volume variable traits here using Traits = ElasticVolumeVariablesTraits<PV, DV, MT, SST, SSY>; @@ -106,11 +113,12 @@ public: }; //! Per default, we use effective stresses on the basis of Hooke's Law -SET_PROP(PoroElastic, StressType) +template<class TypeTag> +struct StressType<TypeTag, TTag::PoroElastic> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using ElasticStressType = HookesLaw< Scalar, FVGridGeometry >; public: using type = EffectiveStressLaw< ElasticStressType, FVGridGeometry >; diff --git a/dumux/geomechanics/properties.hh b/dumux/geomechanics/properties.hh index 1036c4467c3b4471d25fd66db0fbb66013b4207a..5e1d44c342ad6183d1a9760f8485b8a8c6ac2d51 100644 --- a/dumux/geomechanics/properties.hh +++ b/dumux/geomechanics/properties.hh @@ -40,30 +40,40 @@ namespace Dumux { namespace Properties { //! Type tag for geomechanical models -NEW_TYPE_TAG(Geomechanics, INHERITS_FROM(ModelProperties)); +// Create new type tags +namespace TTag { +struct Geomechanics { using InheritsFrom = std::tuple<ModelProperties>; }; +} // end namespace TTag //! The flux variables cache class for models involving flow in porous media -SET_TYPE_PROP(Geomechanics, FluxVariablesCache, StressVariablesCache< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct FluxVariablesCache<TypeTag, TTag::Geomechanics> +{ + using type = StressVariablesCache< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; //! The (currently empty) velocity output -SET_TYPE_PROP(Geomechanics, VelocityOutput, GeomechanicsVelocityOutput<typename GET_PROP_TYPE(TypeTag, GridVariables)>); +template<class TypeTag> +struct VelocityOutput<TypeTag, TTag::Geomechanics> { using type = GeomechanicsVelocityOutput<GetPropType<TypeTag, Properties::GridVariables>>; }; //! The solid state must be inert -SET_PROP(Geomechanics, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::Geomechanics> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = InertSolidState<Scalar, SolidSystem>; }; //! Per default we use one constant component in the inert solid system -SET_PROP(Geomechanics, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::Geomechanics> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using InertComponent = Components::Constant<1, Scalar>; public: using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>; diff --git a/dumux/linear/amgbackend.hh b/dumux/linear/amgbackend.hh index 6e757bd9574d9999c40a5a0e94292332b3c74a0e..f13b0928759ab149ae3f56b412d7b2f75282e7c1 100644 --- a/dumux/linear/amgbackend.hh +++ b/dumux/linear/amgbackend.hh @@ -223,9 +223,9 @@ namespace Dumux { * \note This is an adaptor using a TypeTag */ template<class TypeTag> -using AMGBackend = ParallelAMGBackend<typename GET_PROP_TYPE(TypeTag, GridView), AmgTraits<typename GET_PROP_TYPE(TypeTag, JacobianMatrix), - typename GET_PROP_TYPE(TypeTag, SolutionVector), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry)>>; +using AMGBackend = ParallelAMGBackend<GetPropType<TypeTag, Properties::GridView>, AmgTraits<GetPropType<TypeTag, Properties::JacobianMatrix>, + GetPropType<TypeTag, Properties::SolutionVector>, + GetPropType<TypeTag, Properties::FVGridGeometry>>>; } // namespace Dumux diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh index dd517f0b7a91f8fddeda8a1ecac819dad7af4521..17b80fefc2c86998f689e0666e1274b95ebfe20e 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh @@ -39,17 +39,17 @@ namespace Dumux { template<class TypeTag> class DUNE_DEPRECATED_MSG("Implement SolidSystems instead!") EffectiveSolidDensity { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); - static const int numSolidPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numSPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSPhases(); using Element = typename GridView::template Codim<0>:: Entity; diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh index 61df4ae693f9fec51383a283363a11346d6e133d..1678208ecd50e06a98d6eaa36a2ede45a0be8847 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh @@ -38,17 +38,17 @@ namespace Dumux { template<class TypeTag> class DUNE_DEPRECATED_MSG("Implement SolidSystems instead!") EffectiveSolidHeatCapacity { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - static const int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); - static const int numSolidPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numSPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSPhases(); using Element = typename GridView::template Codim<0>:: Entity; diff --git a/dumux/material/spatialparams/sequentialfv.hh b/dumux/material/spatialparams/sequentialfv.hh index 256bbe1fa47526d484b8baa425c71ebf461629cf..e624899fce3e28deec27d0e46b28cb545804de34 100644 --- a/dumux/material/spatialparams/sequentialfv.hh +++ b/dumux/material/spatialparams/sequentialfv.hh @@ -30,7 +30,8 @@ namespace Dumux { namespace Properties -{ NEW_PROP_TAG( MaterialLaw ); } +{ template<class TypeTag, class MyTypeTag> +struct MaterialLaw { using type = UndefinedProperty; }; } /*! * \ingroup SpatialParameters @@ -40,10 +41,10 @@ namespace Properties template<class TypeTag> class SequentialFVSpatialParams: public SequentialFVSpatialParamsOneP<TypeTag> { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Implementation = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Implementation = GetPropType<TypeTag, Properties::SpatialParams>; enum { @@ -53,7 +54,7 @@ class SequentialFVSpatialParams: public SequentialFVSpatialParamsOneP<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; /// @cond false - using MaterialLawParams = typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params; + using MaterialLawParams = typename GetPropType<TypeTag, Properties::MaterialLaw>::Params; /// @endcond public: diff --git a/dumux/material/spatialparams/sequentialfv1p.hh b/dumux/material/spatialparams/sequentialfv1p.hh index cfc198e0d03b6c9087fe71f825e1d793100e38f6..bbcd094715187f52bb0bf3e978c2d76cb4a5391f 100644 --- a/dumux/material/spatialparams/sequentialfv1p.hh +++ b/dumux/material/spatialparams/sequentialfv1p.hh @@ -40,10 +40,10 @@ namespace Dumux { template<class TypeTag> class SequentialFVSpatialParamsOneP { - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Implementation = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Implementation = GetPropType<TypeTag, Properties::SpatialParams>; enum { diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh index 29ff5d6c428234ce2c6ce27a4ee19c4e44f075b5..7cc9e57f0112d84e9b96d029b523cc28f4c78edc 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh @@ -59,11 +59,11 @@ class DarcyDarcyBoundaryCouplingManager using SolutionVector = typename MDTraits::SolutionVector; template<std::size_t i> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<i>; - template<std::size_t i> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<i>, Problem); - template<std::size_t i> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<i>, PrimaryVariables); - template<std::size_t i> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<i>, NumEqVector); - template<std::size_t i> using ElementVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<i>, GridVolumeVariables)::LocalView; - template<std::size_t i> using VolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<i>, GridVolumeVariables)::VolumeVariables; + template<std::size_t i> using Problem = GetPropType<SubDomainTypeTag<i>, Properties::Problem>; + template<std::size_t i> using PrimaryVariables = GetPropType<SubDomainTypeTag<i>, Properties::PrimaryVariables>; + template<std::size_t i> using NumEqVector = GetPropType<SubDomainTypeTag<i>, Properties::NumEqVector>; + template<std::size_t i> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<i>, Properties::GridVolumeVariables>::LocalView; + template<std::size_t i> using VolumeVariables = typename GetPropType<SubDomainTypeTag<i>, Properties::GridVolumeVariables>::VolumeVariables; template<std::size_t i> using FVGridGeometry = typename MDTraits::template SubDomainFVGridGeometry<i>; template<std::size_t i> using FVElementGeometry = typename FVGridGeometry<i>::LocalView; template<std::size_t i> using SubControlVolumeFace = typename FVGridGeometry<i>::SubControlVolumeFace; diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh index 9dcb8dce71e63c67fe3973b5d89bac1fd0f60f84..2d8d3d8195a3ba7a18ea373af00e1f9f99a89da1 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh @@ -192,8 +192,8 @@ class StokesDarcyCouplingDataImplementation; */ template<class MDTraits, class CouplingManager> using StokesDarcyCouplingData = StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, - GET_PROP_TYPE(typename MDTraits::template SubDomainTypeTag<0>, ModelTraits)::enableEnergyBalance(), - (GET_PROP_TYPE(typename MDTraits::template SubDomainTypeTag<0>, ModelTraits)::numComponents() > 1)>; + GetPropType<typename MDTraits::template SubDomainTypeTag<0>, Properties::ModelTraits>::enableEnergyBalance(), + (GetPropType<typename MDTraits::template SubDomainTypeTag<0>, Properties::ModelTraits>::numComponents() > 1)>; /*! * \ingroup MultiDomain @@ -207,16 +207,16 @@ class StokesDarcyCouplingDataImplementationBase using Scalar = typename MDTraits::Scalar; template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using SubControlVolumeFace = typename FVGridGeometry<id>::LocalView::SubControlVolumeFace; template<std::size_t id> using SubControlVolume = typename FVGridGeometry<id>::LocalView::SubControlVolume; - template<std::size_t id> using Indices = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ModelTraits)::Indices; - template<std::size_t id> using ElementVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::LocalView; - template<std::size_t id> using VolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::VolumeVariables; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using FluidSystem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FluidSystem); - template<std::size_t id> using ModelTraits = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ModelTraits); + template<std::size_t id> using Indices = typename GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>::Indices; + template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView; + template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using FluidSystem = GetPropType<SubDomainTypeTag<id>, Properties::FluidSystem>; + template<std::size_t id> using ModelTraits = GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>; static constexpr auto stokesIdx = CouplingManager::stokesIdx; static constexpr auto darcyIdx = CouplingManager::darcyIdx; @@ -224,8 +224,8 @@ class StokesDarcyCouplingDataImplementationBase static constexpr bool adapterUsed = ModelTraits<darcyIdx>::numPhases() > 1; using IndexHelper = Dumux::IndexHelper<stokesIdx, darcyIdx, FluidSystem<stokesIdx>, adapterUsed>; - static constexpr int enableEnergyBalance = GET_PROP_TYPE(SubDomainTypeTag<stokesIdx>, ModelTraits)::enableEnergyBalance(); - static_assert(GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ModelTraits)::enableEnergyBalance() == enableEnergyBalance, + static constexpr int enableEnergyBalance = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::enableEnergyBalance(); + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::enableEnergyBalance() == enableEnergyBalance, "All submodels must both be either isothermal or non-isothermal"); static_assert(IsSameFluidSystem<FluidSystem<stokesIdx>, @@ -279,7 +279,7 @@ public: const ElementFaceVariables& stokesElemFaceVars, const SubControlVolumeFace<stokesIdx>& scvf) const { - static constexpr auto numPhasesDarcy = GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ModelTraits)::numPhases(); + static constexpr auto numPhasesDarcy = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numPhases(); Scalar momentumFlux(0.0); const auto& stokesContext = couplingManager_.stokesCouplingContext(scvf); @@ -305,7 +305,7 @@ public: } // normalize pressure - if(GET_PROP_VALUE(SubDomainTypeTag<stokesIdx>, NormalizePressure)) + if(getPropValue<SubDomainTypeTag<stokesIdx>, Properties::NormalizePressure>()) momentumFlux -= couplingManager_.problem(stokesIdx).initial(scvf)[Indices<stokesIdx>::pressureIdx]; momentumFlux *= scvf.directionSign(); @@ -408,7 +408,7 @@ protected: const FVElementGeometry<darcyIdx>& fvGeometry, const SubControlVolume<darcyIdx>& scv) const { - using ThermalConductivityModel = typename GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ThermalConductivityModel); + using ThermalConductivityModel = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ThermalConductivityModel>; const auto& problem = this->couplingManager().problem(darcyIdx); return ThermalConductivityModel::effectiveThermalConductivity(volVars, problem.spatialParams(), fvGeometry.fvGridGeometry().element(scv), fvGeometry, scv); } @@ -450,16 +450,16 @@ class StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, enableEne template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using SubControlVolumeFace = typename FVGridGeometry<id>::LocalView::SubControlVolumeFace; template<std::size_t id> using SubControlVolume = typename FVGridGeometry<id>::LocalView::SubControlVolume; - template<std::size_t id> using Indices = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ModelTraits)::Indices; - template<std::size_t id> using ElementVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::LocalView; - template<std::size_t id> using ElementFaceVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridFaceVariables)::LocalView; - template<std::size_t id> using VolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::VolumeVariables; + template<std::size_t id> using Indices = typename GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>::Indices; + template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView; + template<std::size_t id> using ElementFaceVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridFaceVariables>::LocalView; + template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; - static_assert(GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ModelTraits)::numComponents() == GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ModelTraits)::numPhases(), + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numComponents() == GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numPhases(), "Darcy Model must not be compositional"); using DiffusionCoefficientAveragingType = typename StokesDarcyCouplingOptions::DiffusionCoefficientAveragingType; @@ -609,23 +609,23 @@ class StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, enableEne template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using SubControlVolumeFace = typename FVElementGeometry<id>::SubControlVolumeFace; template<std::size_t id> using SubControlVolume = typename FVGridGeometry<id>::LocalView::SubControlVolume; - template<std::size_t id> using Indices = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ModelTraits)::Indices; - template<std::size_t id> using ElementVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::LocalView; - template<std::size_t id> using ElementFaceVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridFaceVariables)::LocalView; - template<std::size_t id> using VolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::VolumeVariables; - template<std::size_t id> using FluidSystem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FluidSystem); - - static constexpr auto numComponents = GET_PROP_TYPE(SubDomainTypeTag<stokesIdx>, ModelTraits)::numComponents(); - static constexpr auto replaceCompEqIdx = GET_PROP_TYPE(SubDomainTypeTag<stokesIdx>, ModelTraits)::replaceCompEqIdx(); - static constexpr bool useMoles = GET_PROP_TYPE(SubDomainTypeTag<stokesIdx>, ModelTraits)::useMoles(); - - static_assert(GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, ModelTraits)::numComponents() == numComponents, "Submodels must use same number of components"); - static_assert(GET_PROP_VALUE(SubDomainTypeTag<darcyIdx>, UseMoles) == useMoles, "Both models must either use moles or not"); - static_assert(GET_PROP_VALUE(SubDomainTypeTag<darcyIdx>, ReplaceCompEqIdx) == replaceCompEqIdx, "Both models must use the same replaceCompEqIdx"); + template<std::size_t id> using Indices = typename GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>::Indices; + template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView; + template<std::size_t id> using ElementFaceVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridFaceVariables>::LocalView; + template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; + template<std::size_t id> using FluidSystem = GetPropType<SubDomainTypeTag<id>, Properties::FluidSystem>; + + static constexpr auto numComponents = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::numComponents(); + static constexpr auto replaceCompEqIdx = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::replaceCompEqIdx(); + static constexpr bool useMoles = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::useMoles(); + + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numComponents() == numComponents, "Submodels must use same number of components"); + static_assert(getPropValue<SubDomainTypeTag<darcyIdx>, Properties::UseMoles>() == useMoles, "Both models must either use moles or not"); + static_assert(getPropValue<SubDomainTypeTag<darcyIdx>, Properties::ReplaceCompEqIdx>() == replaceCompEqIdx, "Both models must use the same replaceCompEqIdx"); using NumEqVector = Dune::FieldVector<Scalar, numComponents>; using DiffusionCoefficientAveragingType = typename StokesDarcyCouplingOptions::DiffusionCoefficientAveragingType; @@ -796,7 +796,7 @@ protected: */ Scalar diffusionCoefficient_(const VolumeVariables<darcyIdx>& volVars, int phaseIdx, int compIdx) const { - using EffDiffModel = typename GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, EffectiveDiffusivityModel); + using EffDiffModel = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::EffectiveDiffusivityModel>; return EffDiffModel::effectiveDiffusivity(volVars.porosity(), volVars.saturation(phaseIdx), volVars.diffusionCoefficient(phaseIdx, compIdx)); diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh b/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh index 542a27f7ba0982edd4848df86a56c524be930b6c..308f2c03188a551facc1bc2e1da3bd0f598c041e 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh @@ -76,24 +76,24 @@ private: template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - static constexpr bool isCompositional = GET_PROP_TYPE(SubDomainTypeTag<0>, ModelTraits)::numComponents() > 1; - - template<std::size_t id> using GridView = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridView); - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<id>, NumEqVector); - template<std::size_t id> using ElementVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::LocalView; - template<std::size_t id> using GridVolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables); - template<std::size_t id> using VolumeVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVolumeVariables)::VolumeVariables; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + static constexpr bool isCompositional = GetPropType<SubDomainTypeTag<0>, Properties::ModelTraits>::numComponents() > 1; + + template<std::size_t id> using GridView = GetPropType<SubDomainTypeTag<id>, Properties::GridView>; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using NumEqVector = GetPropType<SubDomainTypeTag<id>, Properties::NumEqVector>; + template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView; + template<std::size_t id> using GridVolumeVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>; + template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; - template<std::size_t id> using ElementBoundaryTypes = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ElementBoundaryTypes); - template<std::size_t id> using ElementFluxVariablesCache = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridFluxVariablesCache)::LocalView; - template<std::size_t id> using GridVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables); + template<std::size_t id> using ElementBoundaryTypes = GetPropType<SubDomainTypeTag<id>, Properties::ElementBoundaryTypes>; + template<std::size_t id> using ElementFluxVariablesCache = typename GetPropType<SubDomainTypeTag<id>, Properties::GridFluxVariablesCache>::LocalView; + template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; template<std::size_t id> using PrimaryVariables = typename MDTraits::template PrimaryVariables<id>; template<std::size_t id> using SubControlVolumeFace = typename FVElementGeometry<id>::SubControlVolumeFace; - using CellCenterSolutionVector = typename GET_PROP_TYPE (StokesTypeTag, CellCenterSolutionVector); + using CellCenterSolutionVector = GetPropType<StokesTypeTag, Properties::CellCenterSolutionVector>; using VelocityVector = typename Element<stokesIdx>::Geometry::GlobalCoordinate; diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh b/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh index ed18c644c87eaa4e614e8d3cb9f26a694c36254f..ab1eb2a54bd5d940e0667b71a156f9dfd3741b66 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingmapper.hh @@ -74,12 +74,12 @@ private: // the sub domain type tags template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - using CouplingManager = typename GET_PROP_TYPE(StokesTypeTag, CouplingManager); + using CouplingManager = GetPropType<StokesTypeTag, Properties::CouplingManager>; - static_assert(GET_PROP_TYPE(SubDomainTypeTag<stokesIdx>, FVGridGeometry)::discMethod == DiscretizationMethod::staggered, + static_assert(GetPropType<SubDomainTypeTag<stokesIdx>, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::staggered, "The free flow domain must use the staggered discretization"); - static_assert(GET_PROP_TYPE(SubDomainTypeTag<darcyIdx>, FVGridGeometry)::discMethod == DiscretizationMethod::cctpfa, + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::cctpfa, "The Darcy domain must use the CCTpfa discretization"); public: diff --git a/dumux/multidomain/couplingmanager.hh b/dumux/multidomain/couplingmanager.hh index 1008a16bb223059eb6a1834c9503f89ce5b75937..9e220aa31a359133729e0021046e74afaf57ff13 100644 --- a/dumux/multidomain/couplingmanager.hh +++ b/dumux/multidomain/couplingmanager.hh @@ -45,10 +45,10 @@ template<class Traits> class CouplingManager { template<std::size_t id> using SubDomainTypeTag = typename Traits::template SubDomainTypeTag<id>; - template<std::size_t id> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables); - template<std::size_t id> using GridView = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry)::GridView; + template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; + template<std::size_t id> using GridView = typename GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; template<std::size_t id> using ProblemWeakPtr = std::weak_ptr<const Problem<id>>; using Problems = typename Traits::template MakeTuple<ProblemWeakPtr>; diff --git a/dumux/multidomain/embedded/couplingmanager1d3d.hh b/dumux/multidomain/embedded/couplingmanager1d3d.hh index d0fbeca01d90deb9eccfba8fe0bc5d2a66733004..41b0ae8eeaab3ba739399658fe40d51737d6461b 100644 --- a/dumux/multidomain/embedded/couplingmanager1d3d.hh +++ b/dumux/multidomain/embedded/couplingmanager1d3d.hh @@ -55,8 +55,8 @@ struct CircleAveragePointSourceTraits { private: template<std::size_t i> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<i>; - template<std::size_t i> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<i>, FVGridGeometry); - template<std::size_t i> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<i>, NumEqVector); + template<std::size_t i> using FVGridGeometry = GetPropType<SubDomainTypeTag<i>, Properties::FVGridGeometry>; + template<std::size_t i> using NumEqVector = GetPropType<SubDomainTypeTag<i>, Properties::NumEqVector>; public: //! export the point source type for domain i template<std::size_t i> @@ -103,8 +103,8 @@ class EmbeddedCouplingManager1d3d<MDTraits, EmbeddedCouplingMode::line> // the sub domain type aliases template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; @@ -203,8 +203,8 @@ class EmbeddedCouplingManager1d3d<MDTraits, EmbeddedCouplingMode::average> // the sub domain type aliases template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; @@ -581,8 +581,8 @@ class EmbeddedCouplingManager1d3d<MDTraits, EmbeddedCouplingMode::cylindersource // the sub domain type aliases template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; @@ -858,8 +858,8 @@ class EmbeddedCouplingManager1d3d<MDTraits, EmbeddedCouplingMode::kernel> // the sub domain type aliases template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; diff --git a/dumux/multidomain/embedded/couplingmanagerbase.hh b/dumux/multidomain/embedded/couplingmanagerbase.hh index 50fb0013c201caa17b39a5d7b19bb2315c85d3a4..fa5fec57f1a3b56a12cd9316dfdde495d25a93ed 100644 --- a/dumux/multidomain/embedded/couplingmanagerbase.hh +++ b/dumux/multidomain/embedded/couplingmanagerbase.hh @@ -52,8 +52,8 @@ struct DefaultPointSourceTraits { private: template<std::size_t i> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<i>; - template<std::size_t i> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<i>, FVGridGeometry); - template<std::size_t i> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<i>, NumEqVector); + template<std::size_t i> using FVGridGeometry = GetPropType<SubDomainTypeTag<i>, Properties::FVGridGeometry>; + template<std::size_t i> using NumEqVector = GetPropType<SubDomainTypeTag<i>, Properties::NumEqVector>; public: //! export the point source type for domain i template<std::size_t i> @@ -87,9 +87,9 @@ class EmbeddedCouplingManagerBase // the sub domain type tags template<std::size_t id> using PointSource = typename PSTraits::template PointSource<id>; template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables); - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using ElementMapper = typename FVGridGeometry<id>::ElementMapper; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; diff --git a/dumux/multidomain/embedded/extendedsourcestencil.hh b/dumux/multidomain/embedded/extendedsourcestencil.hh index b385bc081527852ddc36bc1ea01b11257cca17fc..22ab62a3719dbba687bf3023bdad3bceb160c37a 100644 --- a/dumux/multidomain/embedded/extendedsourcestencil.hh +++ b/dumux/multidomain/embedded/extendedsourcestencil.hh @@ -45,7 +45,7 @@ class ExtendedSourceStencil using Scalar = typename MDTraits::Scalar; template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; diff --git a/dumux/multidomain/embedded/pointsourcedata.hh b/dumux/multidomain/embedded/pointsourcedata.hh index 94a6177545d7ab36e1b3764107bc88a62223c0bc..088defdf6704c2aff382c1c8b5675eaf31794d5c 100644 --- a/dumux/multidomain/embedded/pointsourcedata.hh +++ b/dumux/multidomain/embedded/pointsourcedata.hh @@ -50,15 +50,15 @@ class PointSourceData using BulkTypeTag = typename MDTraits::template SubDomainTypeTag<0>; using LowDimTypeTag = typename MDTraits::template SubDomainTypeTag<1>; - using BulkPrimaryVariables = typename GET_PROP_TYPE(BulkTypeTag, PrimaryVariables); - using LowDimPrimaryVariables = typename GET_PROP_TYPE(LowDimTypeTag, PrimaryVariables); + using BulkPrimaryVariables = GetPropType<BulkTypeTag, Properties::PrimaryVariables>; + using LowDimPrimaryVariables = GetPropType<LowDimTypeTag, Properties::PrimaryVariables>; - using BulkSolutionVector = typename GET_PROP_TYPE(BulkTypeTag, SolutionVector); - using LowDimSolutionVector = typename GET_PROP_TYPE(LowDimTypeTag, SolutionVector); + using BulkSolutionVector = GetPropType<BulkTypeTag, Properties::SolutionVector>; + using LowDimSolutionVector = GetPropType<LowDimTypeTag, Properties::SolutionVector>; enum { - bulkIsBox = GET_PROP_TYPE(BulkTypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box, - lowDimIsBox = GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box + bulkIsBox = GetPropType<BulkTypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, + lowDimIsBox = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box }; public: @@ -158,15 +158,15 @@ class PointSourceDataCircleAverage : public PointSourceData<MDTraits> using BulkTypeTag = typename MDTraits::template SubDomainTypeTag<0>; using LowDimTypeTag = typename MDTraits::template SubDomainTypeTag<1>; - using BulkPrimaryVariables = typename GET_PROP_TYPE(BulkTypeTag, PrimaryVariables); - using LowDimPrimaryVariables = typename GET_PROP_TYPE(LowDimTypeTag, PrimaryVariables); + using BulkPrimaryVariables = GetPropType<BulkTypeTag, Properties::PrimaryVariables>; + using LowDimPrimaryVariables = GetPropType<LowDimTypeTag, Properties::PrimaryVariables>; - using BulkSolutionVector = typename GET_PROP_TYPE(BulkTypeTag, SolutionVector); - using LowDimSolutionVector = typename GET_PROP_TYPE(LowDimTypeTag, SolutionVector); + using BulkSolutionVector = GetPropType<BulkTypeTag, Properties::SolutionVector>; + using LowDimSolutionVector = GetPropType<LowDimTypeTag, Properties::SolutionVector>; enum { - bulkIsBox = GET_PROP_TYPE(BulkTypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box, - lowDimIsBox = GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box + bulkIsBox = GetPropType<BulkTypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, + lowDimIsBox = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box }; public: diff --git a/dumux/multidomain/facet/box/couplingmanager.hh b/dumux/multidomain/facet/box/couplingmanager.hh index 197bcffbfd9dc8ec1bb700b7474792595c4c5a70..6a1190ed492f2555edad67e1fd901a58d8996516 100644 --- a/dumux/multidomain/facet/box/couplingmanager.hh +++ b/dumux/multidomain/facet/box/couplingmanager.hh @@ -63,13 +63,13 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; // further types specific to the sub-problems - template<std::size_t id> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables); - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<id>, NumEqVector); - template<std::size_t id> using ElementBoundaryTypes = typename GET_PROP_TYPE(SubDomainTypeTag<id>, ElementBoundaryTypes); - template<std::size_t id> using LocalResidual = typename GET_PROP_TYPE(SubDomainTypeTag<id>, LocalResidual); + template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using NumEqVector = GetPropType<SubDomainTypeTag<id>, Properties::NumEqVector>; + template<std::size_t id> using ElementBoundaryTypes = GetPropType<SubDomainTypeTag<id>, Properties::ElementBoundaryTypes>; + template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using SubControlVolume = typename FVGridGeometry<id>::SubControlVolume; template<std::size_t id> using SubControlVolumeFace = typename FVGridGeometry<id>::SubControlVolumeFace; @@ -77,7 +77,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; template<std::size_t id> using IndexType = typename GridView<id>::IndexSet::IndexType; - template<std::size_t id> using GridVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables); + template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using GridVolumeVariables = typename GridVariables<id>::GridVolumeVariables; template<std::size_t id> using ElementVolumeVariables = typename GridVolumeVariables<id>::LocalView; template<std::size_t id> using VolumeVariables = typename ElementVolumeVariables<id>::VolumeVariables; diff --git a/dumux/multidomain/facet/box/localresidual.hh b/dumux/multidomain/facet/box/localresidual.hh index 969565b081d7f1c07b9680076d5e794834f8647b..32bfff7df62f5d39f3041da999ced70204ce8f6b 100644 --- a/dumux/multidomain/facet/box/localresidual.hh +++ b/dumux/multidomain/facet/box/localresidual.hh @@ -45,16 +45,16 @@ template<class TypeTag> class BoxFacetCouplingLocalResidual : public FVLocalResidual<TypeTag> { using ParentType = FVLocalResidual<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: using ElementResidualVector = typename ParentType::ElementResidualVector; diff --git a/dumux/multidomain/facet/box/properties.hh b/dumux/multidomain/facet/box/properties.hh index ffa796d566a4d27daf4f1d959857fe35d2bb8246..f4e442637b1068caf857b40cf0445572622ce657 100644 --- a/dumux/multidomain/facet/box/properties.hh +++ b/dumux/multidomain/facet/box/properties.hh @@ -47,34 +47,44 @@ namespace Properties { //! Type tag for the box scheme with coupling to //! another sub-domain living on the grid facets. -NEW_TYPE_TAG(BoxFacetCouplingModel, INHERITS_FROM(BoxModel)); +// Create new type tags +namespace TTag { +struct BoxFacetCouplingModel { using InheritsFrom = std::tuple<BoxModel>; }; +} // end namespace TTag //! Use the box local residual for models with facet coupling -SET_TYPE_PROP(BoxFacetCouplingModel, BaseLocalResidual, BoxFacetCouplingLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::BoxFacetCouplingModel> { using type = BoxFacetCouplingLocalResidual<TypeTag>; }; //! Use the box facet coupling-specific Darcy's law -SET_TYPE_PROP(BoxFacetCouplingModel, - AdvectionType, - BoxFacetCouplingDarcysLaw< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::BoxFacetCouplingModel> +{ + using type = BoxFacetCouplingDarcysLaw< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; //! Per default, use the porous medium flow flux variables with the modified upwind scheme -SET_TYPE_PROP(BoxFacetCouplingModel, - FluxVariables, - PorousMediumFluxVariables<TypeTag, BoxFacetCouplingUpwindScheme<typename GET_PROP_TYPE(TypeTag, FVGridGeometry)>>); +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::BoxFacetCouplingModel> +{ + using type = PorousMediumFluxVariables<TypeTag, + BoxFacetCouplingUpwindScheme<GetPropType<TypeTag, Properties::FVGridGeometry>>>; +}; //! Per default, use the porous medium flow flux variables with the modified upwind scheme -SET_TYPE_PROP(BoxFacetCouplingModel, - ElementBoundaryTypes, - BoxFacetCouplingElementBoundaryTypes<typename GET_PROP_TYPE(TypeTag, BoundaryTypes)>); +template<class TypeTag> +struct ElementBoundaryTypes<TypeTag, TTag::BoxFacetCouplingModel> +{ using type = BoxFacetCouplingElementBoundaryTypes<GetPropType<TypeTag, Properties::BoundaryTypes>>; }; //! Set the default for the grid finite volume geometry -SET_PROP(BoxFacetCouplingModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::BoxFacetCouplingModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = BoxFacetCouplingFVGridGeometry<Scalar, GridView, enableCache>; }; diff --git a/dumux/multidomain/facet/cellcentered/localresidual.hh b/dumux/multidomain/facet/cellcentered/localresidual.hh index ea18dc4de0400027dc986c45bbaf5514addf3dd5..89fb374776e3b4ed07ac8311f903795ab0044dba 100644 --- a/dumux/multidomain/facet/cellcentered/localresidual.hh +++ b/dumux/multidomain/facet/cellcentered/localresidual.hh @@ -48,7 +48,7 @@ class CCFacetCouplingLocalResidual : public CCLocalResidual<TypeTag> { using ParentType = CCLocalResidual<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -57,7 +57,7 @@ class CCFacetCouplingLocalResidual : public CCLocalResidual<TypeTag> using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: //! pull up the parent's constructor diff --git a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh index 9bcd38eeaa39391a28e66c226069a31986efbc3f..bc9bd8b214508f555968be3a4d9b059ed4b95890 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh @@ -64,12 +64,12 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; // further types specific to the sub-problems - template<std::size_t id> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables); - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); - template<std::size_t id> using NumEqVector = typename GET_PROP_TYPE(SubDomainTypeTag<id>, NumEqVector); - template<std::size_t id> using LocalResidual = typename GET_PROP_TYPE(SubDomainTypeTag<id>, LocalResidual); + template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + template<std::size_t id> using NumEqVector = GetPropType<SubDomainTypeTag<id>, Properties::NumEqVector>; + template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using SubControlVolume = typename FVGridGeometry<id>::SubControlVolume; template<std::size_t id> using SubControlVolumeFace = typename FVGridGeometry<id>::SubControlVolumeFace; @@ -77,7 +77,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; template<std::size_t id> using IndexType = typename GridView<id>::IndexSet::IndexType; - template<std::size_t id> using GridVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables); + template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using GridVolumeVariables = typename GridVariables<id>::GridVolumeVariables; template<std::size_t id> using ElementVolumeVariables = typename GridVolumeVariables<id>::LocalView; template<std::size_t id> using VolumeVariables = typename ElementVolumeVariables<id>::VolumeVariables; @@ -85,11 +85,11 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using ElementFluxVariablesCache = typename GridFluxVariablesCache<id>::LocalView; // this currently does not work for some grid-wide caches being active - static_assert(!GET_PROP_VALUE(SubDomainTypeTag<bulkId>, EnableGridFluxVariablesCache), + static_assert(!getPropValue<SubDomainTypeTag<bulkId>, Properties::EnableGridFluxVariablesCache>(), "Grid flux variables caching currently not supported in the bulk domain of cc-facet coupling models"); - static_assert(!GET_PROP_VALUE(SubDomainTypeTag<lowDimId>, EnableGridVolumeVariablesCache), + static_assert(!getPropValue<SubDomainTypeTag<lowDimId>, Properties::EnableGridVolumeVariablesCache>(), "Grid volume variables caching currently not supported in the lower-dimensional domain of cc-facet coupling models"); - static_assert(!GET_PROP_VALUE(SubDomainTypeTag<bulkId>, EnableGridVolumeVariablesCache), + static_assert(!getPropValue<SubDomainTypeTag<bulkId>, Properties::EnableGridVolumeVariablesCache>(), "Grid volume variables caching currently not supported in the bulk domain of cc-facet coupling models"); // extract corresponding grid ids from the mapper diff --git a/dumux/multidomain/facet/cellcentered/tpfa/properties.hh b/dumux/multidomain/facet/cellcentered/tpfa/properties.hh index 16e6ef0e9c64534197a6f05ef76acd24c2bdf388..ad4328abc503fc7740df613fed4189576a6aaec9 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/properties.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/properties.hh @@ -44,21 +44,30 @@ namespace Properties { //! Type tag for the cell-centered tpfa scheme with coupling to //! another sub-domain living on the grid facets. -NEW_TYPE_TAG(CCTpfaFacetCouplingModel, INHERITS_FROM(CCTpfaModel)); +// Create new type tags +namespace TTag { +struct CCTpfaFacetCouplingModel { using InheritsFrom = std::tuple<CCTpfaModel>; }; +} // end namespace TTag //! Use the tpfa facet coupling-specific Darcy's law -SET_TYPE_PROP(CCTpfaFacetCouplingModel, - AdvectionType, - CCTpfaFacetCouplingDarcysLaw< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::CCTpfaFacetCouplingModel> +{ + using type = CCTpfaFacetCouplingDarcysLaw< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; //! Use the cc local residual for models with facet coupling -SET_TYPE_PROP(CCTpfaFacetCouplingModel, BaseLocalResidual, CCFacetCouplingLocalResidual<TypeTag>); +template<class TypeTag> +struct BaseLocalResidual<TypeTag, TTag::CCTpfaFacetCouplingModel> { using type = CCFacetCouplingLocalResidual<TypeTag>; }; //! Per default, use the porous medium flow flux variables with the modified upwind scheme -SET_TYPE_PROP(CCTpfaFacetCouplingModel, - FluxVariables, - PorousMediumFluxVariables<TypeTag, CCFacetCouplingUpwindScheme<typename GET_PROP_TYPE(TypeTag, FVGridGeometry)>>); +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::CCTpfaFacetCouplingModel> +{ + using type = PorousMediumFluxVariables<TypeTag, + CCFacetCouplingUpwindScheme<GetPropType<TypeTag, Properties::FVGridGeometry>>>; +}; } // namespace Properties } // namespace Dumux diff --git a/dumux/multidomain/facet/couplingmanager.hh b/dumux/multidomain/facet/couplingmanager.hh index 802cc15c7f3e6509fbad50525cfd3b95a64dd382..11c8261594ac4e4d67277f51910b31328ad36887 100644 --- a/dumux/multidomain/facet/couplingmanager.hh +++ b/dumux/multidomain/facet/couplingmanager.hh @@ -90,7 +90,7 @@ template< class MDTraits, class CouplingMapper, std::size_t bulkDomainId = 0, std::size_t lowDimDomainId = 1, - DiscretizationMethod bulkDM = GET_PROP_TYPE(typename MDTraits::template SubDomainTypeTag<bulkDomainId>, FVGridGeometry)::discMethod > + DiscretizationMethod bulkDM = GetPropType<typename MDTraits::template SubDomainTypeTag<bulkDomainId>, Properties::FVGridGeometry>::discMethod > class FacetCouplingManager; /*! @@ -130,17 +130,17 @@ class FacetCouplingThreeDomainManager template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; // further types specific to the sub-problems - template<std::size_t id> using LocalResidual = typename GET_PROP_TYPE(SubDomainTypeTag<id>, LocalResidual); - template<std::size_t id> using PrimaryVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables); - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); + template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; + template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; - template<std::size_t id> using FVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + template<std::size_t id> using FVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; template<std::size_t id> using FVElementGeometry = typename FVGridGeometry<id>::LocalView; template<std::size_t id> using GridView = typename FVGridGeometry<id>::GridView; template<std::size_t id> using IndexType = typename GridView<id>::IndexSet::IndexType; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; - template<std::size_t id> using GridVariables = typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables); + template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using ElementVolumeVariables = typename GridVariables<id>::GridVolumeVariables::LocalView; template<std::size_t id> using ElementFluxVariablesCache = typename GridVariables<id>::GridFluxVariablesCache::LocalView; diff --git a/dumux/multidomain/fvassembler.hh b/dumux/multidomain/fvassembler.hh index 6b49018d38a61ca2f7400ebbdc9afda3e1c7bdc8..34c2e4a9ca72bb013c654b816758c293a8dd6f73 100644 --- a/dumux/multidomain/fvassembler.hh +++ b/dumux/multidomain/fvassembler.hh @@ -65,7 +65,7 @@ public: using Scalar = typename MDTraits::Scalar; template<std::size_t id> - using LocalResidual = typename GET_PROP_TYPE(SubDomainTypeTag<id>, LocalResidual); + using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; using JacobianMatrix = typename MDTraits::JacobianMatrix; using SolutionVector = typename MDTraits::SolutionVector; diff --git a/dumux/multidomain/staggeredcouplingmanager.hh b/dumux/multidomain/staggeredcouplingmanager.hh index d5e8855bc3d0237854f331840269c4391eb1bd03..a1ff234f325577457f56770b547865844b2a0af3 100644 --- a/dumux/multidomain/staggeredcouplingmanager.hh +++ b/dumux/multidomain/staggeredcouplingmanager.hh @@ -42,7 +42,7 @@ class StaggeredCouplingManagerBase: public CouplingManager<MDTraits> using ParentType = CouplingManager<MDTraits>; template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<id>; - template<std::size_t id> using Problem = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem); + template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; using StaggeredSubDomainTypeTag = typename MDTraits::template SubDomainTypeTag<0>; diff --git a/dumux/multidomain/staggeredtraits.hh b/dumux/multidomain/staggeredtraits.hh index eb34f23d326a4cdab1536cb65ed2ddcd87c0d7d0..96e9de31cd5a28dc0eaaeb5cd599ffaed8d23e7f 100644 --- a/dumux/multidomain/staggeredtraits.hh +++ b/dumux/multidomain/staggeredtraits.hh @@ -89,29 +89,29 @@ private: template<std::size_t id> using SolutionSubVector = std::conditional_t<(id < 2), std::conditional_t<(id == 0), - typename GET_PROP_TYPE(SubDomainTypeTag<0>, CellCenterSolutionVector), - typename GET_PROP_TYPE(SubDomainTypeTag<0>, FaceSolutionVector)>, - typename GET_PROP_TYPE(SubDomainTypeTag<id>, SolutionVector)>; + GetPropType<SubDomainTypeTag<0>, Properties::CellCenterSolutionVector>, + GetPropType<SubDomainTypeTag<0>, Properties::FaceSolutionVector>>, + GetPropType<SubDomainTypeTag<id>, Properties::SolutionVector>>; template<std::size_t id> - using SubDomainScalar = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Scalar); + using SubDomainScalar = GetPropType<SubDomainTypeTag<id>, Properties::Scalar>; template<std::size_t id> - using SubDomainProblem = std::shared_ptr<const typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem)>; + using SubDomainProblem = std::shared_ptr<const GetPropType<SubDomainTypeTag<id>, Properties::Problem>>; template<std::size_t id> using SubDomainFVGridGeometry = std::shared_ptr<std::conditional_t<(id < 2), std::conditional_t<(id == 0), - typename GET_PROP_TYPE(SubDomainTypeTag<0>, FVGridGeometry)::CellCenterFVGridGeometryType, - typename GET_PROP_TYPE(SubDomainTypeTag<0>, FVGridGeometry)::FaceFVGridGeometryType>, - typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry)>>; + typename GetPropType<SubDomainTypeTag<0>, Properties::FVGridGeometry>::CellCenterFVGridGeometryType, + typename GetPropType<SubDomainTypeTag<0>, Properties::FVGridGeometry>::FaceFVGridGeometryType>, + GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>>>; template<std::size_t id> using SubDomainGridVariables = std::shared_ptr<std::conditional_t<(id < 2), std::conditional_t<(id == 0), - typename GET_PROP_TYPE(SubDomainTypeTag<0>, GridVariables)::CellCenterGridVariablesType, - typename GET_PROP_TYPE(SubDomainTypeTag<0>, GridVariables)::FaceGridVariablesType>, - typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables)>>; + typename GetPropType<SubDomainTypeTag<0>, Properties::GridVariables>::CellCenterGridVariablesType, + typename GetPropType<SubDomainTypeTag<0>, Properties::GridVariables>::FaceGridVariablesType>, + GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>>>; template<class Scalar, int numEq> struct JacobianType @@ -126,9 +126,9 @@ private: template<std::size_t id> using JacobianDiagBlock = std::conditional_t<(id < 2), std::conditional_t<(id == 0), - typename JacobianType<typename GET_PROP_TYPE(SubDomainTypeTag<0>, Scalar), GET_PROP_VALUE(SubDomainTypeTag<0>, NumEqCellCenter)>::type, - typename JacobianType<typename GET_PROP_TYPE(SubDomainTypeTag<0>, Scalar), GET_PROP_VALUE(SubDomainTypeTag<0>, NumEqFace)>::type>, - typename GET_PROP_TYPE(SubDomainTypeTag<id>, JacobianMatrix)>; + typename JacobianType<GetPropType<SubDomainTypeTag<0>, Properties::Scalar>, getPropValue<SubDomainTypeTag<0>, Properties::NumEqCellCenter>()>::type, + typename JacobianType<GetPropType<SubDomainTypeTag<0>, Properties::Scalar>, getPropValue<SubDomainTypeTag<0>, Properties::NumEqFace>()>::type>, + GetPropType<SubDomainTypeTag<id>, Properties::JacobianMatrix>>; public: @@ -140,9 +140,9 @@ public: template<std::size_t id> using PrimaryVariables = std::conditional_t<(id < 2), - std::conditional_t<(id == 0), typename GET_PROP_TYPE(SubDomainTypeTag<0>, CellCenterPrimaryVariables), - typename GET_PROP_TYPE(SubDomainTypeTag<0>, FacePrimaryVariables)>, - typename GET_PROP_TYPE(SubDomainTypeTag<id>, PrimaryVariables)>; + std::conditional_t<(id == 0), GetPropType<SubDomainTypeTag<0>, Properties::CellCenterPrimaryVariables>, + GetPropType<SubDomainTypeTag<0>, Properties::FacePrimaryVariables>>, + GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>>; template<typename... MatrixBlocks> using createMatrixType = typename Detail::createMultiTypeBlockMatrixType<Scalar, MatrixBlocks...>::type::type; diff --git a/dumux/multidomain/subdomainboxlocalassembler.hh b/dumux/multidomain/subdomainboxlocalassembler.hh index 8a5b8ebc0bfe792b1cbff174746729f8f0ab717a..487912202eea1f03d3904800044f9e2d1cf70632 100644 --- a/dumux/multidomain/subdomainboxlocalassembler.hh +++ b/dumux/multidomain/subdomainboxlocalassembler.hh @@ -56,15 +56,15 @@ class SubDomainBoxLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Asse { using ParentType = FVLocalAssemblerBase<TypeTag, Assembler,Implementation, implicit>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using LocalResidualValues = GetPropType<TypeTag, Properties::NumEqVector>; using ElementResidualVector = typename ParentType::LocalResidual::ElementResidualVector; - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; using SolutionVector = typename Assembler::SolutionVector; - using SubSolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); + using SubSolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -74,12 +74,12 @@ class SubDomainBoxLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Asse using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using CouplingManager = typename Assembler::CouplingManager; - static constexpr auto numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq(); + static constexpr auto numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq(); public: //! export the domain id of this sub-domain @@ -324,22 +324,22 @@ class SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /* SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, true>, true > { using ThisType = SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true>; - using ParentType = SubDomainBoxLocalAssemblerBase<id, TypeTag, Assembler, ThisType, true>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using ParentType = SubDomainBoxLocalAssemblerBase<id, TypeTag, Assembler, ThisType, /*implicit=*/true>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using ElementResidualVector = typename ParentType::LocalResidual::ElementResidualVector; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; - enum { dim = GET_PROP_TYPE(TypeTag, GridView)::dimension }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; + enum { dim = GetPropType<TypeTag, Properties::GridView>::dimension }; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - static constexpr bool enableGridVolVarsCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + static constexpr bool enableGridVolVarsCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); static constexpr auto domainI = Dune::index_constant<id>(); public: @@ -561,20 +561,20 @@ class SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /* { using ThisType = SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/false>; using ParentType = SubDomainBoxLocalAssemblerBase<id, TypeTag, Assembler, ThisType, /*implicit=*/false>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using ElementResidualVector = typename ParentType::LocalResidual::ElementResidualVector; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; - enum { dim = GET_PROP_TYPE(TypeTag, GridView)::dimension }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; + enum { dim = GetPropType<TypeTag, Properties::GridView>::dimension }; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - static constexpr bool enableGridVolVarsCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + static constexpr bool enableGridVolVarsCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); static constexpr auto domainI = Dune::index_constant<id>(); public: diff --git a/dumux/multidomain/subdomaincclocalassembler.hh b/dumux/multidomain/subdomaincclocalassembler.hh index 4495838887bf4d60a87a0835146100abf1a166fa..918e1401c27a6eca2651e53556c02bb79baa1604 100644 --- a/dumux/multidomain/subdomaincclocalassembler.hh +++ b/dumux/multidomain/subdomaincclocalassembler.hh @@ -57,14 +57,14 @@ class SubDomainCCLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assem { using ParentType = FVLocalAssemblerBase<TypeTag, Assembler,Implementation, implicit>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using LocalResidualValues = GetPropType<TypeTag, Properties::NumEqVector>; + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; using SolutionVector = typename Assembler::SolutionVector; - using SubSolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); + using SubSolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -74,7 +74,7 @@ class SubDomainCCLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag, Assem using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using CouplingManager = typename Assembler::CouplingManager; @@ -84,7 +84,7 @@ public: //! export the domain id of this sub-domain static constexpr auto domainId = typename Dune::index_constant<id>(); //! the local residual type of this domain - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; //! pull up constructor of parent class using ParentType::ParentType; @@ -277,20 +277,20 @@ class SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*i using ThisType = SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true>; using ParentType = SubDomainCCLocalAssemblerBase<id, TypeTag, Assembler, ThisType, /*implicit=*/true>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using LocalResidualValues = GetPropType<TypeTag, Properties::NumEqVector>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; enum { dim = GridView::dimension }; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); - static constexpr bool enableGridVolVarsCache = GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache); - static constexpr int maxElementStencilSize = FVGridGeometry::maxElementStencilSize;; + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); + static constexpr bool enableGridVolVarsCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>(); + static constexpr int maxElementStencilSize = FVGridGeometry::maxElementStencilSize; static constexpr auto domainI = Dune::index_constant<id>(); public: @@ -553,10 +553,10 @@ class SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*i using ThisType = SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/false>; using ParentType = SubDomainCCLocalAssemblerBase<id, TypeTag, Assembler, ThisType, /*implicit=*/false>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using LocalResidualValues = GetPropType<TypeTag, Properties::NumEqVector>; - static constexpr int numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq(); + static constexpr int numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq(); static constexpr auto domainI = Dune::index_constant<id>(); public: @@ -677,12 +677,12 @@ class SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::analytic, /* { using ThisType = SubDomainCCLocalAssembler<id, TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/true>; using ParentType = SubDomainCCLocalAssemblerBase<id, TypeTag, Assembler, ThisType, /*implicit=*/true>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using LocalResidualValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using LocalResidualValues = GetPropType<TypeTag, Properties::NumEqVector>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - enum { numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq() }; + enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; enum { dim = GridView::dimension }; static constexpr auto domainI = Dune::index_constant<id>(); diff --git a/dumux/multidomain/subdomainstaggeredlocalassembler.hh b/dumux/multidomain/subdomainstaggeredlocalassembler.hh index ace57abc8eb028ccb13efff7839bb244af15d77e..738477a41067867625fd42d57446c0f45b7a3cfa 100644 --- a/dumux/multidomain/subdomainstaggeredlocalassembler.hh +++ b/dumux/multidomain/subdomainstaggeredlocalassembler.hh @@ -55,28 +55,28 @@ class SubDomainStaggeredLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag { using ParentType = FVLocalAssemblerBase<TypeTag, Assembler,Implementation, isImplicit>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using SolutionVector = typename Assembler::SolutionVector; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVolumeVariables = typename GridVariables::GridVolumeVariables; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; using Scalar = typename GridVariables::Scalar; - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using CellCenterResidualValue = typename LocalResidual::CellCenterResidualValue; using FaceResidualValue = typename LocalResidual::FaceResidualValue; using FVGridGeometry = typename GridVariables::GridGeometry; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using CouplingManager = typename Assembler::CouplingManager; - static constexpr auto numEq = GET_PROP_TYPE(TypeTag, ModelTraits)::numEq(); + static constexpr auto numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq(); public: static constexpr auto domainId = typename Dune::index_constant<id>(); @@ -472,23 +472,23 @@ class SubDomainStaggeredLocalAssembler<id, TypeTag, Assembler, DiffMethod::numer { using ThisType = SubDomainStaggeredLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true>; using ParentType = SubDomainStaggeredLocalAssemblerImplicitBase<id, TypeTag, Assembler, ThisType>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using CellCenterResidualValue = typename LocalResidual::CellCenterResidualValue; using FaceResidualValue = typename LocalResidual::FaceResidualValue; - using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; - using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables); - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using Element = typename GetPropType<TypeTag, Properties::GridView>::template Codim<0>::Entity; + using GridFaceVariables = GetPropType<TypeTag, Properties::GridFaceVariables>; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using FaceVariables = typename ElementFaceVariables::FaceVariables; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr bool enableGridFluxVarsCache = GET_PROP_VALUE(TypeTag, EnableGridFluxVariablesCache); + static constexpr bool enableGridFluxVarsCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>(); static constexpr int maxNeighbors = 4*(2*ModelTraits::dim()); static constexpr auto domainI = Dune::index_constant<id>(); static constexpr auto cellCenterId = typename Dune::index_constant<0>(); @@ -626,7 +626,7 @@ public: const auto& fvGridGeometry = this->problem().fvGridGeometry(); const auto& curSol = this->curSol()[domainI]; - using FaceSolutionVector = typename GET_PROP_TYPE(TypeTag, FaceSolutionVector); // TODO: use reserved vector + using FaceSolutionVector = GetPropType<TypeTag, Properties::FaceSolutionVector>; // TODO: use reserved vector FaceSolutionVector origResiduals; origResiduals.resize(fvGeometry.numScvf()); origResiduals = 0.0; @@ -651,7 +651,7 @@ public: // set the actual dof index const auto faceGlobalI = scvf.dofIndex(); - using FaceSolution = typename GET_PROP_TYPE(TypeTag, StaggeredFaceSolution); + using FaceSolution = GetPropType<TypeTag, Properties::StaggeredFaceSolution>; const auto origFaceSolution = FaceSolution(scvf, curSol, fvGridGeometry); // build derivatives with for face dofs w.r.t. cell center dofs @@ -996,12 +996,12 @@ public: private: template<class T = TypeTag> - static typename std::enable_if<!GET_PROP_VALUE(T, EnableGridFaceVariablesCache), FaceVariables&>::type + static typename std::enable_if<!getPropValue<T, Properties::EnableGridFaceVariablesCache>(), FaceVariables&>::type getFaceVarAccess(GridFaceVariables& gridFaceVariables, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf) { return elemFaceVars[scvf]; } template<class T = TypeTag> - static typename std::enable_if<GET_PROP_VALUE(T, EnableGridFaceVariablesCache), FaceVariables&>::type + static typename std::enable_if<getPropValue<T, Properties::EnableGridFaceVariablesCache>(), FaceVariables&>::type getFaceVarAccess(GridFaceVariables& gridFaceVariables, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf) { return gridFaceVariables.faceVars(scvf.index()); } }; diff --git a/dumux/multidomain/traits.hh b/dumux/multidomain/traits.hh index f8b1770c717af4324ccd02c6c1ca63bfb82e418b..bf8b7806d1eef3c949c45f4da459def06ebcc600 100644 --- a/dumux/multidomain/traits.hh +++ b/dumux/multidomain/traits.hh @@ -125,28 +125,28 @@ struct MultiDomainTraits //! the sub domain geometry template<std::size_t id> - using SubDomainFVGridGeometry = typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry); + using SubDomainFVGridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>; private: using Indices = std::make_index_sequence<numSubDomains>; template<std::size_t id> - using SolutionSubVector = typename GET_PROP_TYPE(SubDomainTypeTag<id>, SolutionVector); + using SolutionSubVector = GetPropType<SubDomainTypeTag<id>, Properties::SolutionVector>; template<std::size_t id> - using SubDomainScalar = typename GET_PROP_TYPE(SubDomainTypeTag<id>, Scalar); + using SubDomainScalar = GetPropType<SubDomainTypeTag<id>, Properties::Scalar>; template<std::size_t id> - using SubDomainProblem = std::shared_ptr<const typename GET_PROP_TYPE(SubDomainTypeTag<id>, Problem)>; + using SubDomainProblem = std::shared_ptr<const GetPropType<SubDomainTypeTag<id>, Properties::Problem>>; template<std::size_t id> - using SubDomainFVGridGeometryPtr = std::shared_ptr<const typename GET_PROP_TYPE(SubDomainTypeTag<id>, FVGridGeometry)>; + using SubDomainFVGridGeometryPtr = std::shared_ptr<const GetPropType<SubDomainTypeTag<id>, Properties::FVGridGeometry>>; template<std::size_t id> - using SubDomainGridVariables = std::shared_ptr<typename GET_PROP_TYPE(SubDomainTypeTag<id>, GridVariables)>; + using SubDomainGridVariables = std::shared_ptr<GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>>; template<std::size_t id> - using JacobianDiagBlock = typename GET_PROP_TYPE(SubDomainTypeTag<id>, JacobianMatrix); + using JacobianDiagBlock = GetPropType<SubDomainTypeTag<id>, Properties::JacobianMatrix>; public: diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh index d70860251b207a334395352bd26ee9f2d91eecc9..219394d476c1a4815dc8841278597dcb48f28e72 100644 --- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh @@ -40,19 +40,19 @@ template<class TypeTag> class OnePIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag> { using ParentType = ImmiscibleLocalResidual<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - 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 FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; // first index for the mass balance enum { conti0EqIdx = Indices::conti0EqIdx }; enum { pressureIdx = Indices::pressureIdx }; @@ -81,7 +81,7 @@ public: //! flux derivatives for the cell-centered tpfa scheme template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -107,7 +107,7 @@ public: //! flux derivatives for the cell-centered mpfa scheme template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::ccmpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -165,7 +165,7 @@ public: //! flux derivatives for the box scheme template<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, @@ -179,7 +179,7 @@ public: static_assert(FluidSystem::viscosityIsConstant(0), "1p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!"); - using AdvectionType = typename GET_PROP_TYPE(T, AdvectionType); + using AdvectionType = GetPropType<T, Properties::AdvectionType>; const auto ti = AdvectionType::calculateTransmissibilities(problem, element, fvGeometry, @@ -203,7 +203,7 @@ public: //! Dirichlet flux derivatives for the cell-centered tpfa scheme template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> addCCDirichletFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -223,7 +223,7 @@ public: //! Dirichlet flux derivatives for the cell-centered mpfa scheme template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::ccmpfa, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::ccmpfa, void> addCCDirichletFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index e79ed569d471e1329650f3095dc716df597d1858..b693a416f24b5f98d3de5ed9a5a2ed0401131050 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -111,30 +111,39 @@ struct OnePVolumeVariablesTraits }; namespace Properties { +// Create new type tags +namespace TTag { //! The type tags for the isothermal single phase model -NEW_TYPE_TAG(OneP, INHERITS_FROM(PorousMediumFlow)); +struct OneP { using InheritsFrom = std::tuple<PorousMediumFlow>; }; + //! The type tags for the non-isothermal single phase model -NEW_TYPE_TAG(OnePNI, INHERITS_FROM(OneP)); +struct OnePNI { using InheritsFrom = std::tuple<OneP>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // properties for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_TYPE_PROP(OneP, IOFields, OnePIOFields); //!< default I/O fields specific to this model -SET_TYPE_PROP(OneP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< the local residual function -SET_TYPE_PROP(OneP, BaseModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model -SET_TYPE_PROP(OneP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits +template<class TypeTag> +struct IOFields<TypeTag, TTag::OneP> { using type = OnePIOFields; }; //!< default I/O fields specific to this model +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OneP> { using type = ImmiscibleLocalResidual<TypeTag>; }; //!< the local residual function +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::OneP> { using type = OnePModelTraits; }; //!< states some specifics of the one-phase model +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OneP> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //!< default the actually used traits to the base traits //! Set the volume variables property -SET_PROP(OneP, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OneP> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = OnePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -147,11 +156,12 @@ public: * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(OneP, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::OneP> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = ImmiscibleFluidState<Scalar, FluidSystem>; }; @@ -161,15 +171,17 @@ public: /////////////////////////////////////////////////////////////////////////// //! Add temperature to the output -SET_TYPE_PROP(OnePNI, IOFields, EnergyIOFields<OnePIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OnePNI> { using type = EnergyIOFields<OnePIOFields>; }; //! The model traits of the non-isothermal model -SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits<OnePModelTraits>); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OnePNI> { using type = PorousMediumFlowNIModelTraits<OnePModelTraits>; }; //! Use the average for effective conductivities -SET_TYPE_PROP(OnePNI, - ThermalConductivityModel, - ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::OnePNI> +{ using type = ThermalConductivityAverage<GetPropType<TypeTag, Properties::Scalar>>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh index c5fe24e9735207d49a900033cf5b954674c705c0..badc8a26cd8ce3e29f2f7ce003b413e865c575ba 100644 --- a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh +++ b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh @@ -26,6 +26,7 @@ #define DUMUX_FVPRESSUREPORPERTIES1P_SEQUENTIAL_HH //Dumux-includes +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/1p/sequential/diffusion/properties.hh> namespace Dumux diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index 7b9fd97c35178c4f39cdea3932aad462d3b9d1bd..f710c2b2aac84ff9f33ce91a4fdea98ba491c734 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -139,25 +139,31 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tag for the implicit the isothermal & non-isothermal one phase n component problems -NEW_TYPE_TAG(OnePNC, INHERITS_FROM(PorousMediumFlow)); -NEW_TYPE_TAG(OnePNCNI, INHERITS_FROM(OnePNC)); +// Create new type tags +namespace TTag { +struct OnePNC { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +struct OnePNCNI { using InheritsFrom = std::tuple<OnePNC>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // properties for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// //! Set as default that no component mass balance is replaced by the total mass balance -SET_INT_PROP(OnePNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::OnePNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; }; //! The base model traits. Per default, we use the number of components of the fluid system. -SET_PROP(OnePNC, BaseModelTraits) +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::OnePNC> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: - using type = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using type = OnePNCModelTraits<FluidSystem::numComponents, getPropValue<TypeTag, Properties::UseMoles>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; }; -SET_TYPE_PROP(OnePNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OnePNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //!< default the actually used traits to the base traits /*! @@ -166,37 +172,42 @@ SET_TYPE_PROP(OnePNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTrai * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(OnePNC, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::OnePNC> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! Use the model after Millington (1961) for the effective diffusivity -SET_TYPE_PROP(OnePNC, EffectiveDiffusivityModel, - DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::OnePNC> +{ using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! Use mole fractions in the balance equations by default -SET_BOOL_PROP(OnePNC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::OnePNC> { static constexpr bool value = true; }; //! The local residual function -SET_TYPE_PROP(OnePNC, LocalResidual, CompositionalLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OnePNC> { using type = CompositionalLocalResidual<TypeTag>; }; //! Set the volume variables property -SET_PROP(OnePNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OnePNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); @@ -208,25 +219,28 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(OnePNC, IOFields, OnePNCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OnePNC> { using type = OnePNCIOFields; }; /////////////////////////////////////////////////////////////////////////// // properties for the non-isothermal single phase model /////////////////////////////////////////////////////////////////////////// //! the non-isothermal vtk output fields -SET_TYPE_PROP(OnePNCNI, IOFields, EnergyIOFields<OnePNCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OnePNCNI> { using type = EnergyIOFields<OnePNCIOFields>; }; //! Use the average for effective conductivities -SET_TYPE_PROP(OnePNCNI, - ThermalConductivityModel, - ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::OnePNCNI> +{ using type = ThermalConductivityAverage<GetPropType<TypeTag, Properties::Scalar>>; }; //! model traits of the non-isothermal model. -SET_PROP(OnePNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OnePNCNI> { private: - using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using IsothermalTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index d03f678254f64697869f5f1ae145f427bbc96f68..19f28ef7e5002e9261d32e10e3e7a140867b1e5a 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -87,24 +87,28 @@ namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(OnePNCMin, INHERITS_FROM(OnePNC)); -NEW_TYPE_TAG(OnePNCMinNI, INHERITS_FROM(OnePNCMin)); +// Create new type tags +namespace TTag { +struct OnePNCMin { using InheritsFrom = std::tuple<OnePNC>; }; +struct OnePNCMinNI { using InheritsFrom = std::tuple<OnePNCMin>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property tags for the isothermal 2pncmin model ////////////////////////////////////////////////////////////////// //! use the mineralization volume variables together with the 1pnc vol vars -SET_PROP(OnePNCMin, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::OnePNCMin> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -118,57 +122,63 @@ public: }; // Use the mineralization local residual -SET_TYPE_PROP(OnePNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OnePNCMin> { using type = MineralizationLocalResidual<TypeTag>; }; //! Use non-mineralization model traits with 1pnc traits -SET_PROP(OnePNCMin, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OnePNCMin> { private: - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMinTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using NonMinTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = MineralizationModelTraits<NonMinTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; }; //! The two-phase model uses the immiscible fluid state -SET_PROP(OnePNCMin, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::OnePNCMin> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = CompositionalSolidState<Scalar, SolidSystem>; }; //! Use the mineralization vtk output fields -SET_TYPE_PROP(OnePNCMin, IOFields, MineralizationIOFields<OnePNCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::OnePNCMin> { using type = MineralizationIOFields<OnePNCIOFields>; }; ////////////////////////////////////////////////////////////////// // Properties for the non-isothermal 2pncmin model ////////////////////////////////////////////////////////////////// //! non-isothermal vtk output -SET_PROP(OnePNCMinNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::OnePNCMinNI> { using MineralizationIOF = MineralizationIOFields<OnePNCIOFields>; using type = EnergyIOFields<MineralizationIOF>; }; //! The non-isothermal model traits -SET_PROP(OnePNCMinNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::OnePNCMinNI> { private: - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using OnePNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using OnePNCTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; using IsothermalTraits = MineralizationModelTraits<OnePNCTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Use the average for effective conductivities -SET_TYPE_PROP(OnePNCMinNI, - ThermalConductivityModel, - ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::OnePNCMinNI> +{ using type = ThermalConductivityAverage<GetPropType<TypeTag, Properties::Scalar>>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p/gridadaptindicator.hh b/dumux/porousmediumflow/2p/gridadaptindicator.hh index e794f0bcffec6bdda47b443ac75a3210bd7c87df..77ff9d02b911922f440e5c967dfe7badaaa5723a 100644 --- a/dumux/porousmediumflow/2p/gridadaptindicator.hh +++ b/dumux/porousmediumflow/2p/gridadaptindicator.hh @@ -42,12 +42,12 @@ namespace Dumux { template<class TypeTag> class TwoPGridAdaptIndicator { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; enum { saturationIdx = Indices::saturationIdx }; diff --git a/dumux/porousmediumflow/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh index 6be93a832e717d2f5f8b4e200ffb5a2dcf4e7006..032cea2489bbcecef4010e160f5175046b626da9 100644 --- a/dumux/porousmediumflow/2p/griddatatransfer.hh +++ b/dumux/porousmediumflow/2p/griddatatransfer.hh @@ -45,22 +45,22 @@ namespace Dumux { template<class TypeTag> class TwoPGridDataTransfer : public GridDataTransfer { - using Grid = typename GET_PROP_TYPE(TypeTag, Grid); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Grid = GetPropType<TypeTag, Properties::Grid>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using Element = typename Grid::template Codim<0>::Entity; using ElementSolution = std::decay_t<decltype(elementSolution(std::declval<Element>(), std::declval<SolutionVector>(), std::declval<FVGridGeometry>()))>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; struct AdaptedValues @@ -76,7 +76,7 @@ class TwoPGridDataTransfer : public GridDataTransfer static constexpr int dim = Grid::dimension; static constexpr int dimWorld = Grid::dimensionworld; - static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box; // saturation primary variable index enum { saturationIdx = Indices::saturationIdx }; @@ -375,7 +375,7 @@ public: //! TODO: fix adaptive simulations in parallel //#if HAVE_MPI // // communicate ghost data -// using SolutionTypes = typename GET_PROP(TypeTag, SolutionTypes); +// using SolutionTypes = typename GetProp<TypeTag, SolutionTypes>; // using ElementMapper = typename SolutionTypes::ElementMapper; // using DataHandle = VectorExchange<ElementMapper, std::vector<CellData> >; // DataHandle dataHandle(problem.elementMapper(), this->cellDataGlobal()); diff --git a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh index 5082f021cc85a6841c00b46d2b11adffdd03218f..3383da378a980a79f5bc9dae2a7d92089a8d3a66 100644 --- a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh @@ -47,22 +47,22 @@ template<class TypeTag> class TwoPIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag> { using ParentType = ImmiscibleLocalResidual<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int pressureIdx = ModelTraits::Indices::pressureIdx; @@ -148,7 +148,7 @@ public: * \param scv The sub control volume */ template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::cctpfa, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::cctpfa, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -171,7 +171,7 @@ public: "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!"); using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; // evaluate the current wetting phase Darcy flux and resulting upwind weights static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight"); @@ -266,7 +266,7 @@ public: * \param scv The sub control volume */ template<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, @@ -289,7 +289,7 @@ public: "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p0-s1 formulation!"); using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; // evaluate the current wetting phase Darcy flux and resulting upwind weights static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight"); @@ -434,7 +434,7 @@ public: const SubControlVolumeFace& scvf) const { using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; // evaluate the current wetting phase Darcy flux and resulting upwind weights static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight"); diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 91765814dfe7a956b0189b613cc0ca4fa0b40db4..7d22fac55a71d7f56ec7ddf7464b6fd67923d412 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -151,41 +151,51 @@ namespace Properties // Type tags ////////////////////////////////////////////////////////////////// +// Create new type tags +namespace TTag { //! The type tag for the isothermal two-phase model -NEW_TYPE_TAG(TwoP, INHERITS_FROM(PorousMediumFlow)); +struct TwoP { using InheritsFrom = std::tuple<PorousMediumFlow>; }; + //! The type tag for the non-isothermal two-phase model -NEW_TYPE_TAG(TwoPNI, INHERITS_FROM(TwoP)); +struct TwoPNI { using InheritsFrom = std::tuple<TwoP>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // properties for the isothermal two-phase model /////////////////////////////////////////////////////////////////////////// //!< Set the default formulation to pwsn -SET_PROP(TwoP, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::TwoP> { static constexpr auto value = TwoPFormulation::p0s1; }; -SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoP> { using type = ImmiscibleLocalResidual<TypeTag>; }; //!< Use the immiscible local residual operator for the 2p model //! The base model traits class -SET_TYPE_PROP(TwoP, BaseModelTraits, TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>); -SET_TYPE_PROP(TwoP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::TwoP> { using type = TwoPModelTraits<getPropValue<TypeTag, Properties::Formulation>()>; }; +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoP> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //!< default the actually used traits to the base traits //! Set the vtk output fields specific to the twop model -SET_TYPE_PROP(TwoP, IOFields, TwoPIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoP> { using type = TwoPIOFields; }; //! Set the volume variables property -SET_PROP(TwoP, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoP> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; - - static constexpr auto DM = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod; - static constexpr bool enableIS = GET_PROP_VALUE(TypeTag, EnableBoxInterfaceSolver); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; + + static constexpr auto DM = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod; + static constexpr bool enableIS = getPropValue<TypeTag, Properties::EnableBoxInterfaceSolver>(); // class used for scv-wise reconstruction of non-wetting phase saturations using SR = TwoPScvSaturationReconstruction<DM, enableIS>; @@ -195,11 +205,12 @@ public: }; //! The two-phase model uses the immiscible fluid state -SET_PROP(TwoP, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::TwoP> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = ImmiscibleFluidState<Scalar, FluidSystem>; }; @@ -209,16 +220,19 @@ public: //////////////////////////////////////////////////////// //! The non-isothermal model traits class -SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits<typename GET_PROP_TYPE(TypeTag, BaseModelTraits)>); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPNI> { using type = PorousMediumFlowNIModelTraits<GetPropType<TypeTag, Properties::BaseModelTraits>>; }; //! Set the vtk output fields specific to the non-isothermal twop model -SET_TYPE_PROP(TwoPNI, IOFields, EnergyIOFields<TwoPIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPNI> { using type = EnergyIOFields<TwoPIOFields>; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(TwoPNI, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::TwoPNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ThermalConductivitySomerton<Scalar>; }; diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh index 869c8b498c367107f231b3946df3841819471953..c1e41b2a1b2d1b127ad6a3db2b2e48b44f88411d 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh @@ -26,6 +26,7 @@ #define DUMUX_FVPRESSUREPORPERTIES2P_SEQUENTIAL_HH //Dumux-includes +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/properties.hh> namespace Dumux diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureproperties.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureproperties.hh index cc4042c8cbe401b4a5564909b73a464c38814e62..7eaed2327337248209fdaec0f2d73b3d4f6a8a19 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureproperties.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureproperties.hh @@ -25,6 +25,7 @@ #define DUMUX_FVMPFAL3DPROPERTIES2P_HH // dumux environment +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/properties.hh> #include <dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh> diff --git a/dumux/porousmediumflow/2p/sequential/properties.hh b/dumux/porousmediumflow/2p/sequential/properties.hh index 25c8514cb06716eca312351c9bd6721f4b2876ce..275e2e1b9976111b976a0eaa1d11f34d00d49597 100644 --- a/dumux/porousmediumflow/2p/sequential/properties.hh +++ b/dumux/porousmediumflow/2p/sequential/properties.hh @@ -83,7 +83,8 @@ SET_INT_PROP(SequentialTwoP, NumComponents, 1); //!< Each phase consists of 1 pu SET_INT_PROP(SequentialTwoP, Formulation, SequentialTwoPCommonIndices::pwsw); //! Chose the set of indices depending on the chosen formulation -SET_PROP(SequentialTwoP, Indices) +template<class TypeTag> +struct Indices<TypeTag, TTag::SequentialTwoP> { using type = SequentialTwoPIndices<GET_PROP_VALUE(TypeTag, Formulation), 0>; }; @@ -113,7 +114,8 @@ SET_TYPE_PROP(SequentialTwoP, Variables, VariableClass<TypeTag>); SET_TYPE_PROP(SequentialTwoP, CellData, CellData2P<TypeTag, GET_PROP_VALUE(TypeTag, EnableCompressibility)>); //! Set default fluid state -SET_PROP(SequentialTwoP, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::SequentialTwoP> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/properties.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/properties.hh index c7043c9fc59c82ac30a1efa6c68a29f2c12fd68d..5daa02b808451d24767dff176e3cbf16457c7d85 100644 --- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/properties.hh +++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/properties.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_FV_TRANSPORT_PROPERTIES_2P_HH #define DUMUX_FV_TRANSPORT_PROPERTIES_2P_HH +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/2p/sequential/transport/properties.hh> namespace Dumux diff --git a/dumux/porousmediumflow/2p/sequential/transport/problem.hh b/dumux/porousmediumflow/2p/sequential/transport/problem.hh index 2e0a751614784fdf0d86a187aafc7ac2da76d391..718644f4c6ad5db9aaa80fc6cc3fe1049e168d7e 100644 --- a/dumux/porousmediumflow/2p/sequential/transport/problem.hh +++ b/dumux/porousmediumflow/2p/sequential/transport/problem.hh @@ -33,7 +33,8 @@ namespace Dumux namespace Properties { // Set the model properties -SET_PROP(TransportTwoP, Model) +template<class TypeTag> +struct Model<TypeTag, TTag::TransportTwoP> { using type = typename GET_PROP_TYPE(TypeTag, TransportModel); }; diff --git a/dumux/porousmediumflow/2p1c/darcyslaw.hh b/dumux/porousmediumflow/2p1c/darcyslaw.hh index ede39d65291b6a79191b7843ac720008e945cf21..624128bdeb7b0ee365f90a9b9250c65a018280cc 100644 --- a/dumux/porousmediumflow/2p1c/darcyslaw.hh +++ b/dumux/porousmediumflow/2p1c/darcyslaw.hh @@ -35,7 +35,8 @@ namespace Dumux namespace Properties { - NEW_PROP_TAG(UseBlockingOfSpuriousFlow); //!< Determines whether blocking of spurious flow is used or not. + template<class TypeTag, class MyTypeTag> +struct UseBlockingOfSpuriousFlow { using type = UndefinedProperty; }; //!< Determines whether blocking of spurious flow is used or not. } /*! @@ -48,18 +49,18 @@ template <class TypeTag> class TwoPOneCDarcysLaw : public DarcysLaw<TypeTag> { using ParentType = DarcysLaw<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElemFluxVarCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using FluxVarCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using ElemFluxVarCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FluxVarCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; using IndexType = typename GridView::IndexSet::IndexType; using CoordScalar = typename GridView::ctype; @@ -91,7 +92,7 @@ public: const Scalar flux = ParentType::flux(problem, element, fvGeometry, elemVolVars, scvf, phaseIdx, elemFluxVarCache); // only block wetting-phase (i.e. liquid water) fluxes - if((!GET_PROP_VALUE(TypeTag, UseBlockingOfSpuriousFlow)) || phaseIdx != liquidPhaseIdx) + if((!getPropValue<TypeTag, Properties::UseBlockingOfSpuriousFlow>()) || phaseIdx != liquidPhaseIdx) return flux; const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()]; diff --git a/dumux/porousmediumflow/2p1c/localresidual.hh b/dumux/porousmediumflow/2p1c/localresidual.hh index f7797145cc0ee5eb092c1be1f4b743c17fde8726..21b124056ad976505fb5a9009f01e273a28cc4ee 100644 --- a/dumux/porousmediumflow/2p1c/localresidual.hh +++ b/dumux/porousmediumflow/2p1c/localresidual.hh @@ -38,23 +38,23 @@ template<class TypeTag> class TwoPOneCLocalResidual : public ImmiscibleLocalResidual<TypeTag> { using ParentType = ImmiscibleLocalResidual<TypeTag>; - 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 Problem = GetPropType<TypeTag, Properties::Problem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; // first index for the mass balance enum { conti0EqIdx = Indices::conti0EqIdx }; - static const int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); + static const int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); public: //! Use the parent type's constructor diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 1d3a3990e9710831622b3ff85004c9066b53a4e9..ecf4c88f3dc7b0126a95e7d612bfecfaacf16979 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -139,7 +139,10 @@ struct TwoPOneCNIVolumeVariablesTraits namespace Properties { //! The type tag for the non-isothermal two-phase one-component model. -NEW_TYPE_TAG(TwoPOneCNI, INHERITS_FROM(PorousMediumFlow)); +// Create new type tags +namespace TTag { +struct TwoPOneCNI { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Properties @@ -151,39 +154,45 @@ NEW_TYPE_TAG(TwoPOneCNI, INHERITS_FROM(PorousMediumFlow)); * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(TwoPOneCNI, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::TwoPOneCNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! Set the default formulation to pw-sn -SET_PROP(TwoPOneCNI, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::TwoPOneCNI> { static constexpr TwoPFormulation value = TwoPFormulation::p1s0; }; //! Do not block spurious flows by default. -SET_BOOL_PROP(TwoPOneCNI, UseBlockingOfSpuriousFlow, false); +template<class TypeTag> +struct UseBlockingOfSpuriousFlow<TypeTag, TTag::TwoPOneCNI> { static constexpr bool value = false; }; //! The specific local residual (i.e. balance equations). -SET_TYPE_PROP(TwoPOneCNI, LocalResidual, TwoPOneCLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPOneCNI> { using type = TwoPOneCLocalResidual<TypeTag>; }; //! Use a modified version of Darcy's law which allows for blocking of spurious flows. -SET_TYPE_PROP(TwoPOneCNI, AdvectionType, TwoPOneCDarcysLaw<TypeTag>); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::TwoPOneCNI> { using type = TwoPOneCDarcysLaw<TypeTag>; }; //! Set the volume variables property -SET_PROP(TwoPOneCNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPOneCNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; static_assert(FSY::numComponents == 1, "Only fluid systems with 1 component are supported by the 2p1cni model!"); static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p1cni model!"); @@ -194,30 +203,35 @@ public: }; //! The primary variable switch for the 2p1cni model. -SET_TYPE_PROP(TwoPOneCNI, PrimaryVariableSwitch, TwoPOneCPrimaryVariableSwitch); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::TwoPOneCNI> { using type = TwoPOneCPrimaryVariableSwitch; }; //! The primary variables vector for the 2p1cni model. -SET_PROP(TwoPOneCNI, PrimaryVariables) +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::TwoPOneCNI> { private: - using PrimaryVariablesVector = Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; public: using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>; }; //! Somerton is used as default model to compute the effective thermal heat conductivity. -SET_TYPE_PROP(TwoPOneCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::TwoPOneCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; }; ////////////////////////////////////////////////////////////////// // Property values for isothermal model required for the general non-isothermal model ////////////////////////////////////////////////////////////////// //! Set the non-isothermal model traits -SET_TYPE_PROP(TwoPOneCNI, ModelTraits, TwoPOneCNIModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPOneCNI> { using type = TwoPOneCNIModelTraits<getPropValue<TypeTag, Properties::Formulation>()>; }; //! The non-isothermal vtk output fields. -SET_TYPE_PROP(TwoPOneCNI, IOFields, EnergyIOFields<TwoPOneCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPOneCNI> { using type = EnergyIOFields<TwoPOneCIOFields>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index b99b2a7e669c10d8f56e7d03468f4b5f5167b97b..dc3e256b8109b1e04733caac44c8a869c241581c 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -131,8 +131,11 @@ namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(TwoPTwoC, INHERITS_FROM(TwoPNC)); -NEW_TYPE_TAG(TwoPTwoCNI, INHERITS_FROM(TwoPTwoC)); +// Create new type tags +namespace TTag { +struct TwoPTwoC { using InheritsFrom = std::tuple<TwoPNC>; }; +struct TwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoC>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property values @@ -141,36 +144,39 @@ NEW_TYPE_TAG(TwoPTwoCNI, INHERITS_FROM(TwoPTwoC)); /*! * \brief Set the model traits property. */ -SET_PROP(TwoPTwoC, BaseModelTraits) +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::TwoPTwoC> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p-2c model!"); static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p-2c model!"); public: - using type = TwoPTwoCModelTraits< GET_PROP_VALUE(TypeTag, Formulation), - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx) >; + using type = TwoPTwoCModelTraits< getPropValue<TypeTag, Properties::Formulation>(), + getPropValue<TypeTag, Properties::UseMoles>(), + getPropValue<TypeTag, Properties::ReplaceCompEqIdx>() >; }; -SET_TYPE_PROP(TwoPTwoC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPTwoC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //! Use the 2p2c VolumeVariables -SET_PROP(TwoPTwoC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPTwoC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; static_assert(FSY::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!"); static_assert(FSY::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!"); - static constexpr bool useConstraintSolver = GET_PROP_VALUE(TypeTag, UseConstraintSolver); + static constexpr bool useConstraintSolver = getPropValue<TypeTag, Properties::UseConstraintSolver>(); using Traits = TwoPNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -178,26 +184,30 @@ public: }; //! Determines whether the constraint solver is used -SET_BOOL_PROP(TwoPTwoC, UseConstraintSolver, true); +template<class TypeTag> +struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; }; ////////////////////////////////////////////////////////////////////// // Properties for the non-isothermal 2p2c model (inherited from 2pnc) ////////////////////////////////////////////////////////////////////// //! Set the non-isothermal model traits -SET_PROP(TwoPTwoCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPTwoCNI> { private: - using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using IsothermalTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPTwoCNI, IOFields, EnergyIOFields<TwoPNCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPTwoCNI> { using type = EnergyIOFields<TwoPNCIOFields>; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_TYPE_PROP(TwoPTwoCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::TwoPTwoCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh b/dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh index 32fb20cee3bcc61775a0406f3d6ae61a99efdc58..3706ac13ec1d6cf2d26a1994bddb2ca35070982c 100644 --- a/dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh +++ b/dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh @@ -29,6 +29,7 @@ #ifndef DUMUX_2P2CADAPTIVE_PROPERTIES_HH #define DUMUX_2P2CADAPTIVE_PROPERTIES_HH +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/2p2c/sequential/properties.hh> #include <dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh> diff --git a/dumux/porousmediumflow/2p2c/sequential/properties.hh b/dumux/porousmediumflow/2p2c/sequential/properties.hh index 87c52615a53a703d10a8b2634a32103fc1fc76e4..3964f40159006f89996f196eca4e06e542822be2 100644 --- a/dumux/porousmediumflow/2p2c/sequential/properties.hh +++ b/dumux/porousmediumflow/2p2c/sequential/properties.hh @@ -86,7 +86,8 @@ SET_TYPE_PROP(SequentialTwoPTwoC, Indices,SequentialTwoPTwoCIndices<TypeTag>); SET_INT_PROP(SequentialTwoPTwoC, NumEq, 3); // set fluid/component information -SET_PROP(SequentialTwoPTwoC, NumPhases) //!< The number of phases in the 2p2c model is 2 +template<class TypeTag> +struct NumPhases<TypeTag, TTag::SequentialTwoPTwoC> //!< The number of phases in the 2p2c model is 2 { // the property is declared in dumux/porousmediumflow/sequential/properties.hh private: @@ -98,7 +99,8 @@ public: "Only fluid systems with 2 phases are supported by the 2p2c model!"); }; -SET_PROP(SequentialTwoPTwoC, NumComponents) //!< The number of components in the 2p2c model is 2 +template<class TypeTag> +struct NumComponents<TypeTag, TTag::SequentialTwoPTwoC> //!< The number of components in the 2p2c model is 2 { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); @@ -122,7 +124,8 @@ SET_INT_PROP(SequentialTwoPTwoC, VelocityFormulation, GET_PROP_TYPE(TypeTag, Indices)::velocityW); -SET_PROP(SequentialTwoPTwoC, TransportSolutionType) +template<class TypeTag> +struct TransportSolutionType<TypeTag, TTag::SequentialTwoPTwoC> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); //! type for vector of vector (of scalars) @@ -134,7 +137,8 @@ SET_BOOL_PROP(SequentialTwoPTwoC, EnableCompressibility, true); //!< Composition SET_BOOL_PROP(SequentialTwoPTwoC, VisitFacesOnlyOnce, false); //!< Faces are regarded from both sides SET_BOOL_PROP(SequentialTwoPTwoC, EnableCapillarity, false); //!< Capillarity is enabled -SET_PROP(SequentialTwoPTwoC, BoundaryMobility) //!< Saturation scales flux on Dirichlet B.C. +template<class TypeTag> +struct BoundaryMobility<TypeTag, TTag::SequentialTwoPTwoC> //!< Saturation scales flux on Dirichlet B.C. { static const int value = SequentialTwoPTwoCIndices<TypeTag>::satDependent;}; SET_TYPE_PROP(SequentialTwoPTwoC, Variables, VariableClass<TypeTag>); diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index 7deeeefc331ef52fc712920afcd7ad44e67dbe66..5ff4035b033b326763b7f84416c730d4ea52a613 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -198,35 +198,41 @@ namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(TwoPNC, INHERITS_FROM(PorousMediumFlow)); -NEW_TYPE_TAG(TwoPNCNI, INHERITS_FROM(TwoPNC)); +// Create new type tags +namespace TTag { +struct TwoPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +struct TwoPNCNI { using InheritsFrom = std::tuple<TwoPNC>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Properties for the isothermal 2pnc model ////////////////////////////////////////////////////////////////// //! The primary variables vector for the 2pnc model -SET_PROP(TwoPNC, PrimaryVariables) +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::TwoPNC> { private: - using PrimaryVariablesVector = Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; public: using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>; }; -SET_TYPE_PROP(TwoPNC, PrimaryVariableSwitch, TwoPNCPrimaryVariableSwitch<TypeTag>); //!< The primary variable switch for the 2pnc model +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::TwoPNC> { using type = TwoPNCPrimaryVariableSwitch<TypeTag>; }; //!< The primary variable switch for the 2pnc model //! Set the volume variables property -SET_PROP(TwoPNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = TwoPNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -234,43 +240,53 @@ public: }; //! Set the base model traits -SET_PROP(TwoPNC, BaseModelTraits) +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::TwoPNC> { private: //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); public: using type = TwoPNCModelTraits<FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), - GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + getPropValue<TypeTag, Properties::UseMoles>(), + getPropValue<TypeTag, Properties::SetMoleFractionsForFirstPhase>(), + getPropValue<TypeTag, Properties::Formulation>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; }; -SET_TYPE_PROP(TwoPNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //!< default the actually used traits to the base traits //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNC, IOFields, TwoPNCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPNC> { using type = TwoPNCIOFields; }; -SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual<TypeTag>); //!< Use the compositional local residual +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPNC> { using type = CompositionalLocalResidual<TypeTag>; }; //!< Use the compositional local residual -SET_INT_PROP(TwoPNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); //!< Per default, no component mass balance is replaced +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::TwoPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; }; //!< Per default, no component mass balance is replaced //! Default formulation is pw-Sn, overwrite if necessary -SET_PROP(TwoPNC, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::TwoPNC> { static constexpr auto value = TwoPFormulation::p0s1; }; -SET_BOOL_PROP(TwoPNC, SetMoleFractionsForFirstPhase, true); //!< Set the primary variables mole fractions for the wetting or non-wetting phase -SET_BOOL_PROP(TwoPNC, UseMoles, true); //!< Use mole fractions in the balance equations by default +template<class TypeTag> +struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; }; //!< Set the primary variables mole fractions for the wetting or non-wetting phase +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; }; //!< Use mole fractions in the balance equations by default //! Use the model after Millington (1961) for the effective diffusivity -SET_TYPE_PROP(TwoPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::TwoPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! This model uses the compositional fluid state -SET_PROP(TwoPNC, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::TwoPNC> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; @@ -280,22 +296,25 @@ public: ///////////////////////////////////////////////// //! Set the non-isothermal model traits -SET_PROP(TwoPNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPNCNI> { private: - using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using IsothermalTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPNCNI, IOFields, EnergyIOFields<TwoPNCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPNCNI> { using type = EnergyIOFields<TwoPNCIOFields>; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(TwoPNCNI, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::TwoPNCNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ThermalConductivitySomerton<Scalar>; }; diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index ebb7782c09cc693a79a8a0842f25ab7adfade8ed..66e7b589bd104dac2aa454bbd431dee0730fe6d0 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -110,27 +110,32 @@ namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(TwoPNCMin, INHERITS_FROM(TwoPNC)); -NEW_TYPE_TAG(TwoPNCMinNI, INHERITS_FROM(TwoPNCMin)); +// Create new type tags +namespace TTag { +struct TwoPNCMin { using InheritsFrom = std::tuple<TwoPNC>; }; +struct TwoPNCMinNI { using InheritsFrom = std::tuple<TwoPNCMin>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property tags for the isothermal 2pncmin model ////////////////////////////////////////////////////////////////// // use the mineralization local residual -SET_TYPE_PROP(TwoPNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPNCMin> { using type = MineralizationLocalResidual<TypeTag>; }; //! use the mineralization volume variables together with the 2pnc vol vars -SET_PROP(TwoPNCMin, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPNCMin> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = TwoPNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; using NonMinVolVars = TwoPNCVolumeVariables<Traits>; @@ -139,24 +144,27 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNCMin, IOFields, MineralizationIOFields<TwoPNCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPNCMin> { using type = MineralizationIOFields<TwoPNCIOFields>; }; //! The 2pnc model traits define the non-mineralization part -SET_PROP(TwoPNCMin, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPNCMin> { private: - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMineralizationTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using NonMineralizationTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = MineralizationModelTraits<NonMineralizationTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; }; //! The two-phase model uses the immiscible fluid state -SET_PROP(TwoPNCMin, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::TwoPNCMin> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = CompositionalSolidState<Scalar, SolidSystem>; }; @@ -166,11 +174,12 @@ public: ////////////////////////////////////////////////////////////////// //! Set non-isothermal model traits -SET_PROP(TwoPNCMinNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TwoPNCMinNI> { private: - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using TwoPNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using TwoPNCTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; using IsothermalTraits = MineralizationModelTraits<TwoPNCTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; public: // the mineralization traits, based on 2pnc traits, are the isothermal traits @@ -178,7 +187,8 @@ public: }; //! non-isothermal vtkoutput -SET_PROP(TwoPNCMinNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPNCMinNI> { using MineralizationIOF = MineralizationIOFields<TwoPNCIOFields>; using type = EnergyIOFields<MineralizationIOF>; diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index bd6b39126d2de1fe0de07f2818c3e44ce2fc88b6..9192cd4cfedf8b773231a8adcf514e8cdc329b10 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -129,20 +129,23 @@ namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// +namespace TTag { //! The type tags for the isothermal three-phase model -NEW_TYPE_TAG(ThreeP, INHERITS_FROM(PorousMediumFlow)); +struct ThreeP { using InheritsFrom = std::tuple<PorousMediumFlow>; }; //! The type tags for the non-isothermal three-phase model -NEW_TYPE_TAG(ThreePNI, INHERITS_FROM(ThreeP)); +struct ThreePNI { using InheritsFrom = std::tuple<ThreeP>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Properties for the isothermal 3p model ////////////////////////////////////////////////////////////////// //! Set the model traits -SET_PROP(ThreeP, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ThreeP> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p model!"); static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p model!"); public: @@ -150,19 +153,21 @@ SET_PROP(ThreeP, ModelTraits) }; //! The local residual function of the conservation equations -SET_TYPE_PROP(ThreeP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::ThreeP> { using type = ImmiscibleLocalResidual<TypeTag>; }; //! Set the volume variables property -SET_PROP(ThreeP, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ThreeP> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = ThreePVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -176,39 +181,44 @@ public: * The fluid state should be chosen appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(ThreeP, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::ThreeP> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = ImmiscibleFluidState<Scalar, FluidSystem>; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(ThreeP, IOFields, ThreePIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ThreeP> { using type = ThreePIOFields; }; ///////////////////////////////////////////////// // Properties for the non-isothermal 3p model ///////////////////////////////////////////////// //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(ThreePNI, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::ThreePNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ThermalConductivitySomerton<Scalar>; }; //! Set non-isothermal output fields -SET_TYPE_PROP(ThreePNI, IOFields, EnergyIOFields<ThreePIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ThreePNI> { using type = EnergyIOFields<ThreePIOFields>; }; //! Set non-isothermal model traits -SET_PROP(ThreePNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ThreePNI> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p model!"); static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p model!"); public: diff --git a/dumux/porousmediumflow/3p3c/localresidual.hh b/dumux/porousmediumflow/3p3c/localresidual.hh index 9ef032a51eb3a5724352240fef8db8df61a0e2bc..a8eee45e164237391c388b90e661ed37f07fe4f2 100644 --- a/dumux/porousmediumflow/3p3c/localresidual.hh +++ b/dumux/porousmediumflow/3p3c/localresidual.hh @@ -37,28 +37,28 @@ namespace Dumux * This class is used to fill the gaps in BoxLocalResidual for the 3P3C flow. */ template<class TypeTag> -class ThreePThreeCLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class ThreePThreeCLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual> { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { - numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(), - numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(), + numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), + numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(), contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wPhaseIdx,//!< index of the mass conservation equation for the water component contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nPhaseIdx,//!< index of the mass conservation equation for the contaminant component diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index be5d31c1751bf8a36f5be7a606788d0357ad13d2..f65f32b98642a15541e5cf8fd2676721f1b5e74a 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -196,73 +196,85 @@ struct ThreePThreeCVolumeVariablesTraits }; namespace Properties { +// Create new type tags +namespace TTag { //! The type tags for the isothermal three-phase three-component model -NEW_TYPE_TAG(ThreePThreeC, INHERITS_FROM(PorousMediumFlow)); +struct ThreePThreeC { using InheritsFrom = std::tuple<PorousMediumFlow>; }; //! The type tags for the non-isothermal three-phase three-component model -NEW_TYPE_TAG(ThreePThreeCNI, INHERITS_FROM(ThreePThreeC)); +struct ThreePThreeCNI { using InheritsFrom = std::tuple<ThreePThreeC>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property values ////////////////////////////////////////////////////////////////// //! Set the model traits -SET_PROP(ThreePThreeC, BaseModelTraits) +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::ThreePThreeC> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!"); static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!"); public: - using type = ThreePThreeCModelTraits<GET_PROP_VALUE(TypeTag, UseConstraintSolver), GET_PROP_VALUE(TypeTag, UseMoles)>; + using type = ThreePThreeCModelTraits<getPropValue<TypeTag, Properties::UseConstraintSolver>(), getPropValue<TypeTag, Properties::UseMoles>()>; }; -SET_TYPE_PROP(ThreePThreeC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ThreePThreeC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //! Determines whether a constraint solver should be used explicitly -SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false); +template<class TypeTag> +struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; }; //! Set as default that _no_ component mass balance is replaced by the total mass balance -SET_INT_PROP(ThreePThreeC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); }; /*! * \brief The fluid state which is used by the volume variables to * store the thermodynamic state. This should be chosen * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(ThreePThreeC, FluidState){ +template<class TypeTag> +struct FluidState<TypeTag, TTag::ThreePThreeC>{ private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! The local residual function of the conservation equations -SET_TYPE_PROP(ThreePThreeC, LocalResidual, ThreePThreeCLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCLocalResidual<TypeTag>; }; //! The primary variable switch for the 3p3c model -SET_TYPE_PROP(ThreePThreeC, PrimaryVariableSwitch, ThreePThreeCPrimaryVariableSwitch); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCPrimaryVariableSwitch; }; //! The primary variables vector for the 3p3c model -SET_PROP(ThreePThreeC, PrimaryVariables) +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::ThreePThreeC> { private: - using PrimaryVariablesVector = Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; public: using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>; }; //! Set the volume variables property -SET_PROP(ThreePThreeC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ThreePThreeC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = ThreePThreeCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -270,32 +282,38 @@ public: }; //! The model after Millington (1961) is used for the effective diffusivity -SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::ThreePThreeC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ThreePThreeC> { using type = ThreePThreeCIOFields; }; //! Use mole fractions in the balance equations by default -SET_BOOL_PROP(ThreePThreeC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_TYPE_PROP(ThreePThreeCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::ThreePThreeCNI> { using type = ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>; }; ////////////////////////////////////////////////////////////////// // Property values for isothermal model required for the general non-isothermal model ////////////////////////////////////////////////////////////////// //! Set non-isothermal NumEq -SET_PROP(ThreePThreeCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ThreePThreeCNI> { private: - using IsothermalModelTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using IsothermalModelTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = PorousMediumFlowNIModelTraits<IsothermalModelTraits>; }; //! Set the non-isothermal vktoutputfields -SET_TYPE_PROP(ThreePThreeCNI, IOFields, EnergyIOFields<ThreePThreeCIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ThreePThreeCNI> { using type = EnergyIOFields<ThreePThreeCIOFields>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/localresidual.hh b/dumux/porousmediumflow/3pwateroil/localresidual.hh index c713b228376c2c0a3482ebf62acb07bcf4bc607d..ea6dc23b0fbd21bed3903f8790db34a2f6bbc09c 100644 --- a/dumux/porousmediumflow/3pwateroil/localresidual.hh +++ b/dumux/porousmediumflow/3pwateroil/localresidual.hh @@ -36,29 +36,29 @@ namespace Dumux { * This class is used to fill the gaps in the CompositionalLocalResidual for the 3PWaterOil flow. */ template<class TypeTag> -class ThreePWaterOilLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class ThreePWaterOilLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual> { protected: - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { - numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(), - numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(), + numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), + numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(), conti0EqIdx = Indices::conti0EqIdx,//!< Index of the mass conservation equation for the water component conti1EqIdx = conti0EqIdx + 1,//!< Index of the mass conservation equation for the contaminant component @@ -72,7 +72,7 @@ protected: }; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); public: using ParentType::ParentType; diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index ecb22d7d78acca55fd786ac7d6d5c651b28d6613..16e31b07eaf091de78fedb9cead3cca4125ffa0e 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -187,21 +187,25 @@ struct ThreePWaterOilVolumeVariablesTraits namespace Properties { -NEW_TYPE_TAG(ThreePWaterOilNI, INHERITS_FROM(PorousMediumFlow)); +// Create new type tags +namespace TTag { +struct ThreePWaterOilNI { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property values ////////////////////////////////////////////////////////////////// //! Set the non-isothermal model traits property -SET_PROP(ThreePWaterOilNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::ThreePWaterOilNI> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 3p2cni model!"); static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p2cni model!"); public: - using type = PorousMediumFlowNIModelTraits<ThreePWaterOilModelTraits<GET_PROP_VALUE(TypeTag, OnlyGasPhaseCanDisappear)>>; + using type = PorousMediumFlowNIModelTraits<ThreePWaterOilModelTraits<getPropValue<TypeTag, Properties::OnlyGasPhaseCanDisappear>()>>; }; /*! @@ -210,47 +214,54 @@ public: * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(ThreePWaterOilNI, FluidState){ +template<class TypeTag> +struct FluidState<TypeTag, TTag::ThreePWaterOilNI>{ private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! The local residual function of the conservation equations -SET_TYPE_PROP(ThreePWaterOilNI, LocalResidual, ThreePWaterOilLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::ThreePWaterOilNI> { using type = ThreePWaterOilLocalResidual<TypeTag>; }; //! Set as default that no component mass balance is replaced by the total mass balance -SET_INT_PROP(ThreePWaterOilNI, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::ThreePWaterOilNI> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); }; //! The primary variable switch for the 3p3c model -SET_TYPE_PROP(ThreePWaterOilNI, PrimaryVariableSwitch, ThreePWaterOilPrimaryVariableSwitch<TypeTag>); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::ThreePWaterOilNI> { using type = ThreePWaterOilPrimaryVariableSwitch<TypeTag>; }; //! The primary variables vector for the 3p3c model -SET_PROP(ThreePWaterOilNI, PrimaryVariables) +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::ThreePWaterOilNI> { private: - using PrimaryVariablesVector = Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; public: using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>; }; //! Determines whether a constraint solver should be used explicitly -SET_BOOL_PROP(ThreePWaterOilNI, OnlyGasPhaseCanDisappear, true); +template<class TypeTag> +struct OnlyGasPhaseCanDisappear<TypeTag, TTag::ThreePWaterOilNI> { static constexpr bool value = true; }; //! Set the volume variables property -SET_PROP(ThreePWaterOilNI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::ThreePWaterOilNI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = ThreePWaterOilVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -258,23 +269,27 @@ public: }; //! Use the model after Millington (1961) for the effective diffusivity -SET_TYPE_PROP(ThreePWaterOilNI, EffectiveDiffusivityModel, - DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::ThreePWaterOilNI> +{ using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; // Define that mole fractions are used in the balance equations per default -SET_BOOL_PROP(ThreePWaterOilNI, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ThreePWaterOilNI> { static constexpr bool value = true; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(ThreePWaterOilNI, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::ThreePWaterOilNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ThermalConductivitySomerton<Scalar>; }; //! Set the non-isothermal vkt output fields -SET_TYPE_PROP(ThreePWaterOilNI, IOFields, EnergyIOFields<ThreePWaterOilIOFields>); +template<class TypeTag> +struct IOFields<TypeTag, TTag::ThreePWaterOilNI> { using type = EnergyIOFields<ThreePWaterOilIOFields>; }; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh index 69fff0cb660a7cac148883c8ab5a32f221676ee7..de858bd0c5a1b50461be1f784f38b802116fb335 100644 --- a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh @@ -40,15 +40,15 @@ class ThreePWaterOilPrimaryVariableSwitch using ParentType = PrimaryVariableSwitch<ThreePWaterOilPrimaryVariableSwitch<TypeTag>>; friend ParentType; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using IndexType = typename GridView::IndexSet::IndexType; using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { switch1Idx = Indices::switch1Idx, @@ -86,7 +86,7 @@ protected: auto phasePresence = priVars.state(); int newPhasePresence = phasePresence; - bool onlyGasPhaseCanDisappear = GET_PROP_VALUE(TypeTag, OnlyGasPhaseCanDisappear); + bool onlyGasPhaseCanDisappear = getPropValue<TypeTag, Properties::OnlyGasPhaseCanDisappear>(); if(onlyGasPhaseCanDisappear) { diff --git a/dumux/porousmediumflow/boxdfm/fluxvariablescache.hh b/dumux/porousmediumflow/boxdfm/fluxvariablescache.hh index ff3070e842a274dedf19efe196217e142ea31f17..cf69e32347622ef00eb5fbc202817792889b6c95 100644 --- a/dumux/porousmediumflow/boxdfm/fluxvariablescache.hh +++ b/dumux/porousmediumflow/boxdfm/fluxvariablescache.hh @@ -42,12 +42,12 @@ namespace Dumux { template<class TypeTag> class BoxDfmFluxVariablesCache { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; using IndexType = typename GridView::IndexSet::IndexType; diff --git a/dumux/porousmediumflow/boxdfm/model.hh b/dumux/porousmediumflow/boxdfm/model.hh index f0d85ae05cc8805074880f4e032f3640552471d4..971d986416cbce709b7072fab65bb0713c0a3631 100644 --- a/dumux/porousmediumflow/boxdfm/model.hh +++ b/dumux/porousmediumflow/boxdfm/model.hh @@ -35,21 +35,26 @@ namespace Dumux { namespace Properties { //! Type tag for the box scheme. -NEW_TYPE_TAG(BoxDfmModel, INHERITS_FROM(BoxModel)); +// Create new type tags +namespace TTag { +struct BoxDfmModel { using InheritsFrom = std::tuple<BoxModel>; }; +} // end namespace TTag //! Set the default for the global finite volume geometry -SET_PROP(BoxDfmModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::BoxDfmModel> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = BoxDfmFVGridGeometry<Scalar, GridView, enableCache>; }; //! The flux variables cache class specific to box-dfm porous medium flow models -SET_TYPE_PROP(BoxDfmModel, FluxVariablesCache, BoxDfmFluxVariablesCache<TypeTag>); +template<class TypeTag> +struct FluxVariablesCache<TypeTag, TTag::BoxDfmModel> { using type = BoxDfmFluxVariablesCache<TypeTag>; }; } // namespace Properties } // namespace Dumux diff --git a/dumux/porousmediumflow/co2/model.hh b/dumux/porousmediumflow/co2/model.hh index 32f2600c36bc6d845cef2491986efa12306a9306..cb9f45dbc0a4db8cd9a7e38ac9eae59801170573 100644 --- a/dumux/porousmediumflow/co2/model.hh +++ b/dumux/porousmediumflow/co2/model.hh @@ -74,40 +74,47 @@ struct TwoPTwoCCO2VolumeVariablesTraits namespace Properties { -NEW_TYPE_TAG(TwoPTwoCCO2, INHERITS_FROM(TwoPTwoC)); -NEW_TYPE_TAG(TwoPTwoCCO2NI, INHERITS_FROM(TwoPTwoCNI)); +// Create new type tags +namespace TTag { +struct TwoPTwoCCO2 { using InheritsFrom = std::tuple<TwoPTwoC>; }; +struct TwoPTwoCCO2NI { using InheritsFrom = std::tuple<TwoPTwoCNI>; }; +} // end namespace TTag //! the CO2 privarswitch and VolumeVariables properties -SET_TYPE_PROP(TwoPTwoCCO2, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch); -SET_TYPE_PROP(TwoPTwoCCO2NI, PrimaryVariableSwitch, TwoPTwoCCO2PrimaryVariableSwitch); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::TwoPTwoCCO2> { using type = TwoPTwoCCO2PrimaryVariableSwitch; }; +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::TwoPTwoCCO2NI> { using type = TwoPTwoCCO2PrimaryVariableSwitch; }; //! the co2 volume variables use the same traits as the 2p2c model -SET_PROP(TwoPTwoCCO2, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPTwoCCO2> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = TwoPTwoCCO2VolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: using type = TwoPTwoCCO2VolumeVariables< Traits >; }; -SET_PROP(TwoPTwoCCO2NI, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::TwoPTwoCCO2NI> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = TwoPTwoCCO2VolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: diff --git a/dumux/porousmediumflow/compositional/localresidual.hh b/dumux/porousmediumflow/compositional/localresidual.hh index 731a7a3011fbc5ab60ae06806a30008018c653af..b4f7160696d8777916b68410b4b231557ce9405a 100644 --- a/dumux/porousmediumflow/compositional/localresidual.hh +++ b/dumux/porousmediumflow/compositional/localresidual.hh @@ -36,25 +36,25 @@ namespace Dumux { * using compositional fully implicit model. */ template<class TypeTag> -class CompositionalLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class CompositionalLocalResidual: public GetPropType<TypeTag, Properties::BaseLocalResidual> { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; + using Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; static constexpr int numPhases = ModelTraits::numPhases(); diff --git a/dumux/porousmediumflow/fluxvariables.hh b/dumux/porousmediumflow/fluxvariables.hh index 3d8056fce1ee4ff4f071fde227d1faf6100e7896..ef15dc6d2e64b9927f0b9366aefb13d38a120cbd 100644 --- a/dumux/porousmediumflow/fluxvariables.hh +++ b/dumux/porousmediumflow/fluxvariables.hh @@ -42,25 +42,25 @@ namespace Dumux { * \note Not all specializations are currently implemented */ template<class TypeTag, - class UpwindScheme = UpwindScheme<typename GET_PROP_TYPE(TypeTag, FVGridGeometry)> > + class UpwindScheme = UpwindScheme<GetPropType<TypeTag, Properties::FVGridGeometry>> > class PorousMediumFluxVariables -: public FluxVariablesBase<typename GET_PROP_TYPE(TypeTag, Problem), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView, - typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView, - typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView> +: public FluxVariablesBase<GetPropType<TypeTag, Properties::Problem>, + typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView, + typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView, + typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using IndexType = typename GridView::IndexSet::IndexType; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; enum { @@ -69,14 +69,14 @@ class PorousMediumFluxVariables }; public: - using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType); - using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); - using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); + using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>; + using MolecularDiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; + using HeatConductionType = GetPropType<TypeTag, Properties::HeatConductionType>; static constexpr bool enableAdvection = ModelTraits::enableAdvection(); static constexpr bool enableMolecularDiffusion = ModelTraits::enableMolecularDiffusion(); static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance(); - static constexpr bool enableThermalNonEquilibrium = GET_PROP_VALUE(TypeTag, EnableThermalNonEquilibrium); + static constexpr bool enableThermalNonEquilibrium = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>(); //! The constructor PorousMediumFluxVariables() diff --git a/dumux/porousmediumflow/fluxvariablescache.hh b/dumux/porousmediumflow/fluxvariablescache.hh index bc0c98be91bfe98a1c486dcaf7881e91154fa8f3..f35e0e691ca53c0d6b6375bec36d088d8c016450 100644 --- a/dumux/porousmediumflow/fluxvariablescache.hh +++ b/dumux/porousmediumflow/fluxvariablescache.hh @@ -48,13 +48,13 @@ class PorousMediumFluxVariablesCacheImplementation; * cache class are provided for different combinations of processes. */ template<class TypeTag> -using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; +using PorousMediumFluxVariablesCache = PorousMediumFluxVariablesCacheImplementation<TypeTag, GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod>; //! We only store discretization-related quantities for the box method. Thus, we need no //! physics-dependent specialization and simply inherit from the physics-independent implementation. template<class TypeTag> class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::box> -: public BoxFluxVariablesCache<typename GET_PROP_TYPE(TypeTag, Scalar), typename GET_PROP_TYPE(TypeTag, FVGridGeometry)> +: public BoxFluxVariablesCache<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::FVGridGeometry>> {}; // the following classes choose the cache type: empty if the law disabled and the law's cache if it's enabled @@ -62,32 +62,32 @@ class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod // in order to prevent that instead of std::conditional_t we use this helper type is only dependent on the advection type // if advection is enabled otherwise its an empty cache type template<class TypeTag, bool EnableAdvection> class AdvectionCacheChooser : public FluxVariablesCaching::EmptyAdvectionCache {}; -template<class TypeTag> class AdvectionCacheChooser<TypeTag, true> : public GET_PROP_TYPE(TypeTag, AdvectionType)::Cache {}; +template<class TypeTag> class AdvectionCacheChooser<TypeTag, true> : public GetPropType<TypeTag, Properties::AdvectionType>::Cache {}; template<class TypeTag, bool EnableMolecularDiffusion> class DiffusionCacheChooser : public FluxVariablesCaching::EmptyDiffusionCache {}; -template<class TypeTag> class DiffusionCacheChooser<TypeTag, true> : public GET_PROP_TYPE(TypeTag, MolecularDiffusionType)::Cache {}; +template<class TypeTag> class DiffusionCacheChooser<TypeTag, true> : public GetPropType<TypeTag, Properties::MolecularDiffusionType>::Cache {}; template<class TypeTag, bool EnableEnergyBalance> class EnergyCacheChooser : public FluxVariablesCaching::EmptyHeatConductionCache {}; -template<class TypeTag> class EnergyCacheChooser<TypeTag, true> : public GET_PROP_TYPE(TypeTag, HeatConductionType)::Cache {}; +template<class TypeTag> class EnergyCacheChooser<TypeTag, true> : public GetPropType<TypeTag, Properties::HeatConductionType>::Cache {}; // specialization for the cell centered tpfa method template<class TypeTag> class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::cctpfa> -: public AdvectionCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableAdvection()> -, public DiffusionCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableMolecularDiffusion()> -, public EnergyCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()> +: public AdvectionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableAdvection()> +, public DiffusionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableMolecularDiffusion()> +, public EnergyCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()> {}; //! specialization of the flux variables cache for the cell centered finite volume mpfa scheme //! stores data which is commonly used by all the different types of processes template<class TypeTag> class PorousMediumFluxVariablesCacheImplementation<TypeTag, DiscretizationMethod::ccmpfa> -: public AdvectionCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableAdvection()> -, public DiffusionCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableMolecularDiffusion()> -, public EnergyCacheChooser<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()> +: public AdvectionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableAdvection()> +, public DiffusionCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableMolecularDiffusion()> +, public EnergyCacheChooser<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()> { - using GridIndexType = typename GET_PROP_TYPE(TypeTag, GridView)::IndexSet::IndexType; + using GridIndexType = typename GetPropType<TypeTag, Properties::GridView>::IndexSet::IndexType; - using MpfaHelper = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::MpfaHelper; + using MpfaHelper = typename GetPropType<TypeTag, Properties::FVGridGeometry>::MpfaHelper; static constexpr bool considerSecondary = MpfaHelper::considerSecondaryIVs(); public: //! Returns whether or not this cache has been updated diff --git a/dumux/porousmediumflow/immiscible/localresidual.hh b/dumux/porousmediumflow/immiscible/localresidual.hh index d48dd4011bbcc1a588cc4f03eedd98201d51f2b7..21a4480f8b02e9080da56b9d8690cb8b26e0d72a 100644 --- a/dumux/porousmediumflow/immiscible/localresidual.hh +++ b/dumux/porousmediumflow/immiscible/localresidual.hh @@ -35,24 +35,24 @@ namespace Dumux * using the n-phase immiscible fully implicit models. */ template<class TypeTag> -class ImmiscibleLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class ImmiscibleLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual> { - 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<TypeTag, Properties::BaseLocalResidual>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; //!< first index for the mass balance diff --git a/dumux/porousmediumflow/mineralization/localresidual.hh b/dumux/porousmediumflow/mineralization/localresidual.hh index 3b3744bdb62d84582b548a1484cf6daa693543db..0ad4b1f558093f0a10fac361e299767a52c7250f 100644 --- a/dumux/porousmediumflow/mineralization/localresidual.hh +++ b/dumux/porousmediumflow/mineralization/localresidual.hh @@ -38,19 +38,19 @@ template<class TypeTag> class MineralizationLocalResidual: public CompositionalLocalResidual<TypeTag> { using ParentType = CompositionalLocalResidual<TypeTag>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int numSolidComps = ModelTraits::numSolidComps(); static constexpr int numInertSolidComps = ModelTraits::numInertSolidComps(); static constexpr int numComponents = ModelTraits::numComponents(); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); enum { conti0EqIdx = Indices::conti0EqIdx }; diff --git a/dumux/porousmediumflow/mpnc/localresidual.hh b/dumux/porousmediumflow/mpnc/localresidual.hh index 9dc89dba005887a97b89907a8e22bfe36962f409..c769c1fea6ecc86fe48039b0c34de0e99bd04f97 100644 --- a/dumux/porousmediumflow/mpnc/localresidual.hh +++ b/dumux/porousmediumflow/mpnc/localresidual.hh @@ -45,12 +45,12 @@ template<class TypeTag> class MPNCLocalResidual : public CompositionalLocalResidual<TypeTag> { using ParentType = CompositionalLocalResidual<TypeTag>; - using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using Element = typename GetPropType<TypeTag, Properties::GridView>::template Codim<0>::Entity; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementBoundaryTypes = GetPropType<TypeTag, Properties::ElementBoundaryTypes>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum {numPhases = ModelTraits::numPhases()}; diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh index fa459904fb2c471062145b72ed3805c705232775..b190da4c491fbc6a7fc564048b3c3da49cefbc8d 100644 --- a/dumux/porousmediumflow/mpnc/model.hh +++ b/dumux/porousmediumflow/mpnc/model.hh @@ -234,51 +234,58 @@ namespace Properties // Type tags ////////////////////////////////////////////////////////////////// //! The type tags for the isothermal & non-isothermal two-phase model -NEW_TYPE_TAG(MPNC, INHERITS_FROM(PorousMediumFlow)); -NEW_TYPE_TAG(MPNCNI, INHERITS_FROM(MPNC)); -NEW_TYPE_TAG(MPNCNonequil, INHERITS_FROM(MPNC, NonEquilibrium)); +// Create new type tags +namespace TTag { +struct MPNC { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +struct MPNCNI { using InheritsFrom = std::tuple<MPNC>; }; +struct MPNCNonequil { using InheritsFrom = std::tuple<NonEquilibrium, MPNC>; }; +} // end namespace TTag ///////////////////////////////////////////////////////////////// // Properties for the isothermal mpnc model ////////////////////////////////////////////////////////////////// //! Use the MpNc local residual for the MpNc model -SET_TYPE_PROP(MPNC, LocalResidual, MPNCLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::MPNC> { using type = MPNCLocalResidual<TypeTag>; }; //! Set the model traits property -SET_PROP(MPNC, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::MPNC> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, PressureFormulation), - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + getPropValue<TypeTag, Properties::PressureFormulation>(), + getPropValue<TypeTag, Properties::UseMoles>(), + getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; }; //! This model uses the compositional fluid state -SET_PROP(MPNC, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::MPNC> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! Set the volume variables property -SET_PROP(MPNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::MPNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = MPNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -286,35 +293,41 @@ public: }; //! Per default, no component mass balance is replaced -SET_INT_PROP(MPNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::MPNC> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; }; //! Use mole fractions in the balance equations by default -SET_BOOL_PROP(MPNC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; }; //! Use the model after Millington (1961) for the effective diffusivity -SET_TYPE_PROP(MPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::MPNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the default pressure formulation to the pressure of the (most) wetting phase -SET_PROP(MPNC, PressureFormulation) +template<class TypeTag> +struct PressureFormulation<TypeTag, TTag::MPNC> { public: static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNC, IOFields, MPNCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::MPNC> { using type = MPNCIOFields; }; ///////////////////////////////////////////////// // Properties for the non-isothermal mpnc model ///////////////////////////////////////////////// //! set the non-isothermal model traits -SET_PROP(MPNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::MPNCNI> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using IsothermalTraits = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, PressureFormulation), - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + getPropValue<TypeTag, Properties::PressureFormulation>(), + getPropValue<TypeTag, Properties::UseMoles>(), + getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; @@ -323,23 +336,26 @@ public: // Properties for the non-equilibrium mpnc model ///////////////////////////////////////////////// -SET_TYPE_PROP(MPNCNonequil, EquilibriumLocalResidual, MPNCLocalResidual<TypeTag>); +template<class TypeTag> +struct EquilibriumLocalResidual<TypeTag, TTag::MPNCNonequil> { using type = MPNCLocalResidual<TypeTag>; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNCNonequil, EquilibriumIOFields, MPNCIOFields); +template<class TypeTag> +struct EquilibriumIOFields<TypeTag, TTag::MPNCNonequil> { using type = MPNCIOFields; }; //! For non-equilibrium with mpnc we have to overwrite the model traits again, //! because the mpnc indices depend on the status of the non-equilibrium model traits -SET_PROP(MPNCNonequil, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::MPNCNonequil> { private: - using EquiTraits = typename GET_PROP_TYPE(TypeTag, EquilibriumModelTraits); - static constexpr bool enableTNE = GET_PROP_VALUE(TypeTag, EnableThermalNonEquilibrium); - static constexpr bool enableCNE = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium); - static constexpr int numEF = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid); - static constexpr int numES = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid); - static constexpr auto nf = GET_PROP_VALUE(TypeTag, NusseltFormulation); - static constexpr auto ns = GET_PROP_VALUE(TypeTag, SherwoodFormulation); + using EquiTraits = GetPropType<TypeTag, Properties::EquilibriumModelTraits>; + static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>(); + static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>(); + static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>(); + static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>(); + static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>(); + static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>(); using NonEquilTraits = NonEquilibriumModelTraits<EquiTraits, enableCNE, enableTNE, numEF, numES, nf, ns>; public: @@ -347,38 +363,41 @@ public: }; //! set equilibrium model traits -SET_PROP(MPNCNonequil, EquilibriumModelTraits) +template<class TypeTag> +struct EquilibriumModelTraits<TypeTag, TTag::MPNCNonequil> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = MPNCModelTraits<FluidSystem::numPhases, FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, PressureFormulation), - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + getPropValue<TypeTag, Properties::PressureFormulation>(), + getPropValue<TypeTag, Properties::UseMoles>(), + getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; }; //! in case we do not assume full non-equilibrium one needs a thermal conductivity -SET_PROP(MPNCNonequil, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::MPNCNonequil> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: - using type = ThermalConductivitySimpleFluidLumping<Scalar, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid)>; + using type = ThermalConductivitySimpleFluidLumping<Scalar, getPropValue<TypeTag, Properties::NumEnergyEqFluid>()>; }; //! use the mineralization volume variables together with the 2pnc vol vars -SET_PROP(MPNCNonequil, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::MPNCNonequil> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = MPNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; using EquilibriumVolVars = MPNCVolumeVariables<Traits>; diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index bb1aede4cf0c87d210458ca8a09bf102d7c9eebf..bcf2e3c4343d383586c710dfbea61def7da930f8 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -39,22 +39,22 @@ namespace Dumux { */ template<class TypeTag> class NonEquilibriumGridVariables -: public FVGridVariables<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, GridVolumeVariables), - typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)> +: public FVGridVariables<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::GridVolumeVariables>, + GetPropType<TypeTag, Properties::GridFluxVariablesCache>> { - using ParentType = FVGridVariables<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, GridVolumeVariables), - typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)>; + using ParentType = FVGridVariables<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::GridVolumeVariables>, + GetPropType<TypeTag, Properties::GridFluxVariablesCache>>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; enum { dim = GridView::dimension }; // Grid and world dimension enum { dimWorld = GridView::dimensionworld }; - static constexpr int numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases(); + static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; public: @@ -75,7 +75,7 @@ public: void calcVelocityAverage(const SolutionVector& curSol) { // instatiate the velocity output - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; VelocityOutput velocityOutput(*this); using Scalar = typename SolutionVector::field_type; diff --git a/dumux/porousmediumflow/nonequilibrium/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/localresidual.hh index cedc6c02a257856fa0ae52241da37c3ea9134ed8..eb4ad8f804ffe7e69e080946ff9f751b4cff19d7 100644 --- a/dumux/porousmediumflow/nonequilibrium/localresidual.hh +++ b/dumux/porousmediumflow/nonequilibrium/localresidual.hh @@ -35,29 +35,29 @@ template<class TypeTag, bool enableThermalNonEquilibrium, bool enableChemicalNon class NonEquilibriumLocalResidualImplementation; template <class TypeTag> -using NonEquilibriumLocalResidual = NonEquilibriumLocalResidualImplementation<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableThermalNonEquilibrium(), GET_PROP_TYPE(TypeTag, ModelTraits)::enableChemicalNonEquilibrium()>; +using NonEquilibriumLocalResidual = NonEquilibriumLocalResidualImplementation<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableThermalNonEquilibrium(), GetPropType<TypeTag, Properties::ModelTraits>::enableChemicalNonEquilibrium()>; /*! * \ingroup PorousmediumNonEquilibriumModel * \brief The mass conservation part of the nonequilibrium model for a model without chemical non-equilibrium */ template<class TypeTag> -class NonEquilibriumLocalResidualImplementation<TypeTag, true, false>: public GET_PROP_TYPE(TypeTag, EquilibriumLocalResidual) +class NonEquilibriumLocalResidualImplementation<TypeTag, true, false>: public GetPropType<TypeTag, Properties::EquilibriumLocalResidual> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using ParentType = typename GET_PROP_TYPE(TypeTag, EquilibriumLocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ParentType = GetPropType<TypeTag, Properties::EquilibriumLocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; static constexpr int numPhases = ModelTraits::numPhases(); @@ -152,34 +152,34 @@ public: /*! * \brief The mass conservation part of the nonequilibrium model for a model assuming chemical non-equilibrium and two phases */ template<class TypeTag> -class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public GET_PROP_TYPE(TypeTag, EquilibriumLocalResidual) +class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public GetPropType<TypeTag, Properties::EquilibriumLocalResidual> { - using ParentType = typename GET_PROP_TYPE(TypeTag, EquilibriumLocalResidual); - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType<TypeTag, Properties::EquilibriumLocalResidual>; + using Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using MolecularDiffusionType = typename GET_PROP_TYPE(TypeTag, MolecularDiffusionType); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using MolecularDiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int numComponents = ModelTraits::numComponents(); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using ComponentVector = Dune::FieldVector<Scalar, numComponents>; enum { conti0EqIdx = Indices::conti0EqIdx }; diff --git a/dumux/porousmediumflow/nonequilibrium/model.hh b/dumux/porousmediumflow/nonequilibrium/model.hh index f4a5b56aa1a3a145976bc27e8bc636cc948a4c8f..1fae5b6f485da8d23a00ec0d516499b9e5758617 100644 --- a/dumux/porousmediumflow/nonequilibrium/model.hh +++ b/dumux/porousmediumflow/nonequilibrium/model.hh @@ -86,62 +86,76 @@ namespace Properties ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(NonEquilibrium); +namespace TTag { +struct NonEquilibrium {}; +} ///////////////////////////////////////////////// // Properties for the non-equilibrium mpnc model ///////////////////////////////////////////////// //! Set the model traits -SET_PROP(NonEquilibrium, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::NonEquilibrium> { private: - using EquiTraits = typename GET_PROP_TYPE(TypeTag, EquilibriumModelTraits); - static constexpr bool enableTNE = GET_PROP_VALUE(TypeTag, EnableThermalNonEquilibrium); - static constexpr bool enableCNE = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium); - static constexpr int numEF = GET_PROP_VALUE(TypeTag, NumEnergyEqFluid); - static constexpr int numES = GET_PROP_VALUE(TypeTag, NumEnergyEqSolid); - static constexpr auto nf = GET_PROP_VALUE(TypeTag, NusseltFormulation); - static constexpr auto ns = GET_PROP_VALUE(TypeTag, SherwoodFormulation); + using EquiTraits = GetPropType<TypeTag, Properties::EquilibriumModelTraits>; + static constexpr bool enableTNE = getPropValue<TypeTag, Properties::EnableThermalNonEquilibrium>(); + static constexpr bool enableCNE = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>(); + static constexpr int numEF = getPropValue<TypeTag, Properties::NumEnergyEqFluid>(); + static constexpr int numES = getPropValue<TypeTag, Properties::NumEnergyEqSolid>(); + static constexpr auto nf = getPropValue<TypeTag, Properties::NusseltFormulation>(); + static constexpr auto ns = getPropValue<TypeTag, Properties::SherwoodFormulation>(); public: using type = NonEquilibriumModelTraits<EquiTraits, enableCNE, enableTNE, numEF, numES, nf, ns>; }; //! Per default, we consider both thermal and chemical non-equilibrium -SET_BOOL_PROP(NonEquilibrium, EnableThermalNonEquilibrium, true); -SET_BOOL_PROP(NonEquilibrium, EnableChemicalNonEquilibrium, true); +template<class TypeTag> +struct EnableThermalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableChemicalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static constexpr bool value = true; }; //! Default values for the number of energy balance equations -SET_INT_PROP(NonEquilibrium, NumEnergyEqSolid, 1); -SET_INT_PROP(NonEquilibrium, NumEnergyEqFluid, GET_PROP_TYPE(TypeTag, EquilibriumModelTraits)::numPhases()); - -SET_TYPE_PROP(NonEquilibrium, EnergyLocalResidual, EnergyLocalResidualNonEquilibrium<TypeTag, GET_PROP_VALUE(TypeTag, NumEnergyEqFluid)>); -SET_TYPE_PROP(NonEquilibrium, LocalResidual, NonEquilibriumLocalResidual<TypeTag>); -SET_TYPE_PROP(NonEquilibrium, HeatConductionType, FouriersLawNonEquilibrium<TypeTag>); - -SET_PROP(NonEquilibrium, FluidState) +template<class TypeTag> +struct NumEnergyEqSolid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = 1; }; +template<class TypeTag> +struct NumEnergyEqFluid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = GetPropType<TypeTag, Properties::EquilibriumModelTraits>::numPhases(); }; + +template<class TypeTag> +struct EnergyLocalResidual<TypeTag, TTag::NonEquilibrium> { using type = EnergyLocalResidualNonEquilibrium<TypeTag, getPropValue<TypeTag, Properties::NumEnergyEqFluid>()>; }; +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::NonEquilibrium> { using type = NonEquilibriumLocalResidual<TypeTag>; }; +template<class TypeTag> +struct HeatConductionType<TypeTag, TTag::NonEquilibrium> { using type = FouriersLawNonEquilibrium<TypeTag>; }; + +template<class TypeTag> +struct FluidState<TypeTag, TTag::NonEquilibrium> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = NonEquilibriumFluidState<Scalar, FluidSystem>; }; //! The grid variables -SET_TYPE_PROP(NonEquilibrium, GridVariables, NonEquilibriumGridVariables<TypeTag>); +template<class TypeTag> +struct GridVariables<TypeTag, TTag::NonEquilibrium> { using type = NonEquilibriumGridVariables<TypeTag>; }; //! indices for non-isothermal models -SET_PROP(NonEquilibrium, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::NonEquilibrium> { private: - using EquilibriumIOFields = typename GET_PROP_TYPE(TypeTag, EquilibriumIOFields); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using EquilibriumIOFields = GetPropType<TypeTag, Properties::EquilibriumIOFields>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; public: using type = NonEquilibriumIOFields<ModelTraits, EquilibriumIOFields>; }; -SET_PROP(NonEquilibrium, NusseltFormulation) +template<class TypeTag> +struct NusseltFormulation<TypeTag, TTag::NonEquilibrium> { public: static constexpr Dumux::NusseltFormulation value = Dumux::NusseltFormulation::WakaoKaguei; @@ -151,7 +165,8 @@ public: * \brief Set the default formulation for the sherwood correlation * Other possible parametrizations can be found in the dimensionlessnumbers */ -SET_PROP(NonEquilibrium, SherwoodFormulation) +template<class TypeTag> +struct SherwoodFormulation<TypeTag, TTag::NonEquilibrium> { public: static constexpr Dumux::SherwoodFormulation value = Dumux::SherwoodFormulation::WakaoKaguei; diff --git a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh index 9e897d70acdb02e0f6b28675f8c57b9a849f4c5d..f7148515093eb7510a77bb5c32d1d5bb5e9b766b 100644 --- a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh +++ b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh @@ -43,19 +43,19 @@ class EnergyLocalResidualNonEquilibrium; template<class TypeTag> class EnergyLocalResidualNonEquilibrium<TypeTag, 1/*numEnergyEqFluid*/> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; @@ -314,20 +314,20 @@ template<class TypeTag> class EnergyLocalResidualNonEquilibrium<TypeTag, 2 /*numEnergyEqFluid*/> : public EnergyLocalResidualNonEquilibrium<TypeTag, 1 /*numEnergyEqFluid*/> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum { numPhases = ModelTraits::numPhases() }; diff --git a/dumux/porousmediumflow/nonisothermal/localresidual.hh b/dumux/porousmediumflow/nonisothermal/localresidual.hh index b059d516a421a2a61086682cc4e8b3530246875c..67a1598563cd087f2499f26db0d361b386918a93 100644 --- a/dumux/porousmediumflow/nonisothermal/localresidual.hh +++ b/dumux/porousmediumflow/nonisothermal/localresidual.hh @@ -34,7 +34,7 @@ template<class TypeTag, bool enableEneryBalance> class EnergyLocalResidualImplementation; template<class TypeTag> -using EnergyLocalResidual = EnergyLocalResidualImplementation<TypeTag, GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()>; +using EnergyLocalResidual = EnergyLocalResidualImplementation<TypeTag, GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()>; /*! * \ingroup NIModel @@ -43,12 +43,12 @@ using EnergyLocalResidual = EnergyLocalResidualImplementation<TypeTag, GET_PROP_ template<class TypeTag> class EnergyLocalResidualImplementation<TypeTag, false> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; public: /*! @@ -107,13 +107,13 @@ public: template<class TypeTag> class EnergyLocalResidualImplementation<TypeTag, true> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { energyEqIdx = Indices::energyEqIdx }; diff --git a/dumux/porousmediumflow/problem.hh b/dumux/porousmediumflow/problem.hh index 6bc30dbf16527208a04de191814ba5822b28392d..96c84d6344b839d3bf6d168753c600a2aa0d895f 100644 --- a/dumux/porousmediumflow/problem.hh +++ b/dumux/porousmediumflow/problem.hh @@ -36,15 +36,15 @@ template<class TypeTag> class PorousMediumFlowProblem : public FVProblem<TypeTag> { using ParentType = FVProblem<TypeTag>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using GridView = GetPropType<TypeTag, Properties::GridView>; enum { dim = GridView::dimension, dimWorld = GridView::dimensionworld }; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -53,7 +53,7 @@ class PorousMediumFlowProblem : public FVProblem<TypeTag> public: //! export spatial parameter type - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; /*! * \brief Constructor, passing the spatial parameters diff --git a/dumux/porousmediumflow/properties.hh b/dumux/porousmediumflow/properties.hh index cb82f244994cb40e218e1b337466f7f62ee3b80b..f04eb75a8f293e85b5eed3b733740fae9686931d 100644 --- a/dumux/porousmediumflow/properties.hh +++ b/dumux/porousmediumflow/properties.hh @@ -48,58 +48,78 @@ namespace Dumux { namespace Properties { //! Type tag for models involving flow in porous media -NEW_TYPE_TAG(PorousMediumFlow, INHERITS_FROM(ModelProperties)); +// Create new type tags +namespace TTag { +struct PorousMediumFlow { using InheritsFrom = std::tuple<ModelProperties>; }; +} // end namespace TTag //! The flux variables for models involving flow in porous media -SET_TYPE_PROP(PorousMediumFlow, FluxVariables, PorousMediumFluxVariables<TypeTag>); +template<class TypeTag> +struct FluxVariables<TypeTag, TTag::PorousMediumFlow> { using type = PorousMediumFluxVariables<TypeTag>; }; //! The flux variables cache class for models involving flow in porous media -SET_TYPE_PROP(PorousMediumFlow, FluxVariablesCache, PorousMediumFluxVariablesCache<TypeTag>); +template<class TypeTag> +struct FluxVariablesCache<TypeTag, TTag::PorousMediumFlow> { using type = PorousMediumFluxVariablesCache<TypeTag>; }; //! By default, we use darcy's law for the advective fluxes -SET_TYPE_PROP(PorousMediumFlow, AdvectionType, DarcysLaw<TypeTag>); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::PorousMediumFlow> { using type = DarcysLaw<TypeTag>; }; //! By default, we use fick's law for the diffusive fluxes -SET_TYPE_PROP(PorousMediumFlow, MolecularDiffusionType, FicksLaw<TypeTag>); +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::PorousMediumFlow> { using type = FicksLaw<TypeTag>; }; //! By default, we use fourier's law as the default for heat conduction fluxes -SET_TYPE_PROP(PorousMediumFlow, HeatConductionType, FouriersLaw<TypeTag>); +template<class TypeTag> +struct HeatConductionType<TypeTag, TTag::PorousMediumFlow> { using type = FouriersLaw<TypeTag>; }; //! By default, parameters are solution-dependent -SET_BOOL_PROP(PorousMediumFlow, SolutionDependentAdvection, true); -SET_BOOL_PROP(PorousMediumFlow, SolutionDependentMolecularDiffusion, true); -SET_BOOL_PROP(PorousMediumFlow, SolutionDependentHeatConduction, true); +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; }; //! The default implementation of the energy balance equation for flow problems in porous media. -SET_TYPE_PROP(PorousMediumFlow, EnergyLocalResidual, Dumux::EnergyLocalResidual<TypeTag> ); +template<class TypeTag> +struct EnergyLocalResidual<TypeTag, TTag::PorousMediumFlow> { using type = Dumux::EnergyLocalResidual<TypeTag> ; }; //! Velocity output -SET_TYPE_PROP(PorousMediumFlow, VelocityOutput, - PorousMediumFlowVelocityOutput<typename GET_PROP_TYPE(TypeTag, GridVariables), - typename GET_PROP_TYPE(TypeTag, FluxVariables)>); +template<class TypeTag> +struct VelocityOutput<TypeTag, TTag::PorousMediumFlow> +{ + using type = PorousMediumFlowVelocityOutput<GetPropType<TypeTag, Properties::GridVariables>, + GetPropType<TypeTag, Properties::FluxVariables>>; +}; //! By default, we set an empty primary variables switch -SET_TYPE_PROP(PorousMediumFlow, PrimaryVariableSwitch, NoPrimaryVariableSwitch); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::PorousMediumFlow> { using type = NoPrimaryVariableSwitch; }; -SET_BOOL_PROP(PorousMediumFlow, EnableThermalNonEquilibrium, false); +template<class TypeTag> +struct EnableThermalNonEquilibrium<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = false; }; //! Per default, we disable the box interface solver -SET_BOOL_PROP(PorousMediumFlow, EnableBoxInterfaceSolver, false); +template<class TypeTag> +struct EnableBoxInterfaceSolver<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = false; }; //! per default solid state is inert -SET_PROP(PorousMediumFlow, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::PorousMediumFlow> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = InertSolidState<Scalar, SolidSystem>; }; // per default the solid system is inert with one constant component -SET_PROP(PorousMediumFlow, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::PorousMediumFlow> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using InertComponent = Components::Constant<1, Scalar>; using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>; }; diff --git a/dumux/porousmediumflow/richards/localresidual.hh b/dumux/porousmediumflow/richards/localresidual.hh index 3927d4716d7a366525eeb86dd6152eb314e8db5b..af7012c170b19e1f18a76576d279e05d7337e2c0 100644 --- a/dumux/porousmediumflow/richards/localresidual.hh +++ b/dumux/porousmediumflow/richards/localresidual.hh @@ -35,26 +35,26 @@ namespace Dumux { * using the Richards fully implicit models. */ template<class TypeTag> -class RichardsLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class RichardsLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual> { - using Implementation = typename GET_PROP_TYPE(TypeTag, LocalResidual); - - 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 Implementation = GetPropType<TypeTag, Properties::LocalResidual>; + + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; // first index for the mass balance enum { conti0EqIdx = Indices::conti0EqIdx }; @@ -66,7 +66,7 @@ class RichardsLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual) }; static constexpr bool enableWaterDiffusionInAir - = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); + = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>(); public: using ParentType::ParentType; diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 992be84a6f76722e04589844cf94af17c3111498..aac562f941852b178e3100a0b295d97b735d0b61 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -180,41 +180,48 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tags for the implicit isothermal one-phase two-component problems -NEW_TYPE_TAG(Richards, INHERITS_FROM(PorousMediumFlow)); -NEW_TYPE_TAG(RichardsNI, INHERITS_FROM(Richards)); +// Create new type tags +namespace TTag { +struct Richards { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +struct RichardsNI { using InheritsFrom = std::tuple<Richards>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Properties values ////////////////////////////////////////////////////////////////// //! The local residual operator -SET_TYPE_PROP(Richards, LocalResidual, RichardsLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Richards> { using type = RichardsLocalResidual<TypeTag>; }; //! Set the vtk output fields specific to this model -SET_PROP(Richards, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::Richards> { private: static constexpr bool enableWaterDiffusionInAir - = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); + = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>(); public: using type = RichardsIOFields<enableWaterDiffusionInAir>; }; //! The model traits -SET_TYPE_PROP(Richards, ModelTraits, RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir)>); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::Richards> { using type = RichardsModelTraits<getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>()>; }; //! Set the volume variables property -SET_PROP(Richards, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::Richards> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; using Traits = RichardsVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: @@ -223,36 +230,38 @@ public: //! The default richards model computes no diffusion in the air phase //! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017) -SET_BOOL_PROP(Richards, EnableWaterDiffusionInAir, false); +template<class TypeTag> +struct EnableWaterDiffusionInAir<TypeTag, TTag::Richards> { static constexpr bool value = false; }; //! Use the model after Millington (1961) for the effective diffusivity -SET_TYPE_PROP(Richards, EffectiveDiffusivityModel, - DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::Richards> +{ using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! The primary variables vector for the richards model -SET_PROP(Richards, PrimaryVariables) +template<class TypeTag> +struct PrimaryVariables<TypeTag, TTag::Richards> { private: - using PrimaryVariablesVector = Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), - GET_PROP_TYPE(TypeTag, ModelTraits)::numEq()>; + using PrimaryVariablesVector = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; public: using type = SwitchablePrimaryVariables<PrimaryVariablesVector, int>; }; //! The primary variable switch for the richards model -SET_TYPE_PROP(Richards, PrimaryVariableSwitch, ExtendedRichardsPrimaryVariableSwitch); - -//! The primary variable switch for the richards model -// SET_BOOL_PROP(Richards, ProblemUsePrimaryVariableSwitch, false); +template<class TypeTag> +struct PrimaryVariableSwitch<TypeTag, TTag::Richards> { using type = ExtendedRichardsPrimaryVariableSwitch; }; /*! *\brief The fluid system used by the model. * * By default this uses the H2O-Air fluid system with Simple H2O (constant density and viscosity). */ -SET_PROP(Richards, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Richards> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::H2OAir<Scalar, Components::SimpleH2O<Scalar>, FluidSystems::H2OAirDefaultPolicy</*fastButSimplifiedRelations=*/true>>; @@ -264,20 +273,22 @@ SET_PROP(Richards, FluidSystem) * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(Richards, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::Richards> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = ImmiscibleFluidState<Scalar, FluidSystem>; }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(RichardsNI, ThermalConductivityModel) +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::RichardsNI> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ThermalConductivitySomerton<Scalar>; }; @@ -287,19 +298,21 @@ public: ///////////////////////////////////////////////////// //! set non-isothermal model traits -SET_PROP(RichardsNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::RichardsNI> { private: - using IsothermalTraits = RichardsModelTraits<GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir)>; + using IsothermalTraits = RichardsModelTraits<getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>()>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Set the vtk output fields specific to th non-isothermal model -SET_PROP(RichardsNI, IOFields) +template<class TypeTag> +struct IOFields<TypeTag, TTag::RichardsNI> { static constexpr bool enableWaterDiffusionInAir - = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); + = getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>(); using RichardsIOF = RichardsIOFields<enableWaterDiffusionInAir>; using type = EnergyIOFields<RichardsIOF>; }; diff --git a/dumux/porousmediumflow/richards/newtonsolver.hh b/dumux/porousmediumflow/richards/newtonsolver.hh index 2fe311f372f8d626406dad3320029cdc79278171..60e6124f720a85e6c4a20bbd1295fe199269296c 100644 --- a/dumux/porousmediumflow/richards/newtonsolver.hh +++ b/dumux/porousmediumflow/richards/newtonsolver.hh @@ -47,7 +47,7 @@ class RichardsNewtonSolver : public RichardsPrivarSwitchNewtonSolver<TypeTag, As using SolutionVector = typename Assembler::ResidualType; using MaterialLaw = typename Assembler::Problem::SpatialParams::MaterialLaw; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { pressureIdx = Indices::pressureIdx }; public: diff --git a/dumux/porousmediumflow/richards/privarswitchnewtonsolver.hh b/dumux/porousmediumflow/richards/privarswitchnewtonsolver.hh index 7b08bf21d1927ed6d7bb8389fde6800bb16f05c7..975273273c1a68460c53b2d7b3140d015f310c26 100644 --- a/dumux/porousmediumflow/richards/privarswitchnewtonsolver.hh +++ b/dumux/porousmediumflow/richards/privarswitchnewtonsolver.hh @@ -38,7 +38,7 @@ class RichardsPrivarSwitchNewtonSolverImplementation; * \brief A base for the richards newton solver which derives from the right base newton solver. */ template <class TypeTag, class Assembler, class LinearSolver> -using RichardsPrivarSwitchNewtonSolver = RichardsPrivarSwitchNewtonSolverImplementation <TypeTag, Assembler, LinearSolver, GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir)>; +using RichardsPrivarSwitchNewtonSolver = RichardsPrivarSwitchNewtonSolverImplementation <TypeTag, Assembler, LinearSolver, getPropValue<TypeTag, Properties::EnableWaterDiffusionInAir>()>; /*! * \ingroup RichardsModel @@ -56,9 +56,9 @@ public: * \brief the case with switchable primary variables */ template <class TypeTag, class Assembler, class LinearSolver> -class RichardsPrivarSwitchNewtonSolverImplementation<TypeTag, Assembler, LinearSolver, true> : public PriVarSwitchNewtonSolver<Assembler, LinearSolver, typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)> +class RichardsPrivarSwitchNewtonSolverImplementation<TypeTag, Assembler, LinearSolver, true> : public PriVarSwitchNewtonSolver<Assembler, LinearSolver, GetPropType<TypeTag, Properties::PrimaryVariableSwitch>> { - using PrimaryVariableSwitch = typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch); + using PrimaryVariableSwitch = GetPropType<TypeTag, Properties::PrimaryVariableSwitch>; using ParentType = PriVarSwitchNewtonSolver<Assembler, LinearSolver, PrimaryVariableSwitch>; public: using ParentType::ParentType; diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 3937e5a5686b25de4c49cc1f22c4ffc9b1e07ad5..397a27f0e607a507e50525e6d6790b62daec16ad 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -134,8 +134,11 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tags for the implicit isothermal one-phase two-component problems -NEW_TYPE_TAG(RichardsNC, INHERITS_FROM(PorousMediumFlow)); -NEW_TYPE_TAG(RichardsNCNI, INHERITS_FROM(RichardsNC)); +// Create new type tags +namespace TTag { +struct RichardsNC { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +struct RichardsNCNI { using InheritsFrom = std::tuple<RichardsNC>; }; +} // end namespace TTag ////////////////////////////////////////////////////////////////// // Property tags ////////////////////////////////////////////////////////////////// @@ -144,36 +147,42 @@ NEW_TYPE_TAG(RichardsNCNI, INHERITS_FROM(RichardsNC)); ////////////////////////////////////////////////////////////////// //! Set the model traits class -SET_PROP(RichardsNC, BaseModelTraits) +template<class TypeTag> +struct BaseModelTraits<TypeTag, TTag::RichardsNC> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: - using type = RichardsNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using type = RichardsNCModelTraits<FluidSystem::numComponents, getPropValue<TypeTag, Properties::UseMoles>(), getPropValue<TypeTag, Properties::ReplaceCompEqIdx>()>; }; -SET_TYPE_PROP(RichardsNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::RichardsNC> { using type = GetPropType<TypeTag, Properties::BaseModelTraits>; }; //! Define that per default mole fractions are used in the balance equations -SET_BOOL_PROP(RichardsNC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::RichardsNC> { static constexpr bool value = true; }; //! Use the dedicated local residual -SET_TYPE_PROP(RichardsNC, LocalResidual, CompositionalLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::RichardsNC> { using type = CompositionalLocalResidual<TypeTag>; }; //! We set the replaceCompIdx to 0, i.e. the first equation is substituted with //! the total mass balance, i.e. the phase balance -SET_INT_PROP(RichardsNC, ReplaceCompEqIdx, 0); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::RichardsNC> { static constexpr int value = 0; }; //! Set the volume variables property -SET_PROP(RichardsNC, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::RichardsNC> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using FST = typename GET_PROP_TYPE(TypeTag, FluidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PT = typename GET_PROP_TYPE(TypeTag, SpatialParams)::PermeabilityType; + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using FST = GetPropType<TypeTag, Properties::FluidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; + using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); @@ -187,16 +196,18 @@ public: //! The default richardsnc model computes no diffusion in the air phase //! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017) -SET_BOOL_PROP(RichardsNC, EnableWaterDiffusionInAir, false); +template<class TypeTag> +struct EnableWaterDiffusionInAir<TypeTag, TTag::RichardsNC> { static constexpr bool value = false; }; /*! *\brief The fluid system used by the model. * * By default this uses the liquid phase fluid system with simple H2O. */ -SET_PROP(RichardsNC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::RichardsNC> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>, Components::Constant<1, Scalar>>; }; @@ -206,31 +217,36 @@ SET_PROP(RichardsNC, FluidSystem) * appropriately for the model ((non-)isothermal, equilibrium, ...). * This can be done in the problem. */ -SET_PROP(RichardsNC, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::RichardsNC> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using type = CompositionalFluidState<Scalar, FluidSystem>; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(RichardsNC, IOFields, RichardsNCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::RichardsNC> { using type = RichardsNCIOFields; }; //! The model after Millington (1961) is used for the effective diffusivity -SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::RichardsNC> { using type = DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>; }; //! average is used as default model to compute the effective thermal heat conductivity -SET_TYPE_PROP(RichardsNCNI, ThermalConductivityModel, ThermalConductivityAverage<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct ThermalConductivityModel<TypeTag, TTag::RichardsNCNI> { using type = ThermalConductivityAverage<GetPropType<TypeTag, Properties::Scalar>>; }; ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Richards n-components model ////////////////////////////////////////////////////////////////// //! set non-isothermal model traits -SET_PROP(RichardsNCNI, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::RichardsNCNI> { private: - using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); + using IsothermalTraits = GetPropType<TypeTag, Properties::BaseModelTraits>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; diff --git a/dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh b/dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh index 185c2b35d59fcafdc7c166915143b4a09d82d5cf..26328b0f8e6a40e1c70ca8a8fc819bd82605f1dd 100644 --- a/dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh +++ b/dumux/porousmediumflow/sequential/cellcentered/mpfa/properties.hh @@ -105,7 +105,8 @@ namespace Properties { //! \cond \private -SET_PROP(MPFAProperties, GridImplementation) +template<class TypeTag> +struct GridImplementation<TypeTag, TTag::MPFAProperties> { private: using Grid = typename GET_PROP_TYPE(TypeTag, Grid); diff --git a/dumux/porousmediumflow/sequential/impetproperties.hh b/dumux/porousmediumflow/sequential/impetproperties.hh index 429c64e9bdd18674f5e3adbeab1b4ac37a5d45e3..1fdb1db235f132a482a120c884e407319c1b52a2 100644 --- a/dumux/porousmediumflow/sequential/impetproperties.hh +++ b/dumux/porousmediumflow/sequential/impetproperties.hh @@ -19,6 +19,7 @@ #ifndef DUMUX_IMPET_PROPERTIES_HH #define DUMUX_IMPET_PROPERTIES_HH +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/sequential/properties.hh> #include <dumux/porousmediumflow/sequential/pressureproperties.hh> #include <dumux/porousmediumflow/sequential/transportproperties.hh> diff --git a/dumux/porousmediumflow/sequential/onemodelproblem.hh b/dumux/porousmediumflow/sequential/onemodelproblem.hh index 620d3e0b27eecbbe17724e7f74b489b76246a34b..1d0fa37f5c1065bf024e3a15baa9366615329bf7 100644 --- a/dumux/porousmediumflow/sequential/onemodelproblem.hh +++ b/dumux/porousmediumflow/sequential/onemodelproblem.hh @@ -20,6 +20,7 @@ #ifndef DUMUX_ONE_MODEL_PROBLEM_HH #define DUMUX_ONE_MODEL_PROBLEM_HH +#include <dumux/common/properties/propertysystemmacros.hh> #include <dumux/porousmediumflow/sequential/properties.hh> #include <dumux/io/vtkmultiwriter.hh> #include <dumux/io/restart.hh> diff --git a/dumux/porousmediumflow/sequential/pressureproperties.hh b/dumux/porousmediumflow/sequential/pressureproperties.hh index f62b8cafc1b062541554aa80038405c3136b8979..13fd7bd68ab8b28d377d11c19bf0f10afb9dd403 100644 --- a/dumux/porousmediumflow/sequential/pressureproperties.hh +++ b/dumux/porousmediumflow/sequential/pressureproperties.hh @@ -73,7 +73,8 @@ namespace Properties SET_BOOL_PROP(Pressure, VisitFacesOnlyOnce, false); //Set defaults -SET_PROP(Pressure, PressureCoefficientMatrix) +template<class TypeTag> +struct PressureCoefficientMatrix<TypeTag, TTag::Pressure> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); @@ -82,7 +83,8 @@ private: public: using type = Dune::BCRSMatrix<MB>; }; -SET_PROP(Pressure, PressureRHSVector) +template<class TypeTag> +struct PressureRHSVector<TypeTag, TTag::Pressure> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh index 8be18264a38ddfc2b13d9e24ee3d969f230776eb..8545e0c63752b7e2d9edfb815527b05839b091fb 100644 --- a/dumux/porousmediumflow/sequential/properties.hh +++ b/dumux/porousmediumflow/sequential/properties.hh @@ -101,7 +101,8 @@ SET_TYPE_PROP(SequentialModel, JacobianMatrix, typename GET_PROP_TYPE(TypeTag, P //! Dummy model traits for compatibility with the rest of dumux //! until the sequential models are incorporated into the general framework -SET_PROP(SequentialModel, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::SequentialModel> { private: struct DummyTraits @@ -114,7 +115,8 @@ public: }; //! Use the leaf grid view if not defined otherwise -SET_PROP(SequentialModel, GridView) +template<class TypeTag> +struct GridView<TypeTag, TTag::SequentialModel> { private: using Grid = typename GET_PROP_TYPE(TypeTag, Grid); @@ -124,7 +126,8 @@ public: }; //! Default number of intersections for quadrilaterals -SET_PROP(SequentialModel, MaxIntersections) +template<class TypeTag> +struct MaxIntersections<TypeTag, TTag::SequentialModel> { private: using GridView = typename GET_PROP_TYPE(TypeTag, GridView); @@ -137,7 +140,8 @@ public: }; //! A simplified grid geometry for compatibility with new style models -SET_PROP(SequentialModel, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::SequentialModel> { struct MockFVGridGeometry : public DefaultMapperTraits<typename GET_PROP_TYPE(TypeTag, GridView)> @@ -151,7 +155,8 @@ public: }; //! For compatibility with new style models we need a solution vector type -SET_PROP(SequentialModel, SolutionVector) +template<class TypeTag> +struct SolutionVector<TypeTag, TTag::SequentialModel> { public: using type = typename GET_PROP(TypeTag, SolutionTypes)::ScalarSolution; @@ -162,7 +167,8 @@ public: * * This means shape functions, solution vectors, etc. */ -SET_PROP(SequentialModel, SolutionTypes) +template<class TypeTag> +struct SolutionTypes<TypeTag, TTag::SequentialModel> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); @@ -219,7 +225,8 @@ SET_TYPE_PROP(SequentialModel, TimeManager, Dumux::TimeManager<TypeTag>); /*! * \brief Boundary types at a single degree of freedom. */ -SET_PROP(SequentialModel, BoundaryTypes) +template<class TypeTag> +struct BoundaryTypes<TypeTag, TTag::SequentialModel> { private: enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) }; public: @@ -227,7 +234,8 @@ public: }; //! do not specific any model-specific default parameters here -SET_PROP(SequentialModel, ModelDefaultParameters) +template<class TypeTag> +struct ModelDefaultParameters<TypeTag, TTag::SequentialModel> { static void defaultParams(Dune::ParameterTree& params, const std::string& group = "") { diff --git a/dumux/porousmediumflow/sequential/transportproperties.hh b/dumux/porousmediumflow/sequential/transportproperties.hh index 5b4dd6ebc258aa2fc7f0fae1cace7b92eddc317a..43871cab6ce3f12169e245e78f5afea9bac99fce 100644 --- a/dumux/porousmediumflow/sequential/transportproperties.hh +++ b/dumux/porousmediumflow/sequential/transportproperties.hh @@ -56,7 +56,8 @@ NEW_PROP_TAG(EvalCflFluxFunction); //!< Type of the evaluation of the CFL-condit * immiscible 2p system, this would represent a vector holding the saturation * of one phase. */ -SET_PROP(Transport, TransportSolutionType) +template<class TypeTag> +struct TransportSolutionType<TypeTag, TTag::Transport> { private: using SolutionType = typename GET_PROP(TypeTag, SolutionTypes); diff --git a/dumux/porousmediumflow/tracer/localresidual.hh b/dumux/porousmediumflow/tracer/localresidual.hh index 8bff51b7c8714dabed0d807a4869cf6b54657525..0cd193d97483eddc051741a8c58575661761359f 100644 --- a/dumux/porousmediumflow/tracer/localresidual.hh +++ b/dumux/porousmediumflow/tracer/localresidual.hh @@ -39,25 +39,25 @@ namespace Dumux * */ template<class TypeTag> -class TracerLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) +class TracerLocalResidual: public GetPropType<TypeTag, Properties::BaseLocalResidual> { - using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)::LocalView; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; + using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - static constexpr int numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents(); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); static constexpr int phaseIdx = 0; public: @@ -206,7 +206,7 @@ public: } template<class PartialDerivativeMatrices, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod != DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod != DiscretizationMethod::box, void> addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices, const Problem& problem, const Element& element, @@ -250,7 +250,7 @@ public: } template<class JacobianMatrix, class T = TypeTag> - std::enable_if_t<GET_PROP_TYPE(T, FVGridGeometry)::discMethod == DiscretizationMethod::box, void> + std::enable_if_t<GetPropType<T, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box, void> addFluxDerivatives(JacobianMatrix& A, const Problem& problem, const Element& element, @@ -280,7 +280,7 @@ public: const auto advDerivIJ = volFlux*rho(outsideVolVars)*outsideWeight; // diffusive term - using DiffusionType = typename GET_PROP_TYPE(T, MolecularDiffusionType); + using DiffusionType = GetPropType<T, Properties::MolecularDiffusionType>; const auto ti = DiffusionType::calculateTransmissibilities(problem, element, fvGeometry, diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index cccbb3bc1037e8e18b5a1607f22a7c1c40ecc1e0..7b5f57931a3b6bba0ac2ce50de869d94d78f2a2d 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -120,39 +120,47 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tags for the fully implicit tracer model. -NEW_TYPE_TAG(Tracer, INHERITS_FROM(PorousMediumFlow)); +// Create new type tags +namespace TTag { +struct Tracer { using InheritsFrom = std::tuple<PorousMediumFlow>; }; +} // end namespace TTag /////////////////////////////////////////////////////////////////////////// // properties for the tracer model /////////////////////////////////////////////////////////////////////////// //! Define that mole fractions are used in the balance equations -SET_BOOL_PROP(Tracer, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Tracer> { static constexpr bool value = true; }; //! set the model traits -SET_PROP(Tracer, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::Tracer> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: - using type = TracerModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles)>; + using type = TracerModelTraits<FluidSystem::numComponents, getPropValue<TypeTag, Properties::UseMoles>()>; }; //! Use the tracer local residual function for the tracer model -SET_TYPE_PROP(Tracer, LocalResidual, TracerLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Tracer> { using type = TracerLocalResidual<TypeTag>; }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(Tracer, IOFields, TracerIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::Tracer> { using type = TracerIOFields; }; //! Set the volume variables property -SET_PROP(Tracer, VolumeVariables) +template<class TypeTag> +struct VolumeVariables<TypeTag, TTag::Tracer> { private: - using PV = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FSY = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SSY = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using SST = typename GET_PROP_TYPE(TypeTag, SolidState); - using MT = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using PV = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FSY = GetPropType<TypeTag, Properties::FluidSystem>; + using SSY = GetPropType<TypeTag, Properties::SolidSystem>; + using SST = GetPropType<TypeTag, Properties::SolidState>; + using MT = GetPropType<TypeTag, Properties::ModelTraits>; using Traits = TracerVolumeVariablesTraits<PV, FSY, SSY, SST, MT>; public: @@ -160,10 +168,12 @@ public: }; //! We use darcy's law as the default for the advective fluxes -SET_TYPE_PROP(Tracer, AdvectionType, StationaryVelocityField<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::Tracer> { using type = StationaryVelocityField<GetPropType<TypeTag, Properties::Scalar>>; }; //! Use simple model with constant tortuosity as pm diffusivity model -SET_TYPE_PROP(Tracer, EffectiveDiffusivityModel, DiffusivityConstantTortuosity<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::Tracer> { using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; } // end namespace Properties // \} } // end namespace Dumux diff --git a/test/common/propertysystem/test_propertysystem.cc b/test/common/propertysystem/test_propertysystem.cc index 15ce9b94fe575e9c59f1cc68366cd6e736755480..e63f5f594c7f020aaf73757c14581954aaaf1966 100644 --- a/test/common/propertysystem/test_propertysystem.cc +++ b/test/common/propertysystem/test_propertysystem.cc @@ -133,3 +133,4 @@ catch (...) std::cerr << "Unknown exception thrown --> Abort!" << std::endl; return 2; } +// find . -type f -not -path '*common/properties*' -not -path '*/sequential/*' -not -name 'test_propertysystem*.cc' -name '*.[ch][ch]' -exec sed -i 's/SET_BOOL_PROP[ ]*(\([^,]*\),[ ]*\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1> { static constexpr bool value = \3; }/g' {} \; diff --git a/test/freeflow/navierstokes/angeli/main.cc b/test/freeflow/navierstokes/angeli/main.cc index 8bdf87c8d63c06e5b08689cbd1ebb066a1c5093f..5358e40daa691dadcb57c2509bc0cf685e08d87d 100644 --- a/test/freeflow/navierstokes/angeli/main.cc +++ b/test/freeflow/navierstokes/angeli/main.cc @@ -89,7 +89,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(AngeliTest); + using TypeTag = Properties::TTag::AngeliTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -102,7 +102,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -113,12 +113,12 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -128,12 +128,12 @@ int main(int argc, char** argv) try timeLoop->setMaxTimeStepSize(maxDt); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->setTimeLoop(timeLoop); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -143,13 +143,13 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); diff --git a/test/freeflow/navierstokes/angeli/problem.hh b/test/freeflow/navierstokes/angeli/problem.hh index 7902c39e3972c32054210d076799424e73639253..5e0e8693385ad574f7c43c389d8265baa06b1e9b 100644 --- a/test/freeflow/navierstokes/angeli/problem.hh +++ b/test/freeflow/navierstokes/angeli/problem.hh @@ -41,27 +41,36 @@ class AngeliTestProblem; namespace Properties { -NEW_TYPE_TAG(AngeliTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct AngeliTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(AngeliTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::AngeliTest> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type -SET_TYPE_PROP(AngeliTest, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::AngeliTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(AngeliTest, Problem, Dumux::AngeliTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::AngeliTest> { using type = Dumux::AngeliTestProblem<TypeTag> ; }; -SET_BOOL_PROP(AngeliTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(AngeliTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(AngeliTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; } @@ -75,17 +84,17 @@ class AngeliTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using VelocityVector = Dune::FieldVector<Scalar, dimWorld>; diff --git a/test/freeflow/navierstokes/channel/1d/main.cc b/test/freeflow/navierstokes/channel/1d/main.cc index 083ce8968cd4ea4e532b5c772c4147e3b4092197..8bdcf02e6e0cd89016c3c68420a4a2e6611ad10c 100644 --- a/test/freeflow/navierstokes/channel/1d/main.cc +++ b/test/freeflow/navierstokes/channel/1d/main.cc @@ -77,7 +77,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(NavierStokesAnalytic); + using TypeTag = Properties::TTag::NavierStokesAnalytic; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -90,7 +90,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -101,16 +101,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -118,12 +118,12 @@ int main(int argc, char** argv) try x[FVGridGeometry::faceIdx()].resize(numDofsFace); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); diff --git a/test/freeflow/navierstokes/channel/1d/problem.hh b/test/freeflow/navierstokes/channel/1d/problem.hh index 00594712bb6da7b99afc72a7d5bcd4b1574d3182..d45b7912ca095d90c391c4ca81e16b2459daf0ed 100644 --- a/test/freeflow/navierstokes/channel/1d/problem.hh +++ b/test/freeflow/navierstokes/channel/1d/problem.hh @@ -45,27 +45,37 @@ class NavierStokesAnalyticProblem; namespace Properties { -NEW_TYPE_TAG(NavierStokesAnalytic, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct NavierStokesAnalytic { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(NavierStokesAnalytic, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::NavierStokesAnalytic> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type -SET_TYPE_PROP(NavierStokesAnalytic, Grid, Dune::YaspGrid<1>); +template<class TypeTag> +struct Grid<TypeTag, TTag::NavierStokesAnalytic> { using type = Dune::YaspGrid<1>; }; // Set the problem property -SET_TYPE_PROP(NavierStokesAnalytic, Problem, Dumux::NavierStokesAnalyticProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::NavierStokesAnalytic> { using type = Dumux::NavierStokesAnalyticProblem<TypeTag> ; }; -SET_BOOL_PROP(NavierStokesAnalytic, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; -SET_BOOL_PROP(NavierStokesAnalytic, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(NavierStokesAnalytic, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; -SET_BOOL_PROP(NavierStokesAnalytic, NormalizePressure, false); +template<class TypeTag> +struct NormalizePressure<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = false; }; } /*! @@ -81,16 +91,16 @@ class NavierStokesAnalyticProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using DimVector = GlobalPosition; diff --git a/test/freeflow/navierstokes/channel/2d/main.cc b/test/freeflow/navierstokes/channel/2d/main.cc index 0afdb8c3468f79baa450f687fbe2de26461f127d..a91da99fb0b9392c5beec3ea9f03f42561e401a4 100644 --- a/test/freeflow/navierstokes/channel/2d/main.cc +++ b/test/freeflow/navierstokes/channel/2d/main.cc @@ -91,7 +91,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(ChannelTest); + using TypeTag = Properties::TTag::ChannelTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -104,7 +104,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -115,16 +115,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -133,7 +133,7 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -148,12 +148,12 @@ int main(int argc, char** argv) try problem->setTimeLoop(timeLoop); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // initialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); @@ -172,7 +172,7 @@ int main(int argc, char** argv) try // set up two surfaces over which fluxes are calculated FluxOverSurface<TypeTag> flux(*problem, *gridVariables, x); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -221,7 +221,7 @@ int main(int argc, char** argv) try // calculate and print mass fluxes over the planes flux.calculateMassOrMoleFluxes(); - if(GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()) + if(GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()) { std::cout << "mass / energy flux at middle is: " << flux.netFlux("middle") << std::endl; std::cout << "mass / energy flux at outlet is: " << flux.netFlux("outlet") << std::endl; diff --git a/test/freeflow/navierstokes/channel/2d/problem.hh b/test/freeflow/navierstokes/channel/2d/problem.hh index 36cd9aa48e37e9811a627330f9e0e5874ba48b3e..da9c0559db9c2b7f3bc17fe089d91fee614067c9 100644 --- a/test/freeflow/navierstokes/channel/2d/problem.hh +++ b/test/freeflow/navierstokes/channel/2d/problem.hh @@ -41,16 +41,20 @@ class ChannelTestProblem; namespace Properties { +// Create new type tags +namespace TTag { #if !NONISOTHERMAL -NEW_TYPE_TAG(ChannelTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +struct ChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; #else -NEW_TYPE_TAG(ChannelTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNI)); +struct ChannelTest { using InheritsFrom = std::tuple<NavierStokesNI, StaggeredFreeFlowModel>; }; #endif +} // end namespace TTag // the fluid system -SET_PROP(ChannelTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ChannelTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; #if NONISOTHERMAL using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; #else @@ -59,15 +63,20 @@ SET_PROP(ChannelTest, FluidSystem) }; // Set the grid type -SET_TYPE_PROP(ChannelTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ChannelTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ChannelTest, Problem, Dumux::ChannelTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::ChannelTest> { using type = Dumux::ChannelTestProblem<TypeTag> ; }; -SET_BOOL_PROP(ChannelTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(ChannelTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(ChannelTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; } /*! @@ -80,14 +89,14 @@ class ChannelTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/freeflow/navierstokes/channel/3d/main.cc b/test/freeflow/navierstokes/channel/3d/main.cc index 45fe8f4e0434c2c15509941c1f844bf7774f2f38..fadc9cdd2c6a3cb54c6638c3966fd17fce8c545e 100644 --- a/test/freeflow/navierstokes/channel/3d/main.cc +++ b/test/freeflow/navierstokes/channel/3d/main.cc @@ -83,7 +83,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(ThreeDChannelTest); + using TypeTag = Properties::TTag::ThreeDChannelTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -96,7 +96,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -107,16 +107,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; static constexpr auto cellCenterIdx = FVGridGeometry::cellCenterIdx(); static constexpr auto faceIdx = FVGridGeometry::faceIdx(); const auto numDofsCellCenter = leafGridView.size(0); @@ -126,12 +126,12 @@ int main(int argc, char** argv) try x[faceIdx].resize(numDofsFace); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -150,8 +150,8 @@ int main(int argc, char** argv) try // set up two planes over which fluxes are calculated FluxOverSurface<TypeTag> flux(*problem, *gridVariables, x); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>; const Scalar xMin = fvGridGeometry->bBoxMin()[0]; @@ -219,7 +219,7 @@ flux.addSurface("middle", p0middle, p1middle); // calculate and print mass fluxes over the planes flux.calculateMassOrMoleFluxes(); - if(GET_PROP_TYPE(TypeTag, ModelTraits)::enableEnergyBalance()) + if(GetPropType<TypeTag, Properties::ModelTraits>::enableEnergyBalance()) { std::cout << "mass / energy flux at inlet is: " << flux.netFlux("inlet") << std::endl; std::cout << "mass / energy flux at middle is: " << flux.netFlux("middle") << std::endl; diff --git a/test/freeflow/navierstokes/channel/3d/problem.hh b/test/freeflow/navierstokes/channel/3d/problem.hh index 9ece717ec7722f109377d03fcfbe27eec966b506..3b7bad39bd4c82ee8cf04a4b21cd90856fc5434f 100644 --- a/test/freeflow/navierstokes/channel/3d/problem.hh +++ b/test/freeflow/navierstokes/channel/3d/problem.hh @@ -51,28 +51,38 @@ class ThreeDChannelTestProblem; namespace Properties { -NEW_TYPE_TAG(ThreeDChannelTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct ThreeDChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(ThreeDChannelTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThreeDChannelTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type #if DIM_3D -SET_TYPE_PROP(ThreeDChannelTest, Grid, Dune::YaspGrid<3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ThreeDChannelTest> { using type = Dune::YaspGrid<3>; }; #else -SET_TYPE_PROP(ThreeDChannelTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ThreeDChannelTest> { using type = Dune::YaspGrid<2>; }; #endif // Set the problem property -SET_TYPE_PROP(ThreeDChannelTest, Problem, ThreeDChannelTestProblem<TypeTag> ); - -SET_BOOL_PROP(ThreeDChannelTest, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(ThreeDChannelTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(ThreeDChannelTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct Problem<TypeTag, TTag::ThreeDChannelTest> { using type = ThreeDChannelTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; } /*! @@ -84,14 +94,14 @@ class ThreeDChannelTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; @@ -100,11 +110,11 @@ class ThreeDChannelTestProblem : public NavierStokesProblem<TypeTag> static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; static constexpr bool enablePseudoThreeDWallFriction = !DIM_3D; diff --git a/test/freeflow/navierstokes/closedsystem/main.cc b/test/freeflow/navierstokes/closedsystem/main.cc index 31c326cc9ad446ba4a40e9fb688219dd66a7f8f6..1133407c9fefabea88000686e9a6a6fc46fd6550 100644 --- a/test/freeflow/navierstokes/closedsystem/main.cc +++ b/test/freeflow/navierstokes/closedsystem/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(ClosedSystemTest); + using TypeTag = Properties::TTag::ClosedSystemTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,16 +112,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -131,18 +131,18 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokes/closedsystem/problem.hh b/test/freeflow/navierstokes/closedsystem/problem.hh index 47d5168e7b9dca0c68b22b95e444b302b225874a..ddd3b90891fab557152bc7f494df3cab9e4f2feb 100644 --- a/test/freeflow/navierstokes/closedsystem/problem.hh +++ b/test/freeflow/navierstokes/closedsystem/problem.hh @@ -40,25 +40,34 @@ class ClosedSystemTestProblem; namespace Properties { -NEW_TYPE_TAG(ClosedSystemTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct ClosedSystemTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(ClosedSystemTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ClosedSystemTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type -SET_TYPE_PROP(ClosedSystemTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ClosedSystemTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ClosedSystemTest, Problem, Dumux::ClosedSystemTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::ClosedSystemTest> { using type = Dumux::ClosedSystemTestProblem<TypeTag> ; }; -SET_BOOL_PROP(ClosedSystemTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::ClosedSystemTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(ClosedSystemTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(ClosedSystemTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ClosedSystemTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ClosedSystemTest> { static constexpr bool value = true; }; } @@ -72,14 +81,14 @@ class ClosedSystemTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; public: diff --git a/test/freeflow/navierstokes/donea/main.cc b/test/freeflow/navierstokes/donea/main.cc index 2ad3f9c20b63698773e16c38ff8dc92cbb6eb6c3..bb7bc985e08c468d8075cab5314c4d957f2edb25 100644 --- a/test/freeflow/navierstokes/donea/main.cc +++ b/test/freeflow/navierstokes/donea/main.cc @@ -90,7 +90,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(DoneaTest); + using TypeTag = Properties::TTag::DoneaTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -103,7 +103,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridManager = Dumux::GridManager<typename GET_PROP_TYPE(TypeTag, Grid)>; + using GridManager = Dumux::GridManager<GetPropType<TypeTag, Properties::Grid>>; GridManager gridManager; gridManager.init(); @@ -115,16 +115,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -132,12 +132,12 @@ int main(int argc, char** argv) try x[FVGridGeometry::faceIdx()].resize(numDofsFace); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); diff --git a/test/freeflow/navierstokes/donea/problem.hh b/test/freeflow/navierstokes/donea/problem.hh index 90bddc6ec5e29df9f4e98e9ece6d8e4160da63cd..32ab4c8d0cdbbe87bfcc067c47f51a6e4d55a162 100644 --- a/test/freeflow/navierstokes/donea/problem.hh +++ b/test/freeflow/navierstokes/donea/problem.hh @@ -46,25 +46,35 @@ class DoneaTestProblem; namespace Properties { -NEW_TYPE_TAG(DoneaTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct DoneaTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(DoneaTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DoneaTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type -SET_TYPE_PROP(DoneaTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DoneaTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(DoneaTest, Problem, Dumux::DoneaTestProblem<TypeTag> ); - -SET_BOOL_PROP(DoneaTest, EnableFVGridGeometryCache, ENABLECACHING); -SET_BOOL_PROP(DoneaTest, EnableGridFluxVariablesCache, ENABLECACHING); -SET_BOOL_PROP(DoneaTest, EnableGridVolumeVariablesCache, ENABLECACHING); -SET_BOOL_PROP(DoneaTest, EnableGridFaceVariablesCache, ENABLECACHING); +template<class TypeTag> +struct Problem<TypeTag, TTag::DoneaTest> { using type = Dumux::DoneaTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFaceVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; } /*! @@ -77,16 +87,16 @@ class DoneaTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using VelocityVector = Dune::FieldVector<Scalar, dimWorld>; diff --git a/test/freeflow/navierstokes/kovasznay/main.cc b/test/freeflow/navierstokes/kovasznay/main.cc index 5d98124dfc51a61e7861ef4ef2963672e4090d1b..2eba37c03163c9ec0453ffe663b1fddba18f8a04 100644 --- a/test/freeflow/navierstokes/kovasznay/main.cc +++ b/test/freeflow/navierstokes/kovasznay/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(KovasznayTest); + using TypeTag = Properties::TTag::KovasznayTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,16 +112,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -129,12 +129,12 @@ int main(int argc, char** argv) try x[FVGridGeometry::faceIdx()].resize(numDofsFace); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); diff --git a/test/freeflow/navierstokes/kovasznay/problem.hh b/test/freeflow/navierstokes/kovasznay/problem.hh index d1e9ae6c8cf8ec67b5c2ca5faca45a14eff50379..162747a9d64beb1395dcbdd11631174dccdc93a5 100644 --- a/test/freeflow/navierstokes/kovasznay/problem.hh +++ b/test/freeflow/navierstokes/kovasznay/problem.hh @@ -41,25 +41,34 @@ class KovasznayTestProblem; namespace Properties { -NEW_TYPE_TAG(KovasznayTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct KovasznayTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(KovasznayTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::KovasznayTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the grid type -SET_TYPE_PROP(KovasznayTest, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::KovasznayTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(KovasznayTest, Problem, Dumux::KovasznayTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::KovasznayTest> { using type = Dumux::KovasznayTestProblem<TypeTag> ; }; -SET_BOOL_PROP(KovasznayTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(KovasznayTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(KovasznayTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; } /*! @@ -72,16 +81,16 @@ class KovasznayTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using VelocityVector = Dune::FieldVector<Scalar, dimWorld>; diff --git a/test/freeflow/navierstokesnc/channel/main.cc b/test/freeflow/navierstokesnc/channel/main.cc index 74f568bdc6c5d32061337ed3209e9215515f1510..6f624634f433b5932e8e8556b6e2ee0db269f629 100644 --- a/test/freeflow/navierstokesnc/channel/main.cc +++ b/test/freeflow/navierstokesnc/channel/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(ChannelNCTest); + using TypeTag = Properties::TTag::ChannelNCTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,16 +112,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -132,7 +132,7 @@ int main(int argc, char** argv) try problem->setTimeLoop(timeLoop); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -142,12 +142,12 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaP(), "deltaP"); diff --git a/test/freeflow/navierstokesnc/channel/problem.hh b/test/freeflow/navierstokesnc/channel/problem.hh index cb37248a958fa851414fcab9623a6c7a69b1ffbc..0829e0311b9142bfce575d356358b360078b7d8d 100644 --- a/test/freeflow/navierstokesnc/channel/problem.hh +++ b/test/freeflow/navierstokesnc/channel/problem.hh @@ -46,38 +46,51 @@ class ChannelNCTestProblem; namespace Properties { +// Create new type tags +namespace TTag { #if !NONISOTHERMAL -NEW_TYPE_TAG(ChannelNCTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; #else -NEW_TYPE_TAG(ChannelNCTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNCNI)); +struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; #endif +} // end namespace TTag // Select the fluid system -SET_PROP(ChannelNCTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ChannelNCTest> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; -SET_INT_PROP(ChannelNCTest, ReplaceCompEqIdx, 0); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::ChannelNCTest> { static constexpr int value = 0; }; // Set the grid type -SET_TYPE_PROP(ChannelNCTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ChannelNCTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ChannelNCTest, Problem, Dumux::ChannelNCTestProblem<TypeTag> ); - -SET_BOOL_PROP(ChannelNCTest, EnableFVGridGeometryCache, ENABLECACHING); -SET_BOOL_PROP(ChannelNCTest, EnableGridFluxVariablesCache, ENABLECACHING); -SET_BOOL_PROP(ChannelNCTest, EnableGridVolumeVariablesCache, ENABLECACHING); -SET_BOOL_PROP(ChannelNCTest, EnableGridFaceVariablesCache, ENABLECACHING); +template<class TypeTag> +struct Problem<TypeTag, TTag::ChannelNCTest> { using type = Dumux::ChannelNCTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFaceVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; // Use mole fraction formulation #if USE_MASS -SET_BOOL_PROP(ChannelNCTest, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = false; }; #else -SET_BOOL_PROP(ChannelNCTest, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = true; }; #endif } @@ -92,15 +105,15 @@ class ChannelNCTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc index 0a6b2c415274267deb6de07e67e75d2e7fa59ef2..0f07ebd9f7668182bc0e45738600d5b1050ba462 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc +++ b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(DensityDrivenFlow); + using TypeTag = Properties::TTag::DensityDrivenFlow; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,16 +112,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -131,7 +131,7 @@ int main(int argc, char** argv) try timeLoop->setMaxTimeStepSize(maxDt); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -141,12 +141,12 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh index ba01c9cf899c600886112e964abcb22e927fe958..1f0a949c71ee9e89029f3f5b0e834a82ec0ef3a6 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh +++ b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh @@ -42,30 +42,41 @@ class DensityDrivenFlowProblem; namespace Properties { -NEW_TYPE_TAG(DensityDrivenFlow, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +// Create new type tags +namespace TTag { +struct DensityDrivenFlow { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag // Select the fluid system -SET_PROP(DensityDrivenFlow, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DensityDrivenFlow> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; -SET_INT_PROP(DensityDrivenFlow, ReplaceCompEqIdx, 0); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::DensityDrivenFlow> { static constexpr int value = 0; }; // Set the grid type -SET_TYPE_PROP(DensityDrivenFlow, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DensityDrivenFlow> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(DensityDrivenFlow, Problem, Dumux::DensityDrivenFlowProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::DensityDrivenFlow> { using type = Dumux::DensityDrivenFlowProblem<TypeTag> ; }; -SET_BOOL_PROP(DensityDrivenFlow, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; -SET_BOOL_PROP(DensityDrivenFlow, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(DensityDrivenFlow, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; -SET_BOOL_PROP(DensityDrivenFlow, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; } /*! @@ -78,20 +89,20 @@ class DensityDrivenFlowProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1; static constexpr auto transportEqIdx = Indices::conti0EqIdx + 1; diff --git a/test/freeflow/navierstokesnc/maxwellstefan/main.cc b/test/freeflow/navierstokesnc/maxwellstefan/main.cc index e6e1f3629eb43adeb56e49ded67c617761d40044..bc7994acfa0504cdae7f33d8f12356c124b0b6bf 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/main.cc +++ b/test/freeflow/navierstokesnc/maxwellstefan/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(MaxwellStefanNCTest); + using TypeTag = Properties::TTag::MaxwellStefanNCTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,16 +112,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -131,7 +131,7 @@ int main(int argc, char** argv) try timeLoop->setMaxTimeStepSize(maxDt); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -141,12 +141,12 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh index 40f77ce2864dd37194f8e9aa84c81d3a58e2d390..34e66b6fb234d644162bfffa6ad9771175aad273 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh +++ b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh @@ -44,26 +44,37 @@ class MaxwellStefanNCTestProblem; namespace Properties { -NEW_TYPE_TAG(MaxwellStefanNCTest, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +// Create new type tags +namespace TTag { +struct MaxwellStefanNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag -SET_INT_PROP(MaxwellStefanNCTest, ReplaceCompEqIdx, 0); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr int value = 0; }; // Set the grid type -SET_TYPE_PROP(MaxwellStefanNCTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(MaxwellStefanNCTest, Problem, Dumux::MaxwellStefanNCTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dumux::MaxwellStefanNCTestProblem<TypeTag> ; }; -SET_BOOL_PROP(MaxwellStefanNCTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(MaxwellStefanNCTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(MaxwellStefanNCTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(MaxwellStefanNCTest, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; //! Here we set FicksLaw or MaxwellStefansLaw -SET_TYPE_PROP(MaxwellStefanNCTest, MolecularDiffusionType, MaxwellStefansLaw<TypeTag>); +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefansLaw<TypeTag>; }; /*! @@ -73,10 +84,10 @@ SET_TYPE_PROP(MaxwellStefanNCTest, MolecularDiffusionType, MaxwellStefansLaw<Typ */ template<class TypeTag> class MaxwellStefanFluidSystem -: public FluidSystems::Base<typename GET_PROP_TYPE(TypeTag, Scalar), MaxwellStefanFluidSystem<TypeTag>> +: public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, MaxwellStefanFluidSystem<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ThisType = MaxwellStefanFluidSystem<TypeTag>; using Base = FluidSystems::Base<Scalar, ThisType>; @@ -181,7 +192,8 @@ public: } }; -SET_TYPE_PROP(MaxwellStefanNCTest, FluidSystem, MaxwellStefanFluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefanFluidSystem<TypeTag>; }; } //end namespace Property /*! @@ -193,13 +205,13 @@ class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/freeflow/rans/main.cc b/test/freeflow/rans/main.cc index c55a82a61f53382f488e2f00d2ceb8b6003bd7d5..13fce8fb9a62c337fc5833076265cd774f0044d9 100644 --- a/test/freeflow/rans/main.cc +++ b/test/freeflow/rans/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(PipeLauferProblem); + using TypeTag = Properties::TTag::PipeLauferProblem; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,16 +105,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -125,7 +125,7 @@ int main(int argc, char** argv) try problem->setTimeLoop(timeLoop); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -137,12 +137,12 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/rans/problem.hh b/test/freeflow/rans/problem.hh index 0670ffdd782bdb2d9ab45469f1ed6592157c965e..4294ca8c7db79f1e82c9431dc58b17bc2e9170f6 100644 --- a/test/freeflow/rans/problem.hh +++ b/test/freeflow/rans/problem.hh @@ -58,40 +58,49 @@ class PipeLauferProblem; namespace Properties { +// Create new type tags +namespace TTag { #if NONISOTHERMAL -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, ZeroEqNI)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<ZeroEqNI, StaggeredFreeFlowModel>; }; #else #if LOWREKEPSILON -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, LowReKEpsilon)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<LowReKEpsilon, StaggeredFreeFlowModel>; }; #elif KEPSILON -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, KEpsilon)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<KEpsilon, StaggeredFreeFlowModel>; }; #elif KOMEGA -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, KOmega)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<KOmega, StaggeredFreeFlowModel>; }; #elif ONEEQ -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, OneEq)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<OneEq, StaggeredFreeFlowModel>; }; #else -NEW_TYPE_TAG(PipeLauferProblem, INHERITS_FROM(StaggeredFreeFlowModel, ZeroEq)); +struct PipeLauferProblem { using InheritsFrom = std::tuple<ZeroEq, StaggeredFreeFlowModel>; }; #endif #endif +} // end namespace TTag // the fluid system -SET_PROP(PipeLauferProblem, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::PipeLauferProblem> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePGas<Scalar, Components::Air<Scalar> >; }; // Set the grid type -SET_TYPE_PROP(PipeLauferProblem, Grid, - Dune::YaspGrid<2, Dune::TensorProductCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::PipeLauferProblem> +{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(PipeLauferProblem, Problem, Dumux::PipeLauferProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::PipeLauferProblem> { using type = Dumux::PipeLauferProblem<TypeTag> ; }; -SET_BOOL_PROP(PipeLauferProblem, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::PipeLauferProblem> { static constexpr bool value = true; }; -SET_BOOL_PROP(PipeLauferProblem, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(PipeLauferProblem, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::PipeLauferProblem> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::PipeLauferProblem> { static constexpr bool value = true; }; } /*! @@ -124,18 +133,18 @@ class PipeLauferProblem : public ZeroEqProblem<TypeTag> using ParentType = ZeroEqProblem<TypeTag>; #endif - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; diff --git a/test/freeflow/ransnc/main.cc b/test/freeflow/ransnc/main.cc index 501d908dffb05ae8766bca735c28fdcfba308716..37be1a1ecf1588538696a228ab604ee438b27e58 100644 --- a/test/freeflow/ransnc/main.cc +++ b/test/freeflow/ransnc/main.cc @@ -77,7 +77,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(FlatPlateNCTest); + using TypeTag = Properties::TTag::FlatPlateNCTest; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -90,7 +90,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -101,16 +101,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -121,7 +121,7 @@ int main(int argc, char** argv) try problem->setTimeLoop(timeLoop); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; const auto numDofsCellCenter = leafGridView.size(0); const auto numDofsFace = leafGridView.size(1); SolutionVector x; @@ -133,12 +133,12 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/freeflow/ransnc/problem.hh b/test/freeflow/ransnc/problem.hh index 652983948fafe93131f6904d8750540f7a5f5957..3fe111c177a4791f1417341997b0145bf1b0315e 100644 --- a/test/freeflow/ransnc/problem.hh +++ b/test/freeflow/ransnc/problem.hh @@ -56,57 +56,68 @@ class FlatPlateNCTestProblem; namespace Properties { +// Create new type tags +namespace TTag { #if NONISOTHERMAL #if LOWREKEPSILON - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, LowReKEpsilonNCNI)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<LowReKEpsilonNCNI, StaggeredFreeFlowModel>; }; #elif KEPSILON - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, KEpsilonNCNI)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<KEpsilonNCNI, StaggeredFreeFlowModel>; }; #elif KOMEGA - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, KOmegaNCNI)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<KOmegaNCNI, StaggeredFreeFlowModel>; }; #elif ONEEQ - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, OneEqNCNI)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<OneEqNCNI, StaggeredFreeFlowModel>; }; #else - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, ZeroEqNCNI)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<ZeroEqNCNI, StaggeredFreeFlowModel>; }; #endif #else #if LOWREKEPSILON - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, LowReKEpsilonNC)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<LowReKEpsilonNC, StaggeredFreeFlowModel>; }; #elif KEPSILON - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, KEpsilonNC)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<KEpsilonNC, StaggeredFreeFlowModel>; }; #elif KOMEGA - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, KOmegaNC)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<KOmegaNC, StaggeredFreeFlowModel>; }; #elif ONEEQ - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, OneEqNC)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<OneEqNC, StaggeredFreeFlowModel>; }; #else - NEW_TYPE_TAG(FlatPlateNCTest, INHERITS_FROM(StaggeredFreeFlowModel, ZeroEqNC)); + struct FlatPlateNCTest { using InheritsFrom = std::tuple<ZeroEqNC, StaggeredFreeFlowModel>; }; #endif #endif +} // end namespace TTag // The fluid system -SET_PROP(FlatPlateNCTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::FlatPlateNCTest> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; // replace the main component balance eq with a total balance eq -SET_INT_PROP(FlatPlateNCTest, ReplaceCompEqIdx, 0); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::FlatPlateNCTest> { static constexpr int value = 0; }; // Set the grid type -SET_TYPE_PROP(FlatPlateNCTest, Grid, - Dune::YaspGrid<2, Dune::TensorProductCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::FlatPlateNCTest> +{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(FlatPlateNCTest, Problem, Dumux::FlatPlateNCTestProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::FlatPlateNCTest> { using type = Dumux::FlatPlateNCTestProblem<TypeTag> ; }; -SET_BOOL_PROP(FlatPlateNCTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::FlatPlateNCTest> { static constexpr bool value = true; }; -SET_BOOL_PROP(FlatPlateNCTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(FlatPlateNCTest, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::FlatPlateNCTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::FlatPlateNCTest> { static constexpr bool value = true; }; // Enable gravity -SET_BOOL_PROP(FlatPlateNCTest, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::FlatPlateNCTest> { static constexpr bool value = true; }; } // end namespace Properties /*! @@ -141,24 +152,24 @@ class FlatPlateNCTestProblem : public ZeroEqProblem<TypeTag> using ParentType = ZeroEqProblem<TypeTag>; #endif - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; - static constexpr auto dimWorld = GET_PROP_TYPE(TypeTag, GridView)::dimensionworld; + static constexpr auto dimWorld = GetPropType<TypeTag, Properties::GridView>::dimensionworld; static constexpr auto transportEqIdx = Indices::conti0EqIdx + 1; static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1; diff --git a/test/geomechanics/elastic/main.cc b/test/geomechanics/elastic/main.cc index 7bc5f5d8db5664b9268f88bccc940360223d3964..e38ab00887a3be95e122d79146878a3394af257c 100644 --- a/test/geomechanics/elastic/main.cc +++ b/test/geomechanics/elastic/main.cc @@ -55,7 +55,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TestElastic); + using TypeTag = Properties::TTag::TestElastic; // stop time for the entire computation Dune::Timer timer; @@ -71,7 +71,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -82,21 +82,21 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); diff --git a/test/geomechanics/elastic/problem.hh b/test/geomechanics/elastic/problem.hh index 8afc10d692e8865ba1813912a835a0d369ad02bf..981ebb1cef109db56b965ca2ff01f185cd35d80d 100644 --- a/test/geomechanics/elastic/problem.hh +++ b/test/geomechanics/elastic/problem.hh @@ -38,14 +38,22 @@ template <class TypeTag> class ElasticProblem; namespace Properties { -NEW_TYPE_TAG(TestElastic, INHERITS_FROM(BoxModel, Elastic)); +// Create new type tags +namespace TTag { +struct TestElastic { using InheritsFrom = std::tuple<Elastic, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TestElastic, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TestElastic> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TestElastic, Problem, Dumux::ElasticProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TestElastic> { using type = Dumux::ElasticProblem<TypeTag>; }; // The spatial parameters property -SET_TYPE_PROP(TestElastic, SpatialParams, ElasticSpatialParams< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TestElastic> +{ using type = ElasticSpatialParams< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; } /*! @@ -59,19 +67,19 @@ class ElasticProblem : public GeomechanicsFVProblem<TypeTag> { using ParentType = GeomechanicsFVProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/geomechanics/poroelastic/main.cc b/test/geomechanics/poroelastic/main.cc index 90a1b5094d99cad2d2d8b9d8762d21bbeac05cbc..636ab07087bb4b9361212e220b8c0b8b74a78731 100644 --- a/test/geomechanics/poroelastic/main.cc +++ b/test/geomechanics/poroelastic/main.cc @@ -98,7 +98,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TestPoroElastic); + using TypeTag = Properties::TTag::TestPoroElastic; // stop time for the entire computation Dune::Timer timer; @@ -114,7 +114,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -125,26 +125,26 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module and output fields - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; using VtkOutputModule = Dumux::VtkOutputModule<GridVariables, SolutionVector>; VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); IOFields::initOutputModule(vtkWriter); @@ -158,7 +158,7 @@ int main(int argc, char** argv) try // Furthermore, write out element stress tensors static constexpr int dim = FVGridGeometry::GridView::dimension; static constexpr int dimWorld = FVGridGeometry::GridView::dimensionworld; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ForceVector = Dune::FieldVector< Scalar, dimWorld >; // containers to store sigma/effective sigma @@ -176,7 +176,7 @@ int main(int argc, char** argv) try } // use convenience function to compute stresses - using StressType = GET_PROP_TYPE(TypeTag, StressType); + using StressType = GetPropType<TypeTag, Properties::StressType>; assembleElementStresses<StressType>(sigmaStorage, effSigmaStorage, *problem, *fvGridGeometry, *gridVariables, x); // write initial solution diff --git a/test/geomechanics/poroelastic/problem.hh b/test/geomechanics/poroelastic/problem.hh index 780f06920f201245b84ebb58fdac1a81ba7d4e68..498f346f9c97dffc5bec8d137fd72f3297375661 100644 --- a/test/geomechanics/poroelastic/problem.hh +++ b/test/geomechanics/poroelastic/problem.hh @@ -41,19 +41,30 @@ template <class TypeTag> class PoroElasticProblem; namespace Properties { -NEW_TYPE_TAG(TestPoroElastic, INHERITS_FROM(BoxModel, PoroElastic)); +// Create new type tags +namespace TTag { +struct TestPoroElastic { using InheritsFrom = std::tuple<PoroElastic, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TestPoroElastic, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TestPoroElastic> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TestPoroElastic, Problem, Dumux::PoroElasticProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TestPoroElastic> { using type = Dumux::PoroElasticProblem<TypeTag>; }; // The fluid phase consists of one constant component -SET_TYPE_PROP(TestPoroElastic, - FluidSystem, - Dumux::FluidSystems::OnePLiquid< typename GET_PROP_TYPE(TypeTag, Scalar), - Dumux::Components::Constant<0, typename GET_PROP_TYPE(TypeTag, Scalar)> >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TestPoroElastic> +{ + using type = Dumux::FluidSystems::OnePLiquid< GetPropType<TypeTag, Properties::Scalar>, + Dumux::Components::Constant<0, GetPropType<TypeTag, Properties::Scalar>> >; +}; // The spatial parameters property -SET_TYPE_PROP(TestPoroElastic, SpatialParams, PoroElasticSpatialParams< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TestPoroElastic> +{ + using type = PoroElasticSpatialParams< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; } /*! @@ -67,19 +78,19 @@ class PoroElasticProblem : public GeomechanicsFVProblem<TypeTag> { using ParentType = GeomechanicsFVProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -113,7 +124,7 @@ public: Scalar effectiveFluidDensityAtPos(const GlobalPosition& globalPos) const { // This test uses the constant component, obtain density only once - using FS = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FS = GetPropType<TypeTag, Properties::FluidSystem>; static const Scalar rho = FS::density( effectivePorePressureAtPos(globalPos), temperature() ); return rho; } diff --git a/test/io/gridmanager/test_gridmanager_cake.cc b/test/io/gridmanager/test_gridmanager_cake.cc index 5112e69af4a2abd63b0dae051235c9735c576ede..0059526ae17be136b6977549528cfcbc6c7c555c 100644 --- a/test/io/gridmanager/test_gridmanager_cake.cc +++ b/test/io/gridmanager/test_gridmanager_cake.cc @@ -42,12 +42,16 @@ namespace Dumux namespace Properties { -NEW_TYPE_TAG(GridCreatorCakeTest); +namespace TTag { +struct GridCreatorCakeTest {}; +} // Set the grid type #if HAVE_DUNE_ALUGRID -SET_TYPE_PROP(GridCreatorCakeTest, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::GridCreatorCakeTest> { using type = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>; }; #elif HAVE_UG -SET_TYPE_PROP(GridCreatorCakeTest, Grid, Dune::UGGrid<3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::GridCreatorCakeTest> { using type = Dune::UGGrid<3>; }; #endif } } @@ -58,8 +62,8 @@ int main(int argc, char** argv) try Dune::MPIHelper::instance(argc, argv); // using declarations - using TypeTag = TTAG(GridCreatorCakeTest); - using Grid = typename GET_PROP_TYPE(TypeTag, Grid); + using TypeTag = Dumux::Properties::TTag::GridCreatorCakeTest; + using Grid = Dumux::GetPropType<TypeTag, Dumux::Properties::Grid>; using GridManager = typename Dumux::CakeGridCreator<Grid>; GridManager gridManager; diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc index 453126339dfd4ed1563bf4437ad0c5525e7ee6ce..76d41225c8067d96f6206cf0999830a068dfb6ae 100644 --- a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -58,58 +58,65 @@ namespace Dumux { namespace Properties { -NEW_TYPE_TAG(StaggeredPVNamesTestTypeTag, INHERITS_FROM(StaggeredFreeFlowModel)); - -NEW_TYPE_TAG(NavierStokesPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokes)); -NEW_TYPE_TAG(NavierStokesNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNI)); -NEW_TYPE_TAG(NavierStokesNCPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNC)); -NEW_TYPE_TAG(NavierStokesNCNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNCNI)); - -NEW_TYPE_TAG(KEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilon)); -NEW_TYPE_TAG(KEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNI)); -NEW_TYPE_TAG(KEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNC)); -NEW_TYPE_TAG(KEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNCNI)); - -NEW_TYPE_TAG(LowReKEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilon)); -NEW_TYPE_TAG(LowReKEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNI)); -NEW_TYPE_TAG(LowReKEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNC)); -NEW_TYPE_TAG(LowReKEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNCNI)); - -NEW_TYPE_TAG(KOmegaNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmega)); -NEW_TYPE_TAG(KOmegaNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNI)); -NEW_TYPE_TAG(KOmegaNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNC)); -NEW_TYPE_TAG(KOmegaNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNCNI)); - -NEW_TYPE_TAG(OneEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEq)); -NEW_TYPE_TAG(OneEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNI)); -NEW_TYPE_TAG(OneEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNC)); -NEW_TYPE_TAG(OneEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNCNI)); - -NEW_TYPE_TAG(ZeroEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEq)); -NEW_TYPE_TAG(ZeroEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNI)); -NEW_TYPE_TAG(ZeroEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNC)); -NEW_TYPE_TAG(ZeroEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNCNI)); +// Create new type tags +namespace TTag { +struct StaggeredPVNamesTestTypeTag { using InheritsFrom = std::tuple<StaggeredFreeFlowModel>; }; + +struct NavierStokesPVNameTypeTag { using InheritsFrom = std::tuple<NavierStokes, StaggeredPVNamesTestTypeTag>; }; +struct NavierStokesNIPVNameTypeTag { using InheritsFrom = std::tuple<NavierStokesNI, StaggeredPVNamesTestTypeTag>; }; +struct NavierStokesNCPVNameTypeTag { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredPVNamesTestTypeTag>; }; +struct NavierStokesNCNIPVNameTypeTag { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredPVNamesTestTypeTag>; }; + +struct KEpsilonNameTestTypeTag { using InheritsFrom = std::tuple<KEpsilon, StaggeredPVNamesTestTypeTag>; }; +struct KEpsilonNINameTestTypeTag { using InheritsFrom = std::tuple<KEpsilonNI, StaggeredPVNamesTestTypeTag>; }; +struct KEpsilonNCNameTestTypeTag { using InheritsFrom = std::tuple<KEpsilonNC, StaggeredPVNamesTestTypeTag>; }; +struct KEpsilonNCNINameTestTypeTag { using InheritsFrom = std::tuple<KEpsilonNCNI, StaggeredPVNamesTestTypeTag>; }; + +struct LowReKEpsilonNameTestTypeTag { using InheritsFrom = std::tuple<LowReKEpsilon, StaggeredPVNamesTestTypeTag>; }; +struct LowReKEpsilonNINameTestTypeTag { using InheritsFrom = std::tuple<LowReKEpsilonNI, StaggeredPVNamesTestTypeTag>; }; +struct LowReKEpsilonNCNameTestTypeTag { using InheritsFrom = std::tuple<LowReKEpsilonNC, StaggeredPVNamesTestTypeTag>; }; +struct LowReKEpsilonNCNINameTestTypeTag { using InheritsFrom = std::tuple<LowReKEpsilonNCNI, StaggeredPVNamesTestTypeTag>; }; + +struct KOmegaNameTestTypeTag { using InheritsFrom = std::tuple<KOmega, StaggeredPVNamesTestTypeTag>; }; +struct KOmegaNINameTestTypeTag { using InheritsFrom = std::tuple<KOmegaNI, StaggeredPVNamesTestTypeTag>; }; +struct KOmegaNCNameTestTypeTag { using InheritsFrom = std::tuple<KOmegaNC, StaggeredPVNamesTestTypeTag>; }; +struct KOmegaNCNINameTestTypeTag { using InheritsFrom = std::tuple<KOmegaNCNI, StaggeredPVNamesTestTypeTag>; }; + +struct OneEqNameTestTypeTag { using InheritsFrom = std::tuple<OneEq, StaggeredPVNamesTestTypeTag>; }; +struct OneEqNINameTestTypeTag { using InheritsFrom = std::tuple<OneEqNI, StaggeredPVNamesTestTypeTag>; }; +struct OneEqNCNameTestTypeTag { using InheritsFrom = std::tuple<OneEqNC, StaggeredPVNamesTestTypeTag>; }; +struct OneEqNCNINameTestTypeTag { using InheritsFrom = std::tuple<OneEqNCNI, StaggeredPVNamesTestTypeTag>; }; + +struct ZeroEqNameTestTypeTag { using InheritsFrom = std::tuple<ZeroEq, StaggeredPVNamesTestTypeTag>; }; +struct ZeroEqNINameTestTypeTag { using InheritsFrom = std::tuple<ZeroEqNI, StaggeredPVNamesTestTypeTag>; }; +struct ZeroEqNCNameTestTypeTag { using InheritsFrom = std::tuple<ZeroEqNC, StaggeredPVNamesTestTypeTag>; }; +struct ZeroEqNCNINameTestTypeTag { using InheritsFrom = std::tuple<ZeroEqNCNI, StaggeredPVNamesTestTypeTag>; }; +} // end namespace TTag // The fluid system -SET_PROP(StaggeredPVNamesTestTypeTag, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StaggeredPVNamesTestTypeTag> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; -SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Scalar, double); +template<class TypeTag> +struct Scalar<TypeTag, TTag::StaggeredPVNamesTestTypeTag> { using type = double; }; // Set the grid type -SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::StaggeredPVNamesTestTypeTag> { using type = Dune::YaspGrid<2>; }; -SET_PROP(StaggeredPVNamesTestTypeTag, Problem) +template<class TypeTag> +struct Problem<TypeTag, TTag::StaggeredPVNamesTestTypeTag> { private: // use the ZeroEqProblem as base class for non-RANS models and for the ZeroEq model // use the the KEpsilonProblem as base class for all RANS models except the ZeroEq model // NOTE: this rather unpleasant hack will be removed once the RANS models have been unified - using MTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using MTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr auto dim = MTraits::dim(); static constexpr auto nComp = MTraits::numComponents(); @@ -136,9 +143,9 @@ private: class MockProblem : public BaseProblem { using ParentType = BaseProblem; - using BoundaryTypes = typename GET_PROP_TYPE(TTag, BoundaryTypes); - using Scalar = typename GET_PROP_TYPE(TTag, Scalar); - using Traits = typename GET_PROP_TYPE(TTag, ModelTraits); + using BoundaryTypes = GetPropType<TTag, Properties::BoundaryTypes>; + using Scalar = GetPropType<TTag, Properties::Scalar>; + using Traits = GetPropType<TTag, Properties::ModelTraits>; public: using ParentType::ParentType; @@ -152,14 +159,14 @@ private: Scalar temperature() const { return 300; } - template<class T = TTag, bool enable = GET_PROP_TYPE(T, ModelTraits)::usesTurbulenceModel(), std::enable_if_t<!enable, int> = 0> + template<class T = TTag, bool enable = GetPropType<T, Properties::ModelTraits>::usesTurbulenceModel(), std::enable_if_t<!enable, int> = 0> void updateStaticWallProperties() {} template<class U, bool enable = Traits::usesTurbulenceModel(), std::enable_if_t<!enable, int> = 0> void updateDynamicWallProperties(const U&) {} // for ZeroEq model - template<class T = TTag, bool enable = GET_PROP_TYPE(T, ModelTraits)::usesTurbulenceModel(), std::enable_if_t<enable, int> = 0> + template<class T = TTag, bool enable = GetPropType<T, Properties::ModelTraits>::usesTurbulenceModel(), std::enable_if_t<enable, int> = 0> void updateStaticWallProperties() { ParentType::updateStaticWallProperties(); } @@ -201,7 +208,7 @@ void assignValues(SolutionVector& sol, Values values) template<class TypeTag, class FVGridGeometry, std::size_t numValues> void testWriteAndReadVtk(std::shared_ptr<FVGridGeometry> fvGridGeometry, - const std::array<typename GET_PROP_TYPE(TypeTag, Scalar), numValues>& values, + const std::array<Dumux::GetPropType<TypeTag, Dumux::Properties::Scalar>, numValues>& values, const std::string& fileName, bool verbose = false, bool deleteFiles = true) @@ -209,7 +216,7 @@ void testWriteAndReadVtk(std::shared_ptr<FVGridGeometry> fvGridGeometry, using namespace Dumux; // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector writeFrom; writeFrom[FVGridGeometry::cellCenterIdx()].resize(fvGridGeometry->numCellCenterDofs()); @@ -218,32 +225,32 @@ void testWriteAndReadVtk(std::shared_ptr<FVGridGeometry> fvGridGeometry, SolutionVector readTo = writeFrom; // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); assignValues(writeFrom[FVGridGeometry::cellCenterIdx()], values); - assignValues(writeFrom[FVGridGeometry::faceIdx()], std::array<typename GET_PROP_TYPE(TypeTag, Scalar), 1>{1.0}); + assignValues(writeFrom[FVGridGeometry::faceIdx()], std::array<GetPropType<TypeTag, Properties::Scalar>, 1>{1.0}); problem->updateStaticWallProperties(); problem->updateDynamicWallProperties(writeFrom); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(writeFrom); // initialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, writeFrom, fileName); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; + using FacePrimaryVariables = GetPropType<TypeTag, Properties::FacePrimaryVariables>; // cc dofs loadSolution(readTo[FVGridGeometry::cellCenterIdx()], fileName + "-00000.vtu", @@ -318,10 +325,10 @@ int main(int argc, char** argv) try Parameters::init(parameters); - using CommonTypeTag = TTAG(StaggeredPVNamesTestTypeTag); - using Grid = typename GET_PROP_TYPE(CommonTypeTag, Grid); - using FVGridGeometry = typename GET_PROP_TYPE(CommonTypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(CommonTypeTag, Scalar); + using CommonTypeTag = Properties::TTag::StaggeredPVNamesTestTypeTag; + using Grid = GetPropType<CommonTypeTag, Properties::Grid>; + using FVGridGeometry = GetPropType<CommonTypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<CommonTypeTag, Properties::Scalar>; using GlobalPosition = Dune::FieldVector<Scalar, Grid::dimension>; const GlobalPosition lowerLeft(0.0); @@ -334,38 +341,38 @@ int main(int argc, char** argv) try auto fvGridGeometry = std::make_shared<FVGridGeometry>(gridView); fvGridGeometry->update(); - using FluidSystem = typename GET_PROP_TYPE(CommonTypeTag, FluidSystem); + using FluidSystem = GetPropType<CommonTypeTag, Properties::FluidSystem>; FluidSystem::init(); - testWriteAndReadVtk<TTAG(NavierStokesPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "navierstokes"); - testWriteAndReadVtk<TTAG(NavierStokesNIPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "navierstokesni"); - testWriteAndReadVtk<TTAG(NavierStokesNCPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "navierstokesnc"); - testWriteAndReadVtk<TTAG(NavierStokesNCNIPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "navierstokesncni"); - - testWriteAndReadVtk<TTAG(ZeroEqNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "zeroeq"); - testWriteAndReadVtk<TTAG(ZeroEqNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "zeroeqni"); - testWriteAndReadVtk<TTAG(ZeroEqNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "zeroeqnc"); - testWriteAndReadVtk<TTAG(ZeroEqNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "zeroeqncni"); - - testWriteAndReadVtk<TTAG(OneEqNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1.0}, "oneeq"); - testWriteAndReadVtk<TTAG(OneEqNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.0, 300.0}, "oneeqni"); - testWriteAndReadVtk<TTAG(OneEqNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 1.0}, "oneeqnc"); - testWriteAndReadVtk<TTAG(OneEqNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.0, 300.0}, "oneeqncni"); - - testWriteAndReadVtk<TTAG(KEpsilonNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "kepsilon"); - testWriteAndReadVtk<TTAG(KEpsilonNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "kepsilonni"); - testWriteAndReadVtk<TTAG(KEpsilonNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "kepsilonnc"); - testWriteAndReadVtk<TTAG(KEpsilonNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "kepsilonncni"); - - testWriteAndReadVtk<TTAG(LowReKEpsilonNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "lowrekepsilon"); - testWriteAndReadVtk<TTAG(LowReKEpsilonNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "lowrekepsilonni"); - testWriteAndReadVtk<TTAG(LowReKEpsilonNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "lowrekepsilonnc"); - testWriteAndReadVtk<TTAG(LowReKEpsilonNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "lowrekepsilonncni"); - - testWriteAndReadVtk<TTAG(KOmegaNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "komega"); - testWriteAndReadVtk<TTAG(KOmegaNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "komegani"); - testWriteAndReadVtk<TTAG(KOmegaNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "komeganc"); - testWriteAndReadVtk<TTAG(KOmegaNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "komegancni"); + testWriteAndReadVtk<Properties::TTag::NavierStokesPVNameTypeTag>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "navierstokes"); + testWriteAndReadVtk<Properties::TTag::NavierStokesNIPVNameTypeTag>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "navierstokesni"); + testWriteAndReadVtk<Properties::TTag::NavierStokesNCPVNameTypeTag>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "navierstokesnc"); + testWriteAndReadVtk<Properties::TTag::NavierStokesNCNIPVNameTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "navierstokesncni"); + + testWriteAndReadVtk<Properties::TTag::ZeroEqNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "zeroeq"); + testWriteAndReadVtk<Properties::TTag::ZeroEqNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "zeroeqni"); + testWriteAndReadVtk<Properties::TTag::ZeroEqNCNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "zeroeqnc"); + testWriteAndReadVtk<Properties::TTag::ZeroEqNCNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "zeroeqncni"); + + testWriteAndReadVtk<Properties::TTag::OneEqNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1.0}, "oneeq"); + testWriteAndReadVtk<Properties::TTag::OneEqNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.0, 300.0}, "oneeqni"); + testWriteAndReadVtk<Properties::TTag::OneEqNCNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 1.0}, "oneeqnc"); + testWriteAndReadVtk<Properties::TTag::OneEqNCNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.0, 300.0}, "oneeqncni"); + + testWriteAndReadVtk<Properties::TTag::KEpsilonNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "kepsilon"); + testWriteAndReadVtk<Properties::TTag::KEpsilonNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "kepsilonni"); + testWriteAndReadVtk<Properties::TTag::KEpsilonNCNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "kepsilonnc"); + testWriteAndReadVtk<Properties::TTag::KEpsilonNCNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "kepsilonncni"); + + testWriteAndReadVtk<Properties::TTag::LowReKEpsilonNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "lowrekepsilon"); + testWriteAndReadVtk<Properties::TTag::LowReKEpsilonNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "lowrekepsilonni"); + testWriteAndReadVtk<Properties::TTag::LowReKEpsilonNCNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "lowrekepsilonnc"); + testWriteAndReadVtk<Properties::TTag::LowReKEpsilonNCNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "lowrekepsilonncni"); + + testWriteAndReadVtk<Properties::TTag::KOmegaNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "komega"); + testWriteAndReadVtk<Properties::TTag::KOmegaNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "komegani"); + testWriteAndReadVtk<Properties::TTag::KOmegaNCNameTestTypeTag>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "komeganc"); + testWriteAndReadVtk<Properties::TTag::KOmegaNCNINameTestTypeTag>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "komegancni"); //////////////////////////////////////////////////////////// // finalize, print dumux message to say goodbye diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index 2305cd5f2cb7307fae1051dc88de1cc8f0a125f9..4c7315316c56db4b229108be425fea7fb6954812 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -60,24 +60,30 @@ namespace Dumux { namespace Properties { -NEW_TYPE_TAG(OnePSub, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct OnePSub { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; // differentiate between the two subproblems -NEW_TYPE_TAG(OnePSub0, INHERITS_FROM(OnePSub)); -NEW_TYPE_TAG(OnePSub1, INHERITS_FROM(OnePSub)); +struct OnePSub0 { using InheritsFrom = std::tuple<OnePSub>; }; +struct OnePSub1 { using InheritsFrom = std::tuple<OnePSub>; }; +} // end namespace TTag // the coupling manager -SET_TYPE_PROP(OnePSub, CouplingManager, - DarcyDarcyBoundaryCouplingManager<MultiDomainTraits<TTAG(OnePSub0), TTAG(OnePSub1)>>); +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePSub> +{ using type = DarcyDarcyBoundaryCouplingManager<MultiDomainTraits<Properties::TTag::OnePSub0, Properties::TTag::OnePSub1>>; }; // Set the grid type #if DOMAINSPLIT==1 -SET_PROP(OnePSub, Grid) +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePSub> { using FullDomainGrid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; using type = Dune::SubGrid<FullDomainGrid::dimension, FullDomainGrid>; }; #elif DOMAINSPLIT==0 -SET_PROP(OnePSub, Grid) +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePSub> { using FullDomainGrid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; using type = FullDomainGrid; @@ -85,19 +91,26 @@ SET_PROP(OnePSub, Grid) #endif // set the spatial params -SET_TYPE_PROP(OnePSub, SpatialParams, OnePTestSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePSub> +{ + using type = OnePTestSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; // the fluid system -SET_PROP(OnePSub, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePSub> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // differentiate between the two subproblems -SET_TYPE_PROP(OnePSub0, Problem, OnePTestProblem<TypeTag, 0>); -SET_TYPE_PROP(OnePSub1, Problem, OnePTestProblem<TypeTag, 1>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSub0> { using type = OnePTestProblem<TypeTag, 0>; }; +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSub1> { using type = OnePTestProblem<TypeTag, 1>; }; } // end namespace Properties } // end namespace Dumux @@ -117,12 +130,12 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using TypeTag = TTAG(OnePSub); - using SubTypeTag0 = TTAG(OnePSub0); - using SubTypeTag1 = TTAG(OnePSub1); + using TypeTag = Properties::TTag::OnePSub; + using SubTypeTag0 = Properties::TTag::OnePSub0; + using SubTypeTag1 = Properties::TTag::OnePSub1; // create the full grid that we are gonna split for the output - using FullDomainGrid = typename GET_PROP(TypeTag, Grid)::FullDomainGrid; + using FullDomainGrid = typename GetProp<TypeTag, Properties::Grid>::FullDomainGrid; GridManager<FullDomainGrid> gridManager; gridManager.init(); @@ -159,7 +172,7 @@ int main(int argc, char** argv) try #elif DOMAINSPLIT==0 // create an upper half and lower half grid - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager0, gridManager1; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager0, gridManager1; gridManager0.init("1"); gridManager1.init("2"); @@ -174,7 +187,7 @@ int main(int argc, char** argv) try //////////////////////////////////////////////// // create the finite volume grid geometries - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry0 = std::make_shared<FVGridGeometry>(gridView0); auto fvGridGeometry1 = std::make_shared<FVGridGeometry>(gridView1); fvGridGeometry0->update(); @@ -186,14 +199,14 @@ int main(int argc, char** argv) try constexpr auto domain1Idx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(); // the problem (initial and boundary conditions) - using Problem0 = typename GET_PROP_TYPE(SubTypeTag0, Problem); + using Problem0 = GetPropType<SubTypeTag0, Properties::Problem>; auto problem0 = std::make_shared<Problem0>(fvGridGeometry0, couplingManager, "1"); problem0->spatialParams().setLens(lensLowerLeft, lensUpperRight); - using Problem1 = typename GET_PROP_TYPE(SubTypeTag1, Problem); + using Problem1 = GetPropType<SubTypeTag1, Properties::Problem>; auto problem1 = std::make_shared<Problem1>(fvGridGeometry1, couplingManager, "2"); problem1->spatialParams().setLens(lensLowerLeft, lensUpperRight); @@ -209,9 +222,9 @@ int main(int argc, char** argv) try couplingManager->init(problem0, problem1, sol); // the grid variables - using GridVariables0 = typename GET_PROP_TYPE(SubTypeTag0, GridVariables); + using GridVariables0 = GetPropType<SubTypeTag0, Properties::GridVariables>; auto gridVariables0 = std::make_shared<GridVariables0>(problem0, fvGridGeometry0); - using GridVariables1 = typename GET_PROP_TYPE(SubTypeTag1, GridVariables); + using GridVariables1 = GetPropType<SubTypeTag1, Properties::GridVariables>; auto gridVariables1 = std::make_shared<GridVariables1>(problem1, fvGridGeometry1); gridVariables0->init(sol[domain0Idx], oldSol[domain0Idx]); gridVariables1->init(sol[domain1Idx], oldSol[domain1Idx]); @@ -225,12 +238,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t<decltype(sol[domain0Idx])>; VtkOutputModule<GridVariables0, SolutionVector0> vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); + GetPropType<SubTypeTag0, Properties::IOFields>::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t<decltype(sol[domain1Idx])>; VtkOutputModule<GridVariables1, SolutionVector1> vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); + GetPropType<SubTypeTag1, Properties::IOFields>::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/problem.hh b/test/multidomain/boundary/darcydarcy/1p_1p/problem.hh index 580a261fcf5208ca79b56dccf063519d7299bfd4..af68fdfed982a6db60454064eae2001f7ec93e48 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/problem.hh +++ b/test/multidomain/boundary/darcydarcy/1p_1p/problem.hh @@ -39,17 +39,17 @@ class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; static constexpr auto domainIdx = Dune::index_constant<tag>{}; diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 5514b898d1181359fc59cced67d3cfb933d7ea80..e29b450f52a1e8b686b924a1976d326f66736321 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -60,43 +60,56 @@ namespace Dumux { namespace Properties { -NEW_TYPE_TAG(OnePSub, INHERITS_FROM(CCTpfaModel)); +// Create new type tags +namespace TTag { +struct OnePSub { using InheritsFrom = std::tuple<CCTpfaModel>; }; // differentiate between the two subproblems -NEW_TYPE_TAG(OnePSub0, INHERITS_FROM(OnePSub, OneP)); -NEW_TYPE_TAG(OnePSub1, INHERITS_FROM(OnePSub, TwoP)); +struct OnePSub0 { using InheritsFrom = std::tuple<OneP, OnePSub>; }; +struct OnePSub1 { using InheritsFrom = std::tuple<TwoP, OnePSub>; }; +} // end namespace TTag // the coupling manager -SET_TYPE_PROP(OnePSub, CouplingManager, - DarcyDarcyBoundaryCouplingManager<MultiDomainTraits<TTAG(OnePSub0), TTAG(OnePSub1)>>); +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePSub> +{ using type = DarcyDarcyBoundaryCouplingManager<MultiDomainTraits<Properties::TTag::OnePSub0, Properties::TTag::OnePSub1>>; }; // Set the grid type -SET_PROP(OnePSub, Grid) +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePSub> { using FullDomainGrid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; using type = Dune::SubGrid<FullDomainGrid::dimension, FullDomainGrid>; }; // set the spatial params -SET_TYPE_PROP(OnePSub, SpatialParams, TestSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePSub> +{ + using type = TestSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; // differentiate between the two fluid systems -SET_PROP(OnePSub0, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePSub0> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; -SET_PROP(OnePSub1, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePSub1> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::TwoPImmiscible<Scalar, FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar>>, FluidSystems::OnePGas<Scalar, Components::CH4<Scalar>>>; }; // differentiate between the two subproblems -SET_TYPE_PROP(OnePSub0, Problem, OnePTestProblem<TypeTag, 0>); -SET_TYPE_PROP(OnePSub1, Problem, OnePTestProblem<TypeTag, 1>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSub0> { using type = OnePTestProblem<TypeTag, 0>; }; +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSub1> { using type = OnePTestProblem<TypeTag, 1>; }; } // end namespace Properties } // end namespace Dumux @@ -116,12 +129,12 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using TypeTag = TTAG(OnePSub); - using SubTypeTag0 = TTAG(OnePSub0); - using SubTypeTag1 = TTAG(OnePSub1); + using TypeTag = Properties::TTag::OnePSub; + using SubTypeTag0 = Properties::TTag::OnePSub0; + using SubTypeTag1 = Properties::TTag::OnePSub1; // create the full grid that we are gonna split for the output - using FullDomainGrid = typename GET_PROP(TypeTag, Grid)::FullDomainGrid; + using FullDomainGrid = typename GetProp<TypeTag, Properties::Grid>::FullDomainGrid; GridManager<FullDomainGrid> gridManager; gridManager.init(); @@ -160,7 +173,7 @@ int main(int argc, char** argv) try //////////////////////////////////////////////// // create the finite volume grid geometries - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry0 = std::make_shared<FVGridGeometry>(gridView0); auto fvGridGeometry1 = std::make_shared<FVGridGeometry>(gridView1); fvGridGeometry0->update(); @@ -172,13 +185,13 @@ int main(int argc, char** argv) try constexpr auto domain1Idx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(); // the problem (initial and boundary conditions) - using Problem0 = typename GET_PROP_TYPE(SubTypeTag0, Problem); + using Problem0 = GetPropType<SubTypeTag0, Properties::Problem>; auto problem0 = std::make_shared<Problem0>(fvGridGeometry0, couplingManager, "1"); - using Problem1 = typename GET_PROP_TYPE(SubTypeTag1, Problem); + using Problem1 = GetPropType<SubTypeTag1, Properties::Problem>; auto problem1 = std::make_shared<Problem1>(fvGridGeometry1, couplingManager, "2"); problem1->computePointSourceMap(); @@ -194,9 +207,9 @@ int main(int argc, char** argv) try couplingManager->init(problem0, problem1, sol); // the grid variables - using GridVariables0 = typename GET_PROP_TYPE(SubTypeTag0, GridVariables); + using GridVariables0 = GetPropType<SubTypeTag0, Properties::GridVariables>; auto gridVariables0 = std::make_shared<GridVariables0>(problem0, fvGridGeometry0); - using GridVariables1 = typename GET_PROP_TYPE(SubTypeTag1, GridVariables); + using GridVariables1 = GetPropType<SubTypeTag1, Properties::GridVariables>; auto gridVariables1 = std::make_shared<GridVariables1>(problem1, fvGridGeometry1); gridVariables0->init(sol[domain0Idx], oldSol[domain0Idx]); gridVariables1->init(sol[domain1Idx], oldSol[domain1Idx]); @@ -210,12 +223,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t<decltype(sol[domain0Idx])>; VtkOutputModule<GridVariables0, SolutionVector0> vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); + GetPropType<SubTypeTag0, Properties::IOFields>::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t<decltype(sol[domain1Idx])>; VtkOutputModule<GridVariables1, SolutionVector1> vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); + GetPropType<SubTypeTag1, Properties::IOFields>::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/problem.hh b/test/multidomain/boundary/darcydarcy/1p_2p/problem.hh index dbcc8d7184eec1be7c393deba51e9d9769137d8d..f63c5e2e7dfdff10a65246f929724c13100fe9b0 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/problem.hh +++ b/test/multidomain/boundary/darcydarcy/1p_2p/problem.hh @@ -39,18 +39,18 @@ class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; static constexpr auto domainIdx = Dune::index_constant<tag>{}; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/main.cc index ca3545ed6464ce2dd7bae6c8eebc5586be398e79..cea2d267ae66282aded0498090d0ebb687a6b52c 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/main.cc @@ -55,15 +55,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOnePTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOnePTwoC> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyOnePTwoC)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyOnePTwoC>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyOnePTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyOnePTwoC> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOnePTwoC), TTAG(StokesOnePTwoC), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOnePTwoC, Properties::TTag::StokesOnePTwoC, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -85,16 +87,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = TTAG(StokesOnePTwoC); - using DarcyTypeTag = TTAG(DarcyOnePTwoC); + using StokesTypeTag = Properties::TTag::StokesOnePTwoC; + using DarcyTypeTag = Properties::TTag::DarcyOnePTwoC; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -103,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -122,16 +124,16 @@ int main(int argc, char** argv) try constexpr auto darcyIdx = CouplingManager::darcyIdx; // the problems (initial and boundary conditions) - using StokesProblem = typename GET_PROP_TYPE(StokesTypeTag, Problem); + using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // initialize the fluidsystem (tabulation) - GET_PROP_TYPE(StokesTypeTag, FluidSystem)::init(); + GetPropType<StokesTypeTag, Properties::FluidSystem>::init(); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(StokesTypeTag, Scalar); + using Scalar = GetPropType<StokesTypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -159,7 +161,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -175,22 +177,22 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol, solStokesOld); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx], solDarcyOld); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh index 16a6fcef6f3177ec1ed4ac5dd4f462b1d29a042b..0db90ae99b33c5014631e42bee2bf3f1f25c34e2 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh @@ -44,37 +44,47 @@ class DarcySubProblem; namespace Properties { -NEW_TYPE_TAG(DarcyOnePTwoC, INHERITS_FROM(CCTpfaModel, OnePNC)); +// Create new type tags +namespace TTag { +struct DarcyOnePTwoC { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyOnePTwoC, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyOnePTwoC> { using type = Dumux::DarcySubProblem<TypeTag>; }; // The fluid system -SET_PROP(DarcyOnePTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyOnePTwoC> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx; // simulate the water phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; // Use moles -SET_BOOL_PROP(DarcyOnePTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> { static constexpr bool value = true; }; // Do not replace one equation with a total mass balance -SET_INT_PROP(DarcyOnePTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePTwoC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::DarcyOnePTwoC> +{ using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the grid type -SET_TYPE_PROP(DarcyOnePTwoC, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyOnePTwoC> { using type = Dune::YaspGrid<2>; }; // Set the spatial paramaters type -SET_PROP(DarcyOnePTwoC, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyOnePTwoC> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; } @@ -83,19 +93,19 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // grid and world dimension dim = GridView::dimension, @@ -109,7 +119,7 @@ class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = Dune::FieldVector<Scalar, dimworld>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh index 6bef73f873f45ccb6fc3b661e994f6e84a36c03f..a7379df64d27ce95da23da7842358ed7b4ab8493 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh @@ -40,31 +40,42 @@ class StokesSubProblem; namespace Properties { -NEW_TYPE_TAG(StokesOnePTwoC, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +// Create new type tags +namespace TTag { +struct StokesOnePTwoC { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag // The fluid system -SET_PROP(StokesOnePTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOnePTwoC> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx; // simulate the water phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; // Set the grid type -SET_TYPE_PROP(StokesOnePTwoC, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOnePTwoC> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(StokesOnePTwoC, Problem, Dumux::StokesSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOnePTwoC> { using type = Dumux::StokesSubProblem<TypeTag> ; }; -SET_BOOL_PROP(StokesOnePTwoC, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; // Use moles -SET_BOOL_PROP(StokesOnePTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; // Do not replace one equation with a total mass balance -SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; }; } /*! @@ -77,21 +88,21 @@ template <class TypeTag> class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager) diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/main.cc index a802ba5d0bcb2b8c38ceef65d51bd57deb858d12..048f451d23d8c0c9f5403ae553018f283ed298f5 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/main.cc @@ -55,15 +55,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOnePTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOnePTwoC> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyOnePTwoC)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyOnePTwoC>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyOnePTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyOnePTwoC> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOnePTwoC), TTAG(StokesOnePTwoC), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOnePTwoC, Properties::TTag::StokesOnePTwoC, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -85,16 +87,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = TTAG(StokesOnePTwoC); - using DarcyTypeTag = TTAG(DarcyOnePTwoC); + using StokesTypeTag = Properties::TTag::StokesOnePTwoC; + using DarcyTypeTag = Properties::TTag::DarcyOnePTwoC; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -103,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -122,7 +124,7 @@ int main(int argc, char** argv) try constexpr auto darcyIdx = CouplingManager::darcyIdx; // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(StokesTypeTag, Scalar); + using Scalar = GetPropType<StokesTypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -130,13 +132,13 @@ int main(int argc, char** argv) try const bool isDiffusionProblem = getParam<bool>("Problem.OnlyDiffusion", false); // the problem (initial and boundary conditions) - using StokesProblem = typename GET_PROP_TYPE(StokesTypeTag, Problem); + using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // initialize the fluidsystem (tabulation) - GET_PROP_TYPE(StokesTypeTag, FluidSystem)::init(); + GetPropType<StokesTypeTag, Properties::FluidSystem>::init(); // instantiate time loop auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd); @@ -160,7 +162,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -176,22 +178,22 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol, solStokesOld); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx], solDarcyOld); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh index 8706a992aaef8d279a0fe810886fc758d4a75f84..fee6ba860f838babe1f25ef711c98f193848e344 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh @@ -44,37 +44,47 @@ class DarcySubProblem; namespace Properties { -NEW_TYPE_TAG(DarcyOnePTwoC, INHERITS_FROM(CCTpfaModel, OnePNC)); +// Create new type tags +namespace TTag { +struct DarcyOnePTwoC { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyOnePTwoC, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyOnePTwoC> { using type = Dumux::DarcySubProblem<TypeTag>; }; // The fluid system -SET_PROP(DarcyOnePTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyOnePTwoC> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx; // simulate the water phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; // Use moles -SET_BOOL_PROP(DarcyOnePTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> { static constexpr bool value = true; }; // Do not replace one equation with a total mass balance -SET_INT_PROP(DarcyOnePTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> { static constexpr int value = 3; }; //! Use a model with constant tortuosity for the effective diffusivity -SET_TYPE_PROP(DarcyOnePTwoC, EffectiveDiffusivityModel, - DiffusivityConstantTortuosity<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct EffectiveDiffusivityModel<TypeTag, TTag::DarcyOnePTwoC> +{ using type = DiffusivityConstantTortuosity<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the grid type -SET_TYPE_PROP(DarcyOnePTwoC, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyOnePTwoC> { using type = Dune::YaspGrid<2>; }; // Set the spatial paramaters type -SET_PROP(DarcyOnePTwoC, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyOnePTwoC> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; } @@ -83,21 +93,21 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // grid and world dimension dim = GridView::dimension, @@ -111,7 +121,7 @@ class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh index 6f20a585d20edd48ff2f295f2d8255f70ab5a2f4..a4d4fe88cfa22af749643d30f61ac39d47cbd85a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh @@ -40,32 +40,43 @@ class StokesSubProblem; namespace Properties { -NEW_TYPE_TAG(StokesOnePTwoC, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +// Create new type tags +namespace TTag { +struct StokesOnePTwoC { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag // The fluid system -SET_PROP(StokesOnePTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOnePTwoC> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx; // simulate the water phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; // Set the grid type -SET_TYPE_PROP(StokesOnePTwoC, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOnePTwoC> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(StokesOnePTwoC, Problem, Dumux::StokesSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOnePTwoC> { using type = Dumux::StokesSubProblem<TypeTag> ; }; // Enable all caches -SET_BOOL_PROP(StokesOnePTwoC, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; // Use moles -SET_BOOL_PROP(StokesOnePTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; // Do not replace one equation with a total mass balance -SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; }; } /*! @@ -79,24 +90,24 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; public: diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc index 442fd2e1a4c4f2a6298ee39b799dfeb62203af85..ed46ee530b7225f81803be657a3d3da5a4e39323 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc @@ -55,15 +55,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOnePTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOnePTwoC> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyTwoPTwoC)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoC>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyTwoPTwoC, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoC> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOnePTwoC), TTAG(StokesOnePTwoC), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOnePTwoC, Properties::TTag::StokesOnePTwoC, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -85,16 +87,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = TTAG(StokesOnePTwoC); - using DarcyTypeTag = TTAG(DarcyTwoPTwoC); + using StokesTypeTag = Properties::TTag::StokesOnePTwoC; + using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoC; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -103,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -122,16 +124,16 @@ 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<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // initialize the fluidsystem (tabulation) - GET_PROP_TYPE(StokesTypeTag, FluidSystem)::init(); + GetPropType<StokesTypeTag, Properties::FluidSystem>::init(); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(StokesTypeTag, Scalar); + using Scalar = GetPropType<StokesTypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -152,7 +154,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -168,22 +170,22 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol, solStokesOld); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx], solDarcyOld); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem @@ -203,7 +205,7 @@ int main(int argc, char** argv) try auto linearSolver = std::make_shared<LinearSolver>(); // the primary variable switches used by the sub models - using PriVarSwitchTuple = std::tuple<NoPrimaryVariableSwitch, NoPrimaryVariableSwitch, typename GET_PROP_TYPE(DarcyTypeTag, PrimaryVariableSwitch)>; + using PriVarSwitchTuple = std::tuple<NoPrimaryVariableSwitch, NoPrimaryVariableSwitch, GetPropType<DarcyTypeTag, Properties::PrimaryVariableSwitch>>; // the non-linear solver using NewtonSolver = MultiDomainPriVarSwitchNewtonSolver<Assembler, LinearSolver, CouplingManager, PriVarSwitchTuple>; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh index 74e25b29e785dcf23438a9374239f031e9b31d0f..8db08d2972fac18df2584d9f08ba24404f95ad15 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh @@ -42,34 +42,44 @@ class DarcySubProblem; namespace Properties { +// Create new type tags +namespace TTag { #if !NONISOTHERMAL -NEW_TYPE_TAG(DarcyTwoPTwoC, INHERITS_FROM(CCTpfaModel, TwoPTwoC)); +struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC, CCTpfaModel>; }; #else -NEW_TYPE_TAG(DarcyTwoPTwoC, INHERITS_FROM(CCTpfaModel, TwoPTwoCNI)); +struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; #endif +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyTwoPTwoC, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyTwoPTwoC> { using type = Dumux::DarcySubProblem<TypeTag>; }; // the fluid system -SET_TYPE_PROP(DarcyTwoPTwoC, FluidSystem, FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyTwoPTwoC> { using type = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the default formulation to pw-Sn: This can be over written in the problem. -SET_PROP(DarcyTwoPTwoC, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::DarcyTwoPTwoC> { static constexpr auto value = TwoPFormulation::p1s0; }; //// The gas component balance (air) is replaced by the total mass balance -SET_INT_PROP(DarcyTwoPTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoC> { static constexpr int value = 3; }; // Set the grid type -SET_TYPE_PROP(DarcyTwoPTwoC, Grid, Dune::YaspGrid<2, Dune::TensorProductCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyTwoPTwoC> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; -SET_BOOL_PROP(DarcyTwoPTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DarcyTwoPTwoC> { static constexpr bool value = true; }; -SET_PROP(DarcyTwoPTwoC, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoC> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TwoPTwoCSpatialParams<FVGridGeometry, Scalar>; }; @@ -79,22 +89,22 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // primary variable indices conti0EqIdx = Indices::conti0EqIdx, @@ -107,7 +117,7 @@ class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; using DiffusionCoefficientAveragingType = typename StokesDarcyCouplingOptions::DiffusionCoefficientAveragingType; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh index 8dfa961988bd143b234b9e8ad29aaefa27abb347..7bacec4fd6af40ceb2d3fe5c8de6740d977ea46d 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh @@ -40,35 +40,46 @@ class StokesSubProblem; namespace Properties { +// Create new type tags +namespace TTag { #if !NONISOTHERMAL -NEW_TYPE_TAG(StokesOnePTwoC, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); +struct StokesOnePTwoC { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; #else -NEW_TYPE_TAG(StokesOnePTwoC, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNCNI)); +struct StokesOnePTwoC { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; #endif +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(StokesOnePTwoC, Grid, Dune::YaspGrid<2, Dune::TensorProductCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOnePTwoC> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // The fluid system -SET_PROP(StokesOnePTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOnePTwoC> { - using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the water phase using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; }; -SET_INT_PROP(StokesOnePTwoC, ReplaceCompEqIdx, 3); +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int value = 3; }; // Use formulation based on mass fractions -SET_BOOL_PROP(StokesOnePTwoC, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; // Set the problem property -SET_TYPE_PROP(StokesOnePTwoC, Problem, Dumux::StokesSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOnePTwoC> { using type = Dumux::StokesSubProblem<TypeTag> ; }; -SET_BOOL_PROP(StokesOnePTwoC, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOnePTwoC, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static constexpr bool value = true; }; } @@ -83,31 +94,31 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>; using DiffusionCoefficientAveragingType = typename StokesDarcyCouplingOptions::DiffusionCoefficientAveragingType; - static constexpr bool useMoles = GET_PROP_TYPE(TypeTag, ModelTraits)::useMoles(); + static constexpr bool useMoles = GetPropType<TypeTag, Properties::ModelTraits>::useMoles(); public: StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager) diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/main.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/main.cc index 0054073c479fb4aba08d500499f74b76acebe744..b1173646948e921c4856ee48964dd0de6a89b174 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/main.cc @@ -55,15 +55,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOneP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOneP> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyOneP)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyOneP>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyOneP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyOneP> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOneP), TTAG(StokesOneP), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOneP, Properties::TTag::StokesOneP, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -85,16 +87,16 @@ 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; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -103,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -122,9 +124,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<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // the solution vector @@ -137,7 +139,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -147,22 +149,22 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx]); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh index be5bad7ab49c3bf1bc809892d565a08467e32413..fc2fdd3900f2e23769198bb9b0be8c935913d031 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh @@ -43,25 +43,32 @@ class DarcySubProblem; namespace Properties { -NEW_TYPE_TAG(DarcyOneP, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct DarcyOneP { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyOneP, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyOneP> { using type = Dumux::DarcySubProblem<TypeTag>; }; // the fluid system -SET_PROP(DarcyOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyOneP> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::SimpleH2O<Scalar> > ; }; // Set the grid type -SET_TYPE_PROP(DarcyOneP, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyOneP> { using type = Dune::YaspGrid<2>; }; -SET_PROP(DarcyOneP, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyOneP> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; } @@ -70,23 +77,23 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh index 1b621a15f4258d9e5f24b93badce56b5abf9634b..4e5edcabc3823fa38a6dd1fd1347dadeffec9577 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh @@ -40,24 +40,33 @@ class StokesSubProblem; namespace Properties { -NEW_TYPE_TAG(StokesOneP, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct StokesOneP { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(StokesOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOneP> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::SimpleH2O<Scalar> > ; }; // Set the grid type -SET_TYPE_PROP(StokesOneP, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOneP> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(StokesOneP, Problem, Dumux::StokesSubProblem<TypeTag> ); - -SET_BOOL_PROP(StokesOneP, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOneP> { using type = Dumux::StokesSubProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; } /*! @@ -71,24 +80,24 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; 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 PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager) diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/main.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/main.cc index 67dbda0226e7d458f21e3b565176a3815906722a..ef884a4254c7b5b3d7af64c3d12461d7f647b63a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/main.cc @@ -55,15 +55,17 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOneP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOneP> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyOneP)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyOneP>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyOneP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyOneP> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOneP), TTAG(StokesOneP), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOneP, Properties::TTag::StokesOneP, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -85,16 +87,16 @@ 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; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -103,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -122,9 +124,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<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // the solution vector @@ -137,7 +139,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -150,22 +152,22 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx]); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh index 34d1ebbb0d20b560a96010fd52297c74d13727ae..04be124e9d1270e31a4a2769c65019a0483a2beb 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh @@ -43,25 +43,32 @@ class DarcySubProblem; namespace Properties { -NEW_TYPE_TAG(DarcyOneP, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct DarcyOneP { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyOneP, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyOneP> { using type = Dumux::DarcySubProblem<TypeTag>; }; // the fluid system -SET_PROP(DarcyOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyOneP> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::SimpleH2O<Scalar> > ; }; // Set the grid type -SET_TYPE_PROP(DarcyOneP, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyOneP> { using type = Dune::YaspGrid<2>; }; -SET_PROP(DarcyOneP, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyOneP> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; } @@ -70,20 +77,20 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // grid and world dimension dim = GridView::dimension, @@ -97,7 +104,7 @@ class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh index cdf945f7badefa436d0c915f6fcfb302da910d6e..721d2ccc76810b0246365c1d53ae8205230adcc4 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh @@ -40,24 +40,33 @@ class StokesSubProblem; namespace Properties { -NEW_TYPE_TAG(StokesOneP, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokes)); +// Create new type tags +namespace TTag { +struct StokesOneP { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(StokesOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOneP> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::SimpleH2O<Scalar> > ; }; // Set the grid type -SET_TYPE_PROP(StokesOneP, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOneP> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(StokesOneP, Problem, Dumux::StokesSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOneP> { using type = Dumux::StokesSubProblem<TypeTag> ; }; -SET_BOOL_PROP(StokesOneP, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; } @@ -72,26 +81,26 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager) diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc index bf690fee74f7e06df8a1fada8a9310b8a942f278..4d1f92b5885d1bc24aeb9a373baec9c5b1978ef8 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc @@ -63,22 +63,24 @@ namespace Dumux { namespace Properties { -SET_PROP(StokesOneP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::StokesOneP> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, TTAG(DarcyTwoP)>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoP>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; -SET_PROP(DarcyTwoP, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::DarcyTwoP> { - using Traits = StaggeredMultiDomainTraits<TTAG(StokesOneP), TTAG(StokesOneP), TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOneP, Properties::TTag::StokesOneP, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; template<class TypeTag> struct CouplingFluidSystem { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2OType = Dumux::Components::SimpleH2O<Scalar>; using H2OPhase = Dumux::FluidSystems::OnePLiquid<Scalar, H2OType>; using AirType = Dumux::Components::TabulatedComponent<Components::Air<Scalar>, false >; @@ -87,14 +89,16 @@ struct CouplingFluidSystem }; // the fluid system for the free-flow model -SET_PROP(StokesOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::StokesOneP> { static constexpr auto phaseIdx = 1; // simulate the air phase using type = FluidSystems::OnePAdapter<typename CouplingFluidSystem<TypeTag>::type, phaseIdx>; }; // the fluid system for the Darcy model -SET_PROP(DarcyTwoP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DarcyTwoP> { using type = typename CouplingFluidSystem<TypeTag>::type; }; @@ -117,16 +121,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = TTAG(StokesOneP); - using DarcyTypeTag = TTAG(DarcyTwoP); + using StokesTypeTag = Properties::TTag::StokesOneP; + using DarcyTypeTag = Properties::TTag::DarcyTwoP; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using DarcyGridManager = Dumux::GridManager<typename GET_PROP_TYPE(DarcyTypeTag, Grid)>; + using DarcyGridManager = Dumux::GridManager<GetPropType<DarcyTypeTag, Properties::Grid>>; DarcyGridManager darcyGridManager; darcyGridManager.init("Darcy"); // pass parameter group - using StokesGridManager = Dumux::GridManager<typename GET_PROP_TYPE(StokesTypeTag, Grid)>; + using StokesGridManager = Dumux::GridManager<GetPropType<StokesTypeTag, Properties::Grid>>; StokesGridManager stokesGridManager; stokesGridManager.init("Stokes"); // pass parameter group @@ -135,10 +139,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = typename GET_PROP_TYPE(StokesTypeTag, FVGridGeometry); + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = typename GET_PROP_TYPE(DarcyTypeTag, FVGridGeometry); + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); @@ -154,13 +158,13 @@ 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<StokesTypeTag, Properties::Problem>; auto stokesProblem = std::make_shared<StokesProblem>(stokesFvGridGeometry, couplingManager); - using DarcyProblem = typename GET_PROP_TYPE(DarcyTypeTag, Problem); + using DarcyProblem = GetPropType<DarcyTypeTag, Properties::Problem>; auto darcyProblem = std::make_shared<DarcyProblem>(darcyFvGridGeometry, couplingManager); // initialize the fluidsystem (tabulation) - GET_PROP_TYPE(StokesTypeTag, FluidSystem)::init(/*tempMin=*/273.15, + GetPropType<StokesTypeTag, Properties::FluidSystem>::init(/*tempMin=*/273.15, /*tempMax=*/320, /*numTemp=*/100, /*pMin=*/1e4, @@ -177,7 +181,7 @@ int main(int argc, char** argv) try const auto& faceSol = sol[stokesFaceIdx]; // apply initial solution for instationary problems - typename GET_PROP_TYPE(StokesTypeTag, SolutionVector) stokesSol; + GetPropType<StokesTypeTag, Properties::SolutionVector> stokesSol; std::get<0>(stokesSol) = cellCenterSol; std::get<1>(stokesSol) = faceSol; stokesProblem->applyInitialSolution(stokesSol); @@ -193,28 +197,28 @@ 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<StokesTypeTag, Properties::GridVariables>; auto stokesGridVariables = std::make_shared<StokesGridVariables>(stokesProblem, stokesFvGridGeometry); stokesGridVariables->init(stokesSol, solStokesOld); - using DarcyGridVariables = typename GET_PROP_TYPE(DarcyTypeTag, GridVariables); + using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>; auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry); darcyGridVariables->init(sol[darcyIdx], solDarcyOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(StokesTypeTag, Scalar); + using Scalar = GetPropType<StokesTypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); - GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); + StaggeredVtkOutputModule<StokesGridVariables, GetPropType<StokesTypeTag, Properties::SolutionVector>> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name()); + GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); - VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); - using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); + VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name()); + using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>; darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); + GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh index 10985faab0601c2dc623cd6632943ef7b9f7a4dd..d67ada36888357b66d472524ce8c077d4910dc8e 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh @@ -40,29 +40,38 @@ class DarcySubProblem; namespace Properties { -NEW_TYPE_TAG(DarcyTwoP, INHERITS_FROM(CCTpfaModel, TwoP)); +// Create new type tags +namespace TTag { +struct DarcyTwoP { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(DarcyTwoP, Problem, Dumux::DarcySubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::DarcyTwoP> { using type = Dumux::DarcySubProblem<TypeTag>; }; // Set the grid type #if ENABLE_3D -SET_TYPE_PROP(DarcyTwoP, Grid, Dune::YaspGrid<3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyTwoP> { using type = Dune::YaspGrid<3>; }; #else -SET_TYPE_PROP(DarcyTwoP, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::DarcyTwoP> { using type = Dune::YaspGrid<2>; }; #endif -SET_BOOL_PROP(DarcyTwoP, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DarcyTwoP> { static constexpr bool value = false; }; -SET_PROP(DarcyTwoP, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DarcyTwoP> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = ConservationSpatialParams<FVGridGeometry, Scalar>; }; //! Set the default formulation to pw-Sn: This can be over written in the problem. -SET_PROP(DarcyTwoP, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::DarcyTwoP> { static constexpr auto value = TwoPFormulation::p1s0; }; } @@ -70,22 +79,22 @@ template <class TypeTag> class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // primary variable indices conti0EqIdx = Indices::conti0EqIdx, @@ -96,7 +105,7 @@ class DarcySubProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh index 8f17e5f1d660ba15188996d46c9b7efa22cfd676..b9cd43ef8d54b34a4ac7fdb0d5596c37d22b9427 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh @@ -37,17 +37,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<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(StokesOneP, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::StokesOneP> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(StokesOneP, Problem, Dumux::StokesSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::StokesOneP> { using type = Dumux::StokesSubProblem<TypeTag> ; }; -SET_BOOL_PROP(StokesOneP, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(StokesOneP, EnableGridVolumeVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; }; } @@ -62,28 +70,28 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag> { using ParentType = NavierStokesProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager) diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc index cf436d34401249df065e9129d64498e737942ad9..2e0b590a9ddb43e604177c52cfdc94dc8860f85b 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc @@ -53,22 +53,28 @@ namespace Dumux { namespace Properties { -SET_PROP(Soil, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::Soil> { - using Traits = MultiDomainTraits<TypeTag, TTAG(Root)>; + using Traits = MultiDomainTraits<TypeTag, Properties::TTag::Root>; using type = EmbeddedCouplingManager1d3d<Traits, EmbeddedCouplingMode::average>; }; -SET_PROP(Root, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::Root> { - using Traits = MultiDomainTraits<TTAG(Soil), TypeTag>; + using Traits = MultiDomainTraits<Properties::TTag::Soil, TypeTag>; using type = EmbeddedCouplingManager1d3d<Traits, EmbeddedCouplingMode::average>; }; -SET_TYPE_PROP(Soil, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<0>); -SET_TYPE_PROP(Root, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<1>); -SET_TYPE_PROP(Soil, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<0>); -SET_TYPE_PROP(Root, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<1>); +template<class TypeTag> +struct PointSource<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; }; +template<class TypeTag> +struct PointSource<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; }; } // end namespace Properties @@ -177,16 +183,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using BulkTypeTag = TTAG(Soil); - using LowDimTypeTag = TTAG(Root); + using BulkTypeTag = Properties::TTag::Soil; + using LowDimTypeTag = Properties::TTag::Root; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using BulkGridManager = Dumux::GridManager<typename GET_PROP_TYPE(BulkTypeTag, Grid)>; + using BulkGridManager = Dumux::GridManager<GetPropType<BulkTypeTag, Properties::Grid>>; BulkGridManager bulkGridManager; bulkGridManager.init("Soil"); // pass parameter group - using LowDimGridManager = Dumux::GridManager<typename GET_PROP_TYPE(LowDimTypeTag, Grid)>; + using LowDimGridManager = Dumux::GridManager<GetPropType<LowDimTypeTag, Properties::Grid>>; LowDimGridManager lowDimGridManager; lowDimGridManager.init("Root"); // pass parameter group @@ -199,10 +205,10 @@ int main(int argc, char** argv) try //////////////////////////////////////////////////////////// // create the finite volume grid geometry - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); bulkFvGridGeometry->update(); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using LowDimFVGridGeometry = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>; auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); lowDimFvGridGeometry->update(); @@ -212,19 +218,19 @@ int main(int argc, char** argv) try constexpr auto lowDimIdx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(BulkTypeTag, CouplingManager); + using CouplingManager = GetPropType<BulkTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(bulkFvGridGeometry, lowDimFvGridGeometry); // the bulk problem (initial and boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkTypeTag, Problem); + using BulkProblem = GetPropType<BulkTypeTag, Properties::Problem>; auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, couplingManager); // the low dim spatial parameters - using LowDimSpatialParams = typename GET_PROP_TYPE(LowDimTypeTag, SpatialParams); + using LowDimSpatialParams = GetPropType<LowDimTypeTag, Properties::SpatialParams>; auto lowDimSpatialParams = std::make_shared<LowDimSpatialParams>(lowDimFvGridGeometry, lowDimGridManager.getGridData()); // the low dim problem (initial and boundary conditions) - using LowDimProblem = typename GET_PROP_TYPE(LowDimTypeTag, Problem); + using LowDimProblem = GetPropType<LowDimTypeTag, Properties::Problem>; auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, lowDimSpatialParams, couplingManager); // locally refine levels deep around the embedded grid @@ -232,8 +238,8 @@ int main(int argc, char** argv) try for (int i = 0; i < levels; ++i) { auto& soilGrid = bulkGridManager.grid(); - using BulkGridView = typename GET_PROP_TYPE(BulkTypeTag, GridView); - using LowDimGridView = typename GET_PROP_TYPE(LowDimTypeTag, GridView); + using BulkGridView = GetPropType<BulkTypeTag, Properties::GridView>; + using LowDimGridView = GetPropType<LowDimTypeTag, Properties::GridView>; MixedDimensionGlue<BulkGridView, LowDimGridView> glue(bulkFvGridGeometry->boundingBoxTree(), lowDimFvGridGeometry->boundingBoxTree()); @@ -331,10 +337,10 @@ int main(int argc, char** argv) try lowDimProblem->computePointSourceMap(); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); bulkGridVariables->init(sol[bulkIdx], oldSol[bulkIdx]); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimTypeTag, GridVariables); + using LowDimGridVariables = GetPropType<LowDimTypeTag, Properties::GridVariables>; auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); @@ -350,12 +356,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); + GetPropType<BulkTypeTag, Properties::IOFields>::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + GetPropType<LowDimTypeTag, Properties::IOFields>::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh index 02273c5f6c068b4485a656fb87818e873c78184d..b387cc9ff39574ad5c8d1762ee92b4df037d7fe8 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh @@ -45,34 +45,51 @@ template <class TypeTag> class RootProblem; namespace Properties { -NEW_TYPE_TAG(Root, INHERITS_FROM(CCTpfaModel, OnePNC)); +// Create new type tags +namespace TTag { +struct Root { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Root, Grid, Dune::FoamGrid<1, 3>); - -SET_BOOL_PROP(Root, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Root, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Root, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Root, SolutionDependentAdvection, false); -SET_BOOL_PROP(Root, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Root, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Root> { using type = Dune::FoamGrid<1, 3>; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Root> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Root> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Root> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Root, Problem, RootProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Root> { using type = RootProblem<TypeTag>; }; // Set the fluid system -SET_PROP(Root, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Root> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>, Components::Constant<1, Scalar>>; }; // Set the spatial parameters -SET_TYPE_PROP(Root, SpatialParams, RootSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Root> +{ + using type = RootSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; -SET_BOOL_PROP(Root, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Root> { static constexpr bool value = true; }; } // end namespace Properties @@ -84,26 +101,26 @@ template <class TypeTag> class RootProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NeumannFluxes = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using SourceValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NeumannFluxes = GetPropType<TypeTag, Properties::NumEqVector>; + using SourceValues = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; using Element = typename GridView::template Codim<0>::Entity; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum Indices { // Grid and world dimension dim = GridView::dimension, diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh index c44c4115ffb3bd229c75610185b20ffa062e2549..d4feee50633cd34455d5f7c34bfa76f42c0a2a90 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh @@ -51,34 +51,51 @@ class SoilProblem; namespace Properties { -NEW_TYPE_TAG(Soil, INHERITS_FROM(CCTpfaModel, RichardsNC)); +// Create new type tags +namespace TTag { +struct Soil { using InheritsFrom = std::tuple<RichardsNC, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Soil, Grid, Dune::UGGrid<3>); - -SET_BOOL_PROP(Soil, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Soil, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Soil, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Soil, SolutionDependentAdvection, false); -SET_BOOL_PROP(Soil, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Soil, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Soil> { using type = Dune::UGGrid<3>; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Soil> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Soil> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Soil> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Soil, Problem, SoilProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Soil> { using type = SoilProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Soil, SpatialParams, SoilSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Soil> +{ + using type = SoilSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; // Set the fluid system -SET_PROP(Soil, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Soil> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>, Components::Constant<1, Scalar>>; }; -SET_BOOL_PROP(Soil, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Soil> { static constexpr bool value = true; }; } // end namespace Properties @@ -90,24 +107,24 @@ template <class TypeTag> class SoilProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using GridView = typename FVGridGeometry::GridView; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; using Element = typename GridView::template Codim<0>::Entity; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum Indices { // world dimension dim = GridView::dimension, @@ -133,7 +150,7 @@ public: // for initial conditions const Scalar sw = getParam<Scalar>("Problem.InitTopSaturation", 0.3); // start with 30% saturation on top - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, SpatialParams)::MaterialLaw; + using MaterialLaw = typename GetPropType<TypeTag, Properties::SpatialParams>::MaterialLaw; pcTop_ = MaterialLaw::pc(this->spatialParams().materialLawParamsAtPos(fvGridGeometry->bBoxMax()), sw); } diff --git a/test/multidomain/embedded/1d3d/1p_1p/main.cc b/test/multidomain/embedded/1d3d/1p_1p/main.cc index 58f0e09f9d85b3abbc6d9412c4b296e6525b786b..dba0062795d594b7c5365de01e8af81076638d6d 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/main.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/main.cc @@ -68,13 +68,19 @@ namespace Properties { template<class Traits> using TheCouplingManager = EmbeddedCouplingManager1d3d<Traits, COUPLINGMODE>; -SET_TYPE_PROP(BULKTYPETAG, CouplingManager, TheCouplingManager<MultiDomainTraits<TypeTag, TTAG(LOWDIMTYPETAG)>>); -SET_TYPE_PROP(BULKTYPETAG, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<0>); -SET_TYPE_PROP(BULKTYPETAG, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<0>); - -SET_TYPE_PROP(LOWDIMTYPETAG, CouplingManager, TheCouplingManager<MultiDomainTraits<TTAG(BULKTYPETAG), TypeTag>>); -SET_TYPE_PROP(LOWDIMTYPETAG, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<1>); -SET_TYPE_PROP(LOWDIMTYPETAG, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<1>); +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::BULKTYPETAG> { using type = TheCouplingManager<MultiDomainTraits<TypeTag, Properties::TTag::LOWDIMTYPETAG>>; }; +template<class TypeTag> +struct PointSource<TypeTag, TTag::BULKTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::BULKTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; }; + +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::LOWDIMTYPETAG> { using type = TheCouplingManager<MultiDomainTraits<Properties::TTag::BULKTYPETAG, TypeTag>>; }; +template<class TypeTag> +struct PointSource<TypeTag, TTag::LOWDIMTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::LOWDIMTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; }; } // end namespace Properties } // end namespace Dumux @@ -94,16 +100,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using BulkTypeTag = TTAG(BULKTYPETAG); - using LowDimTypeTag = TTAG(LOWDIMTYPETAG); + using BulkTypeTag = Properties::TTag::BULKTYPETAG; + using LowDimTypeTag = Properties::TTag::LOWDIMTYPETAG; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using BulkGridManager = Dumux::GridManager<typename GET_PROP_TYPE(BulkTypeTag, Grid)>; + using BulkGridManager = Dumux::GridManager<GetPropType<BulkTypeTag, Properties::Grid>>; BulkGridManager bulkGridManager; bulkGridManager.init("Tissue"); // pass parameter group - using LowDimGridManager = Dumux::GridManager<typename GET_PROP_TYPE(LowDimTypeTag, Grid)>; + using LowDimGridManager = Dumux::GridManager<GetPropType<LowDimTypeTag, Properties::Grid>>; LowDimGridManager lowDimGridManager; lowDimGridManager.init("Vessel"); // pass parameter group @@ -116,10 +122,10 @@ int main(int argc, char** argv) try const auto& lowDimGridView = lowDimGridManager.grid().leafGridView(); // create the finite volume grid geometry - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); bulkFvGridGeometry->update(); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using LowDimFVGridGeometry = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>; auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); lowDimFvGridGeometry->update(); @@ -129,13 +135,13 @@ int main(int argc, char** argv) try constexpr auto lowDimIdx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(BulkTypeTag, CouplingManager); + using CouplingManager = GetPropType<BulkTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(bulkFvGridGeometry, lowDimFvGridGeometry); // the problem (initial and boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkTypeTag, Problem); + using BulkProblem = GetPropType<BulkTypeTag, Properties::Problem>; auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, couplingManager); - using LowDimProblem = typename GET_PROP_TYPE(LowDimTypeTag, Problem); + using LowDimProblem = GetPropType<LowDimTypeTag, Properties::Problem>; auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, couplingManager); // the solution vector @@ -151,23 +157,23 @@ int main(int argc, char** argv) try lowDimProblem->computePointSourceMap(); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); bulkGridVariables->init(sol[bulkIdx], oldSol[bulkIdx]); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimTypeTag, GridVariables); + using LowDimGridVariables = GetPropType<LowDimTypeTag, Properties::GridVariables>; auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); + GetPropType<BulkTypeTag, Properties::IOFields>::initOutputModule(bulkVtkWriter); bulkProblem->addVtkOutputFields(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + GetPropType<LowDimTypeTag, Properties::IOFields>::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh b/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh index 4a97e6b5528b11d0b1d61a611e0c955de5d5da1c..fca4b0bee3ce693e7584970f94fb32a56fe9c08b 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh +++ b/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh @@ -47,37 +47,53 @@ template <class TypeTag> class BloodFlowProblem; namespace Properties { -NEW_TYPE_TAG(BloodFlow, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(BloodFlowCC, INHERITS_FROM(CCTpfaModel, BloodFlow)); -NEW_TYPE_TAG(BloodFlowBox, INHERITS_FROM(BoxModel, BloodFlow)); +// Create new type tags +namespace TTag { +struct BloodFlow { using InheritsFrom = std::tuple<OneP>; }; +struct BloodFlowCC { using InheritsFrom = std::tuple<BloodFlow, CCTpfaModel>; }; +struct BloodFlowBox { using InheritsFrom = std::tuple<BloodFlow, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(BloodFlow, Grid, Dune::FoamGrid<1, 3>); - -SET_BOOL_PROP(BloodFlow, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(BloodFlow, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(BloodFlow, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(BloodFlow, SolutionDependentAdvection, false); -SET_BOOL_PROP(BloodFlow, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(BloodFlow, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::BloodFlow> { using type = Dune::FoamGrid<1, 3>; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(BloodFlow, Problem, BloodFlowProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::BloodFlow> { using type = BloodFlowProblem<TypeTag>; }; // the fluid system -SET_PROP(BloodFlow, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::BloodFlow> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the problem property -SET_TYPE_PROP(BloodFlow, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::BloodFlow> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(BloodFlow, SpatialParams, - BloodFlowSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::BloodFlow> +{ + using type = BloodFlowSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties /*! @@ -88,20 +104,20 @@ template <class TypeTag> class BloodFlowProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: BloodFlowProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh b/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh index 82c4739470d13c94337b4c27d17c35916a2a459d..5f490de02f2aed8652a994023534715fe50df047 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh +++ b/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh @@ -53,37 +53,53 @@ class TissueProblem; namespace Properties { -NEW_TYPE_TAG(Tissue, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(TissueCC, INHERITS_FROM(CCTpfaModel, Tissue)); -NEW_TYPE_TAG(TissueBox, INHERITS_FROM(BoxModel, Tissue)); +// Create new type tags +namespace TTag { +struct Tissue { using InheritsFrom = std::tuple<OneP>; }; +struct TissueCC { using InheritsFrom = std::tuple<Tissue, CCTpfaModel>; }; +struct TissueBox { using InheritsFrom = std::tuple<Tissue, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Tissue, Grid, Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 3> >); - -SET_BOOL_PROP(Tissue, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Tissue, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Tissue, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Tissue, SolutionDependentAdvection, false); -SET_BOOL_PROP(Tissue, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Tissue, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Tissue> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 3> >; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Tissue> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Tissue> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Tissue> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Tissue> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Tissue> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Tissue> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Tissue, Problem, TissueProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Tissue> { using type = TissueProblem<TypeTag>; }; // Set the problem property -SET_TYPE_PROP(Tissue, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Tissue> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // the fluid system -SET_PROP(Tissue, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Tissue> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the spatial parameters -SET_TYPE_PROP(Tissue, SpatialParams, - TissueSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Tissue> +{ + using type = TissueSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties @@ -94,22 +110,22 @@ template <class TypeTag> class TissueProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using GridView = typename FVGridGeometry::GridView; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: TissueProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/embedded/1d3d/1p_richards/main.cc b/test/multidomain/embedded/1d3d/1p_richards/main.cc index 4bc32344dabd967921ee545252174b5ebabf1ff8..b2da622a14ce2118c7f6a87b331483c4470b6e57 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/main.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/main.cc @@ -52,22 +52,28 @@ namespace Dumux { namespace Properties { -SET_PROP(SOILTYPETAG, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::SOILTYPETAG> { - using Traits = MultiDomainTraits<TypeTag, TTAG(Root)>; + using Traits = MultiDomainTraits<TypeTag, Properties::TTag::Root>; using type = EmbeddedCouplingManager1d3d<Traits, EmbeddedCouplingMode::average>; }; -SET_PROP(Root, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::Root> { - using Traits = MultiDomainTraits<TTAG(SOILTYPETAG), TypeTag>; + using Traits = MultiDomainTraits<Properties::TTag::SOILTYPETAG, TypeTag>; using type = EmbeddedCouplingManager1d3d<Traits, EmbeddedCouplingMode::average>; }; -SET_TYPE_PROP(SOILTYPETAG, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<0>); -SET_TYPE_PROP(Root, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<1>); -SET_TYPE_PROP(SOILTYPETAG, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<0>); -SET_TYPE_PROP(Root, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<1>); +template<class TypeTag> +struct PointSource<TypeTag, TTag::SOILTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; }; +template<class TypeTag> +struct PointSource<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::SOILTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; }; } // end namespace Properties } // end namespace Dumux @@ -87,16 +93,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using BulkTypeTag = TTAG(SOILTYPETAG); - using LowDimTypeTag = TTAG(Root); + using BulkTypeTag = Properties::TTag::SOILTYPETAG; + using LowDimTypeTag = Properties::TTag::Root; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using BulkGridManager = Dumux::GridManager<typename GET_PROP_TYPE(BulkTypeTag, Grid)>; + using BulkGridManager = Dumux::GridManager<GetPropType<BulkTypeTag, Properties::Grid>>; BulkGridManager bulkGridManager; bulkGridManager.init("Soil"); // pass parameter group - using LowDimGridManager = Dumux::GridManager<typename GET_PROP_TYPE(LowDimTypeTag, Grid)>; + using LowDimGridManager = Dumux::GridManager<GetPropType<LowDimTypeTag, Properties::Grid>>; LowDimGridManager lowDimGridManager; lowDimGridManager.init("Root"); // pass parameter group @@ -109,10 +115,10 @@ int main(int argc, char** argv) try const auto& lowDimGridView = lowDimGridManager.grid().leafGridView(); // create the finite volume grid geometry - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); bulkFvGridGeometry->update(); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using LowDimFVGridGeometry = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>; auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); lowDimFvGridGeometry->update(); @@ -122,19 +128,19 @@ int main(int argc, char** argv) try constexpr auto lowDimIdx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(BulkTypeTag, CouplingManager); + using CouplingManager = GetPropType<BulkTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(bulkFvGridGeometry, lowDimFvGridGeometry); // the problem (initial and boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkTypeTag, Problem); + using BulkProblem = GetPropType<BulkTypeTag, Properties::Problem>; auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, couplingManager); // the low dim spatial parameters - using LowDimSpatialParams = typename GET_PROP_TYPE(LowDimTypeTag, SpatialParams); + using LowDimSpatialParams = GetPropType<LowDimTypeTag, Properties::SpatialParams>; auto lowDimSpatialParams = std::make_shared<LowDimSpatialParams>(lowDimFvGridGeometry, lowDimGridManager.getGridData()); // the low dim problem (initial and boundary conditions) - using LowDimProblem = typename GET_PROP_TYPE(LowDimTypeTag, Problem); + using LowDimProblem = GetPropType<LowDimTypeTag, Properties::Problem>; auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, lowDimSpatialParams, couplingManager); // the solution vector @@ -150,10 +156,10 @@ int main(int argc, char** argv) try lowDimProblem->computePointSourceMap(); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); bulkGridVariables->init(sol[bulkIdx], oldSol[bulkIdx]); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimTypeTag, GridVariables); + using LowDimGridVariables = GetPropType<LowDimTypeTag, Properties::GridVariables>; auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); @@ -167,12 +173,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); + GetPropType<BulkTypeTag, Properties::IOFields>::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + GetPropType<LowDimTypeTag, Properties::IOFields>::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh b/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh index 9bcbf36b479334088576abcdc661d037416f645a..47f394d177ccb19aead6fee669ffef08acb74610 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh +++ b/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh @@ -46,35 +46,51 @@ template <class TypeTag> class RootProblem; namespace Properties { -NEW_TYPE_TAG(Root, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct Root { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Root, Grid, Dune::FoamGrid<1, 3>); - -SET_BOOL_PROP(Root, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Root, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Root, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Root, SolutionDependentAdvection, false); -SET_BOOL_PROP(Root, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Root, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Root> { using type = Dune::FoamGrid<1, 3>; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Root> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Root> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Root> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Root, Problem, RootProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Root> { using type = RootProblem<TypeTag>; }; // the fluid system -SET_PROP(Root, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Root> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Set the problem property -SET_TYPE_PROP(Root, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Root> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Root, SpatialParams, RootSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); - +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Root> +{ + using type = RootSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties /*! @@ -85,22 +101,22 @@ template <class TypeTag> class RootProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NeumannFluxes = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NeumannFluxes = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using Element = typename GridView::template Codim<0>::Entity; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: diff --git a/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh b/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh index 477c62f6d1becafa79a409179e3df17be540eff9..790ebb413c5729179ea1dc4ba5c0ffa1cdd40c46 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh +++ b/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh @@ -47,27 +47,41 @@ class SoilProblem; namespace Properties { -NEW_TYPE_TAG(Soil, INHERITS_FROM(Richards)); -NEW_TYPE_TAG(SoilCC, INHERITS_FROM(CCTpfaModel, Soil)); -NEW_TYPE_TAG(SoilBox, INHERITS_FROM(BoxModel, Soil)); +// Create new type tags +namespace TTag { +struct Soil { using InheritsFrom = std::tuple<Richards>; }; +struct SoilCC { using InheritsFrom = std::tuple<Soil, CCTpfaModel>; }; +struct SoilBox { using InheritsFrom = std::tuple<Soil, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Soil, Grid, Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 3> >); - -SET_BOOL_PROP(Soil, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Soil, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Soil, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Soil, SolutionDependentAdvection, false); -SET_BOOL_PROP(Soil, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Soil, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Soil> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 3> >; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Soil> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Soil> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Soil> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Soil, Problem, SoilProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Soil> { using type = SoilProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Soil, SpatialParams, SoilSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); - +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Soil> +{ + using type = SoilSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties @@ -78,20 +92,20 @@ template <class TypeTag> class SoilProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; using GlobalPosition = typename FVGridGeometry::GlobalCoordinate; using Element = typename GridView::template Codim<0>::Entity; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: SoilProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/embedded/2d3d/1p_1p/main.cc b/test/multidomain/embedded/2d3d/1p_1p/main.cc index 06ec41bf465c69c5c61d6b591c54d6baff0edefc..a4aa82123ca74639d0221b94a80afc570431e2a3 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/main.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/main.cc @@ -54,22 +54,28 @@ namespace Dumux { namespace Properties { -SET_PROP(Matrix, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::Matrix> { - using Traits = MultiDomainTraits<TypeTag, TTAG(Fracture)>; + using Traits = MultiDomainTraits<TypeTag, Properties::TTag::Fracture>; using type = EmbeddedCouplingManager2d3d<Traits>; }; -SET_PROP(Fracture, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::Fracture> { - using Traits = MultiDomainTraits<TTAG(Matrix), TypeTag>; + using Traits = MultiDomainTraits<Properties::TTag::Matrix, TypeTag>; using type = EmbeddedCouplingManager2d3d<Traits>; }; -SET_TYPE_PROP(Matrix, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<0>); -SET_TYPE_PROP(Fracture, PointSource, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSource<1>); -SET_TYPE_PROP(Matrix, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<0>); -SET_TYPE_PROP(Fracture, PointSourceHelper, typename GET_PROP_TYPE(TypeTag, CouplingManager)::PointSourceTraits::template PointSourceHelper<1>); +template<class TypeTag> +struct PointSource<TypeTag, TTag::Matrix> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; }; +template<class TypeTag> +struct PointSource<TypeTag, TTag::Fracture> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::Matrix> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; }; +template<class TypeTag> +struct PointSourceHelper<TypeTag, TTag::Fracture> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; }; } // end namespace Properties @@ -142,16 +148,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using BulkTypeTag = TTAG(Matrix); - using LowDimTypeTag = TTAG(Fracture); + using BulkTypeTag = Properties::TTag::Matrix; + using LowDimTypeTag = Properties::TTag::Fracture; // try to create a grid (from the given grid file or the input file) // for both sub-domains - using BulkGridManager = Dumux::GridManager<typename GET_PROP_TYPE(BulkTypeTag, Grid)>; + using BulkGridManager = Dumux::GridManager<GetPropType<BulkTypeTag, Properties::Grid>>; BulkGridManager bulkGridManager; bulkGridManager.init("Matrix"); // pass parameter group - using LowDimGridManager = Dumux::GridManager<typename GET_PROP_TYPE(LowDimTypeTag, Grid)>; + using LowDimGridManager = Dumux::GridManager<GetPropType<LowDimTypeTag, Properties::Grid>>; LowDimGridManager lowDimGridManager; lowDimGridManager.init("Fracture"); // pass parameter group @@ -164,10 +170,10 @@ int main(int argc, char** argv) try const auto& lowDimGridView = lowDimGridManager.grid().leafGridView(); // create the finite volume grid geometry - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); bulkFvGridGeometry->update(); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using LowDimFVGridGeometry = GetPropType<LowDimTypeTag, Properties::FVGridGeometry>; auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); lowDimFvGridGeometry->update(); @@ -177,14 +183,14 @@ int main(int argc, char** argv) try constexpr auto lowDimIdx = Traits::template DomainIdx<1>(); // the coupling manager - using CouplingManager = typename GET_PROP_TYPE(BulkTypeTag, CouplingManager); + using CouplingManager = GetPropType<BulkTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(bulkFvGridGeometry, lowDimFvGridGeometry); // the problem (initial and boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkTypeTag, Problem); + using BulkProblem = GetPropType<BulkTypeTag, Properties::Problem>; auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Matrix"); auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Matrix"); - using LowDimProblem = typename GET_PROP_TYPE(LowDimTypeTag, Problem); + using LowDimProblem = GetPropType<LowDimTypeTag, Properties::Problem>; auto lowDimSpatialParams = std::make_shared<typename LowDimProblem::SpatialParams>(lowDimFvGridGeometry, "Fracture"); auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, lowDimSpatialParams, couplingManager, "Fracture"); @@ -201,22 +207,22 @@ int main(int argc, char** argv) try lowDimProblem->computePointSourceMap(); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); bulkGridVariables->init(sol[bulkIdx], oldSol[bulkIdx]); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimTypeTag, GridVariables); + using LowDimGridVariables = GetPropType<LowDimTypeTag, Properties::GridVariables>; auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); lowDimGridVariables->init(sol[lowDimIdx], oldSol[lowDimIdx]); // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); + GetPropType<BulkTypeTag, Properties::IOFields>::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + GetPropType<LowDimTypeTag, Properties::IOFields>::initOutputModule(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh b/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh index 7d659c20fe3492709a96b7997448dae262df2c23..6dc8a051bc6e5555a957b29f41d6bf5391659e11 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh +++ b/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh @@ -45,35 +45,51 @@ template <class TypeTag> class FractureProblem; namespace Properties { -NEW_TYPE_TAG(Fracture, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct Fracture { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Fracture, Grid, Dune::FoamGrid<2, 3>); - -SET_BOOL_PROP(Fracture, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Fracture, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Fracture, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Fracture, SolutionDependentAdvection, false); -SET_BOOL_PROP(Fracture, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Fracture, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Fracture> { using type = Dune::FoamGrid<2, 3>; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Fracture> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Fracture> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Fracture> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Fracture, Problem, FractureProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Fracture> { using type = FractureProblem<TypeTag>; }; // the fluid system -SET_PROP(Fracture, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Fracture> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the problem property -SET_TYPE_PROP(Fracture, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Fracture> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Fracture, SpatialParams, MatrixFractureSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); - +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Fracture> +{ + using type = MatrixFractureSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties /*! @@ -84,22 +100,22 @@ template <class TypeTag> class FractureProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: FractureProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh b/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh index 56bec44a92cc7b2f2be36239048e5706ea451fd9..52098e2509ed2aafc8bb4eff8d4d41d2b83a0d64 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh +++ b/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh @@ -50,34 +50,51 @@ class MatrixProblem; namespace Properties { -NEW_TYPE_TAG(Matrix, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct Matrix { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Matrix, Grid, Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 3> >); - -SET_BOOL_PROP(Matrix, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Matrix, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Matrix, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(Matrix, SolutionDependentAdvection, false); -SET_BOOL_PROP(Matrix, SolutionDependentMolecularDiffusion, false); -SET_BOOL_PROP(Matrix, SolutionDependentHeatConduction, false); +template<class TypeTag> +struct Grid<TypeTag, TTag::Matrix> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 3> >; }; + +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Matrix> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Matrix> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Matrix> { static constexpr bool value = true; }; +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Matrix> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Matrix> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentHeatConduction<TypeTag, TTag::Matrix> { static constexpr bool value = false; }; // Set the problem property -SET_TYPE_PROP(Matrix, Problem, MatrixProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Matrix> { using type = MatrixProblem<TypeTag>; }; // Set the problem property -SET_TYPE_PROP(Matrix, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::Matrix> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // the fluid system -SET_PROP(Matrix, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Matrix> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; // Set the spatial parameters -SET_TYPE_PROP(Matrix, SpatialParams, MatrixFractureSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Matrix> +{ + using type = MatrixFractureSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Properties @@ -88,18 +105,18 @@ template <class TypeTag> class MatrixProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // world dimension @@ -110,7 +127,7 @@ class MatrixProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: MatrixProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index 37700776e4eaf3157d4e6076234453e416c6e9a6..16afe1e2f5779e5a1a6ad6892fa2f95e2383d387 100644 --- a/test/multidomain/facet/1p_1p/analytical/main.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -57,8 +57,8 @@ template< class BulkTypeTag, class LowDimTypeTag > class TestTraits { - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using BulkFVGridGeometry = Dumux::GetPropType<BulkTypeTag, Dumux::Properties::FVGridGeometry>; + using LowDimFVGridGeometry = Dumux::GetPropType<LowDimTypeTag, Dumux::Properties::FVGridGeometry>; public: using MDTraits = Dumux::MultiDomainTraits<BulkTypeTag, LowDimTypeTag>; using CouplingMapper = Dumux::FacetCouplingMapper<BulkFVGridGeometry, LowDimFVGridGeometry>; @@ -70,14 +70,18 @@ namespace Dumux { namespace Properties { // set cm property for the box test -using BoxTraits = TestTraits<TTAG(OnePBulkBox), TTAG(OnePLowDimBox)>; -SET_TYPE_PROP(OnePBulkBox, CouplingManager, typename BoxTraits::CouplingManager); -SET_TYPE_PROP(OnePLowDimBox, CouplingManager, typename BoxTraits::CouplingManager); +using BoxTraits = TestTraits<Properties::TTag::OnePBulkBox, Properties::TTag::OnePLowDimBox>; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePBulkBox> { using type = typename BoxTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePLowDimBox> { using type = typename BoxTraits::CouplingManager; }; // set cm property for the tpfa test -using TpfaTraits = TestTraits<TTAG(OnePBulkTpfa), TTAG(OnePLowDimTpfa)>; -SET_TYPE_PROP(OnePBulkTpfa, CouplingManager, typename TpfaTraits::CouplingManager); -SET_TYPE_PROP(OnePLowDimTpfa, CouplingManager, typename TpfaTraits::CouplingManager); +using TpfaTraits = TestTraits<Properties::TTag::OnePBulkTpfa, Properties::TTag::OnePLowDimTpfa>; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePBulkTpfa> { using type = typename TpfaTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePLowDimTpfa> { using type = typename TpfaTraits::CouplingManager; }; } // end namespace Properties } // end namespace Dumux @@ -198,10 +202,10 @@ int main(int argc, char** argv) try ////////////////////////////////////////////////////// // try to create the grids (from the given grid file) ////////////////////////////////////////////////////// - using BulkProblemTypeTag = TTAG(BULKTYPETAG); - using LowDimProblemTypeTag = TTAG(LOWDIMTYPETAG); - using BulkGrid = typename GET_PROP_TYPE(BulkProblemTypeTag, Grid); - using LowDimGrid = typename GET_PROP_TYPE(LowDimProblemTypeTag, Grid); + using BulkProblemTypeTag = Properties::TTag::BULKTYPETAG; + using LowDimProblemTypeTag = Properties::TTag::LOWDIMTYPETAG; + using BulkGrid = GetPropType<BulkProblemTypeTag, Properties::Grid>; + using LowDimGrid = GetPropType<LowDimProblemTypeTag, Properties::Grid>; using GridManager = FacetCouplingGridManager<BulkGrid, LowDimGrid>; GridManager gridManager; @@ -217,8 +221,8 @@ int main(int argc, char** argv) try const auto& lowDimGridView = gridManager.template grid<1>().leafGridView(); // create the finite volume grid geometries - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkProblemTypeTag, FVGridGeometry); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimProblemTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkProblemTypeTag, Properties::FVGridGeometry>; + using LowDimFVGridGeometry = GetPropType<LowDimProblemTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView); @@ -230,8 +234,8 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // the problems (boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkProblemTypeTag, Problem); - using LowDimProblem = typename GET_PROP_TYPE(LowDimProblemTypeTag, Problem); + using BulkProblem = GetPropType<BulkProblemTypeTag, Properties::Problem>; + using LowDimProblem = GetPropType<LowDimProblemTypeTag, Properties::Problem>; auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Bulk"); auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Bulk"); auto lowDimSpatialParams = std::make_shared<typename LowDimProblem::SpatialParams>(lowDimFvGridGeometry, "LowDim"); @@ -257,8 +261,8 @@ int main(int argc, char** argv) try couplingManager->init(bulkProblem, lowDimProblem, couplingMapper, x); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkProblemTypeTag, GridVariables); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimProblemTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkProblemTypeTag, Properties::GridVariables>; + using LowDimGridVariables = GetPropType<LowDimProblemTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); bulkGridVariables->init(x[bulkId]); @@ -272,15 +276,15 @@ int main(int argc, char** argv) try VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim"); // container for the output of the exact solutions - std::vector<typename GET_PROP_TYPE(BulkProblemTypeTag, Scalar)> bulkExact; - std::vector<typename GET_PROP_TYPE(LowDimProblemTypeTag, Scalar)> lowDimExact; + std::vector<GetPropType<BulkProblemTypeTag, Properties::Scalar>> bulkExact; + std::vector<GetPropType<LowDimProblemTypeTag, Properties::Scalar>> lowDimExact; // Add model specific output fields const bool writeVTK = getParam<bool>("Output.EnableVTK"); if (writeVTK) { - using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); - using LowDimIOFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, IOFields); + using BulkIOFields = GetPropType<BulkProblemTypeTag, Properties::IOFields>; + using LowDimIOFields = GetPropType<LowDimProblemTypeTag, Properties::IOFields>; BulkIOFields::initOutputModule(bulkVtkWriter); LowDimIOFields::initOutputModule(lowDimVtkWriter); diff --git a/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh index acf78c3f276736812cf7efc68879e397affcb154..03f359664387bb1eb890fc36af1af6b6ef1c9c00 100644 --- a/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh @@ -44,23 +44,33 @@ template<class TypeTag> class OnePBulkProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePBulk, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePBulkTpfa, INHERITS_FROM(OnePBulk, CCTpfaFacetCouplingModel)); -NEW_TYPE_TAG(OnePBulkBox, INHERITS_FROM(OnePBulk, BoxFacetCouplingModel)); +// Create new type tags +namespace TTag { +struct OnePBulk { using InheritsFrom = std::tuple<OneP>; }; +struct OnePBulkTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePBulk>; }; +struct OnePBulkBox { using InheritsFrom = std::tuple<BoxFacetCouplingModel, OnePBulk>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePBulk, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePBulk> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; // Set the problem type -SET_TYPE_PROP(OnePBulk, Problem, OnePBulkProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePBulk> { using type = OnePBulkProblem<TypeTag>; }; // set the spatial params -SET_TYPE_PROP(OnePBulk, SpatialParams, OnePSpatialParams< typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePBulk> +{ + using type = OnePSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar> >; +}; // the fluid system -SET_PROP(OnePBulk, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePBulk> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::Constant<1, Scalar> >; }; @@ -76,7 +86,7 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -88,9 +98,9 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh index a2994affb00f4331141fae21126fcb970b5acecf..9a7c8549d3e4f8852fd942b48b79b98e96ebac15 100644 --- a/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh @@ -44,23 +44,33 @@ template<class TypeTag> class OnePLowDimProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePLowDim, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePLowDimTpfa, INHERITS_FROM(CCTpfaModel, OnePLowDim)); -NEW_TYPE_TAG(OnePLowDimBox, INHERITS_FROM(BoxModel, OnePLowDim)); +// Create new type tags +namespace TTag { +struct OnePLowDim { using InheritsFrom = std::tuple<OneP>; }; +struct OnePLowDimTpfa { using InheritsFrom = std::tuple<OnePLowDim, CCTpfaModel>; }; +struct OnePLowDimBox { using InheritsFrom = std::tuple<OnePLowDim, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePLowDim, Grid, Dune::FoamGrid<1, 2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePLowDim> { using type = Dune::FoamGrid<1, 2>; }; // Set the problem type -SET_TYPE_PROP(OnePLowDim, Problem, OnePLowDimProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePLowDim> { using type = OnePLowDimProblem<TypeTag>; }; // set the spatial params -SET_TYPE_PROP(OnePLowDim, SpatialParams, OnePSpatialParams< typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePLowDim> +{ + using type = OnePSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar> >; +}; // the fluid system -SET_PROP(OnePLowDim, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePLowDim> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::Constant<1, Scalar> >; }; @@ -76,7 +86,7 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -88,9 +98,9 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; public: OnePLowDimProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/facet/1p_1p/threedomain/main.cc b/test/multidomain/facet/1p_1p/threedomain/main.cc index c15870ea83ad824bd73946a14b5c70d52ca0cc9a..b13c76e0ecac785a2d8f32a9a78a21df69664706 100644 --- a/test/multidomain/facet/1p_1p/threedomain/main.cc +++ b/test/multidomain/facet/1p_1p/threedomain/main.cc @@ -52,11 +52,11 @@ // obtain/define some types to be used below in the property definitions and in main class TestTraits { - using BulkFVG = typename GET_PROP_TYPE(TTAG(OnePBulkTpfa), FVGridGeometry); - using FacetFVG = typename GET_PROP_TYPE(TTAG(OnePFacetTpfa), FVGridGeometry); - using EdgeFVG = typename GET_PROP_TYPE(TTAG(OnePEdgeTpfa), FVGridGeometry); + using BulkFVG = Dumux::GetPropType<Dumux::Properties::TTag::OnePBulkTpfa, Dumux::Properties::FVGridGeometry>; + using FacetFVG = Dumux::GetPropType<Dumux::Properties::TTag::OnePFacetTpfa, Dumux::Properties::FVGridGeometry>; + using EdgeFVG = Dumux::GetPropType<Dumux::Properties::TTag::OnePEdgeTpfa, Dumux::Properties::FVGridGeometry>; public: - using MDTraits = Dumux::MultiDomainTraits<TTAG(OnePBulkTpfa), TTAG(OnePFacetTpfa), TTAG(OnePEdgeTpfa)>; + using MDTraits = Dumux::MultiDomainTraits<Dumux::Properties::TTag::OnePBulkTpfa, Dumux::Properties::TTag::OnePFacetTpfa, Dumux::Properties::TTag::OnePEdgeTpfa>; using CouplingMapper = Dumux::FacetCouplingThreeDomainMapper<BulkFVG, FacetFVG, EdgeFVG>; using CouplingManager = Dumux::FacetCouplingThreeDomainManager<MDTraits, CouplingMapper>; }; @@ -65,9 +65,12 @@ public: namespace Dumux { namespace Properties { -SET_TYPE_PROP(OnePBulkTpfa, CouplingManager, typename TestTraits::CouplingManager); -SET_TYPE_PROP(OnePFacetTpfa, CouplingManager, typename TestTraits::CouplingManager); -SET_TYPE_PROP(OnePEdgeTpfa, CouplingManager, typename TestTraits::CouplingManager); +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePBulkTpfa> { using type = typename TestTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePFacetTpfa> { using type = typename TestTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePEdgeTpfa> { using type = typename TestTraits::CouplingManager; }; } // end namespace Properties } // end namespace Dumux @@ -90,12 +93,12 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using BulkProblemTypeTag = TTAG(OnePBulkTpfa); - using FacetProblemTypeTag = TTAG(OnePFacetTpfa); - using EdgeProblemTypeTag = TTAG(OnePEdgeTpfa); - using BulkGrid = typename GET_PROP_TYPE(BulkProblemTypeTag, Grid); - using FacetGrid = typename GET_PROP_TYPE(FacetProblemTypeTag, Grid); - using EdgeGrid = typename GET_PROP_TYPE(EdgeProblemTypeTag, Grid); + using BulkProblemTypeTag = Properties::TTag::OnePBulkTpfa; + using FacetProblemTypeTag = Properties::TTag::OnePFacetTpfa; + using EdgeProblemTypeTag = Properties::TTag::OnePEdgeTpfa; + using BulkGrid = GetPropType<BulkProblemTypeTag, Properties::Grid>; + using FacetGrid = GetPropType<FacetProblemTypeTag, Properties::Grid>; + using EdgeGrid = GetPropType<EdgeProblemTypeTag, Properties::Grid>; using GridManager = FacetCouplingGridManager<BulkGrid, FacetGrid, EdgeGrid>; GridManager gridManager; @@ -112,9 +115,9 @@ int main(int argc, char** argv) try const auto& edgeGridView = gridManager.template grid<2>().leafGridView(); // create the finite volume grid geometries - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkProblemTypeTag, FVGridGeometry); - using FacetFVGridGeometry = typename GET_PROP_TYPE(FacetProblemTypeTag, FVGridGeometry); - using EdgeFVGridGeometry = typename GET_PROP_TYPE(EdgeProblemTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkProblemTypeTag, Properties::FVGridGeometry>; + using FacetFVGridGeometry = GetPropType<FacetProblemTypeTag, Properties::FVGridGeometry>; + using EdgeFVGridGeometry = GetPropType<EdgeProblemTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); auto facetFvGridGeometry = std::make_shared<FacetFVGridGeometry>(facetGridView); auto edgeFvGridGeometry = std::make_shared<EdgeFVGridGeometry>(edgeGridView); @@ -127,9 +130,9 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // the problems (boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkProblemTypeTag, Problem); - using FacetProblem = typename GET_PROP_TYPE(FacetProblemTypeTag, Problem); - using EdgeProblem = typename GET_PROP_TYPE(EdgeProblemTypeTag, Problem); + using BulkProblem = GetPropType<BulkProblemTypeTag, Properties::Problem>; + using FacetProblem = GetPropType<FacetProblemTypeTag, Properties::Problem>; + using EdgeProblem = GetPropType<EdgeProblemTypeTag, Properties::Problem>; auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Bulk"); auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Bulk"); auto facetSpatialParams = std::make_shared<typename FacetProblem::SpatialParams>(facetFvGridGeometry, "Facet"); @@ -161,9 +164,9 @@ int main(int argc, char** argv) try couplingManager->init(bulkProblem, facetProblem, edgeProblem, couplingMapper, x); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkProblemTypeTag, GridVariables); - using FacetGridVariables = typename GET_PROP_TYPE(FacetProblemTypeTag, GridVariables); - using EdgeGridVariables = typename GET_PROP_TYPE(EdgeProblemTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkProblemTypeTag, Properties::GridVariables>; + using FacetGridVariables = GetPropType<FacetProblemTypeTag, Properties::GridVariables>; + using EdgeGridVariables = GetPropType<EdgeProblemTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); auto facetGridVariables = std::make_shared<FacetGridVariables>(facetProblem, facetFvGridGeometry); auto edgeGridVariables = std::make_shared<EdgeGridVariables>(edgeProblem, edgeFvGridGeometry); @@ -182,9 +185,9 @@ int main(int argc, char** argv) try VtkOutputModule<EdgeGridVariables, EdgeSolutionVector> edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields - using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); - using FacetIOFields = typename GET_PROP_TYPE(FacetProblemTypeTag, IOFields); - using EdgeIOFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, IOFields); + using BulkIOFields = GetPropType<BulkProblemTypeTag, Properties::IOFields>; + using FacetIOFields = GetPropType<FacetProblemTypeTag, Properties::IOFields>; + using EdgeIOFields = GetPropType<EdgeProblemTypeTag, Properties::IOFields>; BulkIOFields::initOutputModule(bulkVtkWriter); FacetIOFields::initOutputModule(facetVtkWriter); EdgeIOFields::initOutputModule(edgeVtkWriter); diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh index 9b201894353dc7a59f15bdf075275b006e6056eb..f0d212dd5c0ec07ad573e4e484b4547c4a154618 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh @@ -42,26 +42,33 @@ template<class TypeTag> class OnePBulkProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePBulk, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePBulkTpfa, INHERITS_FROM(OnePBulk, CCTpfaFacetCouplingModel)); +// Create new type tags +namespace TTag { +struct OnePBulk { using InheritsFrom = std::tuple<OneP>; }; +struct OnePBulkTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePBulk>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePBulk, Grid, Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePBulk> { using type = Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming>; }; // Set the problem type -SET_TYPE_PROP(OnePBulk, Problem, OnePBulkProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePBulk> { using type = OnePBulkProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePBulk, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePBulk> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(OnePBulk, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePBulk> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::Constant<1, Scalar> >; }; @@ -78,8 +85,8 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -89,8 +96,8 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: //! The constructor diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh index d48f46f4ec98a16060d9268be2984ed32578096a..72a029d3f4695b55192d50d16a949e2ed1e13dcc 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh @@ -44,26 +44,33 @@ template<class TypeTag> class OnePEdgeProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePEdge, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePEdgeTpfa, INHERITS_FROM(CCTpfaModel, OnePEdge)); +// Create new type tags +namespace TTag { +struct OnePEdge { using InheritsFrom = std::tuple<OneP>; }; +struct OnePEdgeTpfa { using InheritsFrom = std::tuple<OnePEdge, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePEdge, Grid, Dune::FoamGrid<1, 3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePEdge> { using type = Dune::FoamGrid<1, 3>; }; // Set the problem type -SET_TYPE_PROP(OnePEdge, Problem, OnePEdgeProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePEdge> { using type = OnePEdgeProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePEdge, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePEdge> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(OnePEdge, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePEdge> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::Constant<1, Scalar> >; }; @@ -79,8 +86,8 @@ class OnePEdgeProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -93,8 +100,8 @@ class OnePEdgeProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: //! The constructor diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh index f56e7f63abd7ff2a10f9fbb3ead7779af6006836..d19beb1f9fe18f6be63a24760c71e0b77b5b53be 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh @@ -43,26 +43,33 @@ template<class TypeTag> class OnePFacetProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePFacet, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePFacetTpfa, INHERITS_FROM(OnePFacet, CCTpfaFacetCouplingModel)); +// Create new type tags +namespace TTag { +struct OnePFacet { using InheritsFrom = std::tuple<OneP>; }; +struct OnePFacetTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePFacet>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePFacet, Grid, Dune::FoamGrid<2, 3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePFacet> { using type = Dune::FoamGrid<2, 3>; }; // Set the problem type -SET_TYPE_PROP(OnePFacet, Problem, OnePFacetProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePFacet> { using type = OnePFacetProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePFacet, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePFacet> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(OnePFacet, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePFacet> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::Constant<1, Scalar> >; }; @@ -79,8 +86,8 @@ class OnePFacetProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -93,8 +100,8 @@ class OnePFacetProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; public: //! The constructor diff --git a/test/multidomain/facet/tracer_tracer/main.cc b/test/multidomain/facet/tracer_tracer/main.cc index 8cae074fd2cb3d3e1e5a879ba65dbf15a3b3cfb0..45fd9a9cb318c2805848f52003ed6484b77d20a4 100644 --- a/test/multidomain/facet/tracer_tracer/main.cc +++ b/test/multidomain/facet/tracer_tracer/main.cc @@ -60,8 +60,8 @@ template< class BulkTypeTag, class LowDimTypeTag > class TestTraits { - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkTypeTag, FVGridGeometry); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimTypeTag, FVGridGeometry); + using BulkFVGridGeometry = Dumux::GetPropType<BulkTypeTag, Dumux::Properties::FVGridGeometry>; + using LowDimFVGridGeometry = Dumux::GetPropType<LowDimTypeTag, Dumux::Properties::FVGridGeometry>; public: using MDTraits = Dumux::MultiDomainTraits<BulkTypeTag, LowDimTypeTag>; using CouplingMapper = Dumux::FacetCouplingMapper<BulkFVGridGeometry, LowDimFVGridGeometry>; @@ -73,20 +73,28 @@ namespace Dumux { namespace Properties { // set cm property for the box test -using BoxTraits = TestTraits<TTAG(OnePBulkBox), TTAG(OnePLowDimBox)>; -using BoxTracerTraits = TestTraits<TTAG(TracerBulkBox), TTAG(TracerLowDimBox)>; -SET_TYPE_PROP(OnePBulkBox, CouplingManager, typename BoxTraits::CouplingManager); -SET_TYPE_PROP(OnePLowDimBox, CouplingManager, typename BoxTraits::CouplingManager); -SET_TYPE_PROP(TracerBulkBox, CouplingManager, typename BoxTracerTraits::CouplingManager); -SET_TYPE_PROP(TracerLowDimBox, CouplingManager, typename BoxTracerTraits::CouplingManager); +using BoxTraits = TestTraits<Properties::TTag::OnePBulkBox, Properties::TTag::OnePLowDimBox>; +using BoxTracerTraits = TestTraits<Properties::TTag::TracerBulkBox, Properties::TTag::TracerLowDimBox>; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePBulkBox> { using type = typename BoxTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePLowDimBox> { using type = typename BoxTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::TracerBulkBox> { using type = typename BoxTracerTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::TracerLowDimBox> { using type = typename BoxTracerTraits::CouplingManager; }; // set cm property for the tpfa test -using TpfaTraits = TestTraits<TTAG(OnePBulkTpfa), TTAG(OnePLowDimTpfa)>; -using TpfaTracerTraits = TestTraits<TTAG(TracerBulkTpfa), TTAG(TracerLowDimTpfa)>; -SET_TYPE_PROP(OnePBulkTpfa, CouplingManager, typename TpfaTraits::CouplingManager); -SET_TYPE_PROP(OnePLowDimTpfa, CouplingManager, typename TpfaTraits::CouplingManager); -SET_TYPE_PROP(TracerBulkTpfa, CouplingManager, typename TpfaTracerTraits::CouplingManager); -SET_TYPE_PROP(TracerLowDimTpfa, CouplingManager, typename TpfaTracerTraits::CouplingManager); +using TpfaTraits = TestTraits<Properties::TTag::OnePBulkTpfa, Properties::TTag::OnePLowDimTpfa>; +using TpfaTracerTraits = TestTraits<Properties::TTag::TracerBulkTpfa, Properties::TTag::TracerLowDimTpfa>; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePBulkTpfa> { using type = typename TpfaTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePLowDimTpfa> { using type = typename TpfaTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::TracerBulkTpfa> { using type = typename TpfaTracerTraits::CouplingManager; }; +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::TracerLowDimTpfa> { using type = typename TpfaTracerTraits::CouplingManager; }; } // end namespace Properties } // end namespace Dumux @@ -206,10 +214,10 @@ int main(int argc, char** argv) try ////////////////////////////////////////////////////// // try to create the grids (from the given grid file) ////////////////////////////////////////////////////// - using BulkOnePTypeTag = TTAG(ONEPBULKTYPETAG); - using LowDimOnePTypeTag = TTAG(ONEPLOWDIMTYPETAG); - using BulkGrid = typename GET_PROP_TYPE(BulkOnePTypeTag, Grid); - using LowDimGrid = typename GET_PROP_TYPE(LowDimOnePTypeTag, Grid); + using BulkOnePTypeTag = Properties::TTag::ONEPBULKTYPETAG; + using LowDimOnePTypeTag = Properties::TTag::ONEPLOWDIMTYPETAG; + using BulkGrid = GetPropType<BulkOnePTypeTag, Properties::Grid>; + using LowDimGrid = GetPropType<LowDimOnePTypeTag, Properties::Grid>; using GridManager = FacetCouplingGridManager<BulkGrid, LowDimGrid>; GridManager gridManager; @@ -225,8 +233,8 @@ int main(int argc, char** argv) try std::vector< std::vector<double> > lowDimVolumeFluxes; // create the finite volume grid geometries - using BulkFVGridGeometry = typename GET_PROP_TYPE(BulkOnePTypeTag, FVGridGeometry); - using LowDimFVGridGeometry = typename GET_PROP_TYPE(LowDimOnePTypeTag, FVGridGeometry); + using BulkFVGridGeometry = GetPropType<BulkOnePTypeTag, Properties::FVGridGeometry>; + using LowDimFVGridGeometry = GetPropType<LowDimOnePTypeTag, Properties::FVGridGeometry>; auto bulkFvGridGeometry = std::make_shared<BulkFVGridGeometry>(bulkGridView); auto lowDimFvGridGeometry = std::make_shared<LowDimFVGridGeometry>(lowDimGridView); updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView); @@ -256,8 +264,8 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // the problems (boundary conditions) - using BulkProblem = typename GET_PROP_TYPE(BulkOnePTypeTag, Problem); - using LowDimProblem = typename GET_PROP_TYPE(LowDimOnePTypeTag, Problem); + using BulkProblem = GetPropType<BulkOnePTypeTag, Properties::Problem>; + using LowDimProblem = GetPropType<LowDimOnePTypeTag, Properties::Problem>; auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Bulk.OneP"); auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Bulk.OneP"); auto lowDimSpatialParams = std::make_shared<typename LowDimProblem::SpatialParams>(lowDimFvGridGeometry, "LowDim.OneP"); @@ -274,8 +282,8 @@ int main(int argc, char** argv) try couplingManager->init(bulkProblem, lowDimProblem, couplingMapper, x); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkOnePTypeTag, GridVariables); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimOnePTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkOnePTypeTag, Properties::GridVariables>; + using LowDimGridVariables = GetPropType<LowDimOnePTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); bulkGridVariables->init(x[bulkId]); @@ -289,8 +297,8 @@ int main(int argc, char** argv) try VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim.OneP"); // Add model specific output fields - using BulkIOFields = typename GET_PROP_TYPE(BulkOnePTypeTag, IOFields); - using LowDimIOFields = typename GET_PROP_TYPE(LowDimOnePTypeTag, IOFields); + using BulkIOFields = GetPropType<BulkOnePTypeTag, Properties::IOFields>; + using LowDimIOFields = GetPropType<LowDimOnePTypeTag, Properties::IOFields>; BulkIOFields::initOutputModule(bulkVtkWriter); LowDimIOFields::initOutputModule(lowDimVtkWriter); @@ -321,8 +329,8 @@ int main(int argc, char** argv) try lowDimVtkWriter.write(1.0); // compute the volume fluxes and store them in the arrays - using BulkFluxVariables = typename GET_PROP_TYPE(BulkOnePTypeTag, FluxVariables); - using LowDimFluxVariables = typename GET_PROP_TYPE(LowDimOnePTypeTag, FluxVariables); + using BulkFluxVariables = GetPropType<BulkOnePTypeTag, Properties::FluxVariables>; + using LowDimFluxVariables = GetPropType<LowDimOnePTypeTag, Properties::FluxVariables>; computeVolumeFluxes<BulkFluxVariables>(bulkVolumeFluxes, *couplingManager, *assembler, *bulkProblem, *bulkFvGridGeometry, *bulkGridVariables, x[bulkId], bulkId); computeVolumeFluxes<LowDimFluxVariables>(lowDimVolumeFluxes, *couplingManager, *assembler, @@ -334,8 +342,8 @@ int main(int argc, char** argv) try //////////////////////////////////////////////////////////////////////////// //! the problem (initial and boundary conditions) - using BulkTracerTypeTag = TTAG(TRACERBULKTYPETAG); - using LowDimTracerTypeTag = TTAG(TRACERLOWDIMTYPETAG); + using BulkTracerTypeTag = Properties::TTag::TRACERBULKTYPETAG; + using LowDimTracerTypeTag = Properties::TTag::TRACERLOWDIMTYPETAG; // instantiate coupling manager using TracerTestTraits = TestTraits<BulkTracerTypeTag, LowDimTracerTypeTag>; @@ -343,8 +351,8 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // instantiate the tracer problems reusing the fv grid geometries - using TracerBulkProblem = typename GET_PROP_TYPE(BulkTracerTypeTag, Problem); - using TracerLowDimProblem = typename GET_PROP_TYPE(LowDimTracerTypeTag, Problem); + using TracerBulkProblem = GetPropType<BulkTracerTypeTag, Properties::Problem>; + using TracerLowDimProblem = GetPropType<LowDimTracerTypeTag, Properties::Problem>; using TracerBulkSpatialParams = typename TracerBulkProblem::SpatialParams; using TracerLowDimSpatialParams = typename TracerLowDimProblem::SpatialParams; auto bulkSpatialParams = std::make_shared<TracerBulkSpatialParams>(bulkFvGridGeometry, bulkVolumeFluxes, "Bulk.Tracer"); @@ -368,8 +376,8 @@ int main(int argc, char** argv) try couplingManager->init(bulkProblem, lowDimProblem, couplingMapper, x); // the grid variables - using BulkGridVariables = typename GET_PROP_TYPE(BulkTracerTypeTag, GridVariables); - using LowDimGridVariables = typename GET_PROP_TYPE(LowDimTracerTypeTag, GridVariables); + using BulkGridVariables = GetPropType<BulkTracerTypeTag, Properties::GridVariables>; + using LowDimGridVariables = GetPropType<LowDimTracerTypeTag, Properties::GridVariables>; auto bulkGridVariables = std::make_shared<BulkGridVariables>(bulkProblem, bulkFvGridGeometry); auto lowDimGridVariables = std::make_shared<LowDimGridVariables>(lowDimProblem, lowDimFvGridGeometry); bulkGridVariables->init(x[bulkId]); @@ -383,8 +391,8 @@ int main(int argc, char** argv) try VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, x[lowDimId], lowDimProblem->name(), "LowDim.Tracer"); // Add model specific output fields - using BulkIOFields = typename GET_PROP_TYPE(BulkTracerTypeTag, IOFields); - using LowDimIOFields = typename GET_PROP_TYPE(LowDimTracerTypeTag, IOFields); + using BulkIOFields = GetPropType<BulkTracerTypeTag, Properties::IOFields>; + using LowDimIOFields = GetPropType<LowDimTracerTypeTag, Properties::IOFields>; BulkIOFields::initOutputModule(bulkVtkWriter); LowDimIOFields::initOutputModule(lowDimVtkWriter); diff --git a/test/multidomain/facet/tracer_tracer/problem_1p_bulk.hh b/test/multidomain/facet/tracer_tracer/problem_1p_bulk.hh index 92fcafea6c12f022d1f45acb31a61c1796f41d07..6246cb9b11ab8fe4ecaf35f7463ff50b2707c420 100644 --- a/test/multidomain/facet/tracer_tracer/problem_1p_bulk.hh +++ b/test/multidomain/facet/tracer_tracer/problem_1p_bulk.hh @@ -45,23 +45,33 @@ template<class TypeTag> class OnePBulkProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePBulk, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePBulkTpfa, INHERITS_FROM(OnePBulk, CCTpfaFacetCouplingModel)); -NEW_TYPE_TAG(OnePBulkBox, INHERITS_FROM(OnePBulk, BoxFacetCouplingModel)); +// Create new type tags +namespace TTag { +struct OnePBulk { using InheritsFrom = std::tuple<OneP>; }; +struct OnePBulkTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, OnePBulk>; }; +struct OnePBulkBox { using InheritsFrom = std::tuple<BoxFacetCouplingModel, OnePBulk>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePBulk, Grid, Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePBulk> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>; }; // Set the problem type -SET_TYPE_PROP(OnePBulk, Problem, OnePBulkProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePBulk> { using type = OnePBulkProblem<TypeTag>; }; // set the spatial params -SET_TYPE_PROP(OnePBulk, SpatialParams, OnePSpatialParams< typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePBulk> +{ + using type = OnePSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar> >; +}; // the fluid system -SET_PROP(OnePBulk, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePBulk> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::SimpleH2O<Scalar> >; }; @@ -79,7 +89,7 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -91,10 +101,10 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; public: OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/facet/tracer_tracer/problem_1p_lowdim.hh b/test/multidomain/facet/tracer_tracer/problem_1p_lowdim.hh index 57cdc3734cc4e18fefa6d2f7fa518503e8f44e43..80f5cbfe2a89e9f236dfa185c2d35251195047fd 100644 --- a/test/multidomain/facet/tracer_tracer/problem_1p_lowdim.hh +++ b/test/multidomain/facet/tracer_tracer/problem_1p_lowdim.hh @@ -45,23 +45,33 @@ template<class TypeTag> class OnePLowDimProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePLowDim, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePLowDimTpfa, INHERITS_FROM(CCTpfaModel, OnePLowDim)); -NEW_TYPE_TAG(OnePLowDimBox, INHERITS_FROM(BoxModel, OnePLowDim)); +// Create new type tags +namespace TTag { +struct OnePLowDim { using InheritsFrom = std::tuple<OneP>; }; +struct OnePLowDimTpfa { using InheritsFrom = std::tuple<OnePLowDim, CCTpfaModel>; }; +struct OnePLowDimBox { using InheritsFrom = std::tuple<OnePLowDim, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePLowDim, Grid, Dune::FoamGrid<1, 2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePLowDim> { using type = Dune::FoamGrid<1, 2>; }; // Set the problem type -SET_TYPE_PROP(OnePLowDim, Problem, OnePLowDimProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePLowDim> { using type = OnePLowDimProblem<TypeTag>; }; // set the spatial params -SET_TYPE_PROP(OnePLowDim, SpatialParams, OnePSpatialParams< typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar) >); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePLowDim> +{ + using type = OnePSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar> >; +}; // the fluid system -SET_PROP(OnePLowDim, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePLowDim> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid< Scalar, Components::SimpleH2O<Scalar> >; }; @@ -77,7 +87,7 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using PrimaryVariables = typename GridVariables::PrimaryVariables; using Scalar = typename GridVariables::Scalar; @@ -89,10 +99,10 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; public: OnePLowDimProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, diff --git a/test/multidomain/facet/tracer_tracer/problem_tracer_bulk.hh b/test/multidomain/facet/tracer_tracer/problem_tracer_bulk.hh index 6718828ece1698b366f7230bda20acb97b4ee1cd..06c1ab2b44891a7d0ac592e0edb41bbffeaff894 100644 --- a/test/multidomain/facet/tracer_tracer/problem_tracer_bulk.hh +++ b/test/multidomain/facet/tracer_tracer/problem_tracer_bulk.hh @@ -44,44 +44,55 @@ template <class TypeTag> class TracerBulkProblem; namespace Properties { -NEW_TYPE_TAG(TracerTestBulk, INHERITS_FROM(Tracer)); +// Create new type tags +namespace TTag { +struct TracerTestBulk { using InheritsFrom = std::tuple<Tracer>; }; // define the type tags -NEW_TYPE_TAG(TracerBulkTpfa, INHERITS_FROM(TracerTestBulk, CCTpfaFacetCouplingModel)); -NEW_TYPE_TAG(TracerBulkBox, INHERITS_FROM(TracerTestBulk, BoxFacetCouplingModel)); +struct TracerBulkTpfa { using InheritsFrom = std::tuple<CCTpfaFacetCouplingModel, TracerTestBulk>; }; +struct TracerBulkBox { using InheritsFrom = std::tuple<BoxFacetCouplingModel, TracerTestBulk>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TracerTestBulk, Grid, Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TracerTestBulk> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>; }; //! Overwrite the advection type property -SET_TYPE_PROP(TracerBulkTpfa, AdvectionType, StationaryVelocityField<typename GET_PROP_TYPE(TypeTag, Scalar)>); -SET_TYPE_PROP(TracerBulkBox, AdvectionType, StationaryVelocityField<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::TracerBulkTpfa> { using type = StationaryVelocityField<GetPropType<TypeTag, Properties::Scalar>>; }; +template<class TypeTag> +struct AdvectionType<TypeTag, TTag::TracerBulkBox> { using type = StationaryVelocityField<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the problem property -SET_TYPE_PROP(TracerTestBulk, Problem, TracerBulkProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TracerTestBulk> { using type = TracerBulkProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(TracerTestBulk, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TracerTestBulk> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TracerSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(TracerTestBulk, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TracerTestBulk> { static constexpr bool value = false; }; //! set the model traits (with disabled diffusion) -SET_PROP(TracerTestBulk, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TracerTestBulk> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: - using type = TracerTestModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles)>; + using type = TracerTestModelTraits<FluidSystem::numComponents, getPropValue<TypeTag, Properties::UseMoles>()>; }; // use the test-specific fluid system -SET_TYPE_PROP(TracerTestBulk, FluidSystem, TracerFluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TracerTestBulk> { using type = TracerFluidSystem<TypeTag>; }; } // end namespace Properties @@ -95,19 +106,19 @@ class TracerBulkProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - 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 CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/multidomain/facet/tracer_tracer/problem_tracer_lowdim.hh b/test/multidomain/facet/tracer_tracer/problem_tracer_lowdim.hh index a96185c465b69469b126601a75841e954eea1b5a..232cb32b77238bedd346609fa1455603405bdbcd 100644 --- a/test/multidomain/facet/tracer_tracer/problem_tracer_lowdim.hh +++ b/test/multidomain/facet/tracer_tracer/problem_tracer_lowdim.hh @@ -44,40 +44,49 @@ template <class TypeTag> class TracerLowDimProblem; namespace Properties { -NEW_TYPE_TAG(TracerTestLowDim, INHERITS_FROM(Tracer)); +// Create new type tags +namespace TTag { +struct TracerTestLowDim { using InheritsFrom = std::tuple<Tracer>; }; // define the type tags for both bulk and lowdim type tag here -NEW_TYPE_TAG(TracerLowDimTpfa, INHERITS_FROM(CCTpfaModel, TracerTestLowDim)); -NEW_TYPE_TAG(TracerLowDimBox, INHERITS_FROM(BoxModel, TracerTestLowDim)); +struct TracerLowDimTpfa { using InheritsFrom = std::tuple<TracerTestLowDim, CCTpfaModel>; }; +struct TracerLowDimBox { using InheritsFrom = std::tuple<TracerTestLowDim, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TracerTestLowDim, Grid, Dune::FoamGrid<1, 2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TracerTestLowDim> { using type = Dune::FoamGrid<1, 2>; }; // Set the problem property -SET_TYPE_PROP(TracerTestLowDim, Problem, TracerLowDimProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TracerTestLowDim> { using type = TracerLowDimProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(TracerTestLowDim, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TracerTestLowDim> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TracerSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(TracerTestLowDim, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TracerTestLowDim> { static constexpr bool value = false; }; //! set the model traits (with disabled diffusion) -SET_PROP(TracerTestLowDim, ModelTraits) +template<class TypeTag> +struct ModelTraits<TypeTag, TTag::TracerTestLowDim> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: - using type = TracerTestModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles)>; + using type = TracerTestModelTraits<FluidSystem::numComponents, getPropValue<TypeTag, Properties::UseMoles>()>; }; // use the test-specific fluid system -SET_TYPE_PROP(TracerTestLowDim, FluidSystem, TracerFluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TracerTestLowDim> { using type = TracerFluidSystem<TypeTag>; }; } // end namespace Properties @@ -92,19 +101,19 @@ class TracerLowDimProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - 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 CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/multidomain/facet/tracer_tracer/tracerfluidsystem.hh b/test/multidomain/facet/tracer_tracer/tracerfluidsystem.hh index a363bf81b02ac972d5f9fd33267dbbad2eb7b324..1b3376a1067471668f2809a568357e1491a362d0 100644 --- a/test/multidomain/facet/tracer_tracer/tracerfluidsystem.hh +++ b/test/multidomain/facet/tracer_tracer/tracerfluidsystem.hh @@ -29,14 +29,14 @@ namespace Dumux { //! A simple fluid system with one tracer component template<class TypeTag> -class TracerFluidSystem : public FluidSystems::Base<typename GET_PROP_TYPE(TypeTag, Scalar), +class TracerFluidSystem : public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, TracerFluidSystem<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; public: diff --git a/test/multidomain/poromechanics/el1p/main.cc b/test/multidomain/poromechanics/el1p/main.cc index fcaef59db52d8c9a87fbca607354ed9b0c7cf901..226478ac8dbf37c815f8157ecec452a7057c3227 100644 --- a/test/multidomain/poromechanics/el1p/main.cc +++ b/test/multidomain/poromechanics/el1p/main.cc @@ -49,20 +49,22 @@ namespace Dumux { namespace Properties { -SET_PROP(OnePSub, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::OnePSub> { private: // define traits etc. as below in main - using Traits = MultiDomainTraits<TTAG(OnePSub), TTAG(PoroElasticSub)>; + using Traits = MultiDomainTraits<TTag::OnePSub, TTag::PoroElasticSub>; public: using type = PoroMechanicsCouplingManager< Traits >; }; -SET_PROP(PoroElasticSub, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::PoroElasticSub> { private: // define traits etc. as below in main - using Traits = MultiDomainTraits<TTAG(OnePSub), TTAG(PoroElasticSub)>; + using Traits = MultiDomainTraits<TTag::OnePSub, TTag::PoroElasticSub>; public: using type = PoroMechanicsCouplingManager< Traits >; }; @@ -89,11 +91,11 @@ int main(int argc, char** argv) try ////////////////////////////////////////////////////////////////////// // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using OnePTypeTag = TTAG(OnePSub); - using PoroMechTypeTag = TTAG(PoroElasticSub); + using OnePTypeTag = Properties::TTag::OnePSub; + using PoroMechTypeTag = Properties::TTag::PoroElasticSub; // we simply extract the grid creator from one of the type tags - using GridManager = Dumux::GridManager<typename GET_PROP_TYPE(OnePTypeTag, Grid)>; + using GridManager = Dumux::GridManager<GetPropType<OnePTypeTag, Properties::Grid>>; GridManager gridManager; gridManager.init(); @@ -105,8 +107,8 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometries - using OnePFVGridGeometry = typename GET_PROP_TYPE(OnePTypeTag, FVGridGeometry); - using PoroMechFVGridGeometry = typename GET_PROP_TYPE(PoroMechTypeTag, FVGridGeometry); + using OnePFVGridGeometry = GetPropType<OnePTypeTag, Properties::FVGridGeometry>; + using PoroMechFVGridGeometry = GetPropType<PoroMechTypeTag, Properties::FVGridGeometry>; auto onePFvGridGeometry = std::make_shared<OnePFVGridGeometry>(leafGridView); auto poroMechFvGridGeometry = std::make_shared<PoroMechFVGridGeometry>(leafGridView); onePFvGridGeometry->update(); @@ -118,8 +120,8 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // the problems (boundary conditions) - using OnePProblem = typename GET_PROP_TYPE(OnePTypeTag, Problem); - using PoroMechProblem = typename GET_PROP_TYPE(PoroMechTypeTag, Problem); + using OnePProblem = GetPropType<OnePTypeTag, Properties::Problem>; + using PoroMechProblem = GetPropType<PoroMechTypeTag, Properties::Problem>; auto onePSpatialParams = std::make_shared<typename OnePProblem::SpatialParams>(onePFvGridGeometry, couplingManager); auto onePProblem = std::make_shared<OnePProblem>(onePFvGridGeometry, onePSpatialParams, "OneP"); auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, couplingManager, "PoroElastic"); @@ -140,22 +142,22 @@ int main(int argc, char** argv) try couplingManager->init(onePProblem, poroMechProblem, x); // the grid variables - using OnePGridVariables = typename GET_PROP_TYPE(OnePTypeTag, GridVariables); - using PoroMechGridVariables = typename GET_PROP_TYPE(PoroMechTypeTag, GridVariables); + using OnePGridVariables = GetPropType<OnePTypeTag, Properties::GridVariables>; + using PoroMechGridVariables = GetPropType<PoroMechTypeTag, Properties::GridVariables>; auto onePGridVariables = std::make_shared<OnePGridVariables>(onePProblem, onePFvGridGeometry); auto poroMechGridVariables = std::make_shared<PoroMechGridVariables>(poroMechProblem, poroMechFvGridGeometry); onePGridVariables->init(x[onePId]); poroMechGridVariables->init(x[poroMechId]); // intialize the vtk output module - using OnePVtkOutputModule = Dumux::VtkOutputModule<OnePGridVariables, typename GET_PROP_TYPE(OnePTypeTag, SolutionVector)>; - using PoroMechVtkOutputModule = Dumux::VtkOutputModule<PoroMechGridVariables, typename GET_PROP_TYPE(PoroMechTypeTag, SolutionVector)>; + using OnePVtkOutputModule = Dumux::VtkOutputModule<OnePGridVariables, GetPropType<OnePTypeTag, Properties::SolutionVector>>; + using PoroMechVtkOutputModule = Dumux::VtkOutputModule<PoroMechGridVariables, GetPropType<PoroMechTypeTag, Properties::SolutionVector>>; OnePVtkOutputModule onePVtkWriter(*onePGridVariables, x[onePId], onePProblem->name()); PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using OnePOutputFields = typename GET_PROP_TYPE(OnePTypeTag, IOFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); + using OnePOutputFields = GetPropType<OnePTypeTag, Properties::IOFields>; + using PoroMechOutputFields = GetPropType<PoroMechTypeTag, Properties::IOFields>; OnePOutputFields::initOutputModule(onePVtkWriter); PoroMechOutputFields::initOutputModule(poroMechVtkWriter); diff --git a/test/multidomain/poromechanics/el1p/problem_1p.hh b/test/multidomain/poromechanics/el1p/problem_1p.hh index d61571d9050687bc084dfd23353a967a46236186..3822c8017229f17724d3901635c3d192e2688dce 100644 --- a/test/multidomain/poromechanics/el1p/problem_1p.hh +++ b/test/multidomain/poromechanics/el1p/problem_1p.hh @@ -46,24 +46,32 @@ class OnePSubProblem; namespace Properties { -NEW_TYPE_TAG(OnePSub, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct OnePSub { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // The fluid phase consists of one constant component -SET_TYPE_PROP(OnePSub, - FluidSystem, - Dumux::FluidSystems::OnePLiquid< typename GET_PROP_TYPE(TypeTag, Scalar), - Dumux::Components::Constant<0, typename GET_PROP_TYPE(TypeTag, Scalar)> >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePSub> +{ + using type = Dumux::FluidSystems::OnePLiquid< GetPropType<TypeTag, Properties::Scalar>, + Dumux::Components::Constant<0, GetPropType<TypeTag, Properties::Scalar>> >; +}; // Set the grid type -SET_TYPE_PROP(OnePSub, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePSub> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(OnePSub, Problem, OnePSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSub> { using type = OnePSubProblem<TypeTag> ; }; // Set the spatial parameters -SET_PROP(OnePSub, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePSub> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; using type = OnePSpatialParams<FVGridGeometry, Scalar, CouplingManager>; }; } // end namespace Properties @@ -80,22 +88,22 @@ class OnePSubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; // copy pressure index for convenience - enum { pressureIdx = GET_PROP_TYPE(TypeTag, ModelTraits)::Indices::pressureIdx }; + enum { pressureIdx = GetPropType<TypeTag, Properties::ModelTraits>::Indices::pressureIdx }; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: OnePSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, - std::shared_ptr<typename GET_PROP_TYPE(TypeTag, SpatialParams)> spatialParams, + std::shared_ptr<GetPropType<TypeTag, Properties::SpatialParams>> spatialParams, const std::string& paramGroup = "OneP") : ParentType(fvGridGeometry, spatialParams, paramGroup) { diff --git a/test/multidomain/poromechanics/el1p/problem_poroelastic.hh b/test/multidomain/poromechanics/el1p/problem_poroelastic.hh index 6b451488172e58cce6c906f97f021ab673c77567..d89f8747ebecaff6fb3e736b5b50dc105ec23bfd 100644 --- a/test/multidomain/poromechanics/el1p/problem_poroelastic.hh +++ b/test/multidomain/poromechanics/el1p/problem_poroelastic.hh @@ -45,20 +45,30 @@ class PoroElasticSubProblem; namespace Properties { -NEW_TYPE_TAG(PoroElasticSub, INHERITS_FROM(BoxModel, PoroElastic)); +// Create new type tags +namespace TTag { +struct PoroElasticSub { using InheritsFrom = std::tuple<PoroElastic, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(PoroElasticSub, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::PoroElasticSub> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(PoroElasticSub, Problem, Dumux::PoroElasticSubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::PoroElasticSub> { using type = Dumux::PoroElasticSubProblem<TypeTag>; }; // The fluid phase consists of one constant component -SET_TYPE_PROP(PoroElasticSub, - FluidSystem, - Dumux::FluidSystems::OnePLiquid< typename GET_PROP_TYPE(TypeTag, Scalar), - Dumux::Components::Constant<0, typename GET_PROP_TYPE(TypeTag, Scalar)> >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::PoroElasticSub> +{ + using type = Dumux::FluidSystems::OnePLiquid< GetPropType<TypeTag, Properties::Scalar>, + Dumux::Components::Constant<0, GetPropType<TypeTag, Properties::Scalar>> >; +}; // The spatial parameters property -SET_TYPE_PROP(PoroElasticSub, SpatialParams, PoroElasticSpatialParams< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); - +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::PoroElasticSub> +{ + using type = PoroElasticSpatialParams< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; } // end namespace Properties /*! @@ -73,18 +83,18 @@ class PoroElasticSubProblem : public GeomechanicsFVProblem<TypeTag> { using ParentType = GeomechanicsFVProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/multidomain/poromechanics/el2p/main.cc b/test/multidomain/poromechanics/el2p/main.cc index 7faac67223574ef6d725d977c82cbda8d6f4c8a9..65a170a88a420d6e41bef56b9857dff995658153 100644 --- a/test/multidomain/poromechanics/el2p/main.cc +++ b/test/multidomain/poromechanics/el2p/main.cc @@ -51,20 +51,22 @@ namespace Dumux { namespace Properties { -SET_PROP(TwoPSub, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::TwoPSub> { private: // define traits etc. as below in main - using Traits = MultiDomainTraits<TTAG(TwoPSub), TTAG(PoroElasticSub)>; + using Traits = MultiDomainTraits<Properties::TTag::TwoPSub, Properties::TTag::PoroElasticSub>; public: using type = PoroMechanicsCouplingManager< Traits >; }; -SET_PROP(PoroElasticSub, CouplingManager) +template<class TypeTag> +struct CouplingManager<TypeTag, TTag::PoroElasticSub> { private: // define traits etc. as below in main - using Traits = MultiDomainTraits<TTAG(TwoPSub), TTAG(PoroElasticSub)>; + using Traits = MultiDomainTraits<Properties::TTag::TwoPSub, Properties::TTag::PoroElasticSub>; public: using type = PoroMechanicsCouplingManager< Traits >; }; @@ -91,11 +93,11 @@ int main(int argc, char** argv) try ////////////////////////////////////////////////////////////////////// // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using TwoPTypeTag = TTAG(TwoPSub); - using PoroMechTypeTag = TTAG(PoroElasticSub); + using TwoPTypeTag = Properties::TTag::TwoPSub; + using PoroMechTypeTag = Properties::TTag::PoroElasticSub; // we simply extract the grid creator from one of the type tags - using GridManager = Dumux::GridManager<typename GET_PROP_TYPE(TwoPTypeTag, Grid)>; + using GridManager = Dumux::GridManager<GetPropType<TwoPTypeTag, Properties::Grid>>; GridManager gridManager; gridManager.init(); @@ -107,8 +109,8 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometries - using TwoPFVGridGeometry = typename GET_PROP_TYPE(TwoPTypeTag, FVGridGeometry); - using PoroMechFVGridGeometry = typename GET_PROP_TYPE(PoroMechTypeTag, FVGridGeometry); + using TwoPFVGridGeometry = GetPropType<TwoPTypeTag, Properties::FVGridGeometry>; + using PoroMechFVGridGeometry = GetPropType<PoroMechTypeTag, Properties::FVGridGeometry>; auto twoPFvGridGeometry = std::make_shared<TwoPFVGridGeometry>(leafGridView); auto poroMechFvGridGeometry = std::make_shared<PoroMechFVGridGeometry>(leafGridView); twoPFvGridGeometry->update(); @@ -120,8 +122,8 @@ int main(int argc, char** argv) try auto couplingManager = std::make_shared<CouplingManager>(); // the problems (boundary conditions) - using TwoPProblem = typename GET_PROP_TYPE(TwoPTypeTag, Problem); - using PoroMechProblem = typename GET_PROP_TYPE(PoroMechTypeTag, Problem); + using TwoPProblem = GetPropType<TwoPTypeTag, Properties::Problem>; + using PoroMechProblem = GetPropType<PoroMechTypeTag, Properties::Problem>; auto twoPSpatialParams = std::make_shared<typename TwoPProblem::SpatialParams>(twoPFvGridGeometry, couplingManager); auto twoPProblem = std::make_shared<TwoPProblem>(twoPFvGridGeometry, twoPSpatialParams, "TwoP"); auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, couplingManager, "PoroElastic"); @@ -142,28 +144,28 @@ int main(int argc, char** argv) try couplingManager->init(twoPProblem, poroMechProblem, x); // the grid variables - using TwoPGridVariables = typename GET_PROP_TYPE(TwoPTypeTag, GridVariables); - using PoroMechGridVariables = typename GET_PROP_TYPE(PoroMechTypeTag, GridVariables); + using TwoPGridVariables = GetPropType<TwoPTypeTag, Properties::GridVariables>; + using PoroMechGridVariables = GetPropType<PoroMechTypeTag, Properties::GridVariables>; auto twoPGridVariables = std::make_shared<TwoPGridVariables>(twoPProblem, twoPFvGridGeometry); auto poroMechGridVariables = std::make_shared<PoroMechGridVariables>(poroMechProblem, poroMechFvGridGeometry); twoPGridVariables->init(x[twoPId]); poroMechGridVariables->init(x[poroMechId]); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TwoPTypeTag, Scalar); + using Scalar = GetPropType<TwoPTypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDT = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using TwoPVtkOutputModule = Dumux::VtkOutputModule<TwoPGridVariables, typename GET_PROP_TYPE(TwoPTypeTag, SolutionVector)>; - using PoroMechVtkOutputModule = Dumux::VtkOutputModule<PoroMechGridVariables, typename GET_PROP_TYPE(PoroMechTypeTag, SolutionVector)>; + using TwoPVtkOutputModule = Dumux::VtkOutputModule<TwoPGridVariables, GetPropType<TwoPTypeTag, Properties::SolutionVector>>; + using PoroMechVtkOutputModule = Dumux::VtkOutputModule<PoroMechGridVariables, GetPropType<PoroMechTypeTag, Properties::SolutionVector>>; TwoPVtkOutputModule twoPVtkWriter(*twoPGridVariables, x[twoPId], twoPProblem->name()); PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using TwoPOutputFields = typename GET_PROP_TYPE(TwoPTypeTag, IOFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); + using TwoPOutputFields = GetPropType<TwoPTypeTag, Properties::IOFields>; + using PoroMechOutputFields = GetPropType<PoroMechTypeTag, Properties::IOFields>; TwoPOutputFields::initOutputModule(twoPVtkWriter); PoroMechOutputFields::initOutputModule(poroMechVtkWriter); @@ -212,7 +214,7 @@ int main(int argc, char** argv) try // report statistics of this time step timeLoop->reportTimeStep(); - using TwoPPrimaryVariables = typename GET_PROP_TYPE(TwoPTypeTag, PrimaryVariables); + using TwoPPrimaryVariables = GetPropType<TwoPTypeTag, Properties::PrimaryVariables>; TwoPPrimaryVariables storage(0); const auto& twoPLocalResidual = assembler->localResidual(twoPId); for (const auto& element : elements(leafGridView, Dune::Partitions::interior)) diff --git a/test/multidomain/poromechanics/el2p/problem_2p.hh b/test/multidomain/poromechanics/el2p/problem_2p.hh index fd6f019cbf92cb4e7c69f9176c9a86086f2bf8da..3ccf7be9c8e36f65929be25553b092fe64ec70b0 100644 --- a/test/multidomain/poromechanics/el2p/problem_2p.hh +++ b/test/multidomain/poromechanics/el2p/problem_2p.hh @@ -46,25 +46,32 @@ class TwoPSubProblem; namespace Properties { -NEW_TYPE_TAG(TwoPSub, INHERITS_FROM(CCTpfaModel, TwoP)); +// Create new type tags +namespace TTag { +struct TwoPSub { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; +} // end namespace TTag // Set the fluid system for TwoPSubProblem -SET_PROP(TwoPSub, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPSub> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::BrineCO2<Scalar, El2P::CO2Tables>; }; // Set the grid type -SET_TYPE_PROP(TwoPSub, Grid, Dune::YaspGrid<3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPSub> { using type = Dune::YaspGrid<3>; }; // Set the problem property -SET_TYPE_PROP(TwoPSub, Problem, TwoPSubProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPSub> { using type = TwoPSubProblem<TypeTag> ; }; // Set the spatial parameters -SET_PROP(TwoPSub, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPSub> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; using type = TwoPSpatialParams<FVGridGeometry, Scalar, CouplingManager>; }; } // end namespace Properties @@ -81,29 +88,29 @@ class TwoPSubProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; // copy pressure index for convenience enum { - pressureIdx = GET_PROP_TYPE(TypeTag, ModelTraits)::Indices::pressureIdx, - saturationNIdx = GET_PROP_TYPE(TypeTag, ModelTraits)::Indices::saturationIdx, + pressureIdx = GetPropType<TypeTag, Properties::ModelTraits>::Indices::pressureIdx, + saturationNIdx = GetPropType<TypeTag, Properties::ModelTraits>::Indices::saturationIdx, waterPhaseIdx = FluidSystem::phase0Idx, gasPhaseIdx = FluidSystem::phase1Idx, dimWorld = GridView::dimensionworld }; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: TwoPSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, - std::shared_ptr<typename GET_PROP_TYPE(TypeTag, SpatialParams)> spatialParams, + std::shared_ptr<GetPropType<TypeTag, Properties::SpatialParams>> spatialParams, const std::string& paramGroup = "TwoP") : ParentType(fvGridGeometry, spatialParams, paramGroup) { diff --git a/test/multidomain/poromechanics/el2p/problem_poroelastic.hh b/test/multidomain/poromechanics/el2p/problem_poroelastic.hh index e59622d4b1dfd57e471b60997261adc2a6983513..6cc32b9e94acaeabe7bdfa13540b8d1e0728dcc9 100644 --- a/test/multidomain/poromechanics/el2p/problem_poroelastic.hh +++ b/test/multidomain/poromechanics/el2p/problem_poroelastic.hh @@ -45,23 +45,32 @@ class PoroElasticSubProblem; namespace Properties { -NEW_TYPE_TAG(PoroElasticSub, INHERITS_FROM(BoxModel, PoroElastic)); +// Create new type tags +namespace TTag { +struct PoroElasticSub { using InheritsFrom = std::tuple<PoroElastic, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(PoroElasticSub, Grid, Dune::YaspGrid<3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::PoroElasticSub> { using type = Dune::YaspGrid<3>; }; // Set the problem property -SET_TYPE_PROP(PoroElasticSub, Problem, Dumux::PoroElasticSubProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::PoroElasticSub> { using type = Dumux::PoroElasticSubProblem<TypeTag>; }; // Set the fluid system for TwoPSubProblem -SET_PROP(PoroElasticSub, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::PoroElasticSub> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::BrineCO2<Scalar, El2P::CO2Tables>; }; // The spatial parameters property -SET_TYPE_PROP(PoroElasticSub, SpatialParams, PoroElasticSpatialParams< typename GET_PROP_TYPE(TypeTag, Scalar), - typename GET_PROP_TYPE(TypeTag, FVGridGeometry) >); - +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::PoroElasticSub> +{ + using type = PoroElasticSpatialParams< GetPropType<TypeTag, Properties::Scalar>, + GetPropType<TypeTag, Properties::FVGridGeometry> >; +}; } // end namespace Properties /*! @@ -76,19 +85,19 @@ class PoroElasticSubProblem : public GeomechanicsFVProblem<TypeTag> { using ParentType = GeomechanicsFVProblem<TypeTag>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVGridGeometry::SubControlVolume; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/implicit/compressible/instationary/main.cc b/test/porousmediumflow/1p/implicit/compressible/instationary/main.cc index 6fe1de6b042539e45ff3b92016beb9e7cf895ac9..e09d8674b54d6bb9e993f8ca77bb8cf73149e5db 100644 --- a/test/porousmediumflow/1p/implicit/compressible/instationary/main.cc +++ b/test/porousmediumflow/1p/implicit/compressible/instationary/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,36 +84,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh b/test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh index 5bcade3c59f01f1b69fbff9f7988014ef968cec4..dd60c217817403a700340e4957d78d769b8b54d0 100644 --- a/test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh +++ b/test/porousmediumflow/1p/implicit/compressible/instationary/problem.hh @@ -47,38 +47,48 @@ template<class TypeTag> class OnePTestProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePCompressible, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePCompressibleTpfa, INHERITS_FROM(CCTpfaModel, OnePCompressible)); -NEW_TYPE_TAG(OnePCompressibleMpfa, INHERITS_FROM(CCMpfaModel, OnePCompressible)); -NEW_TYPE_TAG(OnePCompressibleBox, INHERITS_FROM(BoxModel, OnePCompressible)); +// Create new type tags +namespace TTag { +struct OnePCompressible { using InheritsFrom = std::tuple<OneP>; }; +struct OnePCompressibleTpfa { using InheritsFrom = std::tuple<OnePCompressible, CCTpfaModel>; }; +struct OnePCompressibleMpfa { using InheritsFrom = std::tuple<OnePCompressible, CCMpfaModel>; }; +struct OnePCompressibleBox { using InheritsFrom = std::tuple<OnePCompressible, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePCompressible, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePCompressible> { using type = Dune::YaspGrid<2>; }; // Set the problem type -SET_TYPE_PROP(OnePCompressible, Problem, OnePTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePCompressible> { using type = OnePTestProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePCompressible, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePCompressible> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePTestSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(OnePCompressible, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePCompressible> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid<Scalar, Components::TabulatedComponent<Components::H2O<Scalar>>>; }; // Disable caching (for testing purposes) -SET_BOOL_PROP(OnePCompressible, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(OnePCompressible, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(OnePCompressible, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; } // end namespace Properties /*! @@ -92,12 +102,12 @@ template<class TypeTag> class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/implicit/compressible/stationary/main.cc b/test/porousmediumflow/1p/implicit/compressible/stationary/main.cc index 832cadca5e27ea048a4f9bbf76b3fb45f8e47c01..81a507e76a5ef517bc318b7063ffcec5f35a0163 100644 --- a/test/porousmediumflow/1p/implicit/compressible/stationary/main.cc +++ b/test/porousmediumflow/1p/implicit/compressible/stationary/main.cc @@ -52,7 +52,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -82,27 +82,27 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/compressible/stationary/problem.hh b/test/porousmediumflow/1p/implicit/compressible/stationary/problem.hh index 5bcade3c59f01f1b69fbff9f7988014ef968cec4..dd60c217817403a700340e4957d78d769b8b54d0 100644 --- a/test/porousmediumflow/1p/implicit/compressible/stationary/problem.hh +++ b/test/porousmediumflow/1p/implicit/compressible/stationary/problem.hh @@ -47,38 +47,48 @@ template<class TypeTag> class OnePTestProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePCompressible, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePCompressibleTpfa, INHERITS_FROM(CCTpfaModel, OnePCompressible)); -NEW_TYPE_TAG(OnePCompressibleMpfa, INHERITS_FROM(CCMpfaModel, OnePCompressible)); -NEW_TYPE_TAG(OnePCompressibleBox, INHERITS_FROM(BoxModel, OnePCompressible)); +// Create new type tags +namespace TTag { +struct OnePCompressible { using InheritsFrom = std::tuple<OneP>; }; +struct OnePCompressibleTpfa { using InheritsFrom = std::tuple<OnePCompressible, CCTpfaModel>; }; +struct OnePCompressibleMpfa { using InheritsFrom = std::tuple<OnePCompressible, CCMpfaModel>; }; +struct OnePCompressibleBox { using InheritsFrom = std::tuple<OnePCompressible, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePCompressible, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePCompressible> { using type = Dune::YaspGrid<2>; }; // Set the problem type -SET_TYPE_PROP(OnePCompressible, Problem, OnePTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePCompressible> { using type = OnePTestProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePCompressible, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePCompressible> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePTestSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(OnePCompressible, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePCompressible> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::OnePLiquid<Scalar, Components::TabulatedComponent<Components::H2O<Scalar>>>; }; // Disable caching (for testing purposes) -SET_BOOL_PROP(OnePCompressible, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(OnePCompressible, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(OnePCompressible, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::OnePCompressible> { static constexpr bool value = false; }; } // end namespace Properties /*! @@ -92,12 +102,12 @@ template<class TypeTag> class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/implicit/fracture2d3d/main.cc b/test/porousmediumflow/1p/implicit/fracture2d3d/main.cc index d03b4fc7519e2b5a836bcb2312b64f5af3b6755d..1c866b2e7f68cede09581710cf748056c9cbcb36 100644 --- a/test/porousmediumflow/1p/implicit/fracture2d3d/main.cc +++ b/test/porousmediumflow/1p/implicit/fracture2d3d/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh b/test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh index de95c19842d16528096f22d6037de6e31ada235b..12888577139510f86fc7a5f09d8d30a858856493 100644 --- a/test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh +++ b/test/porousmediumflow/1p/implicit/fracture2d3d/problem.hh @@ -46,35 +46,45 @@ template <class TypeTag> class FractureProblem; namespace Properties { -NEW_TYPE_TAG(Fracture, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(FractureBox, INHERITS_FROM(BoxModel, Fracture)); -NEW_TYPE_TAG(FractureCCTpfa, INHERITS_FROM(CCTpfaModel, Fracture)); -NEW_TYPE_TAG(FractureCCMpfa, INHERITS_FROM(CCMpfaModel, Fracture)); +// Create new type tags +namespace TTag { +struct Fracture { using InheritsFrom = std::tuple<OneP>; }; +struct FractureBox { using InheritsFrom = std::tuple<Fracture, BoxModel>; }; +struct FractureCCTpfa { using InheritsFrom = std::tuple<Fracture, CCTpfaModel>; }; +struct FractureCCMpfa { using InheritsFrom = std::tuple<Fracture, CCMpfaModel>; }; +} // end namespace TTag //! Enable caching (more memory, but faster runtime) -SET_BOOL_PROP(Fracture, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Fracture, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Fracture, EnableGridFluxVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; //! The grid type #if HAVE_DUNE_FOAMGRID -SET_TYPE_PROP(Fracture, Grid, Dune::FoamGrid<2, 3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Fracture> { using type = Dune::FoamGrid<2, 3>; }; #endif // Set the problem property -SET_TYPE_PROP(Fracture, Problem, Dumux::FractureProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Fracture> { using type = Dumux::FractureProblem<TypeTag>; }; // the fluid system -SET_PROP(Fracture, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Fracture> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Set the spatial parameters -SET_PROP(Fracture, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Fracture> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FractureSpatialParams<FVGridGeometry, Scalar>; }; @@ -91,8 +101,8 @@ template <class TypeTag> class FractureProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; @@ -101,12 +111,12 @@ class FractureProblem : public PorousMediumFlowProblem<TypeTag> pressureIdx = Indices::pressureIdx }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: /*! diff --git a/test/porousmediumflow/1p/implicit/incompressible/main.cc b/test/porousmediumflow/1p/implicit/incompressible/main.cc index 2d9c5029791ea297b8a3fa0a7a4b7d7c61cc8f2f..830c99c4548b27dee670d99e1e3b86a6512b8fb4 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/main.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/main.cc @@ -53,7 +53,7 @@ int main(int argc, char** argv) try { using namespace Dumux; - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -73,42 +73,42 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); // we compute on the leaf grid view const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system using Assembler = FVAssembler<TypeTag, NUMDIFFMETHOD>; auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; auto A = std::make_shared<JacobianMatrix>(); auto r = std::make_shared<SolutionVector>(); assembler->setLinearSystem(A, r); diff --git a/test/porousmediumflow/1p/implicit/incompressible/problem.hh b/test/porousmediumflow/1p/implicit/incompressible/problem.hh index 71c6c886494699192a6be77c467d60c287071448..bbd669643f675599b4ff300547b851c2817c9558 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/problem.hh +++ b/test/porousmediumflow/1p/implicit/incompressible/problem.hh @@ -47,44 +47,57 @@ template<class TypeTag> class OnePTestProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePIncompressible, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePIncompressibleTpfa, INHERITS_FROM(CCTpfaModel, OnePIncompressible)); -NEW_TYPE_TAG(OnePIncompressibleMpfa, INHERITS_FROM(CCMpfaModel, OnePIncompressible)); -NEW_TYPE_TAG(OnePIncompressibleBox, INHERITS_FROM(BoxModel, OnePIncompressible)); +// Create new type tags +namespace TTag { +struct OnePIncompressible { using InheritsFrom = std::tuple<OneP>; }; +struct OnePIncompressibleTpfa { using InheritsFrom = std::tuple<OnePIncompressible, CCTpfaModel>; }; +struct OnePIncompressibleMpfa { using InheritsFrom = std::tuple<OnePIncompressible, CCMpfaModel>; }; +struct OnePIncompressibleBox { using InheritsFrom = std::tuple<OnePIncompressible, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePIncompressible, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePIncompressible> { using type = Dune::YaspGrid<2>; }; // Set the problem type -SET_TYPE_PROP(OnePIncompressible, Problem, OnePTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePIncompressible> { using type = OnePTestProblem<TypeTag>; }; // set the spatial params -SET_PROP(OnePIncompressible, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePIncompressible> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePTestSpatialParams<FVGridGeometry, Scalar>; }; // use the incompressible local residual (provides analytic jacobian) -SET_TYPE_PROP(OnePIncompressible, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OnePIncompressible> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // the fluid system -SET_PROP(OnePIncompressible, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePIncompressible> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Enable caching -SET_BOOL_PROP(OnePIncompressible, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(OnePIncompressible, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(OnePIncompressible, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = false; }; // define a TypeTag for a quad precision test #if HAVE_QUAD -NEW_TYPE_TAG(OnePIncompressibleTpfaQuad, INHERITS_FROM(OnePIncompressibleTpfa)); -SET_TYPE_PROP(OnePIncompressibleTpfaQuad, Scalar, Quad); +struct OnePIncompressibleTpfaQuad { using InheritsFrom = std::tuple<OnePIncompressibleTpfa>; }; +} // end namespace TTag +template<class TypeTag> +struct Scalar<TypeTag, TTag::OnePIncompressibleTpfaQuad> { using type = Quad; }; #endif } // end namespace Properties /*! @@ -98,12 +111,12 @@ template<class TypeTag> class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/implicit/isothermal/main.cc b/test/porousmediumflow/1p/implicit/isothermal/main.cc index 7f55a62f83351ee7c67128963ec64d9a239bd4fa..e524e2c62852dffb6af66eb7d58d3f3c9b680c2c 100644 --- a/test/porousmediumflow/1p/implicit/isothermal/main.cc +++ b/test/porousmediumflow/1p/implicit/isothermal/main.cc @@ -87,7 +87,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -100,7 +100,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -111,35 +111,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields diff --git a/test/porousmediumflow/1p/implicit/isothermal/problem.hh b/test/porousmediumflow/1p/implicit/isothermal/problem.hh index 335ede709177fb7d1f444957780273e0f0e475ab..4f5d6bdc47f4be953f41332cfbda6a0c746e03ea 100644 --- a/test/porousmediumflow/1p/implicit/isothermal/problem.hh +++ b/test/porousmediumflow/1p/implicit/isothermal/problem.hh @@ -51,9 +51,9 @@ namespace Properties { // Create new type tags namespace TTag { struct OnePTest { using InheritsFrom = std::tuple<OneP>; }; -struct OnePTestBox { using InheritsFrom = std::tuple<OnePTest, BoxModel>; }; -struct OnePTestCCTpfa { using InheritsFrom = std::tuple<OnePTest, CCTpfaModel>; }; -struct OnePTestCCMpfa { using InheritsFrom = std::tuple<OnePTest, CCMpfaModel>; }; +struct OnePTestBox { using InheritsFrom = std::tuple<BoxModel, OnePTest>; }; +struct OnePTestCCTpfa { using InheritsFrom = std::tuple<CCTpfaModel, OnePTest>; }; +struct OnePTestCCMpfa { using InheritsFrom = std::tuple<CCMpfaModel, OnePTest>; }; } // end namespace TTag // Specialize the fluid system type for this type tag diff --git a/test/porousmediumflow/1p/implicit/network1d3d/main.cc b/test/porousmediumflow/1p/implicit/network1d3d/main.cc index adca4c3010ed83b5d259e72307544b6fc982c34f..add8c910a15143cb470e5a6bed915f752e4779f7 100644 --- a/test/porousmediumflow/1p/implicit/network1d3d/main.cc +++ b/test/porousmediumflow/1p/implicit/network1d3d/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/network1d3d/problem.hh b/test/porousmediumflow/1p/implicit/network1d3d/problem.hh index ff6f7783356d1393fc796a39984530dfca8ffb36..ec9c9d44ad8e20d8405953a53e9a31421ee11f32 100644 --- a/test/porousmediumflow/1p/implicit/network1d3d/problem.hh +++ b/test/porousmediumflow/1p/implicit/network1d3d/problem.hh @@ -51,21 +51,26 @@ class TubesTestProblem; namespace Properties { -NEW_TYPE_TAG(TubesTest, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(TubesTestCCTpfa, INHERITS_FROM(CCTpfaModel, TubesTest)); -NEW_TYPE_TAG(TubesTestBox, INHERITS_FROM(BoxModel, TubesTest)); +// Create new type tags +namespace TTag { +struct TubesTest { using InheritsFrom = std::tuple<OneP>; }; +struct TubesTestCCTpfa { using InheritsFrom = std::tuple<TubesTest, CCTpfaModel>; }; +struct TubesTestBox { using InheritsFrom = std::tuple<TubesTest, BoxModel>; }; +} // end namespace TTag // Set the grid type #if HAVE_DUNE_FOAMGRID -SET_TYPE_PROP(TubesTest, Grid, Dune::FoamGrid<1, 3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TubesTest> { using type = Dune::FoamGrid<1, 3>; }; #endif // if we have pt scotch use the reordering dof mapper to optimally sort the dofs (cc) -SET_PROP(TubesTestCCTpfa, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::TubesTestCCTpfa> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; using ElementMapper = ReorderingDofMapper<GridView>; using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; @@ -75,12 +80,13 @@ public: }; // if we have pt scotch use the reordering dof mapper to optimally sort the dofs (box) -SET_PROP(TubesTestBox, FVGridGeometry) +template<class TypeTag> +struct FVGridGeometry<TypeTag, TTag::TubesTestBox> { private: - static constexpr bool enableCache = GET_PROP_VALUE(TypeTag, EnableFVGridGeometryCache); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableFVGridGeometryCache>(); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; using VertexMapper = ReorderingDofMapper<GridView>; @@ -90,20 +96,23 @@ public: }; // Set the problem property -SET_TYPE_PROP(TubesTest, Problem, TubesTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TubesTest> { using type = TubesTestProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(TubesTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TubesTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TubesTestSpatialParams<FVGridGeometry, Scalar>; }; // the fluid system -SET_PROP(TubesTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TubesTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; }; } // end namespace Properties @@ -117,32 +126,32 @@ template <class TypeTag> class TubesTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; // Grid and world dimension static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // indices of the primary variables conti0EqIdx = Indices::conti0EqIdx, pressureIdx = Indices::pressureIdx }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - enum { isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box }; + enum { isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box }; public: TubesTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) diff --git a/test/porousmediumflow/1p/implicit/nonisothermal/main.cc b/test/porousmediumflow/1p/implicit/nonisothermal/main.cc index d4b85919689ad5ea8880885369dcb1e24e0efd3c..a724d448733da0ded3df679a2bebbad6a0dc3a29 100644 --- a/test/porousmediumflow/1p/implicit/nonisothermal/main.cc +++ b/test/porousmediumflow/1p/implicit/nonisothermal/main.cc @@ -84,7 +84,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -97,7 +97,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -108,17 +108,17 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; const std::string paramGroup = FVGridGeometry::discMethod == DiscretizationMethod::ccmpfa ? "MpfaTest" : ""; auto problem = std::make_shared<Problem>(fvGridGeometry, paramGroup); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -127,13 +127,13 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; const auto fileName = getParam<std::string>("Restart.File"); loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits>(), *fvGridGeometry); } @@ -142,14 +142,14 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/1p/implicit/nonisothermal/problem_conduction.hh b/test/porousmediumflow/1p/implicit/nonisothermal/problem_conduction.hh index bdab5ed666d121b7ee18ec0ce841db53a69768c7..85cafe3957c4631818babcc7f490e0cd34baa7e7 100644 --- a/test/porousmediumflow/1p/implicit/nonisothermal/problem_conduction.hh +++ b/test/porousmediumflow/1p/implicit/nonisothermal/problem_conduction.hh @@ -49,28 +49,37 @@ class OnePNIConductionProblem; namespace Properties { -NEW_TYPE_TAG(OnePNIConduction, INHERITS_FROM(OnePNI)); -NEW_TYPE_TAG(OnePNIConductionBox, INHERITS_FROM(BoxModel, OnePNIConduction)); -NEW_TYPE_TAG(OnePNIConductionCCTpfa, INHERITS_FROM(CCTpfaModel, OnePNIConduction)); -NEW_TYPE_TAG(OnePNIConductionCCMpfa, INHERITS_FROM(CCMpfaModel, OnePNIConduction)); +// Create new type tags +namespace TTag { +struct OnePNIConduction { using InheritsFrom = std::tuple<OnePNI>; }; +struct OnePNIConductionBox { using InheritsFrom = std::tuple<OnePNIConduction, BoxModel>; }; +struct OnePNIConductionCCTpfa { using InheritsFrom = std::tuple<OnePNIConduction, CCTpfaModel>; }; +struct OnePNIConductionCCMpfa { using InheritsFrom = std::tuple<OnePNIConduction, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePNIConduction, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePNIConduction> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(OnePNIConduction, Problem, - OnePNIConductionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePNIConduction> { using type = OnePNIConductionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(OnePNIConduction, FluidSystem, - FluidSystems::OnePLiquid<typename GET_PROP_TYPE(TypeTag, Scalar), - Components::H2O<typename GET_PROP_TYPE(TypeTag, Scalar)> >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePNIConduction> +{ + using type = FluidSystems::OnePLiquid<GetPropType<TypeTag, Properties::Scalar>, + Components::H2O<GetPropType<TypeTag, Properties::Scalar>> >; +}; + // Set the spatial parameters -SET_PROP(OnePNIConduction, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePNIConduction> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNISpatialParams<FVGridGeometry, Scalar>; }; } @@ -100,20 +109,20 @@ template <class TypeTag> class OnePNIConductionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using IapwsH2O = Components::H2O<Scalar>; enum { dimWorld = GridView::dimensionworld }; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // indices of the primary variables pressureIdx = Indices::pressureIdx, @@ -122,7 +131,7 @@ class OnePNIConductionProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: OnePNIConductionProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup) diff --git a/test/porousmediumflow/1p/implicit/nonisothermal/problem_convection.hh b/test/porousmediumflow/1p/implicit/nonisothermal/problem_convection.hh index 39b39b89f52c2f5a2de8133175256fcf6f0513e3..0dfd435cc718b87a62ff0b5839cbf6c6075890a3 100644 --- a/test/porousmediumflow/1p/implicit/nonisothermal/problem_convection.hh +++ b/test/porousmediumflow/1p/implicit/nonisothermal/problem_convection.hh @@ -49,27 +49,36 @@ class OnePNIConvectionProblem; namespace Properties { -NEW_TYPE_TAG(OnePNIConvection, INHERITS_FROM(OnePNI)); -NEW_TYPE_TAG(OnePNIConvectionBox, INHERITS_FROM(BoxModel, OnePNIConvection)); -NEW_TYPE_TAG(OnePNIConvectionCCTpfa, INHERITS_FROM(CCTpfaModel, OnePNIConvection)); -NEW_TYPE_TAG(OnePNIConvectionCCMpfa, INHERITS_FROM(CCMpfaModel, OnePNIConvection)); +// Create new type tags +namespace TTag { +struct OnePNIConvection { using InheritsFrom = std::tuple<OnePNI>; }; +struct OnePNIConvectionBox { using InheritsFrom = std::tuple<OnePNIConvection, BoxModel>; }; +struct OnePNIConvectionCCTpfa { using InheritsFrom = std::tuple<OnePNIConvection, CCTpfaModel>; }; +struct OnePNIConvectionCCMpfa { using InheritsFrom = std::tuple<OnePNIConvection, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePNIConvection, Grid, Dune::YaspGrid<1>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePNIConvection> { using type = Dune::YaspGrid<1>; }; // Set the problem property -SET_TYPE_PROP(OnePNIConvection, Problem, OnePNIConvectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePNIConvection> { using type = OnePNIConvectionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(OnePNIConvection, FluidSystem, - FluidSystems::OnePLiquid<typename GET_PROP_TYPE(TypeTag, Scalar), - Components::H2O<typename GET_PROP_TYPE(TypeTag, Scalar)> >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePNIConvection> +{ + using type = FluidSystems::OnePLiquid<GetPropType<TypeTag, Properties::Scalar>, + Components::H2O<GetPropType<TypeTag, Properties::Scalar>> >; +}; // Set the spatial parameters -SET_PROP(OnePNIConvection, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePNIConvection> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNISpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -101,22 +110,22 @@ template <class TypeTag> class OnePNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using IapwsH2O = Components::H2O<Scalar>; enum { dimWorld = GridView::dimensionworld }; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // indices of the primary variables pressureIdx = Indices::pressureIdx, @@ -128,10 +137,10 @@ class OnePNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> energyEqIdx = Indices::energyEqIdx }; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: OnePNIConvectionProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup) diff --git a/test/porousmediumflow/1p/implicit/periodicbc/main.cc b/test/porousmediumflow/1p/implicit/periodicbc/main.cc index 160f8afe736bdf15dc96c04b7287e1a21bcdde8c..3d63c58e49ec378a72033d381c6f233a6e6ac938 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/main.cc +++ b/test/porousmediumflow/1p/implicit/periodicbc/main.cc @@ -50,7 +50,7 @@ int main(int argc, char** argv) try { using namespace Dumux; - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -70,14 +70,14 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); // we compute on the leaf grid view const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry (and make it periodic) - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); @@ -87,29 +87,29 @@ int main(int argc, char** argv) try DUNE_THROW(Dune::GridError, "Your grid is not periodic. Maybe the grid manager doesn't support periodic boundaries."); // the problem (boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->computePointSourceMap(); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system using Assembler = FVAssembler<TypeTag, DiffMethod::analytic>; auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; auto A = std::make_shared<JacobianMatrix>(); auto r = std::make_shared<SolutionVector>(); assembler->setLinearSystem(A, r); diff --git a/test/porousmediumflow/1p/implicit/periodicbc/problem.hh b/test/porousmediumflow/1p/implicit/periodicbc/problem.hh index e3d34c07d1866c48770c7a0d614f95360cc62271..3e5947a7f5e7341b5679b9d777dd3a0a662d9b91 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/problem.hh +++ b/test/porousmediumflow/1p/implicit/periodicbc/problem.hh @@ -54,35 +54,46 @@ template<class TypeTag> class OnePTestProblem; namespace Properties { // create the type tag nodes -NEW_TYPE_TAG(OnePIncompressible, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePIncompressibleTpfa, INHERITS_FROM(CCTpfaModel, OnePIncompressible)); -NEW_TYPE_TAG(OnePIncompressibleMpfa, INHERITS_FROM(CCMpfaModel, OnePIncompressible)); -NEW_TYPE_TAG(OnePIncompressibleBox, INHERITS_FROM(BoxModel, OnePIncompressible)); +// Create new type tags +namespace TTag { +struct OnePIncompressible { using InheritsFrom = std::tuple<OneP>; }; +struct OnePIncompressibleTpfa { using InheritsFrom = std::tuple<OnePIncompressible, CCTpfaModel>; }; +struct OnePIncompressibleMpfa { using InheritsFrom = std::tuple<OnePIncompressible, CCMpfaModel>; }; +struct OnePIncompressibleBox { using InheritsFrom = std::tuple<OnePIncompressible, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(OnePIncompressible, Grid, Dune::SPGrid<double, 2>); -// SET_TYPE_PROP(OnePIncompressible, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePIncompressible> { using type = Dune::SPGrid<double, 2>; }; +// struct Grid<TypeTag, TTag::OnePIncompressible> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; // Set the problem type -SET_TYPE_PROP(OnePIncompressible, Problem, OnePTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePIncompressible> { using type = OnePTestProblem<TypeTag>; }; // set the spatial params -SET_TYPE_PROP(OnePIncompressible, SpatialParams, OnePTestSpatialParams<TypeTag>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePIncompressible> { using type = OnePTestSpatialParams<TypeTag>; }; // use the incompressible local residual (provides analytic jacobian) -SET_TYPE_PROP(OnePIncompressible, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::OnePIncompressible> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // the fluid system -SET_PROP(OnePIncompressible, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePIncompressible> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Enable caching -SET_BOOL_PROP(OnePIncompressible, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(OnePIncompressible, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(OnePIncompressible, EnableFVGridGeometryCache, FVGEOMCACHING); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::OnePIncompressible> { static constexpr bool value = FVGEOMCACHING; }; } // end namespace Properties /*! @@ -96,13 +107,13 @@ template<class TypeTag> class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using SourceValues = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using SourceValues = GetPropType<TypeTag, Properties::NumEqVector>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/implicit/periodicbc/spatialparams.hh b/test/porousmediumflow/1p/implicit/periodicbc/spatialparams.hh index 749052ac0f2ef97308e47b8993975abfe3cb84ed..6f37c1772cb2dcc3680858dd048fde3a8220f2f5 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/spatialparams.hh +++ b/test/porousmediumflow/1p/implicit/periodicbc/spatialparams.hh @@ -36,12 +36,12 @@ namespace Dumux { */ template<class TypeTag> class OnePTestSpatialParams -: public FVSpatialParamsOneP<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar), +: public FVSpatialParamsOneP<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>, OnePTestSpatialParams<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using FVElementGeometry = typename FVGridGeometry::LocalView; diff --git a/test/porousmediumflow/1p/implicit/pointsources/timedependent/main.cc b/test/porousmediumflow/1p/implicit/pointsources/timedependent/main.cc index 849a2f57b9fb126345d54377bf0d8005ec6f501d..c561dabc1b3e4711587a7f4dfb5620b7403b6000 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/timedependent/main.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/timedependent/main.cc @@ -56,7 +56,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -69,7 +69,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -80,36 +80,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->computePointSourceMap(); // enable point sources // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh b/test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh index aeecb34c269abc1002b030829d2c4e2e065b4509..dac2ead70834c9385ca52eea7f9f253bbdc0225c 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh +++ b/test/porousmediumflow/1p/implicit/pointsources/timedependent/problem.hh @@ -34,13 +34,18 @@ class OnePSingularityProblemTimeDependent; namespace Properties { -NEW_TYPE_TAG(OnePSingularityTimeDependentCCTpfa, INHERITS_FROM(OnePSingularityCCTpfa)); +// Create new type tags +namespace TTag { +struct OnePSingularityTimeDependentCCTpfa { using InheritsFrom = std::tuple<OnePSingularityCCTpfa>; }; +} // end namespace TTag // Set the problem property -SET_TYPE_PROP(OnePSingularityTimeDependentCCTpfa, Problem, OnePSingularityProblemTimeDependent<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSingularityTimeDependentCCTpfa> { using type = OnePSingularityProblemTimeDependent<TypeTag>; }; // point source -SET_TYPE_PROP(OnePSingularityTimeDependentCCTpfa, PointSource, SolDependentPointSource<TypeTag>); +template<class TypeTag> +struct PointSource<TypeTag, TTag::OnePSingularityTimeDependentCCTpfa> { using type = SolDependentPointSource<TypeTag>; }; } /*! @@ -61,17 +66,17 @@ template <class TypeTag> class OnePSingularityProblemTimeDependent : public OnePSingularityProblem<TypeTag> { using ParentType = OnePSingularityProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; public: OnePSingularityProblemTimeDependent(std::shared_ptr<const FVGridGeometry> fvGridGeometry) diff --git a/test/porousmediumflow/1p/implicit/pointsources/timeindependent/main.cc b/test/porousmediumflow/1p/implicit/pointsources/timeindependent/main.cc index 9c6ab49263ac893e9aac47014e32e3a2f8b295f6..814501b0b59eedab34c8d7b39dd8bb038bc60ee6 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/timeindependent/main.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/timeindependent/main.cc @@ -56,7 +56,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -69,7 +69,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -80,36 +80,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->computePointSourceMap(); // enable point sources // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh b/test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh index 419624f066e8d54c2783155fb9d4b16507a1e9eb..cc36cff5cd7ef41909bf91c2e32d7623fdccbded 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh +++ b/test/porousmediumflow/1p/implicit/pointsources/timeindependent/problem.hh @@ -43,29 +43,36 @@ class OnePSingularityProblem; namespace Properties { -NEW_TYPE_TAG(OnePSingularity, INHERITS_FROM(OneP)); -NEW_TYPE_TAG(OnePSingularityBox, INHERITS_FROM(BoxModel, OnePSingularity)); -NEW_TYPE_TAG(OnePSingularityCCTpfa, INHERITS_FROM(CCTpfaModel, OnePSingularity)); +// Create new type tags +namespace TTag { +struct OnePSingularity { using InheritsFrom = std::tuple<OneP>; }; +struct OnePSingularityBox { using InheritsFrom = std::tuple<OnePSingularity, BoxModel>; }; +struct OnePSingularityCCTpfa { using InheritsFrom = std::tuple<OnePSingularity, CCTpfaModel>; }; +} // end namespace TTag // the fluid system -SET_PROP(OnePSingularity, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePSingularity> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Set the grid type -SET_TYPE_PROP(OnePSingularity, Grid, - Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePSingularity> +{ using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(OnePSingularity, Problem, OnePSingularityProblem<TypeTag> ); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePSingularity> { using type = OnePSingularityProblem<TypeTag> ; }; // Set the spatial parameters -SET_PROP(OnePSingularity, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePSingularity> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePSingularitySpatialParams<FVGridGeometry, Scalar>; }; } @@ -87,21 +94,21 @@ template <class TypeTag> class OnePSingularityProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; enum { // index of the primary variable pressureIdx = Indices::pressureIdx }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1p/sequential/test_1pproblem.hh b/test/porousmediumflow/1p/sequential/test_1pproblem.hh index e410974a6d0ba0eff389c259afb5e2ef877616c5..fa23789fa038375d82dd971b617acb55e4d1b2a4 100644 --- a/test/porousmediumflow/1p/sequential/test_1pproblem.hh +++ b/test/porousmediumflow/1p/sequential/test_1pproblem.hh @@ -52,7 +52,8 @@ NEW_TYPE_TAG(TestOneP, INHERITS_FROM(FVPressureOneP)); SET_TYPE_PROP(TestOneP, Grid, Dune::YaspGrid<2>); // the fluid system -SET_PROP(TestOneP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TestOneP> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh index df8f8b216843fa1fec81c67b4417c196470cf22e..38ce14fdabfe338ea21fd9baf4aad96af2f58f94 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh @@ -58,7 +58,8 @@ SET_TYPE_PROP(FVVelocity2PTestTypeTag, Problem, TestDiffusionProblem<TypeTag>); SET_TYPE_PROP(FVVelocity2PTestTypeTag, Grid, Dune::YaspGrid<2>); // Set the fluid system -SET_PROP(FVVelocity2PTestTypeTag, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::FVVelocity2PTestTypeTag> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; @@ -75,7 +76,8 @@ SET_TYPE_PROP(FVMPFAOVelocity2PTestTypeTag, Problem, TestDiffusionProblem<TypeTa SET_TYPE_PROP(FVMPFAOVelocity2PTestTypeTag, Grid, Dune::YaspGrid<2>); // Set the fluid system -SET_PROP(FVMPFAOVelocity2PTestTypeTag, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::FVMPFAOVelocity2PTestTypeTag> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; @@ -91,7 +93,8 @@ SET_TYPE_PROP(MimeticPressure2PTestTypeTag, Problem, TestDiffusionProblem<TypeTa SET_TYPE_PROP(MimeticPressure2PTestTypeTag, Grid, Dune::YaspGrid<2>); // Set the fluid system -SET_PROP(MimeticPressure2PTestTypeTag, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MimeticPressure2PTestTypeTag> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh index c629bbd9872ebba2664c205fa853adfd87d41f08..d5d323defc786e2b420ea6d20741f1e295f4847a 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh @@ -68,7 +68,8 @@ SET_TYPE_PROP(DiffusionTest, Grid, Dune::YaspGrid<3>); SET_TYPE_PROP(DiffusionTest, Problem, TestDiffusion3DProblem<TypeTag>); // Set the fluid system -SET_PROP(DiffusionTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DiffusionTest> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; diff --git a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh index c9dde0908aae58dbac1b6569642c429cc882dffc..0929c325a8968154c477422afd35ec187fb61bd9 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh @@ -45,7 +45,8 @@ NEW_TYPE_TAG(TestDiffusionSpatialParams); SET_TYPE_PROP(TestDiffusionSpatialParams, SpatialParams, TestDiffusionSpatialParams<TypeTag>); // Set the material law -SET_PROP(TestDiffusionSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::TestDiffusionSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh index 03ec4181fc4a8e217e3b858c761adcca07644fa6..659d7bb1e5fe05f5d4c05ddd8307cb13a4fd1fd8 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh @@ -44,7 +44,8 @@ NEW_TYPE_TAG(TestDiffusionSpatialParams3d); SET_TYPE_PROP(TestDiffusionSpatialParams3d, SpatialParams, TestDiffusionSpatialParams3d<TypeTag>); // Set the material law -SET_PROP(TestDiffusionSpatialParams3d, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::TestDiffusionSpatialParams3d> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/main.cc b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/main.cc index 568d8e5c42f9c7870f276576118c08f4fff38013..a8858e3b7591425bde648cc4b0477e7b754c3adf 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/main.cc +++ b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,36 +84,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/problem.hh b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/problem.hh index 4fd7b1675e7e6c864ae26377f98576d4177a4256..ffa72749bced7b654e900a0b54a67fbf1be76aea 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/problem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/problem.hh @@ -50,39 +50,48 @@ class OnePTwoCTestProblem; namespace Properties { -NEW_TYPE_TAG(OnePTwoCTest, INHERITS_FROM(OnePNC)); -NEW_TYPE_TAG(OnePTwoCTestBox, INHERITS_FROM(BoxModel, OnePTwoCTest)); -NEW_TYPE_TAG(OnePTwoCTestCCTpfa, INHERITS_FROM(CCTpfaModel, OnePTwoCTest)); -NEW_TYPE_TAG(OnePTwoCTestCCMpfa, INHERITS_FROM(CCMpfaModel, OnePTwoCTest)); +// Create new type tags +namespace TTag { +struct OnePTwoCTest { using InheritsFrom = std::tuple<OnePNC>; }; +struct OnePTwoCTestBox { using InheritsFrom = std::tuple<OnePTwoCTest, BoxModel>; }; +struct OnePTwoCTestCCTpfa { using InheritsFrom = std::tuple<OnePTwoCTest, CCTpfaModel>; }; +struct OnePTwoCTestCCMpfa { using InheritsFrom = std::tuple<OnePTwoCTest, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type #if HAVE_UG -SET_TYPE_PROP(OnePTwoCTest, Grid, Dune::UGGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCTest> { using type = Dune::UGGrid<2>; }; #else -SET_TYPE_PROP(OnePTwoCTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCTest> { using type = Dune::YaspGrid<2>; }; #endif // Set the problem property -SET_TYPE_PROP(OnePTwoCTest, Problem, OnePTwoCTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePTwoCTest> { using type = OnePTwoCTestProblem<TypeTag>; }; // Set fluid configuration -SET_PROP(OnePTwoCTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePTwoCTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2ON2 = FluidSystems::H2ON2<Scalar, FluidSystems::H2ON2DefaultPolicy</*simplified=*/true>>; using type = FluidSystems::OnePAdapter<H2ON2, H2ON2::liquidPhaseIdx>; }; // Set the spatial parameters -SET_PROP(OnePTwoCTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePTwoCTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNCTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(OnePTwoCTest, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::OnePTwoCTest> { static constexpr bool value = true; }; } @@ -115,16 +124,16 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -144,8 +153,8 @@ class OnePTwoCTestProblem : public PorousMediumFlowProblem<TypeTag> }; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static const bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); + static const bool isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box; static const int dimWorld = GridView::dimensionworld; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/main.cc b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/main.cc index 5731304f669323b4071879a0cd5c96605c84f5ec..6968262f2a8fd33f9a71990fcfd6f722ca21e599 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/main.cc +++ b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,36 +84,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/problem.hh b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/problem.hh index de7c7abb85e2a2e89074a6b38d0dec8444f44010..a0f4cdcd59f23411dbad1286e2adbea303ada3d7 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/problem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2c/isothermal/saltwaterintrusion/problem.hh @@ -38,29 +38,36 @@ template <class TypeTag> class SaltWaterIntrusionTestProblem; namespace Properties { -NEW_TYPE_TAG(SaltWaterIntrusionTest, INHERITS_FROM(BoxModel, OnePNC)); +// Create new type tags +namespace TTag { +struct SaltWaterIntrusionTest { using InheritsFrom = std::tuple<OnePNC, BoxModel>; }; +} // end namespace TTag // Use a structured yasp grid -SET_TYPE_PROP(SaltWaterIntrusionTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::SaltWaterIntrusionTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(SaltWaterIntrusionTest, Problem, SaltWaterIntrusionTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::SaltWaterIntrusionTest> { using type = SaltWaterIntrusionTestProblem<TypeTag>; }; // Set fluid configuration -SET_TYPE_PROP(SaltWaterIntrusionTest, - FluidSystem, - FluidSystems::Brine< typename GET_PROP_TYPE(TypeTag, Scalar) >); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::SaltWaterIntrusionTest> +{ using type = FluidSystems::Brine< GetPropType<TypeTag, Properties::Scalar> >; }; // Set the spatial parameters -SET_PROP(SaltWaterIntrusionTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::SaltWaterIntrusionTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNCTestSpatialParams<FVGridGeometry, Scalar>; }; // Use mass fractions to set salinity conveniently -SET_BOOL_PROP(SaltWaterIntrusionTest, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::SaltWaterIntrusionTest> { static constexpr bool value = false; }; } // end namespace Properties @@ -77,21 +84,21 @@ class SaltWaterIntrusionTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; // copy pressure index for convenience enum { pressureIdx = Indices::pressureIdx }; //! The test is defined using mass fractions - static_assert(!GET_PROP_VALUE(TypeTag, UseMoles), "This test uses mass fractions!"); + static_assert(!getPropValue<TypeTag, Properties::UseMoles>(), "This test uses mass fractions!"); public: SaltWaterIntrusionTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/main.cc b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/main.cc index acb788c48d799ace8ebb3c0848ca28c28317c112..a4d961aab7655aa76af3a8cbf52b475d0261c638 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/main.cc +++ b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,36 +84,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh index 7f57305929f80706a62254e304ffd264cfee1af1..a772552d040ae48d1ac6d914081a6c073cba40bf 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh @@ -50,39 +50,48 @@ class OnePTwoCNIConductionProblem; namespace Properties { -NEW_TYPE_TAG(OnePTwoCNIConduction, INHERITS_FROM(OnePNCNI)); -NEW_TYPE_TAG(OnePTwoCNIConductionCCTpfa, INHERITS_FROM(CCTpfaModel, OnePTwoCNIConduction)); -NEW_TYPE_TAG(OnePTwoCNIConductionCCMpfa, INHERITS_FROM(CCMpfaModel, OnePTwoCNIConduction)); -NEW_TYPE_TAG(OnePTwoCNIConductionBox, INHERITS_FROM(BoxModel, OnePTwoCNIConduction)); +// Create new type tags +namespace TTag { +struct OnePTwoCNIConduction { using InheritsFrom = std::tuple<OnePNCNI>; }; +struct OnePTwoCNIConductionCCTpfa { using InheritsFrom = std::tuple<OnePTwoCNIConduction, CCTpfaModel>; }; +struct OnePTwoCNIConductionCCMpfa { using InheritsFrom = std::tuple<OnePTwoCNIConduction, CCMpfaModel>; }; +struct OnePTwoCNIConductionBox { using InheritsFrom = std::tuple<OnePTwoCNIConduction, BoxModel>; }; +} // end namespace TTag // Set the grid type #if HAVE_UG -SET_TYPE_PROP(OnePTwoCNIConduction, Grid, Dune::UGGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCNIConduction> { using type = Dune::UGGrid<2>; }; #else -SET_TYPE_PROP(OnePTwoCNIConduction, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCNIConduction> { using type = Dune::YaspGrid<2>; }; #endif // Set the problem property -SET_TYPE_PROP(OnePTwoCNIConduction, Problem, OnePTwoCNIConductionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePTwoCNIConduction> { using type = OnePTwoCNIConductionProblem<TypeTag>; }; // Set fluid configuration -SET_PROP(OnePTwoCNIConduction, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePTwoCNIConduction> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2ON2 = FluidSystems::H2ON2<Scalar, FluidSystems::H2ON2DefaultPolicy</*simplified=*/true>>; using type = FluidSystems::OnePAdapter<H2ON2, H2ON2::liquidPhaseIdx>; }; // Set the spatial parameters -SET_PROP(OnePTwoCNIConduction, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePTwoCNIConduction> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNCTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(OnePTwoCNIConduction, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::OnePTwoCNIConduction> { static constexpr bool value = true; }; } @@ -115,18 +124,18 @@ class OnePTwoCNIConductionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using Element = typename GridView::template Codim<0>::Entity; - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using IapwsH2O = Components::H2O<Scalar>; // copy some indices for convenience @@ -140,7 +149,7 @@ class OnePTwoCNIConductionProblem : public PorousMediumFlowProblem<TypeTag> }; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); static const int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/main.cc b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/main.cc index e56585e7f6c5f4ea93545beca59d111b4c36244e..bd8e38d181c97460c91dfcd82c2a65dd89625533 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/main.cc +++ b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,36 +84,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/problem.hh b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/problem.hh index 31fed542e6e9db08dfec3d3a2d3bd8774ef0d030..8dc2705bec6bf26aa0c7a15df0e25c1ab1a3cfdf 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/problem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/convection/problem.hh @@ -50,39 +50,48 @@ class OnePTwoCNIConvectionProblem; namespace Properties { -NEW_TYPE_TAG(OnePTwoCNIConvection, INHERITS_FROM(OnePNCNI)); -NEW_TYPE_TAG(OnePTwoCNIConvectionCCTpfa, INHERITS_FROM(CCTpfaModel, OnePTwoCNIConvection)); -NEW_TYPE_TAG(OnePTwoCNIConvectionCCMpfa, INHERITS_FROM(CCMpfaModel, OnePTwoCNIConvection)); -NEW_TYPE_TAG(OnePTwoCNIConvectionBox, INHERITS_FROM(BoxModel, OnePTwoCNIConvection)); +// Create new type tags +namespace TTag { +struct OnePTwoCNIConvection { using InheritsFrom = std::tuple<OnePNCNI>; }; +struct OnePTwoCNIConvectionCCTpfa { using InheritsFrom = std::tuple<OnePTwoCNIConvection, CCTpfaModel>; }; +struct OnePTwoCNIConvectionCCMpfa { using InheritsFrom = std::tuple<OnePTwoCNIConvection, CCMpfaModel>; }; +struct OnePTwoCNIConvectionBox { using InheritsFrom = std::tuple<OnePTwoCNIConvection, BoxModel>; }; +} // end namespace TTag // Set the grid type #if HAVE_UG -SET_TYPE_PROP(OnePTwoCNIConvection, Grid, Dune::UGGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCNIConvection> { using type = Dune::UGGrid<2>; }; #else -SET_TYPE_PROP(OnePTwoCNIConvection, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::OnePTwoCNIConvection> { using type = Dune::YaspGrid<2>; }; #endif // Set the problem property -SET_TYPE_PROP(OnePTwoCNIConvection, Problem, OnePTwoCNIConvectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::OnePTwoCNIConvection> { using type = OnePTwoCNIConvectionProblem<TypeTag>; }; // Set fluid configuration -SET_PROP(OnePTwoCNIConvection, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::OnePTwoCNIConvection> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2ON2 = FluidSystems::H2ON2<Scalar, FluidSystems::H2ON2DefaultPolicy</*simplified=*/true>>; using type = FluidSystems::OnePAdapter<H2ON2, H2ON2::liquidPhaseIdx>; }; // Set the spatial parameters -SET_PROP(OnePTwoCNIConvection, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::OnePTwoCNIConvection> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePNCTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(OnePTwoCNIConvection, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::OnePTwoCNIConvection> { static constexpr bool value = true; }; } @@ -115,20 +124,20 @@ class OnePTwoCNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using IapwsH2O = Components::H2O<Scalar>; // copy some indices for convenience @@ -149,7 +158,7 @@ class OnePTwoCNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> }; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); static const int dimWorld = GridView::dimensionworld; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/test/porousmediumflow/1pncmin/implicit/nonisothermal/main.cc b/test/porousmediumflow/1pncmin/implicit/nonisothermal/main.cc index ca43aac3566ff0ecbf143f2a67e53d28156247c4..a9c1986781c633dca49f27daa55d8b12c1819de8 100644 --- a/test/porousmediumflow/1pncmin/implicit/nonisothermal/main.cc +++ b/test/porousmediumflow/1pncmin/implicit/nonisothermal/main.cc @@ -80,7 +80,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -110,34 +110,34 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); // Add model specific output fields diff --git a/test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh b/test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh index d5c25b0c48ec77abcfc3d1246f729bb0f5df7d00..87a9626973073e6b7ac83c2a8ff6c32b70779681 100644 --- a/test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh +++ b/test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh @@ -48,44 +48,54 @@ template <class TypeTag> class ThermoChemProblem; namespace Properties { -NEW_TYPE_TAG(ThermoChem, INHERITS_FROM(OnePNCMinNI)); -NEW_TYPE_TAG(ThermoChemBox, INHERITS_FROM(BoxModel, ThermoChem)); +// Create new type tags +namespace TTag { +struct ThermoChem { using InheritsFrom = std::tuple<OnePNCMinNI>; }; +struct ThermoChemBox { using InheritsFrom = std::tuple<ThermoChem, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(ThermoChem, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ThermoChem> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ThermoChem, Problem, ThermoChemProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::ThermoChem> { using type = ThermoChemProblem<TypeTag>; }; // The fluid system -SET_PROP(ThermoChem, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThermoChem> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2ON2 = FluidSystems::H2ON2<Scalar>; static constexpr auto phaseIdx = H2ON2::gasPhaseIdx; // simulate the air phase using type = FluidSystems::OnePAdapter<H2ON2, phaseIdx>; }; -SET_PROP(ThermoChem, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::ThermoChem> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ComponentOne = Components::ModifiedCaO<Scalar>; using ComponentTwo = Components::CaO2H2<Scalar>; using type = SolidSystems::CompositionalSolidPhase<Scalar, ComponentOne, ComponentTwo>; }; // // Enable velocity output -// SET_BOOL_PROP(ThermoChem, VtkAddVelocity, false); +// template<class TypeTag> +// struct VtkAddVelocity<TypeTag, TTag::ThermoChem> { static constexpr bool value = false; }; // Set the spatial parameters -SET_PROP(ThermoChem, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ThermoChem> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = ThermoChemSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(ThermoChem, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ThermoChem> { static constexpr bool value = true; }; } /*! @@ -104,22 +114,22 @@ template <class TypeTag> class ThermoChemProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using ReactionRate = ThermoChemReaction; enum { dim = GridView::dimension }; @@ -168,7 +178,7 @@ public: boundaryVaporMoleFrac_ = getParam<Scalar>("Problem.BoundaryMoleFraction"); boundaryTemperature_ = getParam<Scalar>("Problem.BoundaryTemperature"); - unsigned int codim = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; permeability_.resize(fvGridGeometry->gridView().size(codim)); porosity_.resize(fvGridGeometry->gridView().size(codim)); reactionRate_.resize(fvGridGeometry->gridView().size(codim)); diff --git a/test/porousmediumflow/2p/implicit/adaptive/main.cc b/test/porousmediumflow/2p/implicit/adaptive/main.cc index 95051b319ca619730cdb3b1a4a50f59977e66f3f..62cd6b52374c036f38930f045fb6ecf01b16786d 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/main.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/main.cc @@ -63,23 +63,33 @@ namespace Dumux { namespace Properties { //! Type Tags for the adaptive tests -NEW_TYPE_TAG(TwoPIncompressibleAdaptiveTpfa, INHERITS_FROM(TwoPIncompressibleTpfa)); -NEW_TYPE_TAG(TwoPIncompressibleAdaptiveMpfa, INHERITS_FROM(TwoPIncompressibleMpfa)); -NEW_TYPE_TAG(TwoPIncompressibleAdaptiveBox, INHERITS_FROM(TwoPIncompressibleBox)); -NEW_TYPE_TAG(TwoPAdaptivePointSource, INHERITS_FROM(TwoPIncompressibleAdaptiveTpfa)); +// Create new type tags +namespace TTag { +struct TwoPIncompressibleAdaptiveTpfa { using InheritsFrom = std::tuple<TwoPIncompressibleTpfa>; }; +struct TwoPIncompressibleAdaptiveMpfa { using InheritsFrom = std::tuple<TwoPIncompressibleMpfa>; }; +struct TwoPIncompressibleAdaptiveBox { using InheritsFrom = std::tuple<TwoPIncompressibleBox>; }; +struct TwoPAdaptivePointSource { using InheritsFrom = std::tuple<TwoPIncompressibleAdaptiveTpfa>; }; +} // end namespace TTag //! Use non-conforming refinement in the cell-centered tests, conforming for box #if HAVE_DUNE_ALUGRID -SET_TYPE_PROP(TwoPIncompressibleAdaptiveTpfa, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); -SET_TYPE_PROP(TwoPIncompressibleAdaptiveMpfa, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPIncompressibleAdaptiveTpfa> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPIncompressibleAdaptiveMpfa> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; #endif #if HAVE_DUNE_UGGRID -SET_TYPE_PROP(TwoPIncompressibleAdaptiveBox, Grid, Dune::UGGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPIncompressibleAdaptiveBox> { using type = Dune::UGGrid<2>; }; #endif -SET_TYPE_PROP(TwoPAdaptivePointSource, Problem, PointSourceTestProblem<TypeTag>); -SET_TYPE_PROP(TwoPIncompressibleAdaptiveTpfa, Problem, TwoPTestProblemAdaptive<TypeTag>); -SET_TYPE_PROP(TwoPIncompressibleAdaptiveMpfa, Problem, TwoPTestProblemAdaptive<TypeTag>); -SET_TYPE_PROP(TwoPIncompressibleAdaptiveBox, Problem, TwoPTestProblemAdaptive<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPAdaptivePointSource> { using type = PointSourceTestProblem<TypeTag>; }; +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPIncompressibleAdaptiveTpfa> { using type = TwoPTestProblemAdaptive<TypeTag>; }; +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPIncompressibleAdaptiveMpfa> { using type = TwoPTestProblemAdaptive<TypeTag>; }; +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPIncompressibleAdaptiveBox> { using type = TwoPTestProblemAdaptive<TypeTag>; }; } // end namespace Properties } // end namespace Dumux @@ -88,7 +98,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +111,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,28 +122,28 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->computePointSourceMap(); // enable point sources // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // instantiate indicator & data transfer, read parameters for indicator - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const Scalar refineTol = getParam<Scalar>("Adaptive.RefineTolerance"); const Scalar coarsenTol = getParam<Scalar>("Adaptive.CoarsenTolerance"); TwoPGridAdaptIndicator<TypeTag> indicator(fvGridGeometry); @@ -177,15 +187,15 @@ int main(int argc, char** argv) try } // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/adaptive/pointsourceproblem.hh b/test/porousmediumflow/2p/implicit/adaptive/pointsourceproblem.hh index 470308c28c1b797e38cb2de58095bb9205ac3455..a0ce5017e3097ee909fc7ac7e86a5f20132c284d 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/pointsourceproblem.hh +++ b/test/porousmediumflow/2p/implicit/adaptive/pointsourceproblem.hh @@ -35,7 +35,7 @@ template <class TypeTag > class PointSourceTestProblem : public TwoPTestProblemAdaptive<TypeTag> { using ParentType = TwoPTestProblemAdaptive<TypeTag>; - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); + using PointSource = GetPropType<TypeTag, Properties::PointSource>; public: //! Use parent's constructor diff --git a/test/porousmediumflow/2p/implicit/adaptive/problem.hh b/test/porousmediumflow/2p/implicit/adaptive/problem.hh index 1c777055cf7c73f317e47c2dc2dee0f978773265..4e84296690680b64f3a4e15e2c10fc1a8f9e14f7 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/problem.hh +++ b/test/porousmediumflow/2p/implicit/adaptive/problem.hh @@ -37,12 +37,12 @@ template <class TypeTag > class TwoPTestProblemAdaptive : public TwoPTestProblem<TypeTag> { using ParentType = TwoPTestProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using Vertex = typename GridView::template Codim<GridView::dimensionworld>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; diff --git a/test/porousmediumflow/2p/implicit/boxdfm/main.cc b/test/porousmediumflow/2p/implicit/boxdfm/main.cc index 084faa366a8406608b35c10b039f7511e614ca71..152834a65fb78df93116ae4c12ca5982568ff5be 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/main.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/main.cc @@ -86,7 +86,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TwoPIncompressibleBoxDfm); + using TypeTag = Properties::TTag::TwoPIncompressibleBoxDfm; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try // we reuse the facet coupling grid manager to create the grid // from a mesh file with the fractures being incorporated as // lower-dimensional elements. - using Grid = typename GET_PROP_TYPE(TypeTag, Grid); + using Grid = GetPropType<TypeTag, Properties::Grid>; using FractureGrid = FRACTUREGRIDTYPE; using GridManager = FacetCouplingGridManager<Grid, FractureGrid>; GridManager gridManager; @@ -118,16 +118,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.template grid<0>().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(fractureGridAdapter); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; @@ -136,19 +136,19 @@ int main(int argc, char** argv) try problem->spatialParams().updateMaterialInterfaceParams(x); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module using VtkOutputModule = BoxDfmVtkOutputModule<GridVariables, SolutionVector, FractureGrid>; - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), fractureGridAdapter, "", Dune::VTK::nonconforming); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/boxdfm/problem.hh b/test/porousmediumflow/2p/implicit/boxdfm/problem.hh index 97b59ad38290d1597795709b2a39614029903b4b..71d50c3068ca2ec9b4d295446336afeb986f6379 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/problem.hh +++ b/test/porousmediumflow/2p/implicit/boxdfm/problem.hh @@ -56,43 +56,55 @@ namespace Properties { // we need to derive first from twop and then from the box-dfm Model // because the flux variables cache type of TwoP is overwritten in BoxDfmModel -NEW_TYPE_TAG(TwoPIncompressibleBoxDfm, INHERITS_FROM(TwoP, BoxDfmModel)); +// Create new type tags +namespace TTag { +struct TwoPIncompressibleBoxDfm { using InheritsFrom = std::tuple<BoxDfmModel, TwoP>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TwoPIncompressibleBoxDfm, Grid, GRIDTYPE); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPIncompressibleBoxDfm> { using type = GRIDTYPE; }; // Set the problem type -SET_TYPE_PROP(TwoPIncompressibleBoxDfm, Problem, TwoPTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPIncompressibleBoxDfm> { using type = TwoPTestProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(TwoPIncompressibleBoxDfm, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPIncompressibleBoxDfm> { private: - using FVG = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVG = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = TwoPTestSpatialParams<FVG, Scalar>; }; // the local residual containing the analytic derivative methods -SET_TYPE_PROP(TwoPIncompressibleBoxDfm, LocalResidual, TwoPIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPIncompressibleBoxDfm> { using type = TwoPIncompressibleLocalResidual<TypeTag>; }; // Set the fluid system -SET_PROP(TwoPIncompressibleBoxDfm, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPIncompressibleBoxDfm> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; using NonwettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Trichloroethene<Scalar> >; using type = FluidSystems::TwoPImmiscible<Scalar, WettingPhase, NonwettingPhase>; }; // Enable caching -SET_BOOL_PROP(TwoPIncompressibleBoxDfm, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(TwoPIncompressibleBoxDfm, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(TwoPIncompressibleBoxDfm, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::TwoPIncompressibleBoxDfm> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::TwoPIncompressibleBoxDfm> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::TwoPIncompressibleBoxDfm> { static constexpr bool value = false; }; // Enable the box-interface solver -SET_BOOL_PROP(TwoPIncompressibleBoxDfm, EnableBoxInterfaceSolver, true); +template<class TypeTag> +struct EnableBoxInterfaceSolver<TypeTag, TTag::TwoPIncompressibleBoxDfm> { static constexpr bool value = true; }; } // end namespace Properties /*! @@ -104,20 +116,20 @@ class TwoPTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using SubControlVolume = typename FVGridGeometry::SubControlVolume; // some indices for convenience - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { pressureH2OIdx = Indices::pressureIdx, diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/main.cc b/test/porousmediumflow/2p/implicit/cornerpoint/main.cc index 379702c849ed25f727cdc4a1abf1d668e6c6170f..11215e31d6a3a38a9b710f99aa97be7d326a6306 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/main.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/main.cc @@ -95,7 +95,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TwoPCornerPoint); + using TypeTag = Properties::TTag::TwoPCornerPoint; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -119,37 +119,37 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto spatialParams = std::make_shared<typename Problem::SpatialParams>(fvGridGeometry, gridManager.getDeck()); auto problem = std::make_shared<Problem>(fvGridGeometry, spatialParams); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name(), "", Dune::VTK::conforming); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh b/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh index 46d94376ef676016856db3481b6c75e71af8ffe0..64ab5201e102d75f01bd1428e13df6f7ed6ebf56 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh +++ b/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh @@ -43,40 +43,51 @@ namespace Dumux { template<class TypeTag> class TwoPCornerPointTestProblem; namespace Properties { -NEW_TYPE_TAG(TwoPCornerPoint, INHERITS_FROM(TwoP, CCTpfaModel)); +// Create new type tags +namespace TTag { +struct TwoPCornerPoint { using InheritsFrom = std::tuple<CCTpfaModel, TwoP>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TwoPCornerPoint, Grid, Dune::CpGrid); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPCornerPoint> { using type = Dune::CpGrid; }; // Set the problem type -SET_TYPE_PROP(TwoPCornerPoint, Problem, TwoPCornerPointTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPCornerPoint> { using type = TwoPCornerPointTestProblem<TypeTag>; }; // the local residual containing the analytic derivative methods -SET_TYPE_PROP(TwoPCornerPoint, LocalResidual, TwoPIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPCornerPoint> { using type = TwoPIncompressibleLocalResidual<TypeTag>; }; // Set the fluid system -SET_PROP(TwoPCornerPoint, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPCornerPoint> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; using NonwettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Trichloroethene<Scalar> >; using type = FluidSystems::TwoPImmiscible<Scalar, WettingPhase, NonwettingPhase>; }; // Set the spatial parameters -SET_PROP(TwoPCornerPoint, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPCornerPoint> { private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = TwoPCornerPointTestSpatialParams<FVGridGeometry, Scalar>; }; // Enable caching -SET_BOOL_PROP(TwoPCornerPoint, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(TwoPCornerPoint, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(TwoPCornerPoint, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::TwoPCornerPoint> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::TwoPCornerPoint> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::TwoPCornerPoint> { static constexpr bool value = false; }; } // end namespace Properties /*! @@ -87,20 +98,20 @@ template<class TypeTag> class TwoPCornerPointTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; public: diff --git a/test/porousmediumflow/2p/implicit/fracture/main.cc b/test/porousmediumflow/2p/implicit/fracture/main.cc index be8f72b903bf8258491a7071a252ba6b72a1a218..0d696696d0f2c2594e2c961c2b0b0d2dd5c10727 100644 --- a/test/porousmediumflow/2p/implicit/fracture/main.cc +++ b/test/porousmediumflow/2p/implicit/fracture/main.cc @@ -70,7 +70,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -83,7 +83,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -94,35 +94,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/fracture/problem.hh b/test/porousmediumflow/2p/implicit/fracture/problem.hh index b2a5efb29f84c26dca72fc68a90a2b5d15da62c1..598ca1bca3e7e85c702eab075347b536a9924655 100644 --- a/test/porousmediumflow/2p/implicit/fracture/problem.hh +++ b/test/porousmediumflow/2p/implicit/fracture/problem.hh @@ -49,43 +49,54 @@ template <class TypeTag> class FractureProblem; namespace Properties { -NEW_TYPE_TAG(Fracture, INHERITS_FROM(TwoP)); -NEW_TYPE_TAG(FractureBox, INHERITS_FROM(BoxModel, Fracture)); -NEW_TYPE_TAG(FractureCCTpfa, INHERITS_FROM(CCTpfaModel, Fracture)); -NEW_TYPE_TAG(FractureCCMpfa, INHERITS_FROM(CCMpfaModel, Fracture)); +// Create new type tags +namespace TTag { +struct Fracture { using InheritsFrom = std::tuple<TwoP>; }; +struct FractureBox { using InheritsFrom = std::tuple<Fracture, BoxModel>; }; +struct FractureCCTpfa { using InheritsFrom = std::tuple<Fracture, CCTpfaModel>; }; +struct FractureCCMpfa { using InheritsFrom = std::tuple<Fracture, CCMpfaModel>; }; +} // end namespace TTag // set the grid property #if HAVE_DUNE_FOAMGRID -SET_TYPE_PROP(Fracture, Grid, Dune::FoamGrid<2, 3>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Fracture> { using type = Dune::FoamGrid<2, 3>; }; #endif // Set the problem property -SET_TYPE_PROP(Fracture, Problem, Dumux::FractureProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Fracture> { using type = Dumux::FractureProblem<TypeTag>; }; // Set the fluid system -SET_PROP(Fracture, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Fracture> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; using NonwettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Trichloroethene<Scalar> >; using type = FluidSystems::TwoPImmiscible<Scalar, WettingPhase, NonwettingPhase>; }; // Set the spatial parameters -SET_PROP(Fracture, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Fracture> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FractureSpatialParams<FVGridGeometry, Scalar>; }; // Use global caching -SET_BOOL_PROP(Fracture, EnableFVGridGeometryCache, true); -SET_BOOL_PROP(Fracture, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(Fracture, EnableGridFluxVariablesCache, true); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Fracture> { static constexpr bool value = true; }; // permeablility is solution-independent -SET_BOOL_PROP(Fracture, SolutionDependentAdvection, false); +template<class TypeTag> +struct SolutionDependentAdvection<TypeTag, TTag::Fracture> { static constexpr bool value = false; }; } // end namespace Properties /*! @@ -96,14 +107,14 @@ template <class TypeTag> class FractureProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; enum { diff --git a/test/porousmediumflow/2p/implicit/incompressible/main.cc b/test/porousmediumflow/2p/implicit/incompressible/main.cc index 00a96c92d36e5d876b6c33d78b52b2696ef0c235..70f959a97e51ee9ff72b57ac6ce9688479780e12 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/main.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/main.cc @@ -90,7 +90,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -103,7 +103,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -114,16 +114,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -132,14 +132,14 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; const auto fileName = getParam<std::string>("Restart.File"); loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(), *fvGridGeometry); } @@ -152,18 +152,18 @@ int main(int argc, char** argv) try problem->spatialParams().updateMaterialInterfaceParams(x); // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; // use non-conforming output for the test with interface solver const auto ncOutput = getParam<bool>("Problem.UseNonConformingOutput", false); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name(), "", ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); diff --git a/test/porousmediumflow/2p/implicit/incompressible/problem.hh b/test/porousmediumflow/2p/implicit/incompressible/problem.hh index 5d630ec5953c05dc6cb4c51916c101732d4f64db..90594f9d3eb9576375a6011f2bf6dd3dde2cfcfe 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/problem.hh +++ b/test/porousmediumflow/2p/implicit/incompressible/problem.hh @@ -49,46 +49,58 @@ namespace Dumux { template<class TypeTag> class TwoPTestProblem; namespace Properties { -NEW_TYPE_TAG(TwoPIncompressible, INHERITS_FROM(TwoP)); -NEW_TYPE_TAG(TwoPIncompressibleTpfa, INHERITS_FROM(CCTpfaModel, TwoPIncompressible)); -NEW_TYPE_TAG(TwoPIncompressibleMpfa, INHERITS_FROM(CCMpfaModel, TwoPIncompressible)); -NEW_TYPE_TAG(TwoPIncompressibleBox, INHERITS_FROM(BoxModel, TwoPIncompressible)); +// Create new type tags +namespace TTag { +struct TwoPIncompressible { using InheritsFrom = std::tuple<TwoP>; }; +struct TwoPIncompressibleTpfa { using InheritsFrom = std::tuple<TwoPIncompressible, CCTpfaModel>; }; +struct TwoPIncompressibleMpfa { using InheritsFrom = std::tuple<TwoPIncompressible, CCMpfaModel>; }; +struct TwoPIncompressibleBox { using InheritsFrom = std::tuple<TwoPIncompressible, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TwoPIncompressible, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPIncompressible> { using type = Dune::YaspGrid<2>; }; // Set the problem type -SET_TYPE_PROP(TwoPIncompressible, Problem, TwoPTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPIncompressible> { using type = TwoPTestProblem<TypeTag>; }; // the local residual containing the analytic derivative methods -SET_TYPE_PROP(TwoPIncompressible, LocalResidual, TwoPIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::TwoPIncompressible> { using type = TwoPIncompressibleLocalResidual<TypeTag>; }; // Set the fluid system -SET_PROP(TwoPIncompressible, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPIncompressible> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; using NonwettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Trichloroethene<Scalar> >; using type = FluidSystems::TwoPImmiscible<Scalar, WettingPhase, NonwettingPhase>; }; // Set the spatial parameters -SET_PROP(TwoPIncompressible, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPIncompressible> { private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = TwoPTestSpatialParams<FVGridGeometry, Scalar>; }; // Enable caching -SET_BOOL_PROP(TwoPIncompressible, EnableGridVolumeVariablesCache, false); -SET_BOOL_PROP(TwoPIncompressible, EnableGridFluxVariablesCache, false); -SET_BOOL_PROP(TwoPIncompressible, EnableFVGridGeometryCache, false); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::TwoPIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::TwoPIncompressible> { static constexpr bool value = false; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::TwoPIncompressible> { static constexpr bool value = false; }; // Maybe enable the box-interface solver -SET_BOOL_PROP(TwoPIncompressible, EnableBoxInterfaceSolver, ENABLEINTERFACESOLVER); +template<class TypeTag> +struct EnableBoxInterfaceSolver<TypeTag, TTag::TwoPIncompressible> { static constexpr bool value = ENABLEINTERFACESOLVER; }; } // end namespace Properties /*! @@ -99,16 +111,16 @@ template<class TypeTag> class TwoPTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { pressureH2OIdx = Indices::pressureIdx, saturationDNAPLIdx = Indices::saturationIdx, @@ -149,7 +161,7 @@ public: PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const { PrimaryVariables values; - typename GET_PROP_TYPE(TypeTag, FluidState) fluidState; + GetPropType<TypeTag, Properties::FluidState> fluidState; fluidState.setTemperature(temperature()); fluidState.setPressure(waterPhaseIdx, /*pressure=*/1e5); fluidState.setPressure(dnaplPhaseIdx, /*pressure=*/1e5); @@ -203,7 +215,7 @@ public: PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const { PrimaryVariables values; - typename GET_PROP_TYPE(TypeTag, FluidState) fluidState; + GetPropType<TypeTag, Properties::FluidState> fluidState; fluidState.setTemperature(temperature()); fluidState.setPressure(waterPhaseIdx, /*pressure=*/1e5); fluidState.setPressure(dnaplPhaseIdx, /*pressure=*/1e5); diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/main.cc b/test/porousmediumflow/2p/implicit/nonisothermal/main.cc index dc2a091754b597c31845e2a039be13bf1f96efa8..7bfa8db18ab7d562da20b19d7cdc21e2fe1a04a9 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/main.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -155,7 +155,7 @@ int main(int argc, char** argv) try NewtonSolver nonLinearSolver(assembler, linearSolver); //the convergence writer - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using NewtonConvergenceWriter = Dumux::NewtonConvergenceWriter<GridView, SolutionVector>; auto convergenceWriter = std::make_shared<NewtonConvergenceWriter>(leafGridView, fvGridGeometry->numDofs()); diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh index c18851f0c8d948f564747e1377a5bf70cd1f39f8..ad5f4fd8109b8fa3743eb8a40e7046a70d97b839 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh +++ b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh @@ -58,24 +58,31 @@ namespace Dumux { template <class TypeTag> class InjectionProblem2PNI; namespace Properties { -NEW_TYPE_TAG(Injection2PNITypeTag, INHERITS_FROM(TwoPNI)); -NEW_TYPE_TAG(InjectionBox2PNITypeTag, INHERITS_FROM(BoxModel, Injection2PNITypeTag)); -NEW_TYPE_TAG(InjectionCC2PNITypeTag, INHERITS_FROM(CCTpfaModel, Injection2PNITypeTag)); +// Create new type tags +namespace TTag { +struct Injection2PNITypeTag { using InheritsFrom = std::tuple<TwoPNI>; }; +struct InjectionBox2PNITypeTag { using InheritsFrom = std::tuple<Injection2PNITypeTag, BoxModel>; }; +struct InjectionCC2PNITypeTag { using InheritsFrom = std::tuple<Injection2PNITypeTag, CCTpfaModel>; }; +} // end namespace TTag // Obtain grid type from COMPILE_DEFINITIONS -SET_TYPE_PROP(Injection2PNITypeTag, Grid, GRIDTYPE); +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection2PNITypeTag> { using type = GRIDTYPE; }; // Set the problem property -SET_TYPE_PROP(Injection2PNITypeTag, Problem, InjectionProblem2PNI<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection2PNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; // Use the same fluid system as the 2p2c injection problem -SET_TYPE_PROP(Injection2PNITypeTag, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, 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>>; }; // Set the spatial parameters -SET_PROP(Injection2PNITypeTag, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2PNITypeTag> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = InjectionSpatialParams<FVGridGeometry, Scalar>; }; @@ -113,13 +120,13 @@ template<class TypeTag> class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum @@ -141,13 +148,13 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; public: /*! @@ -263,7 +270,7 @@ public: values[contiN2EqIdx] = -1e-3; // kg/(s*m^2) // compute enthalpy flux associated with this injection [(J/(kg*s)] - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using FluidState = GetPropType<TypeTag, Properties::FluidState>; FluidState fs; const auto initialValues = initialAtPos(globalPos); diff --git a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh index dda365bcebaf0440825b8cb6a6f048a7e1323f4c..d6a826b6c9a721199b836af5664885826756540a 100644 --- a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh @@ -72,7 +72,8 @@ SET_TYPE_PROP(ThreeDTwoPTest, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::noncon SET_TYPE_PROP(ThreeDTwoPTest, Problem, Test3D2PProblem<TypeTag>); // Set the fluid system -SET_PROP(ThreeDTwoPTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThreeDTwoPTest> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; diff --git a/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh b/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh index 4cd36ddafaa5f54cfdb02ee7be27ec545999ec52..6d2f182be39cfa8d93013cf76eeb1e55df2e8444 100644 --- a/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh @@ -47,7 +47,8 @@ NEW_TYPE_TAG(Test3d2pSpatialParams); SET_TYPE_PROP(Test3d2pSpatialParams, SpatialParams, Test3d2pSpatialParams<TypeTag>); // Set the material law -SET_PROP(Test3d2pSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::Test3d2pSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh index 8c5931173839c9969657d29252f4f981bf3e80d8..1d1403a6dbcca13e41359a4694b6b61ba8ce8205 100644 --- a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh @@ -62,7 +62,8 @@ SET_TYPE_PROP(TestIMPESAdaptive, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::non SET_TYPE_PROP(TestIMPESAdaptive, Problem, TestIMPESAdaptiveProblem<TypeTag>); // Set the fluid system -SET_PROP(TestIMPESAdaptive, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TestIMPESAdaptive> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh b/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh index a86fcd5d995927b13f4a1ddfd069a2cd044a07c3..9406046d9d6137b84d9366bdff72b5eadc863323 100644 --- a/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh @@ -45,7 +45,8 @@ NEW_TYPE_TAG(TestIMPESAdaptiveSpatialParams); SET_TYPE_PROP(TestIMPESAdaptiveSpatialParams, SpatialParams, TestIMPESAdaptiveSpatialParams<TypeTag>); // Set the material law -SET_PROP(TestIMPESAdaptiveSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::TestIMPESAdaptiveSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p/sequential/test_impesproblem.hh b/test/porousmediumflow/2p/sequential/test_impesproblem.hh index b679a862f4df1e31c2f65e9cfd24a5a0f4132333..c5ffc27c144efc09dd8d43408901a7cec665c85b 100644 --- a/test/porousmediumflow/2p/sequential/test_impesproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesproblem.hh @@ -84,7 +84,8 @@ SET_TYPE_PROP(IMPESTest, Problem, IMPESTestProblem<TypeTag>); //////////////////////////////////////////////////////////////////////// // Set the fluid system -SET_PROP(IMPESTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::IMPESTest> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; diff --git a/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh b/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh index 857c905446ed11c88b2c2b3cf93b74cd7fcb3b9f..38591a81ca4c7d50cd0df15be024b3d89b6fe69f 100644 --- a/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh @@ -45,7 +45,8 @@ NEW_TYPE_TAG(TestIMPESSpatialParams); SET_TYPE_PROP(TestIMPESSpatialParams, SpatialParams, TestIMPESSpatialParams<TypeTag>); // Set the material law -SET_PROP(TestIMPESSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::TestIMPESSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh index 4e165e812b6bd8febcde52fcfb7d8d3a14c2099b..a33590a307d7048151f5f5a75db89d41e2388665 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh @@ -75,7 +75,8 @@ SET_TYPE_PROP(MPFATwoPTest, Grid, Dune::YaspGrid<2>); SET_TYPE_PROP(MPFATwoPTest, Problem, MPFATwoPTestProblem<TypeTag>); // Set the fluid system -SET_PROP(MPFATwoPTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MPFATwoPTest> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh index 421386db7c2f9c2c5f306558c5cb35db52163c0f..f46d68999355f5b22ec91213f5cc7b21cb83a58a 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh @@ -43,7 +43,8 @@ NEW_TYPE_TAG(Test2PSpatialParams); SET_TYPE_PROP(Test2PSpatialParams, SpatialParams, Test2PSpatialParams<TypeTag>); // Set the material law -SET_PROP(Test2PSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::Test2PSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p/sequential/test_transportproblem.hh b/test/porousmediumflow/2p/sequential/test_transportproblem.hh index 47b497373895d3ae72d89caac0c4107354e65af7..e93160cc98d1f8930c0ebb111878a94759eaae20 100644 --- a/test/porousmediumflow/2p/sequential/test_transportproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_transportproblem.hh @@ -58,7 +58,8 @@ SET_TYPE_PROP(TransportTest, Grid, Dune::YaspGrid<2>); SET_TYPE_PROP(TransportTest, Problem, TestTransportProblem<TypeTag>); // Set the fluid system -SET_PROP(TransportTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TransportTest> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using WettingPhase = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; diff --git a/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh b/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh index 018d15f7fed74fde3a232de9ad45a919d415ca97..1adc79403a78fff772ac655fb52415def73a6525 100644 --- a/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh @@ -48,7 +48,8 @@ NEW_TYPE_TAG(TestTransportSpatialParams); SET_TYPE_PROP(TestTransportSpatialParams, SpatialParams, TestTransportSpatialParams<TypeTag>); // Set the material law -SET_PROP(TestTransportSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::TestTransportSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p1c/implicit/main.cc b/test/porousmediumflow/2p1c/implicit/main.cc index 2f8a0152db168306486ec382bc01ad24359b4d71..a754f8443fff026c62493accc8bf41a92af8390f 100644 --- a/test/porousmediumflow/2p1c/implicit/main.cc +++ b/test/porousmediumflow/2p1c/implicit/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -84,34 +84,34 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -128,7 +128,7 @@ int main(int argc, char** argv) try auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver - using PrimaryVariableSwitch = typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch); + using PrimaryVariableSwitch = GetPropType<TypeTag, Properties::PrimaryVariableSwitch>; using NewtonSolver = Dumux::PriVarSwitchNewtonSolver<Assembler, LinearSolver, PrimaryVariableSwitch>; NewtonSolver nonLinearSolver(assembler, linearSolver); diff --git a/test/porousmediumflow/2p1c/implicit/problem.hh b/test/porousmediumflow/2p1c/implicit/problem.hh index b02d60868e1de9355bc923107b54bbd454d9e809..af6c42591490f914e4d1f400c3d711d7e23f72fa 100644 --- a/test/porousmediumflow/2p1c/implicit/problem.hh +++ b/test/porousmediumflow/2p1c/implicit/problem.hh @@ -44,36 +44,44 @@ template <class TypeTag> class InjectionProblem; namespace Properties { -NEW_TYPE_TAG(InjectionProblem, INHERITS_FROM(TwoPOneCNI)); -NEW_TYPE_TAG(TwoPOneCNIBox, INHERITS_FROM(BoxModel, InjectionProblem)); -NEW_TYPE_TAG(TwoPOneCNICCTpfa, INHERITS_FROM(CCTpfaModel, InjectionProblem)); +// Create new type tags +namespace TTag { +struct InjectionProblem { using InheritsFrom = std::tuple<TwoPOneCNI>; }; +struct TwoPOneCNIBox { using InheritsFrom = std::tuple<InjectionProblem, BoxModel>; }; +struct TwoPOneCNICCTpfa { using InheritsFrom = std::tuple<InjectionProblem, CCTpfaModel>; }; +} // end namespace TTag -SET_TYPE_PROP(InjectionProblem, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::InjectionProblem> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(InjectionProblem, Problem, InjectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::InjectionProblem> { using type = InjectionProblem<TypeTag>; }; // Set fluid configuration -SET_PROP(InjectionProblem, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::InjectionProblem> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using H2OType = Dumux::Components::TabulatedComponent<Dumux::Components::H2O<Scalar> >; public: using type = Dumux::FluidSystems::TwoPOneC<Scalar, H2OType >; }; // Set the spatial parameters -SET_PROP(InjectionProblem, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::InjectionProblem> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = InjectionProblemSpatialParams<FVGridGeometry, Scalar>; }; //Define whether spurious cold-water flow into the steam is blocked -SET_BOOL_PROP(InjectionProblem, UseBlockingOfSpuriousFlow, true); +template<class TypeTag> +struct UseBlockingOfSpuriousFlow<TypeTag, TTag::InjectionProblem> { static constexpr bool value = true; }; } // end namespace Properties /*! @@ -88,19 +96,19 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; // copy some indices for convenience enum { diff --git a/test/porousmediumflow/2p2c/implicit/injection/main.cc b/test/porousmediumflow/2p2c/implicit/injection/main.cc index d64d5cf562121b44ab1a175e9138205cce61a063..df5f6a79c46311777344e44dc295575be7e6ddf5 100644 --- a/test/porousmediumflow/2p2c/implicit/injection/main.cc +++ b/test/porousmediumflow/2p2c/implicit/injection/main.cc @@ -57,7 +57,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -70,7 +70,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -81,16 +81,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -99,14 +99,14 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; const auto fileName = getParam<std::string>("Restart.File"); const auto pvName = createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(); loadSolution(x, fileName, pvName, *fvGridGeometry); @@ -116,14 +116,14 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using VtkOutputFields = GetPropType<TypeTag, Properties::VtkOutputFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); VtkOutputFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); @@ -142,7 +142,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2p2c/implicit/injection/problem.hh b/test/porousmediumflow/2p2c/implicit/injection/problem.hh index dcb28bcc24efeea4565a29f3a9c0bc1bf01a0577..cf5466effbd6a24a4140a4ed53ad34f53b278766 100644 --- a/test/porousmediumflow/2p2c/implicit/injection/problem.hh +++ b/test/porousmediumflow/2p2c/implicit/injection/problem.hh @@ -46,37 +46,50 @@ template <class TypeTag> class InjectionProblem; namespace Properties { -NEW_TYPE_TAG(Injection, INHERITS_FROM(TwoPTwoC)); -NEW_TYPE_TAG(InjectionBox, INHERITS_FROM(BoxModel, Injection)); -NEW_TYPE_TAG(InjectionCCTpfa, INHERITS_FROM(CCTpfaModel, Injection)); -NEW_TYPE_TAG(InjectionCCMpfa, INHERITS_FROM(CCMpfaModel, Injection)); +// Create new type tags +namespace TTag { +struct Injection { using InheritsFrom = std::tuple<TwoPTwoC>; }; +struct InjectionBox { using InheritsFrom = std::tuple<Injection, BoxModel>; }; +struct InjectionCCTpfa { using InheritsFrom = std::tuple<Injection, CCTpfaModel>; }; +struct InjectionCCMpfa { using InheritsFrom = std::tuple<Injection, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Injection, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Injection, Problem, InjectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection> { using type = InjectionProblem<TypeTag>; }; // Set fluid configuration -SET_TYPE_PROP(Injection, - FluidSystem, - FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; // Set the spatial parameters -SET_PROP(Injection, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = InjectionSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(Injection, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Injection> { static constexpr bool value = true; }; // Enable caching or not (reference solutions created without caching) -SET_BOOL_PROP(Injection, EnableFVGridGeometryCache, ENABLECACHING); -SET_BOOL_PROP(Injection, EnableGridVolumeVariablesCache, ENABLECACHING); -SET_BOOL_PROP(Injection, EnableGridFluxVariablesCache, ENABLECACHING); +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::Injection> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::Injection> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::Injection> { static constexpr bool value = ENABLECACHING; }; } // end namespace Properties /*! @@ -105,12 +118,12 @@ template <class TypeTag> class InjectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; // primary variable indices @@ -138,13 +151,13 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag> N2Idx = FluidSystem::N2Idx }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; //! property that defines whether mole or mass fractions are used diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/main.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/main.cc index 0c26d3f02c961fe8e4ffd94d7a0e3c11aa60d3cf..9cc9ceebe7753063732f731158fa795005f5712b 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/main.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/main.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -95,7 +95,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -106,35 +106,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -153,7 +153,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/problem.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/problem.hh index 70eb6943fb7af27734f2fe45fc3a094194fe9393..8b5d6aa9b7f9146048c0c3c4dacd4657301065a2 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/problem.hh +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/problem.hh @@ -47,42 +47,53 @@ template <class TypeTag> class TwoPTwoCComparisonProblem; namespace Properties { -NEW_TYPE_TAG(TwoPTwoCComparison, INHERITS_FROM(TwoPTwoC)); -NEW_TYPE_TAG(TwoPTwoCComparisonBox, INHERITS_FROM(BoxModel, TwoPTwoCComparison)); -NEW_TYPE_TAG(TwoPTwoCComparisonCC, INHERITS_FROM(CCTpfaModel, TwoPTwoCComparison)); +// Create new type tags +namespace TTag { +struct TwoPTwoCComparison { using InheritsFrom = std::tuple<TwoPTwoC>; }; +struct TwoPTwoCComparisonBox { using InheritsFrom = std::tuple<TwoPTwoCComparison, BoxModel>; }; +struct TwoPTwoCComparisonCC { using InheritsFrom = std::tuple<TwoPTwoCComparison, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TwoPTwoCComparison, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPTwoCComparison> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TwoPTwoCComparison, - Problem, - TwoPTwoCComparisonProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPTwoCComparison> { using type = TwoPTwoCComparisonProblem<TypeTag>; }; // Set fluid configuration -SET_TYPE_PROP(TwoPTwoCComparison, - FluidSystem, - FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPTwoCComparison> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; // Set the spatial parameters -SET_PROP(TwoPTwoCComparison, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPTwoCComparison> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TwoPTwoCComparisonSpatialParams<FVGridGeometry, Scalar>; }; // decide which type to use for floating values (double / quad) -SET_TYPE_PROP(TwoPTwoCComparison, Scalar, double); -SET_PROP(TwoPTwoCComparison, Formulation) +template<class TypeTag> +struct Scalar<TypeTag, TTag::TwoPTwoCComparison> { using type = double; }; +template<class TypeTag> +struct Formulation<TypeTag, TTag::TwoPTwoCComparison> { public: static const TwoPFormulation value = TwoPFormulation::p1s0; }; -SET_BOOL_PROP(TwoPTwoCComparison, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TwoPTwoCComparison> { static constexpr bool value = true; }; -SET_TYPE_PROP(TwoPTwoCComparison, IOFields, TwoPTwoCMPNCIOFields); +template<class TypeTag> +struct IOFields<TypeTag, TTag::TwoPTwoCComparison> { using type = TwoPTwoCMPNCIOFields; }; } // end namespace Properties @@ -95,20 +106,20 @@ template <class TypeTag> class TwoPTwoCComparisonProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NeumannFluxes = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NeumannFluxes = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; public: diff --git a/test/porousmediumflow/2p2c/implicit/waterair/main.cc b/test/porousmediumflow/2p2c/implicit/waterair/main.cc index f2c995ea73d1675200eb0e6fb30dd2c9f4fc4108..394fbf323d0835eb27d696d9be44d7b5cf8a8471 100644 --- a/test/porousmediumflow/2p2c/implicit/waterair/main.cc +++ b/test/porousmediumflow/2p2c/implicit/waterair/main.cc @@ -57,7 +57,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -70,7 +70,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -81,16 +81,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -99,14 +99,14 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; const auto fileName = getParam<std::string>("Restart.File"); const auto pvName = createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(); loadSolution(x, fileName, pvName, *fvGridGeometry); @@ -116,14 +116,14 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); @@ -142,7 +142,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2p2c/implicit/waterair/problem.hh b/test/porousmediumflow/2p2c/implicit/waterair/problem.hh index 0c5693fde6b4939e724d790493b5070a5f0b3549..74ad6c2155acb53d8624ef10c3fdf97c89769b92 100644 --- a/test/porousmediumflow/2p2c/implicit/waterair/problem.hh +++ b/test/porousmediumflow/2p2c/implicit/waterair/problem.hh @@ -48,29 +48,37 @@ template <class TypeTag> class WaterAirProblem; namespace Properties { -NEW_TYPE_TAG(WaterAir, INHERITS_FROM(TwoPTwoCNI)); -NEW_TYPE_TAG(WaterAirBox, INHERITS_FROM(BoxModel, WaterAir)); -NEW_TYPE_TAG(WaterAirCCTpfa, INHERITS_FROM(CCTpfaModel, WaterAir)); +// Create new type tags +namespace TTag { +struct WaterAir { using InheritsFrom = std::tuple<TwoPTwoCNI>; }; +struct WaterAirBox { using InheritsFrom = std::tuple<WaterAir, BoxModel>; }; +struct WaterAirCCTpfa { using InheritsFrom = std::tuple<WaterAir, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(WaterAir, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::WaterAir> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(WaterAir, Problem, WaterAirProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::WaterAir> { using type = WaterAirProblem<TypeTag>; }; // Set the wetting phase -SET_TYPE_PROP(WaterAir, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::WaterAir> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the spatial parameters -SET_PROP(WaterAir, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::WaterAir> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = WaterAirSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(WaterAir, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::WaterAir> { static constexpr bool value = true; }; } // end namespace Dumux /*! @@ -112,10 +120,10 @@ class WaterAirProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; // primary variable indices @@ -139,15 +147,15 @@ class WaterAirProblem : public PorousMediumFlowProblem<TypeTag> // component index enum { N2Idx = FluidSystem::N2Idx }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; //! property that defines whether mole or mass fractions are used static constexpr bool useMoles = ModelTraits::useMoles(); diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh index 0e7b3655d1721810a44c83f1e045f077dd62d03e..15eae6e482d192d10d5becf399c4c2a19ed32946 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh @@ -63,7 +63,8 @@ SET_TYPE_PROP(Adaptive2p2c2d, Grid, Dune::YaspGrid<3>); SET_TYPE_PROP(Adaptive2p2c2d, Problem, Adaptive2p2c2d<TTAG(Adaptive2p2c2d)>); // Select fluid system -SET_PROP(Adaptive2p2c2d, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Adaptive2p2c2d> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using type = FluidSystems::H2OAir<Scalar, Components::H2O<Scalar>>; diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh index b1a6fc7b25490de7e6cc260120342eef2a4a2d18..671dc79eacd41ded6fb1945eb944e74916542d9f 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh @@ -67,7 +67,8 @@ SET_TYPE_PROP(Adaptive2p2c3d, TransportModel, FV3dTransport2P2CAdaptive<TTAG(Ada SET_TYPE_PROP(Adaptive2p2c3d, PressureModel, FV3dPressure2P2CAdaptive<TTAG(Adaptive2p2c3d)>); // Select fluid system -SET_PROP(Adaptive2p2c3d, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Adaptive2p2c3d> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using type = FluidSystems::H2OAir<Scalar, Components::H2O<Scalar>, FluidSystems::H2OAirDefaultPolicy</*fastButSimplifiedRelations=*/true>>; diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh b/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh index c617ccf9a1d964bab7bf45d131fde9ec90a83dce..f63ec7f0aea1ba8b4e22acdb610aebe4d43c7ace 100644 --- a/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh +++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh @@ -44,7 +44,8 @@ NEW_TYPE_TAG(Test2P2CSpatialParams); SET_TYPE_PROP(Test2P2CSpatialParams, SpatialParams, Test2P2CSpatialParams<TypeTag>); // Set the material law -SET_PROP(Test2P2CSpatialParams, MaterialLaw) +template<class TypeTag> +struct MaterialLaw<TypeTag, TTag::Test2P2CSpatialParams> { private: using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh index c010546a74429a44f314abc96ca7c2ff8a8c7e0e..d35a582c45e2bfa6367d2d66174e8bee2d354dee 100644 --- a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh @@ -64,7 +64,8 @@ SET_TYPE_PROP(TestDecTwoPTwoC, PressureModel,FVPressure2P2C<TypeTag>); SET_INT_PROP(TestDecTwoPTwoC, PressureFormulation, GET_PROP_TYPE(TypeTag, Indices)::pressureN); // Select fluid system -SET_PROP(TestDecTwoPTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TestDecTwoPTwoC> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using type = FluidSystems::H2OAir<Scalar, Components::H2O<Scalar>>; diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh index a170c1e2f9700885a3e3d80c59fd177035b75a28..89c693f4cc1a9e08aab23cfb565c281a6624cd84 100644 --- a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh @@ -66,7 +66,8 @@ SET_TYPE_PROP(TestMultTwoPTwoC, PressureModel, FVPressure2P2CMultiPhysics<TypeTa SET_INT_PROP(TestMultTwoPTwoC, PressureFormulation, GET_PROP_TYPE(TypeTag, Indices)::pressureNw); // Select fluid system -SET_PROP(TestMultTwoPTwoC, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TestMultTwoPTwoC> { using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using type = FluidSystems::H2OAir<Scalar, Components::H2O<Scalar>>; diff --git a/test/porousmediumflow/2pnc/implicit/diffusion/main.cc b/test/porousmediumflow/2pnc/implicit/diffusion/main.cc index 4f9fa283d337e72d879fec99990ed837ef5e082c..d5a201b0716a6e352de73cf648c1b42abed58f92 100644 --- a/test/porousmediumflow/2pnc/implicit/diffusion/main.cc +++ b/test/porousmediumflow/2pnc/implicit/diffusion/main.cc @@ -79,7 +79,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TwoPNCDiffusionCC); + using TypeTag = Properties::TTag::TwoPNCDiffusionCC; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -92,7 +92,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -103,35 +103,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); @@ -150,7 +150,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2pnc/implicit/diffusion/problem.hh b/test/porousmediumflow/2pnc/implicit/diffusion/problem.hh index 15022321d232684c05b2e1940fa8827da0fd1c8a..d56ad14ef4c41ccec02ffb1f38a4b80236eec881 100644 --- a/test/porousmediumflow/2pnc/implicit/diffusion/problem.hh +++ b/test/porousmediumflow/2pnc/implicit/diffusion/problem.hh @@ -45,36 +45,48 @@ template <class TypeTag> class TwoPNCDiffusionProblem; namespace Properties { -NEW_TYPE_TAG(TwoPNCDiffusion, INHERITS_FROM(TwoPNC)); -NEW_TYPE_TAG(TwoPNCDiffusionCC, INHERITS_FROM(CCTpfaModel, TwoPNCDiffusion)); +// Create new type tags +namespace TTag { +struct TwoPNCDiffusion { using InheritsFrom = std::tuple<TwoPNC>; }; +struct TwoPNCDiffusionCC { using InheritsFrom = std::tuple<TwoPNCDiffusion, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(TwoPNCDiffusion, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TwoPNCDiffusion> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TwoPNCDiffusion, Problem, TwoPNCDiffusionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TwoPNCDiffusion> { using type = TwoPNCDiffusionProblem<TypeTag>; }; // // Set fluid configuration -SET_TYPE_PROP(TwoPNCDiffusion, - FluidSystem, - FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TwoPNCDiffusion> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; // Set the spatial parameters -SET_PROP(TwoPNCDiffusion, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TwoPNCDiffusion> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TwoPNCDiffusionSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(TwoPNCDiffusion, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TwoPNCDiffusion> { static constexpr bool value = true; }; //! Here we set FicksLaw or TwoPNCDiffusionsLaw -SET_TYPE_PROP(TwoPNCDiffusion, MolecularDiffusionType, DIFFUSIONTYPE); +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::TwoPNCDiffusion> { using type = DIFFUSIONTYPE; }; //! Set the default formulation to pw-Sn: This can be over written in the problem. -SET_PROP(TwoPNCDiffusion, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::TwoPNCDiffusion> { static constexpr auto value = TwoPFormulation::p0s1; }; } // end namespace Properties @@ -88,9 +100,9 @@ template <class TypeTag> class TwoPNCDiffusionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { // Grid and world dimension @@ -98,16 +110,16 @@ class TwoPNCDiffusionProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); public: /*! diff --git a/test/porousmediumflow/2pnc/implicit/fuelcell/main.cc b/test/porousmediumflow/2pnc/implicit/fuelcell/main.cc index ff94252551e3565eac21700022e8e51f3d81ad4f..78d1125dab7600090e3142bcf2bd765c05516421 100644 --- a/test/porousmediumflow/2pnc/implicit/fuelcell/main.cc +++ b/test/porousmediumflow/2pnc/implicit/fuelcell/main.cc @@ -79,7 +79,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -92,7 +92,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -103,35 +103,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // initialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addVtkFields(vtkWriter); //!< Add problem specific output fields @@ -151,7 +151,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2pnc/implicit/fuelcell/problem.hh b/test/porousmediumflow/2pnc/implicit/fuelcell/problem.hh index 5e3393903ad28f4176565438a594e57595c1eb35..945b7def48d5827522d65182e9247a6ed71e8aa5 100644 --- a/test/porousmediumflow/2pnc/implicit/fuelcell/problem.hh +++ b/test/porousmediumflow/2pnc/implicit/fuelcell/problem.hh @@ -49,38 +49,46 @@ template <class TypeTag> class FuelCellProblem; namespace Properties { +// Create new type tags +namespace TTag { #ifdef NONISOTHERMAL -NEW_TYPE_TAG(FuelCell, INHERITS_FROM(TwoPNCNI)); -NEW_TYPE_TAG(FuelCellNIBox, INHERITS_FROM(BoxModel, FuelCell)); +struct FuelCell { using InheritsFrom = std::tuple<TwoPNCNI>; }; +struct FuelCellNIBox { using InheritsFrom = std::tuple<FuelCell, BoxModel>; }; #else -NEW_TYPE_TAG(FuelCell, INHERITS_FROM(TwoPNC)); -NEW_TYPE_TAG(FuelCellBox, INHERITS_FROM(BoxModel, FuelCell)); -NEW_TYPE_TAG(FuelCellCCTpfa, INHERITS_FROM(CCTpfaModel, FuelCell)); +struct FuelCell { using InheritsFrom = std::tuple<TwoPNC>; }; +struct FuelCellBox { using InheritsFrom = std::tuple<FuelCell, BoxModel>; }; +struct FuelCellCCTpfa { using InheritsFrom = std::tuple<FuelCell, CCTpfaModel>; }; #endif +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(FuelCell, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::FuelCell> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(FuelCell, Problem, FuelCellProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::FuelCell> { using type = FuelCellProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(FuelCell, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::FuelCell> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FuelCellSpatialParams<FVGridGeometry, Scalar>; }; // Set the primary variable combination for the 2pnc model -SET_PROP(FuelCell, Formulation) +template<class TypeTag> +struct Formulation<TypeTag, TTag::FuelCell> { static constexpr auto value = TwoPFormulation::p1s0; }; // Set fluid configuration -SET_PROP(FuelCell, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::FuelCell> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = FluidSystems::H2ON2O2<Scalar>; }; @@ -99,20 +107,20 @@ class FuelCellProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; // Select the electrochemistry method #ifdef NONISOTHERMAL using ElectroChemistry = typename Dumux::ElectroChemistryNI<Scalar, Indices, FluidSystem, FVGridGeometry, ElectroChemistryModel::Ochs>; diff --git a/test/porousmediumflow/2pncmin/implicit/main.cc b/test/porousmediumflow/2pncmin/implicit/main.cc index 643d7d5679d6ec9e1c7ee2fbce114d39f08274a0..2beb596fabb78be08e23dc1a19ffbed2f8e4f9c1 100644 --- a/test/porousmediumflow/2pncmin/implicit/main.cc +++ b/test/porousmediumflow/2pncmin/implicit/main.cc @@ -80,7 +80,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -93,7 +93,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -104,16 +104,16 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); @@ -122,15 +122,15 @@ int main(int argc, char** argv) try Scalar restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; const auto fileName = getParam<std::string>("Restart.File"); const auto pvName = createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem, SolidSystem>(); loadSolution(x, fileName, pvName, *fvGridGeometry); @@ -140,14 +140,14 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // initialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields //add specific output @@ -170,7 +170,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/2pncmin/implicit/problem.hh b/test/porousmediumflow/2pncmin/implicit/problem.hh index 6b633d40158d078597db51cd17a9d0d29a214b83..6208bc0193218474ca7ab338f5f8e984bd9703d7 100644 --- a/test/porousmediumflow/2pncmin/implicit/problem.hh +++ b/test/porousmediumflow/2pncmin/implicit/problem.hh @@ -49,26 +49,33 @@ template <class TypeTag> class DissolutionProblem; namespace Properties { -NEW_TYPE_TAG(Dissolution, INHERITS_FROM(TwoPNCMin)); -NEW_TYPE_TAG(DissolutionBox, INHERITS_FROM(BoxModel, Dissolution)); -NEW_TYPE_TAG(DissolutionCCTpfa, INHERITS_FROM(CCTpfaModel, Dissolution)); +// Create new type tags +namespace TTag { +struct Dissolution { using InheritsFrom = std::tuple<TwoPNCMin>; }; +struct DissolutionBox { using InheritsFrom = std::tuple<Dissolution, BoxModel>; }; +struct DissolutionCCTpfa { using InheritsFrom = std::tuple<Dissolution, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Dissolution, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Dissolution> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Dissolution, Problem, DissolutionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Dissolution> { using type = DissolutionProblem<TypeTag>; }; // Set fluid configuration -SET_PROP(Dissolution, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Dissolution> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::BrineAir<Scalar, Components::H2O<Scalar>>; }; -SET_PROP(Dissolution, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::Dissolution> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ComponentOne = Components::NaCl<Scalar>; using ComponentTwo = Components::Granite<Scalar>; static constexpr int numInertComponents = 1; @@ -76,16 +83,19 @@ SET_PROP(Dissolution, SolidSystem) }; // Set the spatial parameters -SET_PROP(Dissolution, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Dissolution> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = DissolutionSpatialParams<FVGridGeometry, Scalar>; }; //Set properties here to override the default property settings -SET_INT_PROP(Dissolution, ReplaceCompEqIdx, 1); //!< Replace gas balance by total mass balance -SET_PROP(Dissolution, Formulation) +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::Dissolution> { static constexpr int value = 1; }; //!< Replace gas balance by total mass balance +template<class TypeTag> +struct Formulation<TypeTag, TTag::Dissolution> { static constexpr auto value = TwoPFormulation::p1s0; }; } // end namespace Properties @@ -112,12 +122,12 @@ template <class TypeTag> class DissolutionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; enum { @@ -155,14 +165,14 @@ class DissolutionProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld, }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using GlobalPosition = typename SubControlVolume::GlobalPosition; @@ -191,7 +201,7 @@ public: temperatureHigh_ = getParam<Scalar>("FluidSystem.TemperatureHigh"); name_ = getParam<std::string>("Problem.Name"); - unsigned int codim = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; permeability_.resize(fvGridGeometry->gridView().size(codim)); FluidSystem::init(/*Tmin=*/temperatureLow_, diff --git a/test/porousmediumflow/3p/implicit/conduction/main.cc b/test/porousmediumflow/3p/implicit/conduction/main.cc index 1a790eb3854f2225b809e344b437fc56a0cb4503..388e73f99ef70003271f74c37d59ea7c41828711 100644 --- a/test/porousmediumflow/3p/implicit/conduction/main.cc +++ b/test/porousmediumflow/3p/implicit/conduction/main.cc @@ -86,7 +86,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -99,7 +99,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -110,35 +110,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/3p/implicit/conduction/problem.hh b/test/porousmediumflow/3p/implicit/conduction/problem.hh index 854911e274ad1e8b08ccead8bc538ca437e6d577..883c9382bb70573c06bfea5d95ef502288c12e72 100644 --- a/test/porousmediumflow/3p/implicit/conduction/problem.hh +++ b/test/porousmediumflow/3p/implicit/conduction/problem.hh @@ -50,28 +50,34 @@ template <class TypeTag> class ThreePNIConductionProblem; namespace Properties { -NEW_TYPE_TAG(ThreePNIConduction, INHERITS_FROM(ThreePNI)); -NEW_TYPE_TAG(ThreePNIConductionBox, INHERITS_FROM(BoxModel, ThreePNIConduction)); -NEW_TYPE_TAG(ThreePNIConductionCCTpfa, INHERITS_FROM(CCTpfaModel, ThreePNIConduction)); -NEW_TYPE_TAG(ThreePNIConductionCCMpfa, INHERITS_FROM(CCMpfaModel, ThreePNIConduction)); +// Create new type tags +namespace TTag { +struct ThreePNIConduction { using InheritsFrom = std::tuple<ThreePNI>; }; +struct ThreePNIConductionBox { using InheritsFrom = std::tuple<ThreePNIConduction, BoxModel>; }; +struct ThreePNIConductionCCTpfa { using InheritsFrom = std::tuple<ThreePNIConduction, CCTpfaModel>; }; +struct ThreePNIConductionCCMpfa { using InheritsFrom = std::tuple<ThreePNIConduction, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(ThreePNIConduction, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ThreePNIConduction> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ThreePNIConduction, Problem, ThreePNIConductionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::ThreePNIConduction> { using type = ThreePNIConductionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(ThreePNIConduction, - FluidSystem, - FluidSystems::H2OAirMesitylene<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThreePNIConduction> +{ using type = FluidSystems::H2OAirMesitylene<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the spatial parameters -SET_PROP(ThreePNIConduction, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ThreePNIConduction> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = ThreePNISpatialParams<FVGridGeometry, Scalar>; }; }// end namespace Properties @@ -105,20 +111,20 @@ class ThreePNIConductionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using IapwsH2O = Components::H2O<Scalar>; - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // index of the primary variables pressureIdx = Indices::pressureIdx, diff --git a/test/porousmediumflow/3p/implicit/convection/main.cc b/test/porousmediumflow/3p/implicit/convection/main.cc index 879736738fefa54a5bfe4de36d065252768ec554..b879ac57681d781637f383a04bc02dc9a59b4af8 100644 --- a/test/porousmediumflow/3p/implicit/convection/main.cc +++ b/test/porousmediumflow/3p/implicit/convection/main.cc @@ -86,7 +86,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -99,7 +99,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -110,35 +110,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/3p/implicit/convection/problem.hh b/test/porousmediumflow/3p/implicit/convection/problem.hh index bebdbc21b123ab0e294a1c3da989ffb85175dc75..b9a84467fd38a60bf9264aecb81426bdc8407c24 100644 --- a/test/porousmediumflow/3p/implicit/convection/problem.hh +++ b/test/porousmediumflow/3p/implicit/convection/problem.hh @@ -50,28 +50,34 @@ template <class TypeTag> class ThreePNIConvectionProblem; namespace Properties { -NEW_TYPE_TAG(ThreePNIConvection, INHERITS_FROM(ThreePNI)); -NEW_TYPE_TAG(ThreePNIConvectionBox, INHERITS_FROM(BoxModel, ThreePNIConvection)); -NEW_TYPE_TAG(ThreePNIConvectionCCTpfa, INHERITS_FROM(CCTpfaModel, ThreePNIConvection)); -NEW_TYPE_TAG(ThreePNIConvectionCCMpfa, INHERITS_FROM(CCMpfaModel, ThreePNIConvection)); +// Create new type tags +namespace TTag { +struct ThreePNIConvection { using InheritsFrom = std::tuple<ThreePNI>; }; +struct ThreePNIConvectionBox { using InheritsFrom = std::tuple<ThreePNIConvection, BoxModel>; }; +struct ThreePNIConvectionCCTpfa { using InheritsFrom = std::tuple<ThreePNIConvection, CCTpfaModel>; }; +struct ThreePNIConvectionCCMpfa { using InheritsFrom = std::tuple<ThreePNIConvection, CCMpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(ThreePNIConvection, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::ThreePNIConvection> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(ThreePNIConvection, Problem, ThreePNIConvectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::ThreePNIConvection> { using type = ThreePNIConvectionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(ThreePNIConvection, - FluidSystem, - FluidSystems::H2OAirMesitylene<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThreePNIConvection> +{ using type = FluidSystems::H2OAirMesitylene<GetPropType<TypeTag, Properties::Scalar>>; }; // Set the spatial parameters -SET_PROP(ThreePNIConvection, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::ThreePNIConvection> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = ThreePNISpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -105,22 +111,22 @@ class ThreePNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - 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 BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using IapwsH2O = Components::H2O<Scalar>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { // index of the primary variables pressureIdx = Indices::pressureIdx, diff --git a/test/porousmediumflow/3p/implicit/infiltration/main.cc b/test/porousmediumflow/3p/implicit/infiltration/main.cc index 047e0f05afaa05f700def6ba3faa17da97c5f1c6..27097880bd7bda062757d8f325dfde9258290b0e 100644 --- a/test/porousmediumflow/3p/implicit/infiltration/main.cc +++ b/test/porousmediumflow/3p/implicit/infiltration/main.cc @@ -86,7 +86,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -99,7 +99,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -110,35 +110,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/3p/implicit/infiltration/problem.hh b/test/porousmediumflow/3p/implicit/infiltration/problem.hh index 91cceea0af16e41f26ed11fb2e73ed54e769a18b..37cd201cd243d770526e089a173de1a8ee5767b1 100644 --- a/test/porousmediumflow/3p/implicit/infiltration/problem.hh +++ b/test/porousmediumflow/3p/implicit/infiltration/problem.hh @@ -54,21 +54,27 @@ class InfiltrationThreePProblem; namespace Properties { -NEW_TYPE_TAG(InfiltrationThreeP, INHERITS_FROM(ThreeP)); -NEW_TYPE_TAG(InfiltrationThreePBox, INHERITS_FROM(BoxModel, InfiltrationThreeP)); -NEW_TYPE_TAG(InfiltrationThreePCCTpfa, INHERITS_FROM(CCTpfaModel, InfiltrationThreeP)); +// Create new type tags +namespace TTag { +struct InfiltrationThreeP { using InheritsFrom = std::tuple<ThreeP>; }; +struct InfiltrationThreePBox { using InheritsFrom = std::tuple<InfiltrationThreeP, BoxModel>; }; +struct InfiltrationThreePCCTpfa { using InheritsFrom = std::tuple<InfiltrationThreeP, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(InfiltrationThreeP, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::InfiltrationThreeP> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(InfiltrationThreeP, Problem, InfiltrationThreePProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::InfiltrationThreeP> { using type = InfiltrationThreePProblem<TypeTag>; }; // Set the fluid system -SET_PROP(InfiltrationThreeP, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::InfiltrationThreeP> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Water = Components::TabulatedComponent<Components::H2O<Scalar>>; using WettingFluid = FluidSystems::OnePLiquid<Scalar, Water>; using NonwettingFluid = FluidSystems::OnePLiquid<Scalar, Components::Mesitylene<Scalar>>; @@ -78,10 +84,11 @@ public: }; // Set the spatial parameters -SET_PROP(InfiltrationThreeP, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::InfiltrationThreeP> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = InfiltrationThreePSpatialParams<FVGridGeometry, Scalar>; }; @@ -122,9 +129,9 @@ class InfiltrationThreePProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { pressureIdx = Indices::pressureIdx, @@ -135,11 +142,11 @@ class InfiltrationThreePProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc b/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc index 119f9ae85b32e7a5c866c8da1b45fe858606864c..80765055d65cbe779b634cfda823952fc6e0b493 100644 --- a/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc +++ b/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -97,7 +97,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -108,35 +108,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -156,7 +156,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh b/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh index ae5d2d00ef4c94f0edf054817c36fdb6fe294059..9769d9117dbc8c80eac6b2390de27a344f75a6c8 100644 --- a/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh +++ b/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh @@ -51,24 +51,30 @@ template <class TypeTag> class ColumnProblem; namespace Properties { -NEW_TYPE_TAG(Column, INHERITS_FROM(ThreePThreeCNI)); -NEW_TYPE_TAG(ColumnBox, INHERITS_FROM(BoxModel, Column)); -NEW_TYPE_TAG(ColumnCCTpfa, INHERITS_FROM(CCTpfaModel, Column)); +// Create new type tags +namespace TTag { +struct Column { using InheritsFrom = std::tuple<ThreePThreeCNI>; }; +struct ColumnBox { using InheritsFrom = std::tuple<Column, BoxModel>; }; +struct ColumnCCTpfa { using InheritsFrom = std::tuple<Column, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Column, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Column> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Column, Problem, ColumnProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Column> { using type = ColumnProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(Column, - FluidSystem, - FluidSystems::H2OAirXylene<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Column> +{ using type = FluidSystems::H2OAirXylene<GetPropType<TypeTag, Properties::Scalar>>; }; -SET_PROP(Column, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::Column> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ComponentOne = Dumux::Components::Constant<1, Scalar>; using ComponentTwo = Dumux::Components::Constant<2, Scalar>; static constexpr int numInertComponents = 2; @@ -77,20 +83,22 @@ SET_PROP(Column, SolidSystem) //! The two-phase model uses the immiscible fluid state -SET_PROP(Column, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::Column> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = CompositionalSolidState<Scalar, SolidSystem>; }; // Set the spatial parameters -SET_PROP(Column, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Column> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = ColumnSpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -123,12 +131,12 @@ SET_PROP(Column, SpatialParams) template <class TypeTag > class ColumnProblem : public PorousMediumFlowProblem<TypeTag> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using ParentType = PorousMediumFlowProblem<TypeTag>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum @@ -149,14 +157,14 @@ class ColumnProblem : public PorousMediumFlowProblem<TypeTag> threePhases = Indices::threePhases }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; public: diff --git a/test/porousmediumflow/3p3c/implicit/infiltration/main.cc b/test/porousmediumflow/3p3c/implicit/infiltration/main.cc index 119f9ae85b32e7a5c866c8da1b45fe858606864c..80765055d65cbe779b634cfda823952fc6e0b493 100644 --- a/test/porousmediumflow/3p3c/implicit/infiltration/main.cc +++ b/test/porousmediumflow/3p3c/implicit/infiltration/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -97,7 +97,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -108,35 +108,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -156,7 +156,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh b/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh index f0af668134529ff4f1c5d5a7d5f3927af738b54a..d7c863f68f3f58cadcce353fb81b355916fd3f90 100644 --- a/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh +++ b/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh @@ -46,28 +46,34 @@ template <class TypeTag> class InfiltrationThreePThreeCProblem; namespace Properties { -NEW_TYPE_TAG(InfiltrationThreePThreeC, INHERITS_FROM(ThreePThreeC)); -NEW_TYPE_TAG(InfiltrationThreePThreeCBox, INHERITS_FROM(BoxModel, InfiltrationThreePThreeC)); -NEW_TYPE_TAG(InfiltrationThreePThreeCCCTpfa, INHERITS_FROM(CCTpfaModel, InfiltrationThreePThreeC)); +// Create new type tags +namespace TTag { +struct InfiltrationThreePThreeC { using InheritsFrom = std::tuple<ThreePThreeC>; }; +struct InfiltrationThreePThreeCBox { using InheritsFrom = std::tuple<InfiltrationThreePThreeC, BoxModel>; }; +struct InfiltrationThreePThreeCCCTpfa { using InheritsFrom = std::tuple<InfiltrationThreePThreeC, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(InfiltrationThreePThreeC, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::InfiltrationThreePThreeC> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(InfiltrationThreePThreeC, Problem, InfiltrationThreePThreeCProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::InfiltrationThreePThreeC> { using type = InfiltrationThreePThreeCProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(InfiltrationThreePThreeC, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::InfiltrationThreePThreeC> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = InfiltrationThreePThreeCSpatialParams<FVGridGeometry, Scalar>; }; // Set the fluid system -SET_TYPE_PROP(InfiltrationThreePThreeC, - FluidSystem, - FluidSystems::H2OAirMesitylene<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::InfiltrationThreePThreeC> +{ using type = FluidSystems::H2OAirMesitylene<GetPropType<TypeTag, Properties::Scalar>>; }; } /*! @@ -107,10 +113,10 @@ class InfiltrationThreePThreeCProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; // copy some indices for convenience enum { @@ -129,10 +135,10 @@ class InfiltrationThreePThreeCProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/3p3c/implicit/kuevette/main.cc b/test/porousmediumflow/3p3c/implicit/kuevette/main.cc index 119f9ae85b32e7a5c866c8da1b45fe858606864c..80765055d65cbe779b634cfda823952fc6e0b493 100644 --- a/test/porousmediumflow/3p3c/implicit/kuevette/main.cc +++ b/test/porousmediumflow/3p3c/implicit/kuevette/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -97,7 +97,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -108,35 +108,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); @@ -156,7 +156,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh b/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh index cd102443852686e76bf5f088f6ed5c5bdf0c1f2e..991728192fd988869aa6644ea56f7411dede751f 100644 --- a/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh +++ b/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh @@ -52,28 +52,34 @@ template <class TypeTag> class KuevetteProblem; namespace Properties { -NEW_TYPE_TAG(Kuevette, INHERITS_FROM(ThreePThreeCNI)); -NEW_TYPE_TAG(KuevetteBox, INHERITS_FROM(BoxModel, Kuevette)); -NEW_TYPE_TAG(KuevetteCCTpfa, INHERITS_FROM(CCTpfaModel, Kuevette)); +// Create new type tags +namespace TTag { +struct Kuevette { using InheritsFrom = std::tuple<ThreePThreeCNI>; }; +struct KuevetteBox { using InheritsFrom = std::tuple<Kuevette, BoxModel>; }; +struct KuevetteCCTpfa { using InheritsFrom = std::tuple<Kuevette, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Kuevette, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Kuevette> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Kuevette, Problem, KuevetteProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Kuevette> { using type = KuevetteProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(Kuevette, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Kuevette> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = KuevetteSpatialParams<FVGridGeometry, Scalar>; }; // Set the fluid system -SET_TYPE_PROP(Kuevette, - FluidSystem, - FluidSystems::H2OAirMesitylene<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Kuevette> +{ using type = FluidSystems::H2OAirMesitylene<GetPropType<TypeTag, Properties::Scalar>>; }; } // end namespace Properties /*! @@ -113,12 +119,12 @@ template <class TypeTag > class KuevetteProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using GridView = GetPropType<TypeTag, Properties::GridView>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { pressureIdx = Indices::pressureIdx, @@ -138,14 +144,14 @@ class KuevetteProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/test/porousmediumflow/3pwateroil/implicit/main.cc b/test/porousmediumflow/3pwateroil/implicit/main.cc index 88859e6ce82e8354aa7f3845da77e2bce68159e1..c3faf59e734699ff4c30faab65d6bbc342589755 100644 --- a/test/porousmediumflow/3pwateroil/implicit/main.cc +++ b/test/porousmediumflow/3pwateroil/implicit/main.cc @@ -80,7 +80,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -96,7 +96,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -107,35 +107,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); @@ -155,7 +155,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/3pwateroil/implicit/problem.hh b/test/porousmediumflow/3pwateroil/implicit/problem.hh index e7b1dc0fb6a4b16f6e4d79cda913ee470a5b1bea..d4d3d0a47ac1c558f2723c5702b2bc56fab85540 100644 --- a/test/porousmediumflow/3pwateroil/implicit/problem.hh +++ b/test/porousmediumflow/3pwateroil/implicit/problem.hh @@ -48,36 +48,45 @@ template <class TypeTag> class SagdProblem; namespace Properties { -NEW_TYPE_TAG(Sagd, INHERITS_FROM(ThreePWaterOilNI)); -NEW_TYPE_TAG(ThreePWaterOilSagdBox, INHERITS_FROM(BoxModel, Sagd)); +// Create new type tags +namespace TTag { +struct Sagd { using InheritsFrom = std::tuple<ThreePWaterOilNI>; }; +struct ThreePWaterOilSagdBox { using InheritsFrom = std::tuple<Sagd, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Sagd, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Sagd> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Sagd, Problem, Dumux::SagdProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Sagd> { using type = Dumux::SagdProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(Sagd, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Sagd> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = SagdSpatialParams<FVGridGeometry, Scalar>; }; // Set the fluid system -SET_TYPE_PROP(Sagd, - FluidSystem, - Dumux::FluidSystems::H2OHeavyOil<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Sagd> +{ using type = Dumux::FluidSystems::H2OHeavyOil<GetPropType<TypeTag, Properties::Scalar>>; }; -SET_BOOL_PROP(Sagd, OnlyGasPhaseCanDisappear, true); +template<class TypeTag> +struct OnlyGasPhaseCanDisappear<TypeTag, TTag::Sagd> { static constexpr bool value = true; }; -SET_BOOL_PROP(Sagd, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Sagd> { static constexpr bool value = true; }; -// Set the fluid system -SET_PROP(Sagd, SolidSystem) +// Set the solid system +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::Sagd> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using InertComponent = Components::Constant<1, Scalar>; using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>; }; @@ -96,11 +105,11 @@ template <class TypeTag > class SagdProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { pressureIdx = Indices::pressureIdx, switch1Idx = Indices::switch1Idx, @@ -121,12 +130,12 @@ class SagdProblem : public PorousMediumFlowProblem<TypeTag> dimWorld = GridView::dimensionworld }; - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; diff --git a/test/porousmediumflow/co2/implicit/main.cc b/test/porousmediumflow/co2/implicit/main.cc index 788482a0348f279e588c517c5ebe902837ca8e41..6b3203a85a099a0e93fea26cc2ceacbfa76bea0c 100644 --- a/test/porousmediumflow/co2/implicit/main.cc +++ b/test/porousmediumflow/co2/implicit/main.cc @@ -56,7 +56,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -69,7 +69,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -80,39 +80,39 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the spatial parameters - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; auto spatialParams = std::make_shared<SpatialParams>(fvGridGeometry, gridManager.getGridData()); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry, spatialParams); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields @@ -132,7 +132,7 @@ int main(int argc, char** argv) try // the non-linear solver using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver, - typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>; + GetPropType<TypeTag, Properties::PrimaryVariableSwitch>>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop diff --git a/test/porousmediumflow/co2/implicit/problem.hh b/test/porousmediumflow/co2/implicit/problem.hh index 85f79469837db1f66e9f60efab43fa92b5aae5f3..c8a05e979f06efd2ee0c35252b07b154b2fd396b 100644 --- a/test/porousmediumflow/co2/implicit/problem.hh +++ b/test/porousmediumflow/co2/implicit/problem.hh @@ -56,51 +56,78 @@ template <class TypeTag> class HeterogeneousProblem; namespace Properties { -NEW_TYPE_TAG(Heterogeneous, INHERITS_FROM(TwoPTwoCCO2)); -NEW_TYPE_TAG(HeterogeneousBox, INHERITS_FROM(BoxModel, Heterogeneous)); -NEW_TYPE_TAG(HeterogeneousCCTpfa, INHERITS_FROM(CCTpfaModel, Heterogeneous)); +// Create new type tags +namespace TTag { +struct Heterogeneous { using InheritsFrom = std::tuple<TwoPTwoCCO2>; }; +struct HeterogeneousBox { using InheritsFrom = std::tuple<Heterogeneous, BoxModel>; }; +struct HeterogeneousCCTpfa { using InheritsFrom = std::tuple<Heterogeneous, CCTpfaModel>; }; +} // end namespace TTag //Set the grid type -SET_TYPE_PROP(Heterogeneous, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Heterogeneous> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; // Set the problem property -SET_TYPE_PROP(Heterogeneous, Problem, HeterogeneousProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Heterogeneous> { using type = HeterogeneousProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(Heterogeneous, SpatialParams, HeterogeneousSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Heterogeneous> +{ + using type = HeterogeneousSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; // Set fluid configuration -SET_TYPE_PROP(Heterogeneous, FluidSystem, - FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, Scalar), - HeterogeneousCO2Tables::CO2Tables, - Components::TabulatedComponent<Components::H2O<typename GET_PROP_TYPE(TypeTag, Scalar)>>, - FluidSystems::BrineCO2DefaultPolicy</*constantSalinity=*/true, /*simpleButFast=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Heterogeneous> +{ + using type = FluidSystems::BrineCO2<GetPropType<TypeTag, Properties::Scalar>, + HeterogeneousCO2Tables::CO2Tables, + Components::TabulatedComponent<Components::H2O<GetPropType<TypeTag, Properties::Scalar>>>, + FluidSystems::BrineCO2DefaultPolicy</*constantSalinity=*/true, /*simpleButFast=*/true>>; +}; // Use Moles -SET_BOOL_PROP(Heterogeneous, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Heterogeneous> { static constexpr bool value = false; }; #if !ISOTHERMAL -NEW_TYPE_TAG(HeterogeneousNI, INHERITS_FROM(TwoPTwoCCO2NI)); -NEW_TYPE_TAG(HeterogeneousNIBox, INHERITS_FROM(BoxModel, HeterogeneousNI)); -NEW_TYPE_TAG(HeterogeneousNICCTpfa, INHERITS_FROM(CCTpfaModel, HeterogeneousNI)); +// Create new type tags +namespace TTag { +struct HeterogeneousNI { using InheritsFrom = std::tuple<TwoPTwoCCO2NI>; }; +struct HeterogeneousNIBox { using InheritsFrom = std::tuple<HeterogeneousNI, BoxModel>; }; +struct HeterogeneousNICCTpfa { using InheritsFrom = std::tuple<HeterogeneousNI, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(HeterogeneousNI, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); +template<class TypeTag> +struct Grid<TypeTag, TTag::HeterogeneousNI> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; // Set the problem property -SET_TYPE_PROP(HeterogeneousNI, Problem, HeterogeneousProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::HeterogeneousNI> { using type = HeterogeneousProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(HeterogeneousNI, SpatialParams,HeterogeneousSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::HeterogeneousNI> +{ + using type = HeterogeneousSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; // Set fluid configuration -SET_TYPE_PROP(HeterogeneousNI, FluidSystem, FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, Scalar), - HeterogeneousCO2Tables::CO2Tables>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::HeterogeneousNI> +{ + using type = FluidSystems::BrineCO2<GetPropType<TypeTag, Properties::Scalar>, + HeterogeneousCO2Tables::CO2Tables>; +}; // Use Moles -SET_BOOL_PROP(HeterogeneousNI, UseMoles, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::HeterogeneousNI> { static constexpr bool value = false; }; #endif } // end namespace Properties @@ -131,13 +158,13 @@ template <class TypeTag > class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; // copy some indices for convenience @@ -166,13 +193,13 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag> }; #endif - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using SubControlVolume = typename FVElementGeometry::SubControlVolume; @@ -182,7 +209,7 @@ class HeterogeneousProblem : public PorousMediumFlowProblem<TypeTag> static constexpr bool useMoles = ModelTraits::useMoles(); // the discretization method we are using - static constexpr auto discMethod = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod; + static constexpr auto discMethod = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod; // world dimension to access gravity vector static constexpr int dimWorld = GridView::dimensionworld; diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/main.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/main.cc index 70ab0bce0a75c65ad7b080a2a69c3721db3a3e31..23bc75e5d45a247476cf6671ff9e5b9f945d87e3 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/main.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,35 +112,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh index c3781c478dd1523934c7226e09d1a1a0a7fe4a1c..43fd63f3acc56b4b799437f7767b8bda4e2b03fa 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh @@ -50,34 +50,46 @@ template <class TypeTag> class MPNCComparisonProblem; namespace Properties { -NEW_TYPE_TAG(MPNCComparison, INHERITS_FROM(MPNC)); -NEW_TYPE_TAG(MPNCComparisonBox, INHERITS_FROM(BoxModel, MPNCComparison)); -NEW_TYPE_TAG(MPNCComparisonCC, INHERITS_FROM(CCTpfaModel, MPNCComparison)); +// Create new type tags +namespace TTag { +struct MPNCComparison { using InheritsFrom = std::tuple<MPNC>; }; +struct MPNCComparisonBox { using InheritsFrom = std::tuple<MPNCComparison, BoxModel>; }; +struct MPNCComparisonCC { using InheritsFrom = std::tuple<MPNCComparison, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(MPNCComparison, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::MPNCComparison> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(MPNCComparison, Problem, MPNCComparisonProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::MPNCComparison> { using type = MPNCComparisonProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(MPNCComparison, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::MPNCComparison> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using type = MPNCComparisonSpatialParams<FVGridGeometry, Scalar, FluidSystem>; }; // Set fluid configuration -SET_TYPE_PROP(MPNCComparison, - FluidSystem, - FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MPNCComparison> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; // decide which type to use for floating values (double / quad) -SET_TYPE_PROP(MPNCComparison, Scalar, double); -SET_BOOL_PROP(MPNCComparison, UseMoles, true); -SET_TYPE_PROP(MPNCComparison, IOFields, TwoPTwoCMPNCIOFields); +template<class TypeTag> +struct Scalar<TypeTag, TTag::MPNCComparison> { using type = double; }; +template<class TypeTag> +struct UseMoles<TypeTag, TTag::MPNCComparison> { static constexpr bool value = true; }; +template<class TypeTag> +struct IOFields<TypeTag, TTag::MPNCComparison> { using type = TwoPTwoCMPNCIOFields; }; } // end namespace Dumux /*! @@ -90,25 +102,25 @@ class MPNCComparisonProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NeumannFluxes = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NeumannFluxes = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; using ParameterCache = typename FluidSystem::ParameterCache; // world dimension enum {dimWorld = GridView::dimensionworld}; - enum {numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases()}; - enum {numComponents = GET_PROP_TYPE(TypeTag, ModelTraits)::numComponents()}; + enum {numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases()}; + enum {numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents()}; enum {gasPhaseIdx = FluidSystem::gasPhaseIdx}; enum {liquidPhaseIdx = FluidSystem::liquidPhaseIdx}; enum {wCompIdx = FluidSystem::H2OIdx}; @@ -120,7 +132,7 @@ class MPNCComparisonProblem using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; using PhaseVector = Dune::FieldVector<Scalar, numPhases>; - static constexpr bool isBox = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box; + static constexpr bool isBox = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box; public: /*! diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/main.cc b/test/porousmediumflow/mpnc/implicit/kinetic/main.cc index 6fb6b8ca983abe5ff1b96b914abbbb2db1939fac..dcb433717c5c9da75ddaa43c8f8bba8687ca40a4 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/main.cc +++ b/test/porousmediumflow/mpnc/implicit/kinetic/main.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -98,7 +98,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -109,37 +109,37 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(leafGridView.size(GridView::dimension)); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); problem->setGridVariables(gridVariables); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/plotoverline2d.hh b/test/porousmediumflow/mpnc/implicit/kinetic/plotoverline2d.hh index 6c159bdfa4b36a9e0e9ac1a93c2541a46c1b6093..9ecb3957ee95a3c02c8992cc2733c42211664d3d 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/plotoverline2d.hh +++ b/test/porousmediumflow/mpnc/implicit/kinetic/plotoverline2d.hh @@ -41,15 +41,15 @@ namespace Dumux { template<class TypeTag> class PlotOverLine2D { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { wPhaseIdx = FluidSystem::wPhaseIdx, diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh b/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh index e48b0d71f86cc7651ac658da9f8aa3f99bd516f3..2edd0f301285a6fe9f6f3db4dcfb931e134d5190 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh @@ -73,46 +73,59 @@ template <class TypeTag> class EvaporationAtmosphereProblem; namespace Properties { -NEW_TYPE_TAG(EvaporationAtmosphere, INHERITS_FROM(MPNCNonequil)); -NEW_TYPE_TAG(EvaporationAtmosphereBox, INHERITS_FROM(BoxModel, EvaporationAtmosphere)); +// Create new type tags +namespace TTag { +struct EvaporationAtmosphere { using InheritsFrom = std::tuple<MPNCNonequil>; }; +struct EvaporationAtmosphereBox { using InheritsFrom = std::tuple<EvaporationAtmosphere, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(EvaporationAtmosphere, Grid, Dune::YaspGrid<2, Dune::TensorProductCoordinates<typename GET_PROP_TYPE(TypeTag, Scalar), 2> >); +template<class TypeTag> +struct Grid<TypeTag, TTag::EvaporationAtmosphere> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // Set the problem property -SET_TYPE_PROP(EvaporationAtmosphere, Problem, EvaporationAtmosphereProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::EvaporationAtmosphere> { using type = EvaporationAtmosphereProblem<TypeTag>; }; // Set fluid configuration -SET_TYPE_PROP(EvaporationAtmosphere, - FluidSystem, - FluidSystems::H2ON2Kinetic<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::EvaporationAtmosphere> +{ + using type = FluidSystems::H2ON2Kinetic<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; //! Set the default pressure formulation: either pw first or pn first -SET_PROP(EvaporationAtmosphere, PressureFormulation) +template<class TypeTag> +struct PressureFormulation<TypeTag, TTag::EvaporationAtmosphere> { public: static const MpNcPressureFormulation value = MpNcPressureFormulation::leastWettingFirst; }; // Set the type used for scalar values -SET_TYPE_PROP(EvaporationAtmosphere, Scalar, double); +template<class TypeTag> +struct Scalar<TypeTag, TTag::EvaporationAtmosphere> { using type = double; }; // Set the fluid system -SET_PROP(EvaporationAtmosphere, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::EvaporationAtmosphere> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using InertComponent = Components::Constant<1, Scalar>; using type = SolidSystems::InertSolidPhase<Scalar, InertComponent>; }; // Set the spatial parameters -SET_TYPE_PROP(EvaporationAtmosphere, SpatialParams, EvaporationAtmosphereSpatialParams<TypeTag>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::EvaporationAtmosphere> { using type = EvaporationAtmosphereSpatialParams<TypeTag>; }; // Set the interfacial area relation: wetting -- non-wetting -SET_PROP(EvaporationAtmosphere, AwnSurface) +template<class TypeTag> +struct AwnSurface<TypeTag, TTag::EvaporationAtmosphere> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, SpatialParams)::MaterialLaw; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using MaterialLaw = typename GetPropType<TypeTag, Properties::SpatialParams>::MaterialLaw; using MaterialLawParams = typename MaterialLaw::Params; using EffectiveIALaw = AwnSurfacePcMaxFct<Scalar>; public: @@ -121,10 +134,11 @@ public: // Set the interfacial area relation: wetting -- solid -SET_PROP(EvaporationAtmosphere, AwsSurface) +template<class TypeTag> +struct AwsSurface<TypeTag, TTag::EvaporationAtmosphere> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, SpatialParams)::MaterialLaw; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using MaterialLaw = typename GetPropType<TypeTag, Properties::SpatialParams>::MaterialLaw; using MaterialLawParams = typename MaterialLaw::Params; using EffectiveIALaw = AwnSurfacePolynomial2ndOrder<Scalar>; public: @@ -132,10 +146,11 @@ public: }; // Set the interfacial area relation: non-wetting -- solid -SET_PROP(EvaporationAtmosphere, AnsSurface) +template<class TypeTag> +struct AnsSurface<TypeTag, TTag::EvaporationAtmosphere> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using MaterialLaw = typename GET_PROP_TYPE(TypeTag, SpatialParams)::MaterialLaw; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using MaterialLaw = typename GetPropType<TypeTag, Properties::SpatialParams>::MaterialLaw; using MaterialLawParams = typename MaterialLaw::Params; using EffectiveIALaw = AwnSurfaceExpSwPcTo3<Scalar>; public: @@ -153,25 +168,25 @@ template <class TypeTag> class EvaporationAtmosphereProblem: public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; using ParameterCache = typename FluidSystem::ParameterCache; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum { dimWorld = GridView::dimensionworld }; @@ -188,7 +203,7 @@ class EvaporationAtmosphereProblem: public PorousMediumFlowProblem<TypeTag> enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() }; - static constexpr bool enableChemicalNonEquilibrium = GET_PROP_VALUE(TypeTag, EnableChemicalNonEquilibrium); + static constexpr bool enableChemicalNonEquilibrium = getPropValue<TypeTag, Properties::EnableChemicalNonEquilibrium>(); using ConstraintSolver = MiscibleMultiPhaseComposition<Scalar, FluidSystem>; // formulations diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh b/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh index 7bdbb5e1826a788be85bbac88fbfdcf8158b7cde..58f32f356bbd2acee42391fce042454e91ba8b9a 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh +++ b/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh @@ -43,12 +43,12 @@ namespace Dumux { */ template<class TypeTag> class EvaporationAtmosphereSpatialParams -: public FVSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar), +: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>, EvaporationAtmosphereSpatialParams<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; @@ -58,10 +58,10 @@ class EvaporationAtmosphereSpatialParams using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>; enum { dimWorld = GridView::dimensionworld }; - enum { numPhases = GET_PROP_TYPE(TypeTag, ModelTraits)::numPhases() }; + enum { numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases() }; - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidState = GetPropType<TypeTag, Properties::FluidState>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx }; public: @@ -70,9 +70,9 @@ public: //! export the material law type used using MaterialLaw = TwoPAdapter<liquidPhaseIdx, EffToAbsLaw<RegularizedBrooksCorey<Scalar>>>; //! export the types used for interfacial area calculations - using AwnSurface = typename GET_PROP_TYPE(TypeTag, AwnSurface); - using AwsSurface = typename GET_PROP_TYPE(TypeTag, AwsSurface); - using AnsSurface = typename GET_PROP_TYPE(TypeTag, AnsSurface); + using AwnSurface = GetPropType<TypeTag, Properties::AwnSurface>; + using AwsSurface = GetPropType<TypeTag, Properties::AwsSurface>; + using AnsSurface = GetPropType<TypeTag, Properties::AnsSurface>; //! convenience aliases of the law parameters using MaterialLawParams = typename MaterialLaw::Params; diff --git a/test/porousmediumflow/mpnc/implicit/obstacle/main.cc b/test/porousmediumflow/mpnc/implicit/obstacle/main.cc index 70ab0bce0a75c65ad7b080a2a69c3721db3a3e31..23bc75e5d45a247476cf6671ff9e5b9f945d87e3 100644 --- a/test/porousmediumflow/mpnc/implicit/obstacle/main.cc +++ b/test/porousmediumflow/mpnc/implicit/obstacle/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,35 +112,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh b/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh index 35b14ca4efc360aa18d7f1acc3391ced6e74490d..1ebb273a5d170d9d9acc30035c78bb81c85e3bb8 100644 --- a/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh @@ -53,32 +53,42 @@ template <class TypeTag> class ObstacleProblem; namespace Properties { -NEW_TYPE_TAG(Obstacle, INHERITS_FROM(MPNC)); -NEW_TYPE_TAG(ObstacleBox, INHERITS_FROM(BoxModel, Obstacle)); -NEW_TYPE_TAG(ObstacleCC, INHERITS_FROM(CCTpfaModel, Obstacle)); +// Create new type tags +namespace TTag { +struct Obstacle { using InheritsFrom = std::tuple<MPNC>; }; +struct ObstacleBox { using InheritsFrom = std::tuple<Obstacle, BoxModel>; }; +struct ObstacleCC { using InheritsFrom = std::tuple<Obstacle, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(Obstacle, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::Obstacle> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(Obstacle, Problem, ObstacleProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::Obstacle> { using type = ObstacleProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(Obstacle, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Obstacle> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using type = ObstacleSpatialParams<FVGridGeometry, Scalar, FluidSystem>; }; // Set fluid configuration -SET_TYPE_PROP(Obstacle, - FluidSystem, - FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Obstacle> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; // decide which type to use for floating values (double / quad) -SET_TYPE_PROP(Obstacle, Scalar, double); +template<class TypeTag> +struct Scalar<TypeTag, TTag::Obstacle> { using type = double; }; } @@ -115,22 +125,22 @@ class ObstacleProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; using ParameterCache = typename FluidSystem::ParameterCache; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum { dimWorld = GridView::dimensionworld }; diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/main.cc b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/main.cc index af9667d8558592dc2dc33abdf31a3c92adc3b298..64833aee7ca6fe7bd8e01c497e2042bee4d3799f 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/main.cc +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/main.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// @@ -98,7 +98,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -109,36 +109,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); problem->setGridVariables(gridVariables); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh index 1704440493c7830d7b3595440ca2ed6a79c35326..438bbe7184d77f318560b85e8666520192680612 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh @@ -58,84 +58,96 @@ struct CombustionModelTraits : public MPNCModelTraits<numP, numC, formulation, u }; namespace Properties { -NEW_TYPE_TAG(CombustionOneComponent, INHERITS_FROM(MPNCNonequil)); -NEW_TYPE_TAG(CombustionOneComponentBox, INHERITS_FROM(BoxModel, CombustionOneComponent)); +// Create new type tags +namespace TTag { +struct CombustionOneComponent { using InheritsFrom = std::tuple<MPNCNonequil>; }; +struct CombustionOneComponentBox { using InheritsFrom = std::tuple<CombustionOneComponent, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(CombustionOneComponent, Grid, Dune::OneDGrid); +template<class TypeTag> +struct Grid<TypeTag, TTag::CombustionOneComponent> { using type = Dune::OneDGrid; }; // Set the problem property -SET_TYPE_PROP(CombustionOneComponent, - Problem, - CombustionProblemOneComponent<TypeTag>); - - +template<class TypeTag> +struct Problem<TypeTag, TTag::CombustionOneComponent> +{ using type = CombustionProblemOneComponent<TypeTag>; }; -SET_TYPE_PROP(CombustionOneComponent, - FluidSystem, - FluidSystems::CombustionFluidsystem<typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::CombustionOneComponent> +{ using type = FluidSystems::CombustionFluidsystem<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the default pressure formulation: either pw first or pn first -SET_PROP(CombustionOneComponent, PressureFormulation) +template<class TypeTag> +struct PressureFormulation<TypeTag, TTag::CombustionOneComponent> { public: static const MpNcPressureFormulation value = MpNcPressureFormulation::mostWettingFirst; }; // Set the type used for scalar values -SET_TYPE_PROP(CombustionOneComponent, Scalar, double ); +template<class TypeTag> +struct Scalar<TypeTag, TTag::CombustionOneComponent> { using type = double ; }; // quad / double // We use different model traits for the equilibrium part because we want to deactivate diffusion -SET_PROP(CombustionOneComponent, EquilibriumModelTraits) +template<class TypeTag> +struct EquilibriumModelTraits<TypeTag, TTag::CombustionOneComponent> { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CombustionModelTraits< FluidSystem::numPhases, FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, PressureFormulation), - GET_PROP_VALUE(TypeTag, UseMoles) >; + getPropValue<TypeTag, Properties::PressureFormulation>(), + getPropValue<TypeTag, Properties::UseMoles>() >; }; -SET_PROP(CombustionOneComponent, FluidState) +template<class TypeTag> +struct FluidState<TypeTag, TTag::CombustionOneComponent> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; public: using type = CompositionalFluidState<Scalar, FluidSystem>; }; //################# //changes from the default settings which also assume chemical non-equilibrium //set the number of energyequations we want to use -SET_INT_PROP(CombustionOneComponent, NumEnergyEqFluid, 1); -SET_INT_PROP(CombustionOneComponent, NumEnergyEqSolid, 1); +template<class TypeTag> +struct NumEnergyEqFluid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; }; +template<class TypeTag> +struct NumEnergyEqSolid<TypeTag, TTag::CombustionOneComponent> { static constexpr int value = 1; }; // by default chemical non equilibrium is enabled in the nonequil model, switch that off here -SET_BOOL_PROP(CombustionOneComponent, EnableChemicalNonEquilibrium, false); +template<class TypeTag> +struct EnableChemicalNonEquilibrium<TypeTag, TTag::CombustionOneComponent> { static constexpr bool value = false; }; //################# -SET_PROP(CombustionOneComponent, SolidSystem) +template<class TypeTag> +struct SolidSystem<TypeTag, TTag::CombustionOneComponent> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using ComponentOne = Dumux::Components::Constant<1, Scalar>; using ComponentTwo = Dumux::Components::Constant<2, Scalar>; static constexpr int numInertComponents = 2; using type = SolidSystems::CompositionalSolidPhase<Scalar, ComponentOne, ComponentTwo, numInertComponents>; }; -SET_PROP(CombustionOneComponent, SolidState) +template<class TypeTag> +struct SolidState<TypeTag, TTag::CombustionOneComponent> { private: - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; public: using type = CompositionalSolidState<Scalar, SolidSystem>; }; // Set the spatial parameters -SET_TYPE_PROP(CombustionOneComponent, SpatialParams, CombustionSpatialParams<TypeTag>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::CombustionOneComponent> { using type = CombustionSpatialParams<TypeTag>; }; } /*! @@ -147,24 +159,24 @@ template<class TypeTag> class CombustionProblemOneComponent: public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidState = typename GET_PROP_TYPE(TypeTag, FluidState); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FluidState = GetPropType<TypeTag, Properties::FluidState>; using ParameterCache = typename FluidSystem::ParameterCache; - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; enum {dimWorld = GridView::dimensionworld}; diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh index d90838f6afefcae3c8ad68d341c8e8d3aa80292f..edb715a66929ef6d6db71056d67872fcd6453f1c 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh @@ -41,12 +41,12 @@ namespace Dumux { */ template<class TypeTag> class CombustionSpatialParams -: public FVSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar), +: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>, CombustionSpatialParams<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; @@ -58,7 +58,7 @@ class CombustionSpatialParams using EffectiveLaw = HeatPipeLaw<Scalar>; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum {wPhaseIdx = FluidSystem::wPhaseIdx}; public: diff --git a/test/porousmediumflow/richards/implicit/analytical/main.cc b/test/porousmediumflow/richards/implicit/analytical/main.cc index 8c048ec2ddf146eed1c702d1eec11a8051e16c19..37aa7421dadff65136c834d5946153429497a90d 100644 --- a/test/porousmediumflow/richards/implicit/analytical/main.cc +++ b/test/porousmediumflow/richards/implicit/analytical/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(RichardsAnalyticalCC); + using TypeTag = Properties::TTag::RichardsAnalyticalCC; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/analytical/problem.hh b/test/porousmediumflow/richards/implicit/analytical/problem.hh index 9a13cdba624f85a1482d5d701921a43d39bc737a..7c2e03a03bdba47208f5fafb2175cd0927df9593 100644 --- a/test/porousmediumflow/richards/implicit/analytical/problem.hh +++ b/test/porousmediumflow/richards/implicit/analytical/problem.hh @@ -59,21 +59,27 @@ class RichardsAnalyticalProblem; // Specify the properties for the analytical problem ////////// namespace Properties { -NEW_TYPE_TAG(RichardsAnalytical, INHERITS_FROM(Richards)); -NEW_TYPE_TAG(RichardsAnalyticalBox, INHERITS_FROM(BoxModel, RichardsAnalytical)); -NEW_TYPE_TAG(RichardsAnalyticalCC, INHERITS_FROM(CCTpfaModel, RichardsAnalytical)); +// Create new type tags +namespace TTag { +struct RichardsAnalytical { using InheritsFrom = std::tuple<Richards>; }; +struct RichardsAnalyticalBox { using InheritsFrom = std::tuple<RichardsAnalytical, BoxModel>; }; +struct RichardsAnalyticalCC { using InheritsFrom = std::tuple<RichardsAnalytical, CCTpfaModel>; }; +} // end namespace TTag // Use 2d YaspGrid -SET_TYPE_PROP(RichardsAnalytical, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsAnalytical> { using type = Dune::YaspGrid<2>; }; // Set the physical problem to be solved -SET_TYPE_PROP(RichardsAnalytical, Problem, RichardsAnalyticalProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsAnalytical> { using type = RichardsAnalyticalProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(RichardsAnalytical, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsAnalytical> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = RichardsAnalyticalSpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -97,14 +103,14 @@ template <class TypeTag> class RichardsAnalyticalProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; enum { // copy some indices for convenience pwIdx = Indices::pressureIdx, diff --git a/test/porousmediumflow/richards/implicit/lens/main.cc b/test/porousmediumflow/richards/implicit/lens/main.cc index cfca7cc7c545a8025ae727c6a11b70b6f1753acf..315cb2df0c85525111e3b9dc5ee66e7d8f008f54 100644 --- a/test/porousmediumflow/richards/implicit/lens/main.cc +++ b/test/porousmediumflow/richards/implicit/lens/main.cc @@ -57,7 +57,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -70,7 +70,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -81,27 +81,27 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // check if we are about to restart a previously interrupted simulation - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto restartTime = getParam<Scalar>("Restart.Time", 0); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; const auto fileName = getParam<std::string>("Restart.File"); loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(), *fvGridGeometry); } @@ -113,14 +113,14 @@ int main(int argc, char** argv) try auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); diff --git a/test/porousmediumflow/richards/implicit/lens/problem.hh b/test/porousmediumflow/richards/implicit/lens/problem.hh index 253fddd7988e8e4a89bb20da8be311a451816309..015805ae00bd70eb3ed283b9a78c7626e68edf9f 100644 --- a/test/porousmediumflow/richards/implicit/lens/problem.hh +++ b/test/porousmediumflow/richards/implicit/lens/problem.hh @@ -57,24 +57,34 @@ class RichardsLensProblem; // Specify the properties for the lens problem namespace Properties { -NEW_TYPE_TAG(RichardsLens, INHERITS_FROM(Richards)); -NEW_TYPE_TAG(RichardsLensBox, INHERITS_FROM(BoxModel, RichardsLens)); -NEW_TYPE_TAG(RichardsLensCC, INHERITS_FROM(CCTpfaModel, RichardsLens)); +// Create new type tags +namespace TTag { +struct RichardsLens { using InheritsFrom = std::tuple<Richards>; }; +struct RichardsLensBox { using InheritsFrom = std::tuple<RichardsLens, BoxModel>; }; +struct RichardsLensCC { using InheritsFrom = std::tuple<RichardsLens, CCTpfaModel>; }; +} // end namespace TTag #ifndef GRIDTYPE // Use 2d YaspGrid -SET_TYPE_PROP(RichardsLens, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsLens> { using type = Dune::YaspGrid<2>; }; #else // Use GRIDTYPE from CMakeLists.txt -SET_TYPE_PROP(RichardsLens, Grid, GRIDTYPE); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsLens> { using type = GRIDTYPE; }; #endif // Set the physical problem to be solved -SET_TYPE_PROP(RichardsLens, Problem, RichardsLensProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsLens> { using type = RichardsLensProblem<TypeTag>; }; // Set the spatial parameters -SET_TYPE_PROP(RichardsLens, SpatialParams, RichardsLensSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar)>); +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsLens> +{ + using type = RichardsLensSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, + GetPropType<TypeTag, Properties::Scalar>>; +}; } // end namespace Dumux /*! @@ -108,13 +118,13 @@ template <class TypeTag> class RichardsLensProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; enum { // copy some indices for convenience pressureIdx = Indices::pressureIdx, diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/main.cc b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/main.cc index 5c87ef156440e7c018c066684ee2f14181d56a7a..aa57f67e94fe1b4b6aa3d0b66dc76cedcaaa428f 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/main.cc +++ b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh index b2d3a1f097b9104ffa72416624f7218b99c1e305..ebfd9fb5aa8b67e3084e3b2834c7d34fdf3446f6 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh @@ -49,25 +49,31 @@ template <class TypeTag> class RichardsNIConductionProblem; namespace Properties { -NEW_TYPE_TAG(RichardsNIConduction, INHERITS_FROM(RichardsNI)); -NEW_TYPE_TAG(RichardsNIConductionBox, INHERITS_FROM(BoxModel, RichardsNIConduction)); -NEW_TYPE_TAG(RichardsNIConductionCC, INHERITS_FROM(CCTpfaModel, RichardsNIConduction)); +// Create new type tags +namespace TTag { +struct RichardsNIConduction { using InheritsFrom = std::tuple<RichardsNI>; }; +struct RichardsNIConductionBox { using InheritsFrom = std::tuple<RichardsNIConduction, BoxModel>; }; +struct RichardsNIConductionCC { using InheritsFrom = std::tuple<RichardsNIConduction, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(RichardsNIConduction, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsNIConduction> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(RichardsNIConduction, Problem, - RichardsNIConductionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsNIConduction> { using type = RichardsNIConductionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(RichardsNIConduction, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::RichardsNIConduction> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; }; // Set the spatial parameters -SET_PROP(RichardsNIConduction, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsNIConduction> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = RichardsNISpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -99,19 +105,19 @@ class RichardsNIConductionProblem :public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using IapwsH2O = Components::H2O<Scalar>; - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; enum { diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/convection/main.cc b/test/porousmediumflow/richards/implicit/nonisothermal/convection/main.cc index 5c87ef156440e7c018c066684ee2f14181d56a7a..aa57f67e94fe1b4b6aa3d0b66dc76cedcaaa428f 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/convection/main.cc +++ b/test/porousmediumflow/richards/implicit/nonisothermal/convection/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,35 +105,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh index a70b9c0df53915a056cb36b17f017646f063d9dd..1c0801da5b0b34118fc9e07430957ce039afaeb4 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh @@ -50,24 +50,31 @@ template <class TypeTag> class RichardsNIConvectionProblem; namespace Properties { -NEW_TYPE_TAG(RichardsNIConvection, INHERITS_FROM(RichardsNI)); -NEW_TYPE_TAG(RichardsNIConvectionBox, INHERITS_FROM(BoxModel, RichardsNIConvection)); -NEW_TYPE_TAG(RichardsNIConvectionCC, INHERITS_FROM(CCTpfaModel, RichardsNIConvection)); +// Create new type tags +namespace TTag { +struct RichardsNIConvection { using InheritsFrom = std::tuple<RichardsNI>; }; +struct RichardsNIConvectionBox { using InheritsFrom = std::tuple<RichardsNIConvection, BoxModel>; }; +struct RichardsNIConvectionCC { using InheritsFrom = std::tuple<RichardsNIConvection, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(RichardsNIConvection, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsNIConvection> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(RichardsNIConvection, Problem, RichardsNIConvectionProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsNIConvection> { using type = RichardsNIConvectionProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(RichardsNIConvection, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::RichardsNIConvection> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; }; // Set the spatial parameters -SET_PROP(RichardsNIConvection, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsNIConvection> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = RichardsNISpatialParams<FVGridGeometry, Scalar>; }; } // end namespace Properties @@ -101,23 +108,23 @@ class RichardsNIConvectionProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - 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 BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using IapwsH2O = Components::H2O<Scalar>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; enum { diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/main.cc b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/main.cc index 9fe53abe8f8e1883ea2eda113c03a21d92713633..fa01a59e767997b1a7d6722d91c2f082623ea231 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/main.cc +++ b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/main.cc @@ -54,7 +54,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -67,7 +67,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -78,35 +78,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh index fb110fa8182d0d854f733ac58bf822bbf2f5ec8b..8805f1737573608c4b434d521462b506f75f28e0 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh @@ -48,29 +48,36 @@ template <class TypeTag> class RichardsNIEvaporationProblem; namespace Properties { -NEW_TYPE_TAG(RichardsNIEvaporation, INHERITS_FROM(RichardsNI)); -NEW_TYPE_TAG(RichardsNIEvaporationBox, INHERITS_FROM(BoxModel, RichardsNIEvaporation)); -NEW_TYPE_TAG(RichardsNIEvaporationCC, INHERITS_FROM(CCTpfaModel, RichardsNIEvaporation)); +// Create new type tags +namespace TTag { +struct RichardsNIEvaporation { using InheritsFrom = std::tuple<RichardsNI>; }; +struct RichardsNIEvaporationBox { using InheritsFrom = std::tuple<RichardsNIEvaporation, BoxModel>; }; +struct RichardsNIEvaporationCC { using InheritsFrom = std::tuple<RichardsNIEvaporation, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(RichardsNIEvaporation, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsNIEvaporation> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(RichardsNIEvaporation, Problem, - RichardsNIEvaporationProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsNIEvaporation> { using type = RichardsNIEvaporationProblem<TypeTag>; }; // Set the fluid system -SET_TYPE_PROP(RichardsNIEvaporation, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::RichardsNIEvaporation> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; }; // Set the spatial parameters -SET_PROP(RichardsNIEvaporation, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsNIEvaporation> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = RichardsNISpatialParams<FVGridGeometry, Scalar>; }; -SET_BOOL_PROP(RichardsNIEvaporation, EnableWaterDiffusionInAir, true); +template<class TypeTag> +struct EnableWaterDiffusionInAir<TypeTag, TTag::RichardsNIEvaporation> { static constexpr bool value = true; }; } // end namespace Properties /*! @@ -90,24 +97,24 @@ class RichardsNIEvaporationProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using GridView = GetPropType<TypeTag, Properties::GridView>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace; - 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 BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using ThermalConductivityModel = typename GET_PROP_TYPE(TypeTag, ThermalConductivityModel); - using GridVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables); + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; + using GridVolumeVariables = GetPropType<TypeTag, Properties::GridVolumeVariables>; using ElementVolumeVariables = typename GridVolumeVariables::LocalView; using VolumeVariables = typename GridVolumeVariables::VolumeVariables; - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; using IapwsH2O = Components::H2O<Scalar>; // copy some indices for convenience - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; enum { dimWorld = GridView::dimensionworld }; enum { diff --git a/test/porousmediumflow/richardsnc/implicit/main.cc b/test/porousmediumflow/richardsnc/implicit/main.cc index 89fa2370ccc0b2a9417de9dd392b391063adbf89..b1b76df3ec369e077df4c4b67cc37f87d385a3c4 100644 --- a/test/porousmediumflow/richardsnc/implicit/main.cc +++ b/test/porousmediumflow/richardsnc/implicit/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -94,7 +94,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -105,36 +105,36 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); problem->computePointSourceMap(); // enable point sources // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richardsnc/implicit/problem.hh b/test/porousmediumflow/richardsnc/implicit/problem.hh index 9372c56f0125882ac550a864b48e5a6dd184ead0..795dd21a7fa5a26e2b455703a04d7e66615e50df 100644 --- a/test/porousmediumflow/richardsnc/implicit/problem.hh +++ b/test/porousmediumflow/richardsnc/implicit/problem.hh @@ -49,26 +49,33 @@ class RichardsWellTracerProblem; // Specify the properties for the lens problem namespace Properties { -NEW_TYPE_TAG(RichardsWellTracer, INHERITS_FROM(RichardsNC)); -NEW_TYPE_TAG(RichardsWellTracerBox, INHERITS_FROM(BoxModel, RichardsWellTracer)); -NEW_TYPE_TAG(RichardsWellTracerCC, INHERITS_FROM(CCTpfaModel, RichardsWellTracer)); +// Create new type tags +namespace TTag { +struct RichardsWellTracer { using InheritsFrom = std::tuple<RichardsNC>; }; +struct RichardsWellTracerBox { using InheritsFrom = std::tuple<RichardsWellTracer, BoxModel>; }; +struct RichardsWellTracerCC { using InheritsFrom = std::tuple<RichardsWellTracer, CCTpfaModel>; }; +} // end namespace TTag // Use 2d YaspGrid -SET_TYPE_PROP(RichardsWellTracer, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::RichardsWellTracer> { using type = Dune::YaspGrid<2>; }; // Set the physical problem to be solved -SET_TYPE_PROP(RichardsWellTracer, Problem, RichardsWellTracerProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::RichardsWellTracer> { using type = RichardsWellTracerProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(RichardsWellTracer, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RichardsWellTracer> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = RichardsWellTracerSpatialParams<FVGridGeometry, Scalar>; }; // Set the physical problem to be solved -SET_TYPE_PROP(RichardsWellTracer, PointSource, SolDependentPointSource<TypeTag>); +template<class TypeTag> +struct PointSource<TypeTag, TTag::RichardsWellTracer> { using type = SolDependentPointSource<TypeTag>; }; } // end namespace Properties /*! @@ -101,21 +108,21 @@ template <class TypeTag> class RichardsWellTracerProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); - using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using PointSource = GetPropType<TypeTag, Properties::PointSource>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; enum { pressureIdx = Indices::pressureIdx, compIdx = Indices::compMainIdx + 1, diff --git a/test/porousmediumflow/tracer/1ptracer/main.cc b/test/porousmediumflow/tracer/1ptracer/main.cc index 86a587b6a01a0fce300893f37a0f73f05e83b12d..3b998c76a4db3b3720d193e7a2ff4e652ed8f7ec 100644 --- a/test/porousmediumflow/tracer/1ptracer/main.cc +++ b/test/porousmediumflow/tracer/1ptracer/main.cc @@ -51,8 +51,8 @@ int main(int argc, char** argv) try using namespace Dumux; //! define the type tags for this problem - using OnePTypeTag = TTAG(IncompressibleTest); - using TracerTypeTag = TTAG(TracerTestCC); + using OnePTypeTag = Properties::TTag::IncompressibleTest; + using TracerTypeTag = Properties::TTag::TracerTestCC; //! initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -73,7 +73,7 @@ int main(int argc, char** argv) try ///////////////////////////////////////////////////////////////////// // only create the grid once using the 1p type tag - GridManager<typename GET_PROP_TYPE(OnePTypeTag, Grid)> gridManager; + GridManager<GetPropType<OnePTypeTag, Properties::Grid>> gridManager; gridManager.init(); //! we compute on the leaf grid view @@ -84,17 +84,17 @@ int main(int argc, char** argv) try //////////////////////////////////////////////////////////// //! create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(OnePTypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<OnePTypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); //! the problem (boundary conditions) - using OnePProblem = typename GET_PROP_TYPE(OnePTypeTag, Problem); + using OnePProblem = GetPropType<OnePTypeTag, Properties::Problem>; auto problemOneP = std::make_shared<OnePProblem>(fvGridGeometry); //! the solution vector - using JacobianMatrix = typename GET_PROP_TYPE(OnePTypeTag, JacobianMatrix); - using SolutionVector = typename GET_PROP_TYPE(OnePTypeTag, SolutionVector); + using JacobianMatrix = GetPropType<OnePTypeTag, Properties::JacobianMatrix>; + using SolutionVector = GetPropType<OnePTypeTag, Properties::SolutionVector>; SolutionVector p(leafGridView.size(0)); //! the linear system @@ -102,7 +102,7 @@ int main(int argc, char** argv) try auto r = std::make_shared<SolutionVector>(); //! the grid variables - using OnePGridVariables = typename GET_PROP_TYPE(OnePTypeTag, GridVariables); + using OnePGridVariables = GetPropType<OnePTypeTag, Properties::GridVariables>; auto onePGridVariables = std::make_shared<OnePGridVariables>(problemOneP, fvGridGeometry); onePGridVariables->init(p); @@ -133,7 +133,7 @@ int main(int argc, char** argv) try updateTimer.elapsed(); std::cout << " took " << updateTimer.elapsed() << std::endl; //! write output to vtk - using GridView = typename GET_PROP_TYPE(OnePTypeTag, GridView); + using GridView = GetPropType<OnePTypeTag, Properties::GridView>; Dune::VTKWriter<GridView> onepWriter(leafGridView); onepWriter.addCellData(p, "p"); const auto& k = problemOneP->spatialParams().getKField(); @@ -150,10 +150,10 @@ int main(int argc, char** argv) try //////////////////////////////////////////////////////////// // compute volume fluxes for the tracer model //////////////////////////////////////////////////////////// - using Scalar = typename GET_PROP_TYPE(OnePTypeTag, Scalar); + using Scalar = GetPropType<OnePTypeTag, Properties::Scalar>; std::vector<Scalar> volumeFlux(fvGridGeometry->numScvf(), 0.0); - using FluxVariables = typename GET_PROP_TYPE(OnePTypeTag, FluxVariables); + using FluxVariables = GetPropType<OnePTypeTag, Properties::FluxVariables>; auto upwindTerm = [](const auto& volVars) { return volVars.mobility(0); }; for (const auto& element : elements(leafGridView)) { @@ -194,7 +194,7 @@ int main(int argc, char** argv) try //////////////////////////////////////////////////////////// //! the problem (initial and boundary conditions) - using TracerProblem = typename GET_PROP_TYPE(TracerTypeTag, Problem); + using TracerProblem = GetPropType<TracerTypeTag, Properties::Problem>; auto tracerProblem = std::make_shared<TracerProblem>(fvGridGeometry); // set the flux from the 1p problem @@ -206,7 +206,7 @@ int main(int argc, char** argv) try auto xOld = x; //! the grid variables - using GridVariables = typename GET_PROP_TYPE(TracerTypeTag, GridVariables); + using GridVariables = GetPropType<TracerTypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(tracerProblem, fvGridGeometry); gridVariables->init(x, xOld); @@ -226,9 +226,9 @@ int main(int argc, char** argv) try //! intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, tracerProblem->name()); - using IOFields = typename GET_PROP_TYPE(TracerTypeTag, IOFields); + using IOFields = GetPropType<TracerTypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields - using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TracerTypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/1ptracer/problem_1p.hh b/test/porousmediumflow/tracer/1ptracer/problem_1p.hh index 7de7fa2ae6677805c8af737089d037fba31d17df..dff0c7335caa9564926bfdbab527cf2d700d1beb 100644 --- a/test/porousmediumflow/tracer/1ptracer/problem_1p.hh +++ b/test/porousmediumflow/tracer/1ptracer/problem_1p.hh @@ -46,48 +46,59 @@ template<class TypeTag> class OnePTestProblem; namespace Properties { -NEW_TYPE_TAG(IncompressibleTest, INHERITS_FROM(CCTpfaModel, OneP)); +// Create new type tags +namespace TTag { +struct IncompressibleTest { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(IncompressibleTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::IncompressibleTest> { using type = Dune::YaspGrid<2>; }; // Set the problem type -SET_TYPE_PROP(IncompressibleTest, Problem, OnePTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::IncompressibleTest> { using type = OnePTestProblem<TypeTag>; }; -SET_PROP(IncompressibleTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::IncompressibleTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = OnePTestSpatialParams<FVGridGeometry, Scalar>; }; -SET_TYPE_PROP(IncompressibleTest, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>); +template<class TypeTag> +struct LocalResidual<TypeTag, TTag::IncompressibleTest> { using type = OnePIncompressibleLocalResidual<TypeTag>; }; // the fluid system -SET_PROP(IncompressibleTest, FluidSystem) +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::IncompressibleTest> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; }; // Enable caching -SET_BOOL_PROP(IncompressibleTest, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(IncompressibleTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(IncompressibleTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::IncompressibleTest> { static constexpr bool value = true; }; } // end namespace Properties template<class TypeTag> class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; diff --git a/test/porousmediumflow/tracer/1ptracer/problem_tracer.hh b/test/porousmediumflow/tracer/1ptracer/problem_tracer.hh index a292cb22925187718ee298de8cdb9dce80334ab3..20be005782052399bde9c03d1a72999a220143b5 100644 --- a/test/porousmediumflow/tracer/1ptracer/problem_tracer.hh +++ b/test/porousmediumflow/tracer/1ptracer/problem_tracer.hh @@ -44,42 +44,53 @@ template <class TypeTag> class TracerTestProblem; namespace Properties { -NEW_TYPE_TAG(TracerTest, INHERITS_FROM(Tracer)); -NEW_TYPE_TAG(TracerTestCC, INHERITS_FROM(CCTpfaModel, TracerTest)); +// Create new type tags +namespace TTag { +struct TracerTest { using InheritsFrom = std::tuple<Tracer>; }; +struct TracerTestCC { using InheritsFrom = std::tuple<TracerTest, CCTpfaModel>; }; +} // end namespace TTag // enable caching -SET_BOOL_PROP(TracerTest, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(TracerTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(TracerTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; // Set the grid type -SET_TYPE_PROP(TracerTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TracerTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TracerTest, Problem, TracerTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TracerTest> { using type = TracerTestProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(TracerTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TracerTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TracerTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(TracerTest, UseMoles, false); -SET_BOOL_PROP(TracerTestCC, SolutionDependentMolecularDiffusion, false); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TracerTest> { static constexpr bool value = false; }; +template<class TypeTag> +struct SolutionDependentMolecularDiffusion<TypeTag, TTag::TracerTestCC> { static constexpr bool value = false; }; //! A simple fluid system with one tracer component template<class TypeTag> -class TracerFluidSystem : public FluidSystems::Base<typename GET_PROP_TYPE(TypeTag, Scalar), +class TracerFluidSystem : public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, TracerFluidSystem<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; public: @@ -115,7 +126,8 @@ public: { return 0.0; } }; -SET_TYPE_PROP(TracerTest, FluidSystem, TracerFluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TracerTest> { using type = TracerFluidSystem<TypeTag>; }; } // end namespace Properties @@ -138,17 +150,17 @@ class TracerTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/tracer/constvel/main.cc b/test/porousmediumflow/tracer/constvel/main.cc index 3f84df8b21355633968e6eadb168232ccadc6888..23bc96cab04cf63a809e67c31a532ab99b80cbff 100644 --- a/test/porousmediumflow/tracer/constvel/main.cc +++ b/test/porousmediumflow/tracer/constvel/main.cc @@ -49,7 +49,7 @@ int main(int argc, char** argv) try using namespace Dumux; //! define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; //! initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -62,7 +62,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; try { gridManager.init(); } catch (...) { std::cout << "\n\t -> Creation of the grid failed! <- \n\n"; @@ -77,27 +77,27 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); //! create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); //! the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); //! the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; //! the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); //! get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); @@ -109,7 +109,7 @@ int main(int argc, char** argv) try //! the assembler with time loop for instationary problem using Assembler = FVAssembler<TypeTag, DiffMethod::analytic, IMPLICIT>; auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); - using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); + using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; auto A = std::make_shared<JacobianMatrix>(); auto r = std::make_shared<SolutionVector>(); assembler->setLinearSystem(A, r); @@ -120,9 +120,9 @@ int main(int argc, char** argv) try //! intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/constvel/problem.hh b/test/porousmediumflow/tracer/constvel/problem.hh index b2b221e0c56875bdf7f1eb5f25b6b67f32def2e0..cae6ce784de0a29c8aeed06f4ed39747493ee8b0 100644 --- a/test/porousmediumflow/tracer/constvel/problem.hh +++ b/test/porousmediumflow/tracer/constvel/problem.hh @@ -50,43 +50,53 @@ template <class TypeTag> class TracerTest; namespace Properties { -NEW_TYPE_TAG(TracerTest, INHERITS_FROM(Tracer)); -NEW_TYPE_TAG(TracerTestTpfa, INHERITS_FROM(CCTpfaModel, TracerTest)); -NEW_TYPE_TAG(TracerTestMpfa, INHERITS_FROM(CCMpfaModel, TracerTest)); -NEW_TYPE_TAG(TracerTestBox, INHERITS_FROM(BoxModel, TracerTest)); +// Create new type tags +namespace TTag { +struct TracerTest { using InheritsFrom = std::tuple<Tracer>; }; +struct TracerTestTpfa { using InheritsFrom = std::tuple<TracerTest, CCTpfaModel>; }; +struct TracerTestMpfa { using InheritsFrom = std::tuple<TracerTest, CCMpfaModel>; }; +struct TracerTestBox { using InheritsFrom = std::tuple<TracerTest, BoxModel>; }; +} // end namespace TTag // enable caching -SET_BOOL_PROP(TracerTest, EnableGridVolumeVariablesCache, true); -SET_BOOL_PROP(TracerTest, EnableGridFluxVariablesCache, true); -SET_BOOL_PROP(TracerTest, EnableFVGridGeometryCache, true); +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableFVGridGeometryCache<TypeTag, TTag::TracerTest> { static constexpr bool value = true; }; // Set the grid type -SET_TYPE_PROP(TracerTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::TracerTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(TracerTest, Problem, TracerTest<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::TracerTest> { using type = TracerTest<TypeTag>; }; // Set the spatial parameters -SET_PROP(TracerTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::TracerTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = TracerTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(TracerTest, UseMoles, USEMOLES); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::TracerTest> { static constexpr bool value = USEMOLES; }; //! A simple fluid system with one tracer component template<class TypeTag> -class TracerFluidSystem : public FluidSystems::Base<typename GET_PROP_TYPE(TypeTag, Scalar), +class TracerFluidSystem : public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, TracerFluidSystem<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; public: @@ -141,7 +151,8 @@ public: { return true; } }; -SET_TYPE_PROP(TracerTest, FluidSystem, TracerFluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::TracerTest> { using type = TracerFluidSystem<TypeTag>; }; } // end namespace Properties @@ -164,17 +175,17 @@ class TracerTest : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/test/porousmediumflow/tracer/multicomp/main.cc b/test/porousmediumflow/tracer/multicomp/main.cc index e1e01cc2a45e7a5984c0251bb6bebd0861244246..4cbefe060ef0a53b29ee259ffd2b5141129fd156 100644 --- a/test/porousmediumflow/tracer/multicomp/main.cc +++ b/test/porousmediumflow/tracer/multicomp/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try using namespace Dumux; // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + using TypeTag = Properties::TTag::TYPETAG; // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); @@ -101,7 +101,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); //////////////////////////////////////////////////////////// @@ -112,35 +112,35 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(fvGridGeometry); // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; SolutionVector x(fvGridGeometry->numDofs()); problem->applyInitialSolution(x); auto xOld = x; // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); gridVariables->init(x, xOld); // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; const auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using IOFields = GetPropType<TypeTag, Properties::IOFields>; VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>; vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/multicomp/problem.hh b/test/porousmediumflow/tracer/multicomp/problem.hh index 2cba9f75abfdb16d416f4d7e100b458eee4e969a..eb7f6e01d16df2fbdda2d73e48dd418c326ae323 100644 --- a/test/porousmediumflow/tracer/multicomp/problem.hh +++ b/test/porousmediumflow/tracer/multicomp/problem.hh @@ -45,41 +45,49 @@ template <class TypeTag> class MaxwellStefanTestProblem; namespace Properties { -NEW_TYPE_TAG(MaxwellStefanTest, INHERITS_FROM(Tracer)); -NEW_TYPE_TAG(MaxwellStefanTestCC, INHERITS_FROM(CCTpfaModel, MaxwellStefanTest)); -NEW_TYPE_TAG(MaxwellStefanTestBox, INHERITS_FROM(BoxModel, MaxwellStefanTest)); +// Create new type tags +namespace TTag { +struct MaxwellStefanTest { using InheritsFrom = std::tuple<Tracer>; }; +struct MaxwellStefanTestCC { using InheritsFrom = std::tuple<MaxwellStefanTest, CCTpfaModel>; }; +struct MaxwellStefanTestBox { using InheritsFrom = std::tuple<MaxwellStefanTest, BoxModel>; }; +} // end namespace TTag // Set the grid type -SET_TYPE_PROP(MaxwellStefanTest, Grid, Dune::YaspGrid<2>); +template<class TypeTag> +struct Grid<TypeTag, TTag::MaxwellStefanTest> { using type = Dune::YaspGrid<2>; }; // Set the problem property -SET_TYPE_PROP(MaxwellStefanTest, Problem, MaxwellStefanTestProblem<TypeTag>); +template<class TypeTag> +struct Problem<TypeTag, TTag::MaxwellStefanTest> { using type = MaxwellStefanTestProblem<TypeTag>; }; // Set the spatial parameters -SET_PROP(MaxwellStefanTest, SpatialParams) +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::MaxwellStefanTest> { - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; using type = MaxwellStefanTestSpatialParams<FVGridGeometry, Scalar>; }; // Define whether mole(true) or mass (false) fractions are used -SET_BOOL_PROP(MaxwellStefanTest, UseMoles, true); +template<class TypeTag> +struct UseMoles<TypeTag, TTag::MaxwellStefanTest> { static constexpr bool value = true; }; //! Here we set FicksLaw or MaxwellStefansLaw -SET_TYPE_PROP(MaxwellStefanTest, MolecularDiffusionType, MaxwellStefansLaw<TypeTag>); +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::MaxwellStefanTest> { using type = MaxwellStefansLaw<TypeTag>; }; //! A simple fluid system with one MaxwellStefan component template<class TypeTag> class H2N2CO2FluidSystem -: public FluidSystems::Base<typename GET_PROP_TYPE(TypeTag, Scalar), H2N2CO2FluidSystem<TypeTag>> +: public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, H2N2CO2FluidSystem<TypeTag>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Problem = GetPropType<TypeTag, Properties::Problem>; + using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; public: @@ -179,7 +187,8 @@ public: } }; -SET_TYPE_PROP(MaxwellStefanTest, FluidSystem, H2N2CO2FluidSystem<TypeTag>); +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MaxwellStefanTest> { using type = H2N2CO2FluidSystem<TypeTag>; }; } // end namespace Properties @@ -197,20 +206,20 @@ class MaxwellStefanTestProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - 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 SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + using GridView = GetPropType<TypeTag, Properties::GridView>; + using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; + using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; + using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; + using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; + using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; + using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; //! property that defines whether mole or mass fractions are used - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate;