From bda92ea261d4a681d283fa7f46d01d4d7457deb2 Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Wed, 23 Mar 2016 23:33:27 +0100
Subject: [PATCH] [mpfa] fix sequential MPFA tests

Sequential MPFA relies on the local vertex numberings of the individual
grid managers. This numberings have changed for the 2d-ALUGrid. Until this
is fixed, change the corresponding tests to use UGGrid instead. Alternatively,
master-old of dune-alugrid can be used.

Also revert changes to the input file that never were reflected in the
corresponding spatial parameters file.
---
 .../2p/sequential/test_mpfa2p.cc              |  6 +--
 .../2p/sequential/test_mpfa2p.input           | 41 ++++++++++++-------
 .../2p/sequential/test_mpfa2pproblem.hh       |  4 +-
 3 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2p.cc b/test/porousmediumflow/2p/sequential/test_mpfa2p.cc
index a08f521bd4..01b4cf25e9 100644
--- a/test/porousmediumflow/2p/sequential/test_mpfa2p.cc
+++ b/test/porousmediumflow/2p/sequential/test_mpfa2p.cc
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#if HAVE_DUNE_ALUGRID
+#if HAVE_UG
 
 #include "test_mpfa2pproblem.hh"
 #include <dumux/common/start.hh>
@@ -153,8 +153,8 @@ int main(int argc, char** argv)
 
 int main()
 {
-#warning You need to have dune-ALUGrid installed to run this test
-    std::cerr << "You need to have dune-ALUGrid installed to run this test\n";
+#warning You need to have UGGrid to run this test
+    std::cerr << "You need to have UGGrid to run this test\n";
     return 77;
 }
 #endif
diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2p.input b/test/porousmediumflow/2p/sequential/test_mpfa2p.input
index 379cfb7780..29f0746c81 100644
--- a/test/porousmediumflow/2p/sequential/test_mpfa2p.input
+++ b/test/porousmediumflow/2p/sequential/test_mpfa2p.input
@@ -4,11 +4,10 @@ DtInitial = 5e5# [s]
 SubTimestepVerbosity = 0
 
 [Grid]
-File = grids/test_mpfa2p.dgf#grid for buckley-leverett or mcwhorter problem
-
+#File = grids/test_mpfa2p.dgf#grid for buckley-leverett or mcwhorter problem
 Cells = 10 10
-
 UpperRight = 20 10
+ClosureType = None
 
 [Problem]
 OutputInterval =0
@@ -25,18 +24,30 @@ InjectionFlux = 0.1
 OutputLevel = 1 # 0 -> only primary variables (default), 1 -> also secondary variables
 
 [SpatialParams]
-BackgroundPermeability = 1e-10 0 0 1e-10 # XX XY YX YY
-
-LensPermeability = 1e-14 0 0 1e-14 # XX XY YX YY
-
-LensOneLowerLeft = 7 6
-LensOneUpperRight = 13 7
-
-LensTwoLowerLeft = 2 4
-LensTwoUpperRight = 8 5
-
-LensThreeLowerLeft = 10 2
-LensThreeUpperRight = 18 3
+BackgroundPermeabilityXX = 1e-10
+BackgroundPermeabilityXY = 0
+BackgroundPermeabilityYX = 0
+BackgroundPermeabilityYY = 1e-10
+
+LensPermeabilityXX = 1e-14
+LensPermeabilityXY = 0
+LensPermeabilityYX = 0
+LensPermeabilityYY = 1e-14
+
+LensOneLowerLeftX = 7
+LensOneLowerLeftY = 6
+LensOneUpperRightX = 13
+LensOneUpperRightY = 7
+
+LensTwoLowerLeftX = 2
+LensTwoLowerLeftY = 4
+LensTwoUpperRightX = 8
+LensTwoUpperRightY = 5
+
+LensThreeLowerLeftX = 10
+LensThreeLowerLeftY = 2
+LensThreeUpperRightX = 18
+LensThreeUpperRightY = 3
 
 BackgroundEntryPressure = 500
 LenseEntryPressure = 5000
diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
index 8f2788cb89..08cbe04e9e 100644
--- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
+++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh
@@ -59,9 +59,7 @@ namespace Properties
 NEW_TYPE_TAG(MPFATwoPTestProblem, INHERITS_FROM(Test2PSpatialParams));
 
 // Set the grid type
-#if HAVE_DUNE_ALUGRID
-SET_TYPE_PROP(MPFATwoPTestProblem, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>);
-#endif
+SET_TYPE_PROP(MPFATwoPTestProblem, Grid, Dune::UGGrid<2>);
 
 // Set the problem property
 SET_TYPE_PROP(MPFATwoPTestProblem, Problem, Dumux::MPFATwoPTestProblem<TypeTag>);
-- 
GitLab