From 60f1a4162e6341a3ff4ea4a2a060a7c91d79d517 Mon Sep 17 00:00:00 2001
From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de>
Date: Fri, 21 Dec 2018 11:10:01 +0100
Subject: [PATCH] [macros] Use script to replace exercise macros

---
 .../exercise-basic/injection2p2cproblem.hh    |  2 +-
 .../exercise-mainfile/1pspatialparams.hh      |  1 -
 .../exercise-properties/mylocalresidual.hh    | 26 +++++++++----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh
index 79009852..d2cc5189 100644
--- a/exercises/exercise-basic/injection2p2cproblem.hh
+++ b/exercises/exercise-basic/injection2p2cproblem.hh
@@ -43,7 +43,7 @@ namespace Properties {
 // Create new type tags
 namespace TTag {
 struct Injection2p2c { using InheritsFrom = std::tuple<TwoPTwoC>; };
-struct Injection2p2cCC { using InheritsFrom = std::tuple<CCTpfaModel, Injection2p2c>; };
+struct Injection2p2cCC { using InheritsFrom = std::tuple<Injection2p2c, CCTpfaModel>; };
 } // end namespace TTag
 
 // Set the grid type
diff --git a/exercises/exercise-mainfile/1pspatialparams.hh b/exercises/exercise-mainfile/1pspatialparams.hh
index a7df1fd5..d15c8b53 100644
--- a/exercises/exercise-mainfile/1pspatialparams.hh
+++ b/exercises/exercise-mainfile/1pspatialparams.hh
@@ -36,7 +36,6 @@ namespace Dumux {
 template<class FVGridGeometry, class Scalar>
 class OnePTestSpatialParams
 : public FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePTestSpatialParams<FVGridGeometry, Scalar>>
-{
     using GridView = typename FVGridGeometry::GridView;
     using Element = typename GridView::template Codim<0>::Entity;
     using FVElementGeometry = typename FVGridGeometry::LocalView;
diff --git a/exercises/exercise-properties/mylocalresidual.hh b/exercises/exercise-properties/mylocalresidual.hh
index 1a35cf0f..f47698e5 100644
--- a/exercises/exercise-properties/mylocalresidual.hh
+++ b/exercises/exercise-properties/mylocalresidual.hh
@@ -35,24 +35,24 @@ namespace Dumux
  *        using the n-phase immiscible fully implicit models.
  */
 template<class TypeTag>
-class MyLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
+class MyLocalResidual : 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
 
-- 
GitLab