From 97ae6f0f91019faacb32920e3ac01242ff27d295 Mon Sep 17 00:00:00 2001 From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de> Date: Fri, 21 Dec 2018 11:48:38 +0100 Subject: [PATCH] [InheritsFrom] Consistent ordering --- exercises/exercise-basic/injection2pniproblem.hh | 6 +++++- exercises/exercise-fluidsystem/2p2cproblem.hh | 2 +- exercises/exercise-fluidsystem/2pproblem.hh | 2 +- exercises/exercise-fluidsystem/README.md | 4 ++-- exercises/exercise-fractures/fractureproblem.hh | 2 +- .../solution/exercise-basic/injection2pniproblem.hh | 12 +++--------- .../solution/exercise-fluidsystem/2p2cproblem.hh | 2 +- exercises/solution/exercise-fluidsystem/2pproblem.hh | 2 +- .../solution/exercise-fractures/fractureproblem.hh | 2 +- 9 files changed, 16 insertions(+), 18 deletions(-) diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index c6ee453a..7642c96a 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -73,7 +73,11 @@ public: // Set fluid configuration template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; +struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; } // end namespace Properties /*! diff --git a/exercises/exercise-fluidsystem/2p2cproblem.hh b/exercises/exercise-fluidsystem/2p2cproblem.hh index 1a395ad9..0c3082ca 100644 --- a/exercises/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/exercise-fluidsystem/2p2cproblem.hh @@ -50,7 +50,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC, BoxModel>; }; } // end namespace TTag // Set the "Problem" property diff --git a/exercises/exercise-fluidsystem/2pproblem.hh b/exercises/exercise-fluidsystem/2pproblem.hh index 2787cacc..1acfb0ff 100644 --- a/exercises/exercise-fluidsystem/2pproblem.hh +++ b/exercises/exercise-fluidsystem/2pproblem.hh @@ -64,7 +64,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<TwoP, BoxModel>; }; } // end namespace TTag // Set the "Problem" property diff --git a/exercises/exercise-fluidsystem/README.md b/exercises/exercise-fluidsystem/README.md index 8ab0cb8e..124002bb 100644 --- a/exercises/exercise-fluidsystem/README.md +++ b/exercises/exercise-fluidsystem/README.md @@ -41,7 +41,7 @@ the `TwoP` _TypeTag_ (immiscible two-phase model properties) and the `BoxModel` ```c++ // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<TwoP, BoxModel>; }; } // end namespace TTag ``` @@ -185,7 +185,7 @@ two-component model properties: ```c++ // Create a new type tag for the problem -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC, BoxModel>; }; } // end namespace TTag ``` diff --git a/exercises/exercise-fractures/fractureproblem.hh b/exercises/exercise-fractures/fractureproblem.hh index 38caa0cd..5088241c 100644 --- a/exercises/exercise-fractures/fractureproblem.hh +++ b/exercises/exercise-fractures/fractureproblem.hh @@ -51,7 +51,7 @@ namespace Properties { // Create new type tag node namespace TTag { -struct FractureProblem { using InheritsFrom = std::tuple<CCTpfaModel, TwoP>; }; +struct FractureProblem { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; } // end namespace TTag // Set the grid type diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 1a668c7a..8d971152 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -66,19 +66,13 @@ public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; }; -// the fluid system for incompressible tests +// Set fluid configuration template<class TypeTag> struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> { -private: - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; }; - -// Set fluid configuration -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; } // end namespace Properties /*! diff --git a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh index 0f0602f1..25ae5d6c 100644 --- a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh @@ -50,7 +50,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; }; +struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC, BoxModel>; }; } // end namespace TTag // Set the "Problem" property diff --git a/exercises/solution/exercise-fluidsystem/2pproblem.hh b/exercises/solution/exercise-fluidsystem/2pproblem.hh index b292a43d..fa461792 100644 --- a/exercises/solution/exercise-fluidsystem/2pproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2pproblem.hh @@ -64,7 +64,7 @@ namespace Properties { // Create a new type tag for the problem // Create new type tags namespace TTag { -struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; }; +struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<TwoP, BoxModel>; }; } // end namespace TTag // Set the "Problem" property diff --git a/exercises/solution/exercise-fractures/fractureproblem.hh b/exercises/solution/exercise-fractures/fractureproblem.hh index 2fc8aaa9..1f74f6c6 100644 --- a/exercises/solution/exercise-fractures/fractureproblem.hh +++ b/exercises/solution/exercise-fractures/fractureproblem.hh @@ -51,7 +51,7 @@ namespace Properties { // Create new type tag node namespace TTag { -struct FractureProblem { using InheritsFrom = std::tuple<CCTpfaModel, TwoP>; }; +struct FractureProblem { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; } // end namespace TTag // Set the grid type -- GitLab