From 9537f6bfe58a1d80fede828d0761da960dc173e7 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Tue, 22 Mar 2016 14:33:24 +0100
Subject: [PATCH] [cleanup][tests] Use new standard grid creator for 2p
 (implicit)

* Use input file for structured grids instead of dgf files for
  2p implicit tests
---
 .../implicit/generalizeddirichletproblem.hh   |  7 +---
 .../2p/implicit/grids/test_2p.dgf             | 10 ------
 .../2p/implicit/grids/test_2pni.dgf           | 10 ------
 .../2p/implicit/injectionproblem2pni.hh       | 34 ++++++-------------
 .../2p/implicit/lensproblem.hh                | 10 ------
 .../2p/implicit/test_box2p.input              |  4 ++-
 .../2p/implicit/test_box2pni.input            |  8 ++---
 .../2p/implicit/test_boxadaptive2p.input      |  4 ++-
 .../2p/implicit/test_cc2p.input               |  4 ++-
 .../2p/implicit/test_cc2pni.input             |  8 ++---
 .../2p/implicit/test_ccadaptive2p.input       |  4 ++-
 .../implicit/test_generalizeddirichlet.input  |  5 +--
 12 files changed, 32 insertions(+), 76 deletions(-)
 delete mode 100644 test/porousmediumflow/2p/implicit/grids/test_2p.dgf
 delete mode 100644 test/porousmediumflow/2p/implicit/grids/test_2pni.dgf

diff --git a/test/porousmediumflow/2p/implicit/generalizeddirichletproblem.hh b/test/porousmediumflow/2p/implicit/generalizeddirichletproblem.hh
index 82b97399e1..16702de8bf 100644
--- a/test/porousmediumflow/2p/implicit/generalizeddirichletproblem.hh
+++ b/test/porousmediumflow/2p/implicit/generalizeddirichletproblem.hh
@@ -30,16 +30,12 @@
 // The base porous media box problem
 #include <dumux/porousmediumflow/implicit/problem.hh>
 
-// The DUNE grid used
-#include <dune/grid/yaspgrid.hh>
-
 // Spatially dependent parameters
 #include "generalizeddirichletspatialparams.hh"
 
 // The components that are used
 #include <dumux/material/components/h2o.hh>
 #include <dumux/material/components/lnapl.hh>
-#include <dumux/io/cubegridcreator.hh>
 #include <dumux/linear/seqsolverbackend.hh>
 
 namespace Dumux{
@@ -55,9 +51,8 @@ NEW_TYPE_TAG(GeneralizedDirichletProblem, INHERITS_FROM(BoxTwoP, GeneralizedDiri
 SET_PROP(GeneralizedDirichletProblem, Problem)
 { typedef Dumux::GeneralizedDirichletProblem<TypeTag> type;};
 
-// Set grid and the grid creator to be used
+// Set grid to be used
 SET_TYPE_PROP(GeneralizedDirichletProblem, Grid, Dune::YaspGrid<1>);
-SET_TYPE_PROP(GeneralizedDirichletProblem, GridCreator, Dumux::CubeGridCreator<TypeTag>);
 
 // Set the wetting phase
 SET_PROP(GeneralizedDirichletProblem, WettingPhase)
diff --git a/test/porousmediumflow/2p/implicit/grids/test_2p.dgf b/test/porousmediumflow/2p/implicit/grids/test_2p.dgf
deleted file mode 100644
index be11789225..0000000000
--- a/test/porousmediumflow/2p/implicit/grids/test_2p.dgf
+++ /dev/null
@@ -1,10 +0,0 @@
-DGF
-Interval
-0 0   % first corner
-6.0 4.0   % second corner
-48 32   % 48 cells in x and 32 in y direction
-#
-BOUNDARYDOMAIN
-default 1    % all boundaries have id 1
-#BOUNDARYDOMAIN
-# unitcube.dgf
\ No newline at end of file
diff --git a/test/porousmediumflow/2p/implicit/grids/test_2pni.dgf b/test/porousmediumflow/2p/implicit/grids/test_2pni.dgf
deleted file mode 100644
index f2df78b633..0000000000
--- a/test/porousmediumflow/2p/implicit/grids/test_2pni.dgf
+++ /dev/null
@@ -1,10 +0,0 @@
-DGF
-Interval
-0 0   % first corner
-60 40   % second corner
-24 16   % 24 cells in x and 16 in y direction
-#
-BOUNDARYDOMAIN
-default 1    % all boundaries have id 1
-#BOUNDARYDOMAIN
-# unitcube.dgf
diff --git a/test/porousmediumflow/2p/implicit/injectionproblem2pni.hh b/test/porousmediumflow/2p/implicit/injectionproblem2pni.hh
index 60e522b16a..4ec1d5c1e9 100644
--- a/test/porousmediumflow/2p/implicit/injectionproblem2pni.hh
+++ b/test/porousmediumflow/2p/implicit/injectionproblem2pni.hh
@@ -27,12 +27,6 @@
 #ifndef DUMUX_INJECTION_PROBLEM_2PNI_HH
 #define DUMUX_INJECTION_PROBLEM_2PNI_HH
 
-#if HAVE_UG
-#include <dune/grid/io/file/dgfparser/dgfug.hh>
-#endif
-#include <dumux/io/simplexgridcreator.hh>
-#include <dumux/io/cubegridcreator.hh>
-
 #include <dumux/porousmediumflow/2p/implicit/model.hh>
 #include <dumux/porousmediumflow/implicit/problem.hh>
 
@@ -61,13 +55,6 @@ NEW_TYPE_TAG(InjectionBoxProblem2PNI, INHERITS_FROM(BoxModel, InjectionProblem2P
 NEW_TYPE_TAG(InjectionCCProblem2PNI, INHERITS_FROM(CCModel, InjectionProblem2PNI));
 #endif
 
-// set the GridCreator property
-#if HAVE_UG
-SET_TYPE_PROP(InjectionProblem2PNI, GridCreator, Dumux::SimplexGridCreator<TypeTag>);
-#else
-SET_TYPE_PROP(InjectionProblem2PNI, GridCreator, Dumux::CubeGridCreator<TypeTag>);
-#endif
-
 // Set the grid type
 #if HAVE_UG
 SET_TYPE_PROP(InjectionProblem2PNI, Grid, Dune::UGGrid<2>);
@@ -78,22 +65,21 @@ SET_TYPE_PROP(InjectionProblem2PNI, Grid, Dune::YaspGrid<2>);
 // Set the problem property
 SET_TYPE_PROP(InjectionProblem2PNI, Problem, Dumux::InjectionProblem2PNI<TypeTag>);
 
-#if 1
 // Use the same fluid system as the 2p2c injection problem
 SET_TYPE_PROP(InjectionProblem2PNI, FluidSystem, FluidSystems::H2ON2<typename GET_PROP_TYPE(TypeTag, Scalar), false>);
-#else
+
+// Alternative: set phases separately
 // Set the wetting phase
-SET_TYPE_PROP(InjectionProblem2PNI,
-              WettingPhase,
-              Dumux::FluidSystems::LiquidPhase<GET_PROP_TYPE(TypeTag, Scalar) Scalar,
-                                               Dumux::SimpleH2O<GET_PROP_TYPE(TypeTag, Scalar) Scalar> >);
+// SET_TYPE_PROP(InjectionProblem2PNI,
+//               WettingPhase,
+//               Dumux::FluidSystems::LiquidPhase<GET_PROP_TYPE(TypeTag, Scalar) Scalar,
+//                                                Dumux::SimpleH2O<GET_PROP_TYPE(TypeTag, Scalar) Scalar> >);
 
 // Set the non-wetting phase
-SET_TYPE_PROP(InjectionProblem2PNI,
-              NonwettingPhase,
-              Dumux::FluidSystems::GasPhase<GET_PROP_TYPE(TypeTag, Scalar) Scalar,
-                                            Dumux::N2<GET_PROP_TYPE(TypeTag, Scalar) Scalar> >);
-#endif
+// SET_TYPE_PROP(InjectionProblem2PNI,
+//               NonwettingPhase,
+//               Dumux::FluidSystems::GasPhase<GET_PROP_TYPE(TypeTag, Scalar) Scalar,
+//                                             Dumux::N2<GET_PROP_TYPE(TypeTag, Scalar) Scalar> >);
 }
 
 /*!
diff --git a/test/porousmediumflow/2p/implicit/lensproblem.hh b/test/porousmediumflow/2p/implicit/lensproblem.hh
index 28aadeaace..4210c75a22 100644
--- a/test/porousmediumflow/2p/implicit/lensproblem.hh
+++ b/test/porousmediumflow/2p/implicit/lensproblem.hh
@@ -26,16 +26,6 @@
 #ifndef DUMUX_LENSPROBLEM_HH
 #define DUMUX_LENSPROBLEM_HH
 
-#if HAVE_DUNE_ALUGRID
-#include <dune/alugrid/grid.hh>
-#endif
-
-#if HAVE_UG
-#include <dune/grid/uggrid.hh>
-#endif
-
-#include <dune/grid/yaspgrid.hh>
-
 #include <dumux/material/components/simpleh2o.hh>
 #include <dumux/material/components/dnapl.hh>
 #include <dumux/porousmediumflow/2p/implicit/model.hh>
diff --git a/test/porousmediumflow/2p/implicit/test_box2p.input b/test/porousmediumflow/2p/implicit/test_box2p.input
index 2dffa89db1..fce9353e9e 100644
--- a/test/porousmediumflow/2p/implicit/test_box2p.input
+++ b/test/porousmediumflow/2p/implicit/test_box2p.input
@@ -3,7 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 3000 # [s]
 
 [Grid]
-File = ./grids/test_2p.dgf
+LowerLeft = 0 0
+UpperRight = 6 4
+Cells = 48 32
 
 [SpatialParams]
 LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner
diff --git a/test/porousmediumflow/2p/implicit/test_box2pni.input b/test/porousmediumflow/2p/implicit/test_box2pni.input
index 932fccac03..6c05aae18c 100644
--- a/test/porousmediumflow/2p/implicit/test_box2pni.input
+++ b/test/porousmediumflow/2p/implicit/test_box2pni.input
@@ -3,11 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 1e4 # [s]
 
 [Grid]
-NumberOfCellsX = 24 # [-] resolution in x-direction
-NumberOfCellsY = 16 # [-] resolution in y-direction
-
-UpperRightX = 60 # [m] length of the domain
-UpperRightY = 40 # [m] height of the domain
+LowerLeft = 0 0
+UpperRight = 60 40
+Cells = 24 16
 
 [Problem]
 Name = injection2pnibox
diff --git a/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input b/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input
index 53cf7bbd4e..0641558f9f 100644
--- a/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input
+++ b/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input
@@ -3,7 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 3000 # [s]
 
 [Grid]
-File = ./grids/test_2p.dgf
+LowerLeft = 0 0
+UpperRight = 6 4
+Cells = 48 32
 
 [SpatialParams]
 LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner
diff --git a/test/porousmediumflow/2p/implicit/test_cc2p.input b/test/porousmediumflow/2p/implicit/test_cc2p.input
index 59fbf23e61..e2162947fd 100644
--- a/test/porousmediumflow/2p/implicit/test_cc2p.input
+++ b/test/porousmediumflow/2p/implicit/test_cc2p.input
@@ -3,7 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 3000 # [s]
 
 [Grid]
-File = ./grids/test_2p.dgf
+LowerLeft = 0 0
+UpperRight = 6 4
+Cells = 48 32
 
 [SpatialParams]
 LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner
diff --git a/test/porousmediumflow/2p/implicit/test_cc2pni.input b/test/porousmediumflow/2p/implicit/test_cc2pni.input
index 3911aa42c4..955b924841 100644
--- a/test/porousmediumflow/2p/implicit/test_cc2pni.input
+++ b/test/porousmediumflow/2p/implicit/test_cc2pni.input
@@ -3,11 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 1e4 # [s]
 
 [Grid]
-NumberOfCellsX = 24 # [-] resolution in x-direction
-NumberOfCellsY = 16 # [-] resolution in y-direction
-
-UpperRightX = 60 # [m] length of the domain
-UpperRightY = 40 # [m] height of the domain
+LowerLeft = 0 0
+UpperRight = 60 40
+Cells = 24 16
 
 [Problem]
 Name = injection2pnicc
diff --git a/test/porousmediumflow/2p/implicit/test_ccadaptive2p.input b/test/porousmediumflow/2p/implicit/test_ccadaptive2p.input
index dec939fb9f..2e54e998cb 100644
--- a/test/porousmediumflow/2p/implicit/test_ccadaptive2p.input
+++ b/test/porousmediumflow/2p/implicit/test_ccadaptive2p.input
@@ -3,7 +3,9 @@ DtInitial = 250 # [s]
 TEnd = 3000 # [s]
 
 [Grid]
-File = ./grids/test_2p.dgf
+LowerLeft = 0 0
+UpperRight = 6 4
+Cells = 48 32
 
 [SpatialParams]
 LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner
diff --git a/test/porousmediumflow/2p/implicit/test_generalizeddirichlet.input b/test/porousmediumflow/2p/implicit/test_generalizeddirichlet.input
index 5833179c7c..36475ff127 100644
--- a/test/porousmediumflow/2p/implicit/test_generalizeddirichlet.input
+++ b/test/porousmediumflow/2p/implicit/test_generalizeddirichlet.input
@@ -6,5 +6,6 @@ DtInitial = 10 # initial time step size [s]
 Name = generalizeddirichlet # name passed to the output routines
 
 [Grid]
-UpperRightX = 300 # coordinate of the right corner of the grid [m]
-NumberOfCellsX = 100 # resolution of the grid
+LowerLeft = 0
+UpperRight = 300
+Cells = 100
-- 
GitLab