From 09b1506927d72811c4cf8bf7cbf7087528569395 Mon Sep 17 00:00:00 2001
From: seitz <gabriele.seitz@iws.uni-stuttgart.de>
Date: Thu, 2 Apr 2020 14:14:03 +0200
Subject: [PATCH] [biomin][propertiesheader] add the properties headers to
 exercise and solution

and adapt the problem files and the README
---
 .../exercise-biomineralization/README.md      |   1 +
 .../biominproblem.hh                          |  72 +------------
 exercises/exercise-biomineralization/main.cc  |   2 +-
 .../exercise-biomineralization/properties.hh  | 102 ++++++++++++++++++
 .../biominproblem.hh                          |  72 +------------
 .../exercise-biomineralization/main.cc        |   2 +-
 .../exercise-biomineralization/properties.hh  | 102 ++++++++++++++++++
 7 files changed, 209 insertions(+), 144 deletions(-)
 create mode 100644 exercises/exercise-biomineralization/properties.hh
 create mode 100644 exercises/solution/exercise-biomineralization/properties.hh

diff --git a/exercises/exercise-biomineralization/README.md b/exercises/exercise-biomineralization/README.md
index b4697c0e..9e04ab2f 100644
--- a/exercises/exercise-biomineralization/README.md
+++ b/exercises/exercise-biomineralization/README.md
@@ -22,6 +22,7 @@ Locate all the files you will need for this exercise
 * The __main file__ : `main.cc`
 * The __input file__: `params.input`
 * The __problem file__ : `biominproblem.hh`
+* The __properties file__: `properties.hh`
 * The __spatial parameters file__: `biominspatialparams.hh`
 
 Furthermore you will find the following folders:
diff --git a/exercises/exercise-biomineralization/biominproblem.hh b/exercises/exercise-biomineralization/biominproblem.hh
index 2f0bd7dc..0793acdf 100644
--- a/exercises/exercise-biomineralization/biominproblem.hh
+++ b/exercises/exercise-biomineralization/biominproblem.hh
@@ -24,84 +24,14 @@
 #ifndef DUMUX_EXERCISE_FOUR_PROBLEM_HH
 #define DUMUX_EXERCISE_FOUR_PROBLEM_HH
 
-#include <dune/grid/yaspgrid.hh>
-
-#include <dumux/discretization/cctpfa.hh>
-#include <dumux/porousmediumflow/2pncmin/model.hh>
+#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/problem.hh>
-#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system
-
-#include <dumux/material/components/co2tablereader.hh>
 
-#include "fluidsystems/biomin.hh" // The biomineralization fluid system
 // TODO: dumux-course-task
 // include chemistry file here
-#include "biominspatialparams.hh" // Spatially dependent parameters
 
 namespace Dumux {
 
-/*!
- * \brief Tutorial problem for a fully coupled TwoPNCMineralization CC Tpfa model.
- */
-
-//! Provides the precalculated tabulated values of CO2 density and enthalpy.
-#include <dumux/material/components/co2tables.inc>
-
-template <class TypeTag>
-class BioMinProblem;
-
-namespace Properties {
-//! Create new type tag for the problem
-// Create new type tags
-namespace TTag {
-struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
-struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
-} // end namespace TTag
-
-//! Set the problem property
-template<class TypeTag>
-struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = BioMinProblem<TypeTag>; };
-
-//! Set grid and the grid creator to be used
-template<class TypeTag>
-struct Grid<TypeTag, TTag::ExerciseFourBioMin> { using type = Dune::YaspGrid<2>; };
-
-//! Set the fluid system type
-template<class TypeTag>
-struct FluidSystem<TypeTag, TTag::ExerciseFourBioMin>
-{
-private:
-    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
-    using CO2Tables = Dumux::CO2Tables;
-    using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
-public:
-    using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
-};
-
-template<class TypeTag>
-struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
-{
-    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
-    using type = SolidSystems::BiominSolidPhase<Scalar>;
-};
-
-// Set the spatial parameters
-template<class TypeTag>
-struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
-    using MT = GetPropType<TypeTag, ModelTraits>;
-    static constexpr int numFluidComps = MT::numFluidComponents();
-    static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
-    using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
-};
-
-template<class TypeTag>
-struct EnableGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-template<class TypeTag>
-struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-template<class TypeTag>
-struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-
-} // end namespace properties
 /*!
  * \brief Problem biomineralization (MICP) in an experimental setup.
  */
diff --git a/exercises/exercise-biomineralization/main.cc b/exercises/exercise-biomineralization/main.cc
index 41aa7454..cd8011e1 100644
--- a/exercises/exercise-biomineralization/main.cc
+++ b/exercises/exercise-biomineralization/main.cc
@@ -50,7 +50,7 @@
 #include <dumux/io/vtkoutputmodule.hh>
 #include <dumux/io/grid/gridmanager.hh>
 
-#include "biominproblem.hh"
+#include "properties.hh"
 
 ////////////////////////
 // the main function
diff --git a/exercises/exercise-biomineralization/properties.hh b/exercises/exercise-biomineralization/properties.hh
new file mode 100644
index 00000000..96f310cc
--- /dev/null
+++ b/exercises/exercise-biomineralization/properties.hh
@@ -0,0 +1,102 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief The two-phase porousmediumflow properties file for exercise biomin
+ */
+
+#ifndef DUMUX_EXERCISE_FOUR_PROPERTIES_HH
+#define DUMUX_EXERCISE_FOUR_PROPERTIES_HH
+
+#include <dune/grid/yaspgrid.hh>
+
+#include <dumux/discretization/cctpfa.hh>
+#include <dumux/porousmediumflow/2pncmin/model.hh>
+#include <dumux/porousmediumflow/problem.hh>
+#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system
+
+#include <dumux/material/components/co2tablereader.hh>
+
+#include "fluidsystems/biomin.hh" // The biomineralization fluid system
+
+#include "biominspatialparams.hh" // Spatially dependent parameters
+#include "biominproblem.hh"
+
+namespace Dumux {
+
+//! Provides the precalculated tabulated values of CO2 density and enthalpy.
+#include <dumux/material/components/co2tables.inc>
+
+namespace Properties {
+
+//! Create new type tag for the problem
+// Create new type tags
+namespace TTag {
+struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
+struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
+} // end namespace TTag
+
+//! Set the problem property
+template<class TypeTag>
+struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = BioMinProblem<TypeTag>; };
+
+//! Set grid and the grid creator to be used
+template<class TypeTag>
+struct Grid<TypeTag, TTag::ExerciseFourBioMin> { using type = Dune::YaspGrid<2>; };
+
+//! Set the fluid system type
+template<class TypeTag>
+struct FluidSystem<TypeTag, TTag::ExerciseFourBioMin>
+{
+private:
+    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
+    using CO2Tables = Dumux::CO2Tables;
+    using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
+public:
+    using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
+};
+
+template<class TypeTag>
+struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
+{
+    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
+    using type = SolidSystems::BiominSolidPhase<Scalar>;
+};
+
+// Set the spatial parameters
+template<class TypeTag>
+struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
+    using MT = GetPropType<TypeTag, ModelTraits>;
+    static constexpr int numFluidComps = MT::numFluidComponents();
+    static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
+    using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
+};
+
+template<class TypeTag>
+struct EnableGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+template<class TypeTag>
+struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+template<class TypeTag>
+struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+
+} // end namespace properties
+} // end namespace Dumux
+
+#endif
diff --git a/exercises/solution/exercise-biomineralization/biominproblem.hh b/exercises/solution/exercise-biomineralization/biominproblem.hh
index 8c511ec8..4c6e462b 100644
--- a/exercises/solution/exercise-biomineralization/biominproblem.hh
+++ b/exercises/solution/exercise-biomineralization/biominproblem.hh
@@ -24,85 +24,15 @@
 #ifndef DUMUX_EXERCISE_FOUR_PROBLEM_HH
 #define DUMUX_EXERCISE_FOUR_PROBLEM_HH
 
-#include <dune/grid/yaspgrid.hh>
-
-#include <dumux/discretization/cctpfa.hh>
-#include <dumux/porousmediumflow/2pncmin/model.hh>
+#include <dumux/common/properties.hh>
 #include <dumux/porousmediumflow/problem.hh>
-#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system
-
-#include <dumux/material/components/co2tablereader.hh>
 
-#include "fluidsystems/biomin.hh" // The biomineralization fluid system
 // TODO: dumux-course-task
 // include chemistry file here
 #include "chemistry/simplebiominreactions.hh" // chemical reactions
-#include "biominspatialparams.hh" // Spatially dependent parameters
 
 namespace Dumux {
 
-/*!
- * \brief Tutorial problem for a fully coupled TwoPNCMineralization CC Tpfa model.
- */
-
-//! Provides the precalculated tabulated values of CO2 density and enthalpy.
-#include <dumux/material/components/co2tables.inc>
-
-template <class TypeTag>
-class BioMinProblem;
-
-namespace Properties {
-//! Create new type tag for the problem
-// Create new type tags
-namespace TTag {
-struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
-struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
-} // end namespace TTag
-
-//! Set the problem property
-template<class TypeTag>
-struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = BioMinProblem<TypeTag>; };
-
-//! Set grid and the grid creator to be used
-template<class TypeTag>
-struct Grid<TypeTag, TTag::ExerciseFourBioMin> { using type = Dune::YaspGrid<2>; };
-
-//! Set the fluid system type
-template<class TypeTag>
-struct FluidSystem<TypeTag, TTag::ExerciseFourBioMin>
-{
-private:
-    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
-    using CO2Tables = Dumux::CO2Tables;
-    using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
-public:
-    using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
-};
-
-template<class TypeTag>
-struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
-{
-    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
-    using type = SolidSystems::BiominSolidPhase<Scalar>;
-};
-
-// Set the spatial parameters
-template<class TypeTag>
-struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
-    using MT = GetPropType<TypeTag, ModelTraits>;
-    static constexpr int numFluidComps = MT::numFluidComponents();
-    static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
-    using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
-};
-
-template<class TypeTag>
-struct EnableGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-template<class TypeTag>
-struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-template<class TypeTag>
-struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
-
-} // end namespace properties
 /*!
  *
  * \brief Problem biomineralization (MICP) in an experimental setup.
diff --git a/exercises/solution/exercise-biomineralization/main.cc b/exercises/solution/exercise-biomineralization/main.cc
index 41aa7454..cd8011e1 100644
--- a/exercises/solution/exercise-biomineralization/main.cc
+++ b/exercises/solution/exercise-biomineralization/main.cc
@@ -50,7 +50,7 @@
 #include <dumux/io/vtkoutputmodule.hh>
 #include <dumux/io/grid/gridmanager.hh>
 
-#include "biominproblem.hh"
+#include "properties.hh"
 
 ////////////////////////
 // the main function
diff --git a/exercises/solution/exercise-biomineralization/properties.hh b/exercises/solution/exercise-biomineralization/properties.hh
new file mode 100644
index 00000000..96f310cc
--- /dev/null
+++ b/exercises/solution/exercise-biomineralization/properties.hh
@@ -0,0 +1,102 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief The two-phase porousmediumflow properties file for exercise biomin
+ */
+
+#ifndef DUMUX_EXERCISE_FOUR_PROPERTIES_HH
+#define DUMUX_EXERCISE_FOUR_PROPERTIES_HH
+
+#include <dune/grid/yaspgrid.hh>
+
+#include <dumux/discretization/cctpfa.hh>
+#include <dumux/porousmediumflow/2pncmin/model.hh>
+#include <dumux/porousmediumflow/problem.hh>
+#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system
+
+#include <dumux/material/components/co2tablereader.hh>
+
+#include "fluidsystems/biomin.hh" // The biomineralization fluid system
+
+#include "biominspatialparams.hh" // Spatially dependent parameters
+#include "biominproblem.hh"
+
+namespace Dumux {
+
+//! Provides the precalculated tabulated values of CO2 density and enthalpy.
+#include <dumux/material/components/co2tables.inc>
+
+namespace Properties {
+
+//! Create new type tag for the problem
+// Create new type tags
+namespace TTag {
+struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
+struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
+} // end namespace TTag
+
+//! Set the problem property
+template<class TypeTag>
+struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = BioMinProblem<TypeTag>; };
+
+//! Set grid and the grid creator to be used
+template<class TypeTag>
+struct Grid<TypeTag, TTag::ExerciseFourBioMin> { using type = Dune::YaspGrid<2>; };
+
+//! Set the fluid system type
+template<class TypeTag>
+struct FluidSystem<TypeTag, TTag::ExerciseFourBioMin>
+{
+private:
+    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
+    using CO2Tables = Dumux::CO2Tables;
+    using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
+public:
+    using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
+};
+
+template<class TypeTag>
+struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
+{
+    using Scalar = GetPropType<TypeTag, Properties::Scalar>;
+    using type = SolidSystems::BiominSolidPhase<Scalar>;
+};
+
+// Set the spatial parameters
+template<class TypeTag>
+struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
+    using MT = GetPropType<TypeTag, ModelTraits>;
+    static constexpr int numFluidComps = MT::numFluidComponents();
+    static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
+    using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
+};
+
+template<class TypeTag>
+struct EnableGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+template<class TypeTag>
+struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+template<class TypeTag>
+struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = true; };
+
+} // end namespace properties
+} // end namespace Dumux
+
+#endif
-- 
GitLab