From 92fc0d23a29a0a56aeb9f881737ae79cc61e9526 Mon Sep 17 00:00:00 2001
From: Beatrix Becker <beatrix.becker@iws.uni-stuttgart.de>
Date: Fri, 23 Feb 2018 14:27:46 +0100
Subject: [PATCH] [sequential] give problem to spatialparams (like implicit)

---
 dumux/material/spatialparams/sequentialfv.hh                 | 5 +++--
 dumux/material/spatialparams/sequentialfv1p.hh               | 3 ++-
 dumux/porousmediumflow/1p/sequential/diffusion/problem.hh    | 4 ++--
 dumux/porousmediumflow/2p/sequential/diffusion/problem.hh    | 4 ++--
 dumux/porousmediumflow/2p/sequential/impes/problem.hh        | 2 +-
 dumux/porousmediumflow/2p/sequential/transport/problem.hh    | 2 +-
 test/porousmediumflow/1p/sequential/test_1pspatialparams.hh  | 5 +++--
 .../1p/sequential/test_diffusionspatialparams.hh             | 5 +++--
 .../1p/sequential/test_diffusionspatialparams3d.hh           | 5 +++--
 .../porousmediumflow/2p/sequential/test_3d2pspatialparams.hh | 5 +++--
 .../2p/sequential/test_impesadaptivespatialparams.hh         | 5 +++--
 .../2p/sequential/test_impesspatialparams.hh                 | 5 +++--
 .../2p/sequential/test_mpfa2pspatialparams.hh                | 5 +++--
 .../2p/sequential/test_transportspatialparams.hh             | 5 +++--
 .../2p2c/sequential/test_dec2p2c_spatialparams.hh            | 3 ++-
 15 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/dumux/material/spatialparams/sequentialfv.hh b/dumux/material/spatialparams/sequentialfv.hh
index 1f214c28db..efea0982b0 100644
--- a/dumux/material/spatialparams/sequentialfv.hh
+++ b/dumux/material/spatialparams/sequentialfv.hh
@@ -38,6 +38,7 @@ namespace Dumux
 template<class TypeTag>
 class SequentialFVSpatialParams: public SequentialFVSpatialParamsOneP<TypeTag>
 {
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Implementation = typename GET_PROP_TYPE(TypeTag, SpatialParams);
@@ -54,8 +55,8 @@ class SequentialFVSpatialParams: public SequentialFVSpatialParamsOneP<TypeTag>
     /// @endcond
 
 public:
-    SequentialFVSpatialParams(const GridView &gridView)
-    :SequentialFVSpatialParamsOneP<TypeTag>(gridView)
+    SequentialFVSpatialParams(const Problem& problem)
+    :SequentialFVSpatialParamsOneP<TypeTag>(problem)
     {
     }
 
diff --git a/dumux/material/spatialparams/sequentialfv1p.hh b/dumux/material/spatialparams/sequentialfv1p.hh
index 1f19e64005..29eb62b20c 100644
--- a/dumux/material/spatialparams/sequentialfv1p.hh
+++ b/dumux/material/spatialparams/sequentialfv1p.hh
@@ -46,6 +46,7 @@ NEW_PROP_TAG(SpatialParams);
 template<class TypeTag>
 class SequentialFVSpatialParamsOneP
 {
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Implementation = typename GET_PROP_TYPE(TypeTag, SpatialParams);
@@ -61,7 +62,7 @@ class SequentialFVSpatialParamsOneP
     using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 
 public:
-    SequentialFVSpatialParamsOneP(const GridView &gridView)
+    SequentialFVSpatialParamsOneP(const Problem& problem)
     {
     }
     /*!
diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh
index 7ea150b65b..22c8ee9a86 100644
--- a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh
+++ b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh
@@ -75,7 +75,7 @@ public:
     DiffusionProblem1P(TimeManager& timeManager, Grid& grid)
     : ParentType(timeManager, grid), gravity_(0)
     {
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
             gravity_[dim - 1] = -9.81;
@@ -105,7 +105,7 @@ public:
     DiffusionProblem1P(Grid& grid)
     : ParentType(grid, false), gravity_(0)
     {
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
             gravity_[dim - 1] = -9.81;
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh b/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh
index 976afd0eea..67e48f3f5a 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh
@@ -74,7 +74,7 @@ public:
     DiffusionProblem2P(TimeManager& timeManager, Grid& grid)
     : ParentType(timeManager, grid), gravity_(0)
     {
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
             gravity_[dim - 1] = -9.81;
@@ -107,7 +107,7 @@ public:
     DiffusionProblem2P(Grid& grid)
     : ParentType(grid, false), gravity_(0)
     {
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
             gravity_[dim - 1] = -9.81;
diff --git a/dumux/porousmediumflow/2p/sequential/impes/problem.hh b/dumux/porousmediumflow/2p/sequential/impes/problem.hh
index c818202444..8dbd6bd375 100644
--- a/dumux/porousmediumflow/2p/sequential/impes/problem.hh
+++ b/dumux/porousmediumflow/2p/sequential/impes/problem.hh
@@ -77,7 +77,7 @@ public:
         : ParentType(timeManager, grid),
         gravity_(0)
     {
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
 
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
diff --git a/dumux/porousmediumflow/2p/sequential/transport/problem.hh b/dumux/porousmediumflow/2p/sequential/transport/problem.hh
index 9976e09885..ab9742dd56 100644
--- a/dumux/porousmediumflow/2p/sequential/transport/problem.hh
+++ b/dumux/porousmediumflow/2p/sequential/transport/problem.hh
@@ -98,7 +98,7 @@ public:
     {
         cFLFactor_ = getParam<Scalar>("Impet.CFLFactor");
 
-        spatialParams_ = std::make_shared<SpatialParams>(grid.leafGridView());
+        spatialParams_ = std::make_shared<SpatialParams>(asImp_());
 
         gravity_ = 0;
         if (getParam<bool>("Problem.EnableGravity"))
diff --git a/test/porousmediumflow/1p/sequential/test_1pspatialparams.hh b/test/porousmediumflow/1p/sequential/test_1pspatialparams.hh
index 0d13ca6bf3..c649a38882 100644
--- a/test/porousmediumflow/1p/sequential/test_1pspatialparams.hh
+++ b/test/porousmediumflow/1p/sequential/test_1pspatialparams.hh
@@ -37,6 +37,7 @@ template<class TypeTag>
 class TestOnePSpatialParams: public SequentialFVSpatialParamsOneP<TypeTag>
 {
     using ParentType = SequentialFVSpatialParamsOneP<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using IndexSet = typename GridView::IndexSet;
@@ -74,8 +75,8 @@ public:
 
     }
 
-    TestOnePSpatialParams(const GridView& gridView)
-    : ParentType(gridView), gridView_(gridView), indexSet_(gridView.indexSet())
+    TestOnePSpatialParams(const Problem& problem)
+    : ParentType(problem), gridView_(problem.gridView()), indexSet_(problem.gridView().indexSet())
     { }
 
 private:
diff --git a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh
index 988c67e18d..0382c2193b 100644
--- a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh
+++ b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams.hh
@@ -63,6 +63,7 @@ template<class TypeTag>
 class TestDiffusionSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
     using ParentType = SequentialFVSpatialParams<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using IndexSet = typename GridView::IndexSet;
@@ -133,8 +134,8 @@ public:
         return;
     }
 
-    TestDiffusionSpatialParams(const GridView& gridView)
-    : ParentType(gridView),gridView_(gridView), indexSet_(gridView.indexSet()), permeability_(0)
+    TestDiffusionSpatialParams(const Problem& problem)
+    : ParentType(problem),gridView_(problem.gridView()), indexSet_(problem.gridView().indexSet()), permeability_(0)
     {
         // residual saturations
         materialLawParams_.setSwr(0.0);
diff --git a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh
index 860ae3384a..de20b85cae 100644
--- a/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh
+++ b/test/porousmediumflow/1p/sequential/test_diffusionspatialparams3d.hh
@@ -62,6 +62,7 @@ template<class TypeTag>
 class TestDiffusionSpatialParams3d: public SequentialFVSpatialParams<TypeTag>
 {
     using ParentType = SequentialFVSpatialParams<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -95,8 +96,8 @@ public:
             return materialLawParams_;
     }
 
-    TestDiffusionSpatialParams3d(const GridView& gridView)
-    : ParentType(gridView), permeability_(0)
+    TestDiffusionSpatialParams3d(const Problem& problem)
+    : ParentType(problem), permeability_(0)
     {
         // residual saturations
         materialLawParams_.setSwr(0.0);
diff --git a/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh b/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh
index 4da3876a02..5ac0286ddc 100644
--- a/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh
+++ b/test/porousmediumflow/2p/sequential/test_3d2pspatialparams.hh
@@ -67,6 +67,7 @@ template<class TypeTag>
 class Test3d2pSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
     using ParentType = SequentialFVSpatialParams<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -110,8 +111,8 @@ public:
     }
 
 
-    Test3d2pSpatialParams(const GridView& gridView)
-    : ParentType(gridView), constPermeability_(0)
+    Test3d2pSpatialParams(const Problem& problem)
+    : ParentType(problem), constPermeability_(0)
     {
 
 
diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh b/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh
index e0754289be..ddf2f3d3bb 100644
--- a/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh
+++ b/test/porousmediumflow/2p/sequential/test_impesadaptivespatialparams.hh
@@ -62,6 +62,7 @@ public:
 template<class TypeTag>
 class TestIMPESAdaptiveSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -98,8 +99,8 @@ public:
     }
 
 
-    TestIMPESAdaptiveSpatialParams(const GridView& gridView)
-    : ParentType(gridView)
+    TestIMPESAdaptiveSpatialParams(const Problem& problem)
+    : ParentType(problem)
     {
         // residual saturations
         materialLawParams_.setSwr(0.2);
diff --git a/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh b/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh
index 958b84377c..5f2050e151 100644
--- a/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh
+++ b/test/porousmediumflow/2p/sequential/test_impesspatialparams.hh
@@ -62,6 +62,7 @@ public:
 template<class TypeTag>
 class TestIMPESSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -98,8 +99,8 @@ public:
     }
 
 
-    TestIMPESSpatialParams(const GridView& gridView)
-    : ParentType(gridView)
+    TestIMPESSpatialParams(const Problem& problem)
+    : ParentType(problem)
     {
         // residual saturations
         materialLawParams_.setSwr(0.2);
diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh
index 270cb96950..aa9b3dfb75 100644
--- a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh
+++ b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh
@@ -61,6 +61,7 @@ template<class TypeTag>
 class Test2PSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
     using ParentType = SequentialFVSpatialParams<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -115,8 +116,8 @@ public:
             return materialLawParamsBackground_;
     }
 
-    Test2PSpatialParams(const GridView& gridView) :
-            ParentType(gridView), permBackground_(0), permLenses_(0),
+    Test2PSpatialParams(const Problem& problem) :
+            ParentType(problem), permBackground_(0), permLenses_(0),
             lensOneLowerLeft_(0), lensOneUpperRight_(0), lensTwoLowerLeft_(0), lensTwoUpperRight_(0), lensThreeLowerLeft_(0), lensThreeUpperRight_(0)
     {
 #if PROBLEM == 0
diff --git a/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh b/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh
index 709af67ed9..018d15f7fe 100644
--- a/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh
+++ b/test/porousmediumflow/2p/sequential/test_transportspatialparams.hh
@@ -66,6 +66,7 @@ template<class TypeTag>
 class TestTransportSpatialParams: public SequentialFVSpatialParams<TypeTag>
 {
     using ParentType = SequentialFVSpatialParams<TypeTag>;
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
@@ -94,8 +95,8 @@ public:
     }
 
 
-    TestTransportSpatialParams(const GridView& gridView)
-    : ParentType(gridView)
+    TestTransportSpatialParams(const Problem& problem)
+    : ParentType(problem)
     {
         // residual saturations
         materialLawParams_.setSwr(0.0);
diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh b/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh
index a632c12b61..c617ccf9a1 100644
--- a/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh
+++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2c_spatialparams.hh
@@ -61,6 +61,7 @@ public:
 template<class TypeTag>
 class Test2P2CSpatialParams : public SequentialFVSpatialParams<TypeTag>
 {
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
     using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
@@ -91,7 +92,7 @@ public:
     }
 
 
-    Test2P2CSpatialParams(const GridView& gridView) : SequentialFVSpatialParams<TypeTag>(gridView),
+    Test2P2CSpatialParams(const Problem& problem) : SequentialFVSpatialParams<TypeTag>(problem),
             constPermeability_(0)
     {
         // residual saturations
-- 
GitLab