From 5bfdff853a988cdbf85506ddbbaca9be2fdd3248 Mon Sep 17 00:00:00 2001
From: Simon Scholz <simon.scholz@iws.uni-stuttgart.de>
Date: Thu, 8 Nov 2018 11:42:03 +0100
Subject: [PATCH] [3p] harmonize sources, input and executables

---
 .../3p/implicit/CMakeLists.txt                | 79 +------------------
 .../3p/implicit/conduction/CMakeLists.txt     | 28 +++++++
 .../main.cc}                                  |  2 +-
 .../params.input}                             |  0
 .../problem.hh}                               |  2 +-
 .../spatialparams.hh}                         |  0
 .../3p/implicit/convection/CMakeLists.txt     | 27 +++++++
 .../main.cc}                                  |  2 +-
 .../params.input}                             |  0
 .../problem.hh}                               |  2 +-
 .../3p/implicit/infiltration/CMakeLists.txt   | 27 +++++++
 .../{test_3p_fv.cc => infiltration/main.cc}   |  2 +-
 .../params.input}                             |  0
 .../problem.hh}                               |  3 +-
 .../spatialparams.hh}                         |  0
 ...=> test_3p_infiltration_box-reference.vtu} |  0
 ...> test_3p_infiltration_tpfa-reference.vtu} |  0
 ...=> test_3pni_conduction_box-reference.vtu} |  0
 ...> test_3pni_conduction_tpfa-reference.vtu} |  0
 ...=> test_3pni_convection_box-reference.vtu} |  0
 ...> test_3pni_convection_tpfa-reference.vtu} |  0
 21 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 test/porousmediumflow/3p/implicit/conduction/CMakeLists.txt
 rename test/porousmediumflow/3p/implicit/{test_3pni_fv_conduction.cc => conduction/main.cc} (99%)
 rename test/porousmediumflow/3p/implicit/{test_3pni_fv_conduction.input => conduction/params.input} (100%)
 rename test/porousmediumflow/3p/implicit/{3pniconductionproblem.hh => conduction/problem.hh} (99%)
 rename test/porousmediumflow/3p/implicit/{3pnispatialparams.hh => conduction/spatialparams.hh} (100%)
 create mode 100644 test/porousmediumflow/3p/implicit/convection/CMakeLists.txt
 rename test/porousmediumflow/3p/implicit/{test_3pni_fv_convection.cc => convection/main.cc} (99%)
 rename test/porousmediumflow/3p/implicit/{test_3pni_fv_convection.input => convection/params.input} (100%)
 rename test/porousmediumflow/3p/implicit/{3pniconvectionproblem.hh => convection/problem.hh} (99%)
 create mode 100644 test/porousmediumflow/3p/implicit/infiltration/CMakeLists.txt
 rename test/porousmediumflow/3p/implicit/{test_3p_fv.cc => infiltration/main.cc} (99%)
 rename test/porousmediumflow/3p/implicit/{test_3p_fv.input => infiltration/params.input} (100%)
 rename test/porousmediumflow/3p/implicit/{infiltration3pproblem.hh => infiltration/problem.hh} (99%)
 rename test/porousmediumflow/3p/implicit/{infiltration3pspatialparams.hh => infiltration/spatialparams.hh} (100%)
 rename test/references/{infiltration3pbox-reference.vtu => test_3p_infiltration_box-reference.vtu} (100%)
 rename test/references/{infiltration3pcc-reference.vtu => test_3p_infiltration_tpfa-reference.vtu} (100%)
 rename test/references/{3pniconductionbox-reference.vtu => test_3pni_conduction_box-reference.vtu} (100%)
 rename test/references/{3pniconductioncc-reference.vtu => test_3pni_conduction_tpfa-reference.vtu} (100%)
 rename test/references/{3pniconvectionbox-reference.vtu => test_3pni_convection_box-reference.vtu} (100%)
 rename test/references/{3pniconvectioncc-reference.vtu => test_3pni_convection_tpfa-reference.vtu} (100%)

diff --git a/test/porousmediumflow/3p/implicit/CMakeLists.txt b/test/porousmediumflow/3p/implicit/CMakeLists.txt
index c3a2c862b1..4e0ed60487 100644
--- a/test/porousmediumflow/3p/implicit/CMakeLists.txt
+++ b/test/porousmediumflow/3p/implicit/CMakeLists.txt
@@ -1,76 +1,3 @@
-add_input_file_links()
-
-# isothermal tests
-dune_add_test(NAME test_box3p
-              SOURCES test_3p_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/infiltration3pbox-reference.vtu
-                                    ${CMAKE_CURRENT_BINARY_DIR}/infiltration3pbox-00008.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_box3p test_3p_fv.input -Problem.Name infiltration3pbox")
-
-dune_add_test(NAME test_cc3p
-              SOURCES test_3p_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePCCTpfa
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/infiltration3pcc-reference.vtu
-                                    ${CMAKE_CURRENT_BINARY_DIR}/infiltration3pcc-00008.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_cc3p test_3p_fv.input -Problem.Name infiltration3pcc")
-
-# non-isothermal tests
-dune_add_test(NAME test_box3pniconvection
-              SOURCES test_3pni_fv_convection.cc
-              COMPILE_DEFINITIONS TYPETAG=ThreePNIConvectionBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/3pniconvectionbox-reference.vtu
-                            ${CMAKE_CURRENT_BINARY_DIR}/test_box3pniconvection-00009.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_box3pniconvection test_3pni_fv_convection.input -Problem.Name test_box3pniconvection"
-                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
-
-dune_add_test(NAME test_cc3pniconvection
-              SOURCES test_3pni_fv_convection.cc
-              COMPILE_DEFINITIONS TYPETAG=ThreePNIConvectionCCTpfa
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/3pniconvectioncc-reference.vtu
-                            ${CMAKE_CURRENT_BINARY_DIR}/test_cc3pniconvection-00009.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_cc3pniconvection test_3pni_fv_convection.input -Problem.Name test_cc3pniconvection"
-                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
-
-dune_add_test(NAME test_box3pniconduction
-              SOURCES test_3pni_fv_conduction.cc
-              COMPILE_DEFINITIONS TYPETAG=ThreePNIConductionBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/3pniconductionbox-reference.vtu
-                            ${CMAKE_CURRENT_BINARY_DIR}/test_box3pniconduction-00005.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_box3pniconduction test_3pni_fv_conduction.input -Problem.Name test_box3pniconduction"
-                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
-
-dune_add_test(NAME test_cc3pniconduction
-              SOURCES test_3pni_fv_conduction.cc
-              COMPILE_DEFINITIONS TYPETAG=ThreePNIConductionCCTpfa
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/3pniconductioncc-reference.vtu
-                            ${CMAKE_CURRENT_BINARY_DIR}/test_cc3pniconduction-00005.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_cc3pniconduction test_3pni_fv_conduction.input -Problem.Name test_cc3pniconduction"
-                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
-
-#install sources
-install(FILES
-3pniconductionproblem.hh
-3pniconvectionproblem.hh
-3pnispatialparams.hh
-infiltration3pproblem.hh
-infiltration3pspatialparams.hh
-test_box3p.cc
-test_box3pniconduction.cc
-test_box3pniconvection.cc
-test_cc3p.cc
-test_cc3pniconduction.cc
-test_cc3pniconvection.cc
-DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p)
+add_subdirectory("conduction")
+add_subdirectory("convection")
+add_subdirectory("infiltration")
diff --git a/test/porousmediumflow/3p/implicit/conduction/CMakeLists.txt b/test/porousmediumflow/3p/implicit/conduction/CMakeLists.txt
new file mode 100644
index 0000000000..541a1f98dc
--- /dev/null
+++ b/test/porousmediumflow/3p/implicit/conduction/CMakeLists.txt
@@ -0,0 +1,28 @@
+add_input_file_links(FILES params.input)
+
+dune_add_test(NAME test_3pni_conduction_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ThreePNIConductionBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3pni_conduction_box-reference.vtu
+                            ${CMAKE_CURRENT_BINARY_DIR}/test_3pni_conduction_box-00005.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3pni_conduction_box params.input -Problem.Name test_3pni_conduction_box"
+                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
+
+dune_add_test(NAME test_3pni_conduction_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ThreePNIConductionCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3pni_conduction_tpfa-reference.vtu
+                            ${CMAKE_CURRENT_BINARY_DIR}/test_3pni_conduction_tpfa-00005.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3pni_conduction_tpfa params.input -Problem.Name test_3pni_conduction_tpfa"
+                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
+
+#install sources
+install(FILES
+main.cc
+spatialparams.hh
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p/conduction)
diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/conduction/main.cc
similarity index 99%
rename from test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc
rename to test/porousmediumflow/3p/implicit/conduction/main.cc
index 0944b34c0d..4aa1c04602 100644
--- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc
+++ b/test/porousmediumflow/3p/implicit/conduction/main.cc
@@ -22,7 +22,7 @@
  * \brief test for the 3pni CC model
  */
 #include <config.h>
-#include "3pniconductionproblem.hh"
+#include "problem.hh"
 #include <ctime>
 #include <iostream>
 
diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.input b/test/porousmediumflow/3p/implicit/conduction/params.input
similarity index 100%
rename from test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.input
rename to test/porousmediumflow/3p/implicit/conduction/params.input
diff --git a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh b/test/porousmediumflow/3p/implicit/conduction/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p/implicit/3pniconductionproblem.hh
rename to test/porousmediumflow/3p/implicit/conduction/problem.hh
index 4ef899ea8c..854911e274 100644
--- a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh
+++ b/test/porousmediumflow/3p/implicit/conduction/problem.hh
@@ -38,7 +38,7 @@
 #include <dumux/material/components/h2o.hh>
 #include <dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh>
 
-#include "3pnispatialparams.hh"
+#include "spatialparams.hh"
 
 namespace Dumux {
 /**
diff --git a/test/porousmediumflow/3p/implicit/3pnispatialparams.hh b/test/porousmediumflow/3p/implicit/conduction/spatialparams.hh
similarity index 100%
rename from test/porousmediumflow/3p/implicit/3pnispatialparams.hh
rename to test/porousmediumflow/3p/implicit/conduction/spatialparams.hh
diff --git a/test/porousmediumflow/3p/implicit/convection/CMakeLists.txt b/test/porousmediumflow/3p/implicit/convection/CMakeLists.txt
new file mode 100644
index 0000000000..f8c38175e9
--- /dev/null
+++ b/test/porousmediumflow/3p/implicit/convection/CMakeLists.txt
@@ -0,0 +1,27 @@
+add_input_file_links(FILES params.input)
+
+dune_add_test(NAME test_3pni_convection_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ThreePNIConvectionBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3pni_convection_box-reference.vtu
+                            ${CMAKE_CURRENT_BINARY_DIR}/test_3pni_convection_box-00009.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3pni_convection_box params.input -Problem.Name test_3pni_convection_box"
+                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
+
+dune_add_test(NAME test_3pni_convection_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ThreePNIConvectionCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3pni_convection_tpfa-reference.vtu
+                            ${CMAKE_CURRENT_BINARY_DIR}/test_3pni_convection_tpfa-00009.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3pni_convection_tpfa params.input -Problem.Name test_3pni_convection_tpfa"
+                            --zeroThreshold {"velocity_aq \(m/s\)_1":1e-8})
+
+#install sources
+install(FILES
+main.cc
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p/convection)
diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/convection/main.cc
similarity index 99%
rename from test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc
rename to test/porousmediumflow/3p/implicit/convection/main.cc
index f1eb062fd2..02cc5ab2f9 100644
--- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc
+++ b/test/porousmediumflow/3p/implicit/convection/main.cc
@@ -22,7 +22,7 @@
  * \brief test for the 3pni CC model
  */
 #include <config.h>
-#include "3pniconvectionproblem.hh"
+#include "problem.hh"
 #include <ctime>
 #include <iostream>
 
diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.input b/test/porousmediumflow/3p/implicit/convection/params.input
similarity index 100%
rename from test/porousmediumflow/3p/implicit/test_3pni_fv_convection.input
rename to test/porousmediumflow/3p/implicit/convection/params.input
diff --git a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh b/test/porousmediumflow/3p/implicit/convection/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh
rename to test/porousmediumflow/3p/implicit/convection/problem.hh
index 506055d68b..bebdbc21b1 100644
--- a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh
+++ b/test/porousmediumflow/3p/implicit/convection/problem.hh
@@ -38,7 +38,7 @@
 #include <dumux/material/components/h2o.hh>
 #include <dumux/material/fluidmatrixinteractions/3p/thermalconductivitysomerton3p.hh>
 
-#include "3pnispatialparams.hh"
+#include "../conduction/spatialparams.hh"  //! reuse the conduction spatialParams
 
 namespace Dumux {
 /**
diff --git a/test/porousmediumflow/3p/implicit/infiltration/CMakeLists.txt b/test/porousmediumflow/3p/implicit/infiltration/CMakeLists.txt
new file mode 100644
index 0000000000..6d1c03f246
--- /dev/null
+++ b/test/porousmediumflow/3p/implicit/infiltration/CMakeLists.txt
@@ -0,0 +1,27 @@
+add_input_file_links(FILES params.input)
+
+# isothermal tests
+dune_add_test(NAME test_3p_infiltration_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3p_infiltration_box-reference.vtu
+                                    ${CMAKE_CURRENT_BINARY_DIR}/test_3p_infiltration_box-00008.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p_infiltration_box params.input -Problem.Name test_3p_infiltration_box")
+
+dune_add_test(NAME test_3p_infiltration_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3p_infiltration_tpfa-reference.vtu
+                                    ${CMAKE_CURRENT_BINARY_DIR}/test_3p_infiltration_tpfa-00008.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p_infiltration_tpfa params.input -Problem.Name test_3p_infiltration_tpfa")
+
+#install sources
+install(FILES
+main.cc
+spatialparams.hh
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p/infiltration)
diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/infiltration/main.cc
similarity index 99%
rename from test/porousmediumflow/3p/implicit/test_3p_fv.cc
rename to test/porousmediumflow/3p/implicit/infiltration/main.cc
index 6e8373ebfb..e4542330f4 100644
--- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc
+++ b/test/porousmediumflow/3p/implicit/infiltration/main.cc
@@ -22,7 +22,7 @@
  * \brief Test for the three-phase CC model
  */
 #include <config.h>
-#include "infiltration3pproblem.hh"
+#include "problem.hh"
 #include <ctime>
 #include <iostream>
 
diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.input b/test/porousmediumflow/3p/implicit/infiltration/params.input
similarity index 100%
rename from test/porousmediumflow/3p/implicit/test_3p_fv.input
rename to test/porousmediumflow/3p/implicit/infiltration/params.input
diff --git a/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh b/test/porousmediumflow/3p/implicit/infiltration/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p/implicit/infiltration3pproblem.hh
rename to test/porousmediumflow/3p/implicit/infiltration/problem.hh
index 12c3b7e9d6..99544683db 100644
--- a/test/porousmediumflow/3p/implicit/infiltration3pproblem.hh
+++ b/test/porousmediumflow/3p/implicit/infiltration/problem.hh
@@ -39,9 +39,8 @@
 #include <dumux/material/components/air.hh>
 #include <dumux/material/components/mesitylene.hh>
 #include <dumux/material/components/h2o.hh>
-// #include <dumux/material/fluidsystems/h2oairmesitylene.hh>
 
-#include "infiltration3pspatialparams.hh"
+#include "spatialparams.hh"
 
 namespace Dumux
 {
diff --git a/test/porousmediumflow/3p/implicit/infiltration3pspatialparams.hh b/test/porousmediumflow/3p/implicit/infiltration/spatialparams.hh
similarity index 100%
rename from test/porousmediumflow/3p/implicit/infiltration3pspatialparams.hh
rename to test/porousmediumflow/3p/implicit/infiltration/spatialparams.hh
diff --git a/test/references/infiltration3pbox-reference.vtu b/test/references/test_3p_infiltration_box-reference.vtu
similarity index 100%
rename from test/references/infiltration3pbox-reference.vtu
rename to test/references/test_3p_infiltration_box-reference.vtu
diff --git a/test/references/infiltration3pcc-reference.vtu b/test/references/test_3p_infiltration_tpfa-reference.vtu
similarity index 100%
rename from test/references/infiltration3pcc-reference.vtu
rename to test/references/test_3p_infiltration_tpfa-reference.vtu
diff --git a/test/references/3pniconductionbox-reference.vtu b/test/references/test_3pni_conduction_box-reference.vtu
similarity index 100%
rename from test/references/3pniconductionbox-reference.vtu
rename to test/references/test_3pni_conduction_box-reference.vtu
diff --git a/test/references/3pniconductioncc-reference.vtu b/test/references/test_3pni_conduction_tpfa-reference.vtu
similarity index 100%
rename from test/references/3pniconductioncc-reference.vtu
rename to test/references/test_3pni_conduction_tpfa-reference.vtu
diff --git a/test/references/3pniconvectionbox-reference.vtu b/test/references/test_3pni_convection_box-reference.vtu
similarity index 100%
rename from test/references/3pniconvectionbox-reference.vtu
rename to test/references/test_3pni_convection_box-reference.vtu
diff --git a/test/references/3pniconvectioncc-reference.vtu b/test/references/test_3pni_convection_tpfa-reference.vtu
similarity index 100%
rename from test/references/3pniconvectioncc-reference.vtu
rename to test/references/test_3pni_convection_tpfa-reference.vtu
-- 
GitLab