From 0c626ffba3127955c9783d1cae74196af24895e1 Mon Sep 17 00:00:00 2001 From: seitz <gabriele.seitz@iws.uni-stuttgart.de> Date: Wed, 2 Oct 2019 13:08:05 +0200 Subject: [PATCH] [exercise-basic] naming conventions and remove a few typos --- .../{exercisebasic2p2c.cc => 2p2cmain.cc} | 0 .../{exercisebasic2p.cc => 2pmain.cc} | 0 exercises/exercise-basic/CMakeLists.txt | 4 ++-- exercises/exercise-basic/README.md | 12 +++++------ .../exercise-basic/injection2p2cproblem.hh | 14 ++++++------- .../exercise-basic/injection2pniproblem.hh | 20 +++++++++---------- .../exercise-basic/injection2pproblem.hh | 10 +++++----- ...ion2pspatialparams.hh => spatialparams.hh} | 0 .../{exercisebasic2pni.cc => 2pnimain.cc} | 0 .../solution/exercise-basic/CMakeLists.txt | 2 +- .../exercise-basic/injection2pniproblem.hh | 20 +++++++++---------- ...basic_2pni_solution.input => params.input} | 0 ...ion2pspatialparams.hh => spatialparams.hh} | 0 13 files changed, 41 insertions(+), 41 deletions(-) rename exercises/exercise-basic/{exercisebasic2p2c.cc => 2p2cmain.cc} (100%) rename exercises/exercise-basic/{exercisebasic2p.cc => 2pmain.cc} (100%) rename exercises/exercise-basic/{injection2pspatialparams.hh => spatialparams.hh} (100%) rename exercises/solution/exercise-basic/{exercisebasic2pni.cc => 2pnimain.cc} (100%) rename exercises/solution/exercise-basic/{exercise_basic_2pni_solution.input => params.input} (100%) rename exercises/solution/exercise-basic/{injection2pspatialparams.hh => spatialparams.hh} (100%) diff --git a/exercises/exercise-basic/exercisebasic2p2c.cc b/exercises/exercise-basic/2p2cmain.cc similarity index 100% rename from exercises/exercise-basic/exercisebasic2p2c.cc rename to exercises/exercise-basic/2p2cmain.cc diff --git a/exercises/exercise-basic/exercisebasic2p.cc b/exercises/exercise-basic/2pmain.cc similarity index 100% rename from exercises/exercise-basic/exercisebasic2p.cc rename to exercises/exercise-basic/2pmain.cc diff --git a/exercises/exercise-basic/CMakeLists.txt b/exercises/exercise-basic/CMakeLists.txt index 9281f68d..9845ea5f 100644 --- a/exercises/exercise-basic/CMakeLists.txt +++ b/exercises/exercise-basic/CMakeLists.txt @@ -1,10 +1,10 @@ # the immiscible two-phase simulation program dune_add_test(NAME exercise_basic_2p - SOURCES exercisebasic2p.cc) + SOURCES 2pmain.cc) # the compositional two-phase two-component simulation program dune_add_test(NAME exercise_basic_2p2c - SOURCES exercisebasic2p2c.cc) + SOURCES 2p2cmain.cc) # here, add the two-phase non-isothermal simulation program diff --git a/exercises/exercise-basic/README.md b/exercises/exercise-basic/README.md index 178bdc0d..c7d5417d 100644 --- a/exercises/exercise-basic/README.md +++ b/exercises/exercise-basic/README.md @@ -18,8 +18,8 @@ This exercise deals with two problems: a two-phase immiscible problem (__2p__) a <hr> Locate all the files you will need for this exercise -* The __main file__ for the __2p__ problem : `exercisebasic2p.cc` -* The __main file__ for the __2p2c__ problem : `exercisebasic2p2c.cc` +* The __main file__ for the __2p__ problem : `2pmain.cc` +* The __main file__ for the __2p2c__ problem : `2p2cmain.cc` * The __problem file__ for the __2p__ problem: `injection2pproblem.hh` * The __problem file__ for the __2p2c__ problem: `injection2p2cproblem.hh` * The shared __spatial parameters file__: `injection2pspatialparams.hh` @@ -58,15 +58,15 @@ paraview injection-2p2c.pvd ### Task 3: Setting up a new executable (for a non-isothermal simulation) <hr> -* Copy the main file `exercise_basic_2p.cc` and rename it to `exercise_basic_2pni.cc` -* In `exercise_basic_2pni.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`. -* In `exercise_basic_2pni.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;` +* Copy the main file `2pmain.cc` and rename it to `2pnimain.cc` +* In `2pnimain.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`. +* In `2pnimain.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;` * Add a new executable in `CMakeLists.txt` by adding the lines ```cmake # the two-phase non-isothermal simulation program dune_add_test(NAME exercise_basic_2pni - SOURCES exercise_basic_2pni.cc) + SOURCES 2pnimain.cc) ``` * Test that everything compiles without error diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index d44a7c59..16fc3b24 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -31,7 +31,7 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { @@ -69,7 +69,7 @@ public: template<class TypeTag> struct FluidSystem<TypeTag, TTag::Injection2p2c> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; -// Define whether mole(true) or mass (false) fractions are used +// Define whether mole (true) or mass (false) fractions are used template<class TypeTag> struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = true; }; } // end namespace Properties @@ -83,15 +83,15 @@ struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = tr * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ @@ -192,7 +192,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index 86fa9001..f8b6ee12 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2PNI; +class Injection2PNIProblem; namespace Properties { @@ -58,7 +58,7 @@ struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2 // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -89,20 +89,20 @@ struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> +class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -120,7 +120,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PNIProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system @@ -190,7 +190,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index d550902c..e20e85c8 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2P; +class Injection2PProblem; namespace Properties { // define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. @@ -54,7 +54,7 @@ struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2p> { using type = Injection2PProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -94,7 +94,7 @@ struct FluidSystem<TypeTag, TTag::Injection2p> { using type = FluidSystems::H2ON * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> +class Injection2PProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -112,7 +112,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2P(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system diff --git a/exercises/exercise-basic/injection2pspatialparams.hh b/exercises/exercise-basic/spatialparams.hh similarity index 100% rename from exercises/exercise-basic/injection2pspatialparams.hh rename to exercises/exercise-basic/spatialparams.hh diff --git a/exercises/solution/exercise-basic/exercisebasic2pni.cc b/exercises/solution/exercise-basic/2pnimain.cc similarity index 100% rename from exercises/solution/exercise-basic/exercisebasic2pni.cc rename to exercises/solution/exercise-basic/2pnimain.cc diff --git a/exercises/solution/exercise-basic/CMakeLists.txt b/exercises/solution/exercise-basic/CMakeLists.txt index 5ec8e31d..2ebe30e2 100644 --- a/exercises/solution/exercise-basic/CMakeLists.txt +++ b/exercises/solution/exercise-basic/CMakeLists.txt @@ -1,6 +1,6 @@ # the two-phase non-isothermal simulation program dune_add_test(NAME exercise_basic_2pni_solution - SOURCES exercisebasic2pni.cc) + SOURCES 2pnimain.cc) # add exercise to the common target diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 1a43fcfa..73f2fadc 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2PNI; +class Injection2PNIProblem; namespace Properties { // Create new type tags @@ -53,7 +53,7 @@ struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2 // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -84,20 +84,20 @@ struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> +class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -115,7 +115,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PNIProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system @@ -185,7 +185,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/solution/exercise-basic/exercise_basic_2pni_solution.input b/exercises/solution/exercise-basic/params.input similarity index 100% rename from exercises/solution/exercise-basic/exercise_basic_2pni_solution.input rename to exercises/solution/exercise-basic/params.input diff --git a/exercises/solution/exercise-basic/injection2pspatialparams.hh b/exercises/solution/exercise-basic/spatialparams.hh similarity index 100% rename from exercises/solution/exercise-basic/injection2pspatialparams.hh rename to exercises/solution/exercise-basic/spatialparams.hh -- GitLab