diff --git a/exercises/exercise-basic/README.md b/exercises/exercise-basic/README.md
index 8aee3292b4f5fc7e87d5e474f241aa70c50fbbf9..f0dbdf870d69e7061cb0872a76bc0b34a614995f 100644
--- a/exercises/exercise-basic/README.md
+++ b/exercises/exercise-basic/README.md
@@ -25,7 +25,7 @@ Locate all the files you will need for this exercise
* The shared __spatial parameters file__: `injection2pspatialparams.hh`
* The shared __input file__: `exercise_basic.input`
-
+
### Task 2: Compiling and running an executable
@@ -54,13 +54,13 @@ make exercise_basic_2p exercise_basic_2p2c
paraview injection-2p2c.pvd
```
-
+
### Task 3: Setting up a new executable (for a non-isothermal simulation)
* 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 `Injection2pCCTypeTag` to `Injection2pNICCTypeTag` in the line `using TypeTag = TTAG(Injection2pCCTypeTag);`
+* In `exercise_basic_2pni.cc`, change `Injection2pCCTypeTag` to `Injection2pNICCTypeTag` in the line `using TypeTag = Properties::TTag::Injection2pNICCTypeTag;`
* Add a new executable in `CMakeLists.txt` by adding the lines
```cmake
@@ -77,7 +77,7 @@ make # should rerun cmake
make exercise_basic_2pni # builds new executable
```
-
+
### Task 4: Setting up a non-isothermal __2pni__ test problem
diff --git a/exercises/exercise-basic/exercise_basic_2p.cc b/exercises/exercise-basic/exercise_basic_2p.cc
index 88f18f84da4bccded1a97b48ccf2bab040369909..babdd6785167f3d519fa9dc664aff95b0dc551bd 100644
--- a/exercises/exercise-basic/exercise_basic_2p.cc
+++ b/exercises/exercise-basic/exercise_basic_2p.cc
@@ -41,10 +41,11 @@
#include
#include
-#include
+#include
#include
#include
+#include
// The problem file, where setup-specific boundary and initial conditions are defined.
#include "injection2pproblem.hh"
@@ -57,7 +58,7 @@ int main(int argc, char** argv) try
using namespace Dumux;
// define the type tag for this problem
- using TypeTag = TTAG(Injection2pCCTypeTag);
+ using TypeTag = Properties::TTag::Injection2pCCTypeTag;
// initialize MPI, finalize is done automatically on exit
const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
@@ -70,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 gridManager;
+ GridManager> gridManager;
gridManager.init();
////////////////////////////////////////////////////////////
@@ -81,35 +82,57 @@ 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;
auto fvGridGeometry = std::make_shared(leafGridView);
fvGridGeometry->update();
// the problem (initial and boundary conditions)
- using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
+ using Problem = GetPropType;
auto problem = std::make_shared(fvGridGeometry);
+ // check if we are about to restart a previously interrupted simulation
+ using Scalar = GetPropType;
+ Scalar restartTime = getParam("Restart.Time", 0);
+
// the solution vector
- using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+ using SolutionVector = GetPropType;
SolutionVector x(fvGridGeometry->numDofs());
- problem->applyInitialSolution(x);
+ if (restartTime > 0)
+ {
+ using IOFields = GetPropType;
+ using PrimaryVariables = GetPropType;
+ using ModelTraits = GetPropType;
+ using FluidSystem = GetPropType;
+ const auto fileName = getParam("Restart.File");
+ const auto pvName = createPVNameFunction();
+ loadSolution(x, fileName, pvName, *fvGridGeometry);
+ }
+ else
+ problem->applyInitialSolution(x);
auto xOld = x;
// the grid variables
- using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+ using GridVariables = GetPropType;
auto gridVariables = std::make_shared(problem, fvGridGeometry);
- gridVariables->init(x, xOld);
+ gridVariables->init(x);
// get some time loop parameters
- using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+ using Scalar = GetPropType;
const auto tEnd = getParam("TimeLoop.TEnd");
const auto maxDt = getParam("TimeLoop.MaxTimeStepSize");
auto dt = getParam("TimeLoop.DtInitial");
// intialize the vtk output module
- using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
- VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name());
- VtkOutputFields::init(vtkWriter); //! Add model specific output fields
+ using IOFields = GetPropType;
+
+ // use non-conforming output for the test with interface solver
+ const auto ncOutput = getParam("Problem.UseNonConformingOutput", false);
+ VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "",
+ ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming);
+ using VelocityOutput = GetPropType;
+ vtkWriter.addVelocityOutput(std::make_shared(*gridVariables));
+ IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields
+ vtkWriter.write(restartTime);
// instantiate time loop
auto timeLoop = std::make_shared>(0.0, dt, tEnd);
diff --git a/exercises/exercise-basic/exercise_basic_2p2c.cc b/exercises/exercise-basic/exercise_basic_2p2c.cc
index b4359b9ea717c3b3a01ae3ba0601ecda031f64e5..3232900d53c192578da9b4c550919b3db82b5ac7 100644
--- a/exercises/exercise-basic/exercise_basic_2p2c.cc
+++ b/exercises/exercise-basic/exercise_basic_2p2c.cc
@@ -36,15 +36,16 @@
#include
#include
-#include
+#include
#include
#include
-#include
+#include
#include
#include
+#include
// The problem file, where setup-specific boundary and initial conditions are defined.
#include "injection2p2cproblem.hh"
@@ -57,7 +58,7 @@ int main(int argc, char** argv) try
using namespace Dumux;
// define the type tag for this problem
- using TypeTag = TTAG(Injection2p2cCCTypeTag);
+ using TypeTag = Properties::TTag::Injection2p2cCCTypeTag;
// initialize MPI, finalize is done automatically on exit
const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
@@ -70,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 gridManager;
+ GridManager> gridManager;
gridManager.init();
////////////////////////////////////////////////////////////
@@ -81,38 +82,57 @@ 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;
auto fvGridGeometry = std::make_shared(leafGridView);
fvGridGeometry->update();
// the problem (initial and boundary conditions)
- using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
+ using Problem = GetPropType;
auto problem = std::make_shared(fvGridGeometry);
+ // check if we are about to restart a previously interrupted simulation
+ using Scalar = GetPropType;
+ Scalar restartTime = getParam("Restart.Time", 0);
+
// the solution vector
- using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+ using SolutionVector = GetPropType;
SolutionVector x(fvGridGeometry->numDofs());
- problem->applyInitialSolution(x);
+// problem->applyInitialSolution(x);
+ if (restartTime > 0)
+ {
+ using IOFields = GetPropType;
+ using PrimaryVariables = GetPropType;
+ using ModelTraits = GetPropType;
+ using FluidSystem = GetPropType;
+ const auto fileName = getParam("Restart.File");
+ const auto pvName = createPVNameFunction();
+ loadSolution(x, fileName, pvName, *fvGridGeometry);
+ }
+ else
+ problem->applyInitialSolution(x);
auto xOld = x;
// the grid variables
- using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+ using GridVariables = GetPropType;
auto gridVariables = std::make_shared(problem, fvGridGeometry);
- gridVariables->init(x, xOld);
+ gridVariables->init(x);
// get some time loop parameters
- using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+ using Scalar = GetPropType;
const auto tEnd = getParam("TimeLoop.TEnd");
const auto maxDt = getParam("TimeLoop.MaxTimeStepSize");
auto dt = getParam("TimeLoop.DtInitial");
// intialize the vtk output module
- using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
- VtkOutputModule vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name());
- VtkOutputFields::init(vtkWriter); //! Add model specific output fields
+ using IOFields = GetPropType;
+ VtkOutputModule vtkWriter(*gridVariables, x, problem->name());
+ using VelocityOutput = GetPropType;
+ vtkWriter.addVelocityOutput(std::make_shared(*gridVariables));
+ IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields
+ vtkWriter.write(restartTime);
// instantiate time loop
- auto timeLoop = std::make_shared>(0.0, dt, tEnd);
+ auto timeLoop = std::make_shared>(restartTime, dt, tEnd);
timeLoop->setMaxTimeStepSize(maxDt);
// the assembler with time loop for instationary problem
@@ -124,8 +144,8 @@ int main(int argc, char** argv) try
auto linearSolver = std::make_shared(leafGridView, fvGridGeometry->dofMapper());
// the non-linear solver
- using PrimaryVariableSwitch = typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch);
- using NewtonSolver = Dumux::PriVarSwitchNewtonSolver;
+// using PrimaryVariableSwitch = GetPropType;
+ using NewtonSolver = NewtonSolver;
NewtonSolver nonLinearSolver(assembler, linearSolver);
// time loop
diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh
index 39b0ab57b0389f731defb65b161dbef572692a73..9e483829ade944566991f052555a1d3a644fc50e 100644
--- a/exercises/exercise-basic/injection2p2cproblem.hh
+++ b/exercises/exercise-basic/injection2p2cproblem.hh
@@ -24,7 +24,7 @@
#ifndef DUMUX_EX_BASIC_PROBLEM_2P2C_HH
#define DUMUX_EX_BASIC_PROBLEM_2P2C_HH
-#include
+#include
#include
#include
#include
@@ -38,25 +38,32 @@ template
class Injection2p2cProblem;
namespace Properties {
-NEW_TYPE_TAG(Injection2p2cTypeTag, INHERITS_FROM(TwoPTwoC));
-NEW_TYPE_TAG(Injection2p2cCCTypeTag, INHERITS_FROM(CCTpfaModel, Injection2p2cTypeTag));
+// Create new type tags
+namespace TTag {
+struct Injection2p2cTypeTag { using InheritsFrom = std::tuple; };
+struct Injection2p2cCCTypeTag { using InheritsFrom = std::tuple; };
+} // end namespace TTag
// Set the grid type
-SET_TYPE_PROP(Injection2p2cTypeTag, Grid, Dune::YaspGrid<2>);
+template
+struct Grid { using type = Dune::YaspGrid<2>; };
// Set the problem property
-SET_TYPE_PROP(Injection2p2cTypeTag, Problem, Injection2p2cProblem);
+template
+struct Problem { using type = Injection2p2cProblem; };
// Set the spatial parameters
SET_TYPE_PROP(Injection2p2cTypeTag, SpatialParams,
- InjectionSpatialParams);
+ InjectionSpatialParams,
+ GetPropType>);
// Set fluid configuration
-SET_TYPE_PROP(Injection2p2cTypeTag, FluidSystem, FluidSystems::H2ON2>);
+template
+struct FluidSystem { using type = FluidSystems::H2ON2, FluidSystems::H2ON2DefaultPolicy*fastButSimplifiedRelations=*/ true>>; };
// Define whether mole(true) or mass (false) fractions are used
-SET_BOOL_PROP(Injection2p2cTypeTag, UseMoles, true);
+template
+struct UseMoles { static constexpr bool value = true; };
} // end namespace Properties
/*!
@@ -84,15 +91,15 @@ template
class Injection2p2cProblem : public PorousMediumFlowProblem
{
using ParentType = PorousMediumFlowProblem;
- 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 PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
- using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
- using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
- using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
- using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
- using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+ using GridView = GetPropType;
+ using Scalar = GetPropType;
+ using Indices = typename GetPropType::Indices;
+ using PrimaryVariables = GetPropType;
+ using BoundaryTypes = GetPropType;
+ using FVGridGeometry = GetPropType;
+ using FVElementGeometry = typename GetPropType::LocalView;
+ using FluidSystem = GetPropType;
+ using NumEqVector = GetPropType;
enum { dimWorld = GridView::dimensionworld };
using Element = typename GridView::template Codim<0>::Entity;
diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh
index 5d03855918653c1227ee2d31bc21cba1f6644df8..eb5c5a44fd9f962870160bfb835023752205e9c8 100644
--- a/exercises/exercise-basic/injection2pniproblem.hh
+++ b/exercises/exercise-basic/injection2pniproblem.hh
@@ -25,7 +25,7 @@
#ifndef DUMUX_EX_BASIC_PROBLEM_2PNI_HH
#define DUMUX_EX_BASIC_PROBLEM_2PNI_HH
-#include
+#include
#include
#include
#include
@@ -44,22 +44,28 @@ namespace Properties
* TODO:dumux-course-task:
* inherit from the TwoPNI model instead of TwoP here
*/
-NEW_TYPE_TAG(Injection2pNITypeTag, INHERITS_FROM(TwoP));
-NEW_TYPE_TAG(Injection2pNICCTypeTag, INHERITS_FROM(CCTpfaModel, Injection2pNITypeTag));
+// Create new type tags
+namespace TTag {
+struct Injection2pNITypeTag { using InheritsFrom = std::tuple; };
+struct Injection2pNICCTypeTag { using InheritsFrom = std::tuple; };
+} // end namespace TTag
// Set the grid type
-SET_TYPE_PROP(Injection2pNITypeTag, Grid, Dune::YaspGrid<2>);
+template
+struct Grid { using type = Dune::YaspGrid<2>; };
// Set the problem property
-SET_TYPE_PROP(Injection2pNITypeTag, Problem, InjectionProblem2PNI);
+template
+struct Problem { using type = InjectionProblem2PNI; };
// Set the spatial parameters
SET_TYPE_PROP(Injection2pNITypeTag, SpatialParams,
- InjectionSpatialParams);
+ InjectionSpatialParams,
+ GetPropType>);
// Set fluid configuration
-SET_TYPE_PROP(Injection2pNITypeTag, FluidSystem, FluidSystems::H2ON2>);
+template
+struct FluidSystem { using type = FluidSystems::H2ON2, FluidSystems::H2ON2DefaultPolicy*fastButSimplifiedRelations=*/ true>>; };
} // end namespace Properties
/*!
@@ -87,15 +93,15 @@ template
class InjectionProblem2PNI : public PorousMediumFlowProblem
{
using ParentType = PorousMediumFlowProblem;
- 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 PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
- using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
- using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
- using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
- using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
- using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+ using GridView = GetPropType;
+ using Scalar = GetPropType;
+ using Indices = typename GetPropType::Indices;
+ using PrimaryVariables = GetPropType;
+ using BoundaryTypes = GetPropType;
+ using FVGridGeometry = GetPropType;
+ using FVElementGeometry = typename GetPropType::LocalView;
+ using FluidSystem = GetPropType;
+ using NumEqVector = GetPropType;
enum { dimWorld = GridView::dimensionworld };
using Element = typename GridView::template Codim<0>::Entity;
diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh
index aae875173477bd98d8ac046ab2c7ba976132b5ed..414b4124b94c7778d60e1ab42f912cd50a8d530f 100644
--- a/exercises/exercise-basic/injection2pproblem.hh
+++ b/exercises/exercise-basic/injection2pproblem.hh
@@ -25,7 +25,7 @@
#ifndef DUMUX_EX_BASIC_PROBLEM_2P_HH
#define DUMUX_EX_BASIC_PROBLEM_2P_HH
-#include
+#include
#include
#include
#include
@@ -40,22 +40,28 @@ class InjectionProblem2P;
namespace Properties {
// define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization.
-NEW_TYPE_TAG(Injection2pTypeTag, INHERITS_FROM(TwoP));
-NEW_TYPE_TAG(Injection2pCCTypeTag, INHERITS_FROM(CCTpfaModel, Injection2pTypeTag));
+// Create new type tags
+namespace TTag {
+struct Injection2pTypeTag { using InheritsFrom = std::tuple; };
+struct Injection2pCCTypeTag { using InheritsFrom = std::tuple; };
+} // end namespace TTag
// Set the grid type
-SET_TYPE_PROP(Injection2pTypeTag, Grid, Dune::YaspGrid<2>);
+template
+struct Grid { using type = Dune::YaspGrid<2>; };
// Set the problem property
-SET_TYPE_PROP(Injection2pTypeTag, Problem, InjectionProblem2P);
+template
+struct Problem { using type = InjectionProblem2P; };
// Set the spatial parameters
SET_TYPE_PROP(Injection2pTypeTag, SpatialParams,
- InjectionSpatialParams);
+ InjectionSpatialParams,
+ GetPropType>);
// Set fluid configuration
-SET_TYPE_PROP(Injection2pTypeTag, FluidSystem, FluidSystems::H2ON2>);
+template
+struct FluidSystem { using type = FluidSystems::H2ON2, FluidSystems::H2ON2DefaultPolicy*fastButSimplifiedRelations=*/ true>>; };
} // end namespace Properties
/*!
@@ -83,15 +89,15 @@ template
class InjectionProblem2P : public PorousMediumFlowProblem
{
using ParentType = PorousMediumFlowProblem;
- 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 PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
- using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
- using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
- using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
- using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
- using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
+ using GridView = GetPropType;
+ using Scalar = GetPropType;
+ using Indices = typename GetPropType::Indices;
+ using PrimaryVariables = GetPropType;
+ using BoundaryTypes = GetPropType;
+ using FVGridGeometry = GetPropType;
+ using FVElementGeometry = typename GetPropType::LocalView;
+ using FluidSystem = GetPropType;
+ using NumEqVector = GetPropType;
enum { dimWorld = GridView::dimensionworld };
using Element = typename GridView::template Codim<0>::Entity;
diff --git a/exercises/exercise-biomineralization/README.md b/exercises/exercise-biomineralization/README.md
index f7348b045b8e3cb182b7fb65b48406d6bb9023cd..dfd4c1b145e4d0433ce2a177bcdf782ff10981b4 100644
--- a/exercises/exercise-biomineralization/README.md
+++ b/exercises/exercise-biomineralization/README.md
@@ -124,7 +124,7 @@ Run two simulations and compare them side by side by creating two input files, o
```bash
./exercisebiomin -Problem.Name biominNoUrea -Injection.ConcUrea 0
```
-The result for the biomineralization process after the CO2 injection should look like this:
+The result for the biomineralization process during the CO2 injection should look like this:

@@ -133,13 +133,13 @@ The result for the biomineralization process after the CO2 injection should look
In the last step, the manual comparison of the results can be quite difficult. Paraview offers the option to use programmable python filters. To use them, make sure two result files with __different names__ are loaded. Mark both of them and click on `Filters --> Alphabetical --> Programmable Filter`. Now a new field opens on the left side. Copy the following lines there:
```python
-Sn_0 = inputs[0].CellData['S_n'];
-Sn_1 = inputs[1].CellData['S_n'];
-output.CellData.append(abs(Sn_0-Sn_1),'diffSn');
+S_gas_0 = inputs[0].CellData['S_gas'];
+S_gas_1 = inputs[1].CellData['S_gas'];
+output.CellData.append(abs(S_gas_0-S_gas_1),'diffS_gas');
```
-Click `Apply` and select `diffSn` as new output. You should now see the difference between the two result files. You can also change the output to a not absolute value by changing the last line to:
+Click `Apply` and select `diffS_gas` as new output. You should now see the difference between the two result files. You can also change the output to a not absolute value by changing the last line to:
```python
-output.CellData.append((Sn_0-Sn_1),'diffSn');
+output.CellData.append((S_gas_0-S_gas_1),'diffS_gas');
```
diff --git a/exercises/exercise-biomineralization/biominproblem.hh b/exercises/exercise-biomineralization/biominproblem.hh
index aa2c8a2c5d75e680dd96fff7ee81b03dc3c38ee4..5b1a8b2859a2765059e9eb00cd8da976e7fadcde 100644
--- a/exercises/exercise-biomineralization/biominproblem.hh
+++ b/exercises/exercise-biomineralization/biominproblem.hh
@@ -24,7 +24,7 @@
#ifndef DUMUX_EXERCISE_FOUR_PROBLEM_HH
#define DUMUX_EXERCISE_FOUR_PROBLEM_HH
-#include
+#include
#include
#include
#include "solidsystems/biominsolidphase.hh" // The biomineralization solid system
@@ -51,42 +51,54 @@ class ExerciseFourBioMinProblem;
namespace Properties
{
//! Create new type tag for the problem
-NEW_TYPE_TAG(ExerciseFourBioMinTypeTag, INHERITS_FROM(TwoPNCMin, BioMinSpatialparams));
-NEW_TYPE_TAG(ExerciseFourBioMinCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, ExerciseFourBioMinTypeTag));
+// Create new type tags
+namespace TTag {
+struct ExerciseFourBioMinTypeTag { using InheritsFrom = std::tuple; };
+struct ExerciseFourBioMinCCTpfaTypeTag { using InheritsFrom = std::tuple; };
+} // end namespace TTag
//! Set the problem property
-SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Problem, ExerciseFourBioMinProblem);
+template
+struct Problem { using type = ExerciseFourBioMinProblem; };
//! Set grid and the grid creator to be used
#if HAVE_DUNE_ALUGRID
-SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::ALUGrid*dim=*/2, 2, Dune::cube, Dune::nonconforming>);
+template
+struct Grid { using type = Dune::ALUGrid*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
-SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::UGGrid<2>);
+template
+struct Grid { using type = Dune::UGGrid<2>; };
#else
-SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::YaspGrid<2>);
+template
+struct Grid { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
//! Set the fluid system type
-SET_PROP(ExerciseFourBioMinTypeTag, FluidSystem)
+template
+struct FluidSystem
{
private:
- using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+ using Scalar = GetPropType;
using CO2Tables = Dumux::CO2Tables;
using H2OType = Components::TabulatedComponent>;
public:
using type = FluidSystems::BioMin;
};
-SET_PROP(ExerciseFourBioMinTypeTag, SolidSystem)
+template
+struct SolidSystem
{
- using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+ using Scalar = GetPropType;
using type = SolidSystems::BiominSolidPhase;
};
-SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableFVGridGeometryCache, false);
-SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridVolumeVariablesCache, false);
-SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridFluxVariablesCache, false);
+template
+struct EnableFVGridGeometryCache { static constexpr bool value = false; };
+template
+struct EnableGridVolumeVariablesCache { static constexpr bool value = false; };
+template
+struct EnableGridFluxVariablesCache { static constexpr bool value = false; };
} // end namespace properties
/*!
@@ -98,16 +110,16 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem
{
using ParentType = PorousMediumFlowProblem;
- 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 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 VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
- using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
- using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
+ using GridView = GetPropType;
+ using Scalar = GetPropType;
+ using FluidSystem = GetPropType;
+ using SolidSystem = GetPropType;
+ using Indices = typename GetPropType::Indices;
+ using PrimaryVariables = GetPropType;
+ using BoundaryTypes = GetPropType;
+ using VolumeVariables = GetPropType;
+ using FVGridGeometry = GetPropType;
+ using FVElementGeometry = typename GetPropType::LocalView;
// Grid dimension
enum
@@ -117,10 +129,10 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem
};
using GlobalPosition = Dune::FieldVector;
- using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
- using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
+ using NumEqVector = GetPropType;
+ using ElementVolumeVariables = typename GetPropType::LocalView;
using Element = typename GridView::template Codim<0>::Entity;
- using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+ using SolutionVector = GetPropType;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
// TODO: dumux-course-task
// set the chemistry TypeTag
@@ -173,7 +185,7 @@ public:
concCa_ = getParam("Injection.ConcCa");
concUrea_ = getParam("Injection.ConcUrea");
- unsigned int codim = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box ? dim : 0;
+ unsigned int codim = GetPropType::discMethod == DiscretizationMethod::box ? dim : 0;
Kxx_.resize(fvGridGeometry->gridView().size(codim));
Kyy_.resize(fvGridGeometry->gridView().size(codim));
@@ -268,7 +280,6 @@ public:
NumEqVector values(0.0);
Scalar waterFlux = injVolumeflux_; // divide by area if area not 1! [m/s]
- Scalar gasFlux = injCO2_; // divide by area if area not 1! [m/s]
// Set values for Ca + urea injection above aquitard.
// Use negative values for injection.
@@ -285,6 +296,7 @@ public:
// Set CO2 injection below aquitard after the injBioTime
else
{
+ // Scalar gasFlux = injCO2_; // divide by area if area not 1! [m/s]
values = 0.0; //mol/m²/s
}
diff --git a/exercises/exercise-biomineralization/biominspatialparams.hh b/exercises/exercise-biomineralization/biominspatialparams.hh
index c8d01efc71a2bcb7b63c87d7111a6f58a72fc14c..12be491883ddd47bb5e96e5495b4f101b7e37520 100644
--- a/exercises/exercise-biomineralization/biominspatialparams.hh
+++ b/exercises/exercise-biomineralization/biominspatialparams.hh
@@ -31,7 +31,7 @@
#include
#include
-#include
+#include
namespace Dumux
{
@@ -45,7 +45,8 @@ namespace Properties
NEW_TYPE_TAG(BioMinSpatialparams);
// Set the spatial parameters
-SET_TYPE_PROP(BioMinSpatialparams, SpatialParams, BioMinSpatialparams);
+template
+struct SpatialParams { using type = BioMinSpatialparams; };
} // end namespace Properties
/*!
@@ -54,17 +55,17 @@ SET_TYPE_PROP(BioMinSpatialparams, SpatialParams, BioMinSpatialparams);
*/
template
class BioMinSpatialparams
-: public FVSpatialParams,
+ GetPropType,
BioMinSpatialparams>
{
- using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
- using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+ using Scalar = GetPropType;
+ using FVGridGeometry = GetPropType;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams>;
using EffectiveLaw = RegularizedBrooksCorey;
- using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+ using SolutionVector = GetPropType;
using GridView = typename FVGridGeometry::GridView;
using CoordScalar = typename GridView::ctype;
@@ -75,7 +76,7 @@ class BioMinSpatialparams
using Tensor = Dune::FieldMatrix;
public:
- using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem);
+ using SolidSystem = GetPropType;
using PermeabilityType = Tensor;
using MaterialLaw = EffToAbsLaw;
using MaterialLawParams = typename MaterialLaw::Params;
@@ -331,8 +332,8 @@ private:
bool isFaultZone_(const GlobalPosition &globalPos) const
{ return globalPos[dimWorld-2] > 2 - eps_ && globalPos[dimWorld-2] < 3 + eps_;}
- using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
- PorosityPrecipitation poroLaw_;
+ using ModelTraits = GetPropType;
+ PorosityPrecipitation poroLaw_;
PermeabilityKozenyCarman permLaw_;
diff --git a/exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh b/exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh
index fff7201abdffedb149802d904e7b2377bb5dd750..bc0e0f0a9a086aa4c51f7688ba0581abee0d0ef4 100644
--- a/exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh
+++ b/exercises/exercise-biomineralization/chemistry/simplebiominreactions.hh
@@ -33,12 +33,12 @@ namespace Dumux {
template