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

---
 .../3p3c/implicit/CMakeLists.txt              |  74 +-----
 .../3p3c/implicit/columnxylol/CMakeLists.txt  |  27 ++
 .../{test_3p3c_fv.cc => columnxylol/main.cc}  |   4 +-
 .../params.input}                             |   0
 .../problem.hh}                               |   4 +-
 .../spatialparams.hh}                         |   0
 .../3p3c/implicit/infiltration/CMakeLists.txt |  27 ++
 .../3p3c/implicit/infiltration/main.cc        | 230 ++++++++++++++++++
 .../params.input}                             |   0
 .../problem.hh}                               |   2 +-
 .../spatialparams.hh}                         |   0
 .../3p3c/implicit/kuevette/CMakeLists.txt     |  26 ++
 .../3p3c/implicit/kuevette/main.cc            | 230 ++++++++++++++++++
 .../params.input}                             |   0
 .../problem.hh}                               |   2 +-
 .../spatialparams.hh}                         |   0
 ... test_3p3c_infiltration_box-reference.vtu} |   0
 ...test_3p3c_infiltration_tpfa-reference.vtu} |   0
 ...test_3p3cni_columnxylol_box-reference.vtu} |   0
 ...est_3p3cni_columnxylol_tpfa-reference.vtu} |   0
 ...=> test_3p3cni_kuevette_box-reference.vtu} |   0
 ...> test_3p3cni_kuevette_tpfa-reference.vtu} |   0
 22 files changed, 548 insertions(+), 78 deletions(-)
 create mode 100644 test/porousmediumflow/3p3c/implicit/columnxylol/CMakeLists.txt
 rename test/porousmediumflow/3p3c/implicit/{test_3p3c_fv.cc => columnxylol/main.cc} (98%)
 rename test/porousmediumflow/3p3c/implicit/{test_columnxylol_fv.input => columnxylol/params.input} (100%)
 rename test/porousmediumflow/3p3c/implicit/{columnxylolproblem.hh => columnxylol/problem.hh} (99%)
 rename test/porousmediumflow/3p3c/implicit/{columnxylolspatialparams.hh => columnxylol/spatialparams.hh} (100%)
 create mode 100644 test/porousmediumflow/3p3c/implicit/infiltration/CMakeLists.txt
 create mode 100644 test/porousmediumflow/3p3c/implicit/infiltration/main.cc
 rename test/porousmediumflow/3p3c/implicit/{test_3p3c_fv.input => infiltration/params.input} (100%)
 rename test/porousmediumflow/3p3c/implicit/{infiltration3p3cproblem.hh => infiltration/problem.hh} (99%)
 rename test/porousmediumflow/3p3c/implicit/{infiltration3p3cspatialparams.hh => infiltration/spatialparams.hh} (100%)
 create mode 100644 test/porousmediumflow/3p3c/implicit/kuevette/CMakeLists.txt
 create mode 100644 test/porousmediumflow/3p3c/implicit/kuevette/main.cc
 rename test/porousmediumflow/3p3c/implicit/{test_kuvette_fv.input => kuevette/params.input} (100%)
 rename test/porousmediumflow/3p3c/implicit/{kuevetteproblem.hh => kuevette/problem.hh} (99%)
 rename test/porousmediumflow/3p3c/implicit/{kuevettespatialparams.hh => kuevette/spatialparams.hh} (100%)
 rename test/references/{infiltrationbox-reference.vtu => test_3p3c_infiltration_box-reference.vtu} (100%)
 rename test/references/{infiltrationcc-reference.vtu => test_3p3c_infiltration_tpfa-reference.vtu} (100%)
 rename test/references/{column3p3cnibox-reference.vtu => test_3p3cni_columnxylol_box-reference.vtu} (100%)
 rename test/references/{column3p3cnicc-reference.vtu => test_3p3cni_columnxylol_tpfa-reference.vtu} (100%)
 rename test/references/{kuevette3p3cnibox-reference.vtu => test_3p3cni_kuevette_box-reference.vtu} (100%)
 rename test/references/{kuevette3p3cnicc-reference.vtu => test_3p3cni_kuevette_tpfa-reference.vtu} (100%)

diff --git a/test/porousmediumflow/3p3c/implicit/CMakeLists.txt b/test/porousmediumflow/3p3c/implicit/CMakeLists.txt
index ce9ff0711d..d5cacea89f 100644
--- a/test/porousmediumflow/3p3c/implicit/CMakeLists.txt
+++ b/test/porousmediumflow/3p3c/implicit/CMakeLists.txt
@@ -1,71 +1,3 @@
-add_input_file_links()
-
-# isothermal tests
-dune_add_test(NAME test_3p3c_box
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePThreeCBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS      --script fuzzy
-                            --files ${CMAKE_SOURCE_DIR}/test/references/infiltrationbox-reference.vtu
-                                    ${CMAKE_CURRENT_BINARY_DIR}/infiltration3p3cbox-00005.vtu
-                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_box test_3p3c_fv.input -Problem.Name infiltration3p3cbox")
-
-dune_add_test(NAME test_3p3c_tpfa
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePThreeCCCTpfa
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS --script fuzzy
-                       --files ${CMAKE_SOURCE_DIR}/test/references/infiltrationcc-reference.vtu
-                               ${CMAKE_CURRENT_BINARY_DIR}/infiltration3p3ccc-00005.vtu
-                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_tpfa test_3p3c_fv.input -Problem.Name infiltration3p3ccc")
-
-# non-isothermal tests
-dune_add_test(NAME test_3p3cni_columnxylol_box
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=ColumnBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS --script fuzzy
-                       --files ${CMAKE_SOURCE_DIR}/test/references/column3p3cnibox-reference.vtu
-                               ${CMAKE_CURRENT_BINARY_DIR}/columnxylol_box-00062.vtu
-                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_box test_columnxylol_fv.input -Problem.Name columnxylol_box")
-
-dune_add_test(NAME test_3p3cni_columnxylol_tpfa
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=ColumnCCTpfaTypeTag
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS --script fuzzy
-                       --files ${CMAKE_SOURCE_DIR}/test/references/column3p3cnicc-reference.vtu
-                               ${CMAKE_CURRENT_BINARY_DIR}/columnxylol_tpfa-00053.vtu
-                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_tpfa test_columnxylol_fv.input -Problem.Name columnxylol_tpfa")
-
-dune_add_test(NAME test_3p3cni_kuevette_box
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=KuevetteBox
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS --script fuzzy
-                       --files ${CMAKE_SOURCE_DIR}/test/references/kuevette3p3cnibox-reference.vtu
-                               ${CMAKE_CURRENT_BINARY_DIR}/kuevette_box-00004.vtu
-                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_box test_kuvette_fv.input -Problem.Name kuevette_box")
-
-dune_add_test(NAME test_3p3cni_kuevette_tpfa
-              SOURCES test_3p3c_fv.cc
-              COMPILE_DEFINITIONS TYPETAG=KuevetteCCTpfa
-              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
-              CMD_ARGS --script fuzzy
-                       --files ${CMAKE_SOURCE_DIR}/test/references/kuevette3p3cnicc-reference.vtu
-                               ${CMAKE_CURRENT_BINARY_DIR}/kuvette_tpfa-00004.vtu
-                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_tpfa test_kuvette_fv.input -Problem.Name kuvette_tpfa")
-
-#install sources
-install(FILES
-columnxylolproblem.hh
-columnxylolspatialparams.hh
-infiltrationproblem.hh
-infiltrationspatialparameters.hh
-kuevetteproblem.hh
-kuevettespatialparams.hh
-test_3p3c_fv.cc
-test_3p3c_fv.input
-test_columnxylol_fv.input
-test_kuvette_fv.input
-DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p3c)
+add_subdirectory("columnxylol")
+add_subdirectory("infiltration")
+add_subdirectory("kuevette")
diff --git a/test/porousmediumflow/3p3c/implicit/columnxylol/CMakeLists.txt b/test/porousmediumflow/3p3c/implicit/columnxylol/CMakeLists.txt
new file mode 100644
index 0000000000..219f16d8d8
--- /dev/null
+++ b/test/porousmediumflow/3p3c/implicit/columnxylol/CMakeLists.txt
@@ -0,0 +1,27 @@
+add_input_file_links(FILES params.input)
+
+# non-isothermal tests
+dune_add_test(NAME test_3p3cni_columnxylol_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ColumnBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS --script fuzzy
+                       --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3cni_columnxylol_box-reference.vtu
+                               ${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_box-00062.vtu
+                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_box params.input -Problem.Name test_3p3cni_columnxylol_box")
+
+dune_add_test(NAME test_3p3cni_columnxylol_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=ColumnCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS --script fuzzy
+                       --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3cni_columnxylol_tpfa-reference.vtu
+                               ${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_tpfa-00053.vtu
+                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_columnxylol_tpfa params.input -Problem.Name test_3p3cni_columnxylol_tpfa")
+
+#install sources
+install(FILES
+main.cc
+spatialparams.hh
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p3c/columnxylol)
diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc
similarity index 98%
rename from test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc
rename to test/porousmediumflow/3p3c/implicit/columnxylol/main.cc
index 727f1a7bac..2da386eeed 100644
--- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc
+++ b/test/porousmediumflow/3p3c/implicit/columnxylol/main.cc
@@ -47,9 +47,7 @@
 #include <dumux/io/vtkoutputmodule.hh>
 #include <dumux/io/grid/gridmanager.hh>
 
-#include "infiltration3p3cproblem.hh"
-#include "kuevetteproblem.hh"
-#include "columnxylolproblem.hh"
+#include "problem.hh"
 
 /*!
  * \brief Provides an interface for customizing error messages associated with
diff --git a/test/porousmediumflow/3p3c/implicit/test_columnxylol_fv.input b/test/porousmediumflow/3p3c/implicit/columnxylol/params.input
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/test_columnxylol_fv.input
rename to test/porousmediumflow/3p3c/implicit/columnxylol/params.input
diff --git a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh b/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh
rename to test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh
index 3f61c3df66..ae5d2d00ef 100644
--- a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/columnxylol/problem.hh
@@ -37,7 +37,7 @@
 #include <dumux/porousmediumflow/3p3c/model.hh>
 #include <dumux/porousmediumflow/problem.hh>
 
-#include "columnxylolspatialparams.hh"
+#include "spatialparams.hh"
 
 #define ISOTHERMAL 0
 
@@ -53,7 +53,7 @@ class ColumnProblem;
 namespace Properties {
 NEW_TYPE_TAG(Column, INHERITS_FROM(ThreePThreeCNI));
 NEW_TYPE_TAG(ColumnBox, INHERITS_FROM(BoxModel, Column));
-NEW_TYPE_TAG(ColumnCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, Column));
+NEW_TYPE_TAG(ColumnCCTpfa, INHERITS_FROM(CCTpfaModel, Column));
 
 // Set the grid type
 SET_TYPE_PROP(Column, Grid, Dune::YaspGrid<2>);
diff --git a/test/porousmediumflow/3p3c/implicit/columnxylolspatialparams.hh b/test/porousmediumflow/3p3c/implicit/columnxylol/spatialparams.hh
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/columnxylolspatialparams.hh
rename to test/porousmediumflow/3p3c/implicit/columnxylol/spatialparams.hh
diff --git a/test/porousmediumflow/3p3c/implicit/infiltration/CMakeLists.txt b/test/porousmediumflow/3p3c/implicit/infiltration/CMakeLists.txt
new file mode 100644
index 0000000000..8dc02fa592
--- /dev/null
+++ b/test/porousmediumflow/3p3c/implicit/infiltration/CMakeLists.txt
@@ -0,0 +1,27 @@
+add_input_file_links(FILES params.input)
+
+# isothermal tests
+dune_add_test(NAME test_3p3c_infiltration_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePThreeCBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS      --script fuzzy
+                            --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3c_infiltration_box-reference.vtu
+                                    ${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_infiltration_box-00005.vtu
+                            --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_infiltration_box params.input -Problem.Name test_3p3c_infiltration_box")
+
+dune_add_test(NAME test_3p3c_infiltration_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=InfiltrationThreePThreeCCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS --script fuzzy
+                       --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3c_infiltration_tpfa-reference.vtu
+                               ${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_infiltration_tpfa-00005.vtu
+                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3c_infiltration_tpfa params.input -Problem.Name test_3p3c_infiltration_tpfa")
+
+#install sources
+install(FILES
+main.cc
+spatialparams.hh
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p3c/infiltration)
diff --git a/test/porousmediumflow/3p3c/implicit/infiltration/main.cc b/test/porousmediumflow/3p3c/implicit/infiltration/main.cc
new file mode 100644
index 0000000000..2da386eeed
--- /dev/null
+++ b/test/porousmediumflow/3p3c/implicit/infiltration/main.cc
@@ -0,0 +1,230 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief Test for the three-phase three-component box model
+ */
+#include <config.h>
+#include <ctime>
+#include <iostream>
+
+#include <dune/common/parallel/mpihelper.hh>
+#include <dune/common/timer.hh>
+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
+#include <dune/grid/io/file/vtk.hh>
+
+#include <dumux/common/properties.hh>
+#include <dumux/common/parameters.hh>
+#include <dumux/common/dumuxmessage.hh>
+#include <dumux/common/defaultusagemessage.hh>
+#include <dumux/common/timeloop.hh>
+
+#include <dumux/linear/amgbackend.hh>
+#include <dumux/nonlinear/privarswitchnewtonsolver.hh>
+
+#include <dumux/assembly/fvassembler.hh>
+#include <dumux/assembly/diffmethod.hh>
+
+#include <dumux/discretization/methods.hh>
+
+#include <dumux/io/vtkoutputmodule.hh>
+#include <dumux/io/grid/gridmanager.hh>
+
+#include "problem.hh"
+
+/*!
+ * \brief Provides an interface for customizing error messages associated with
+ *        reading in parameters.
+ *
+ * \param progName  The name of the program, that was tried to be started.
+ * \param errorMsg  The error message that was issued by the start function.
+ *                  Comprises the thing that went wrong and a general help message.
+ */
+void usage(const char *progName, const std::string &errorMsg)
+{
+    if (errorMsg.size() > 0) {
+        std::string errorMessageOut = "\nUsage: ";
+                    errorMessageOut += progName;
+                    errorMessageOut += " [options]\n";
+                    errorMessageOut += errorMsg;
+                    errorMessageOut += "\n\nThe list of mandatory options for this program is:\n"
+                                        "\t-TimeManager.TEnd              End of the simulation [s] \n"
+                                        "\t-TimeManager.DtInitial         Initial timestep size [s] \n"
+                                        "\t-Grid.File                     Name of the file containing the grid \n"
+                                        "\t                               definition in DGF format\n";
+
+        std::cout << errorMessageOut
+                  << "\n";
+    }
+}
+
+int main(int argc, char** argv) try
+{
+
+    using namespace Dumux;
+
+    // define the type tag for this problem
+    using TypeTag = TTAG(TYPETAG);
+
+    ////////////////////////////////////////////////////////////
+    ////////////////////////////////////////////////////////////
+
+    // initialize MPI, finalize is done automatically on exit
+    const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
+
+    // print dumux start message
+    if (mpiHelper.rank() == 0)
+        DumuxMessage::print(/*firstCall=*/true);
+
+    // parse command line arguments and input file
+    Parameters::init(argc, argv, usage);
+
+    // try to create a grid (from the given grid file or the input file)
+    GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager;
+    gridManager.init();
+
+    ////////////////////////////////////////////////////////////
+    // run instationary non-linear problem on this grid
+    ////////////////////////////////////////////////////////////
+
+    // we compute on the leaf grid view
+    const auto& leafGridView = gridManager.grid().leafGridView();
+
+    // create the finite volume grid geometry
+    using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView);
+    fvGridGeometry->update();
+
+    // the problem (initial and boundary conditions)
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
+    auto problem = std::make_shared<Problem>(fvGridGeometry);
+
+    // the solution vector
+    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+    SolutionVector x(fvGridGeometry->numDofs());
+    problem->applyInitialSolution(x);
+    auto xOld = x;
+
+    // the grid variables
+    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+    auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry);
+    gridVariables->init(x, xOld);
+
+    // get some time loop parameters
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+    const auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
+    const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
+    auto dt = getParam<Scalar>("TimeLoop.DtInitial");
+
+    // intialize the vtk output module
+    using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields);
+    VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name());
+    using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput);
+    vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables));
+    IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields
+    vtkWriter.write(0.0);
+
+    // instantiate time loop
+    auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd);
+    timeLoop->setMaxTimeStepSize(maxDt);
+    timeLoop->setPeriodicCheckPoint(getParam<Scalar>("TimeLoop.EpisodeLength", std::numeric_limits<Scalar>::max()));
+
+    // the assembler with time loop for instationary problem
+    using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
+    auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop);
+
+    // the linear solver
+    using LinearSolver = Dumux::AMGBackend<TypeTag>;
+    auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->dofMapper());
+
+    // the non-linear solver
+    using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver,
+                                                  typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>;
+    NewtonSolver nonLinearSolver(assembler, linearSolver);
+
+    // time loop
+    timeLoop->start();
+    while (!timeLoop->finished())
+    {
+        // set previous solution for storage evaluations
+        assembler->setPreviousSolution(xOld);
+
+        // solve the non-linear system with time step control
+        nonLinearSolver.solve(x, *timeLoop);
+
+        // make the new solution the old solution
+        xOld = x;
+        gridVariables->advanceTimeStep();
+
+        // advance to the time loop to the next step
+        timeLoop->advanceTimeStep();
+
+        // write vtk output
+        // if episode length was specificied output only at the end of episodes
+        if (!hasParam("TimeLoop.EpisodeLength") || timeLoop->isCheckPoint() || timeLoop->finished() || timeLoop->timeStepIndex() == 1)
+            vtkWriter.write(timeLoop->time());
+
+        // report statistics of this time step
+        timeLoop->reportTimeStep();
+
+        // set new dt as suggested by the newton solver
+        timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize()));
+    }
+
+    timeLoop->finalize(leafGridView.comm());
+
+    ////////////////////////////////////////////////////////////
+    // finalize, print dumux message to say goodbye
+    ////////////////////////////////////////////////////////////
+
+    // print dumux end message
+    if (mpiHelper.rank() == 0)
+    {
+        Parameters::print();
+        DumuxMessage::print(/*firstCall=*/false);
+    }
+
+    return 0;
+
+}
+catch (Dumux::ParameterException &e)
+{
+    std::cerr << std::endl << e << " ---> Abort!" << std::endl;
+    return 1;
+}
+catch (Dune::DGFException & e)
+{
+    std::cerr << "DGF exception thrown (" << e <<
+                 "). Most likely, the DGF file name is wrong "
+                 "or the DGF file is corrupted, "
+                 "e.g. missing hash at end of file or wrong number (dimensions) of entries."
+                 << " ---> Abort!" << std::endl;
+    return 2;
+}
+catch (Dune::Exception &e)
+{
+    std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl;
+    return 3;
+}
+catch (...)
+{
+    std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl;
+    return 4;
+}
diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.input b/test/porousmediumflow/3p3c/implicit/infiltration/params.input
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/test_3p3c_fv.input
rename to test/porousmediumflow/3p3c/implicit/infiltration/params.input
diff --git a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh b/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh
rename to test/porousmediumflow/3p3c/implicit/infiltration/problem.hh
index 8d249c8b56..f0af668134 100644
--- a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/infiltration/problem.hh
@@ -33,7 +33,7 @@
 #include <dumux/porousmediumflow/3p3c/model.hh>
 #include <dumux/material/fluidsystems/h2oairmesitylene.hh>
 
-#include "infiltration3p3cspatialparams.hh"
+#include "spatialparams.hh"
 
 namespace Dumux {
 
diff --git a/test/porousmediumflow/3p3c/implicit/infiltration3p3cspatialparams.hh b/test/porousmediumflow/3p3c/implicit/infiltration/spatialparams.hh
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/infiltration3p3cspatialparams.hh
rename to test/porousmediumflow/3p3c/implicit/infiltration/spatialparams.hh
diff --git a/test/porousmediumflow/3p3c/implicit/kuevette/CMakeLists.txt b/test/porousmediumflow/3p3c/implicit/kuevette/CMakeLists.txt
new file mode 100644
index 0000000000..0118f75f2a
--- /dev/null
+++ b/test/porousmediumflow/3p3c/implicit/kuevette/CMakeLists.txt
@@ -0,0 +1,26 @@
+add_input_file_links(FILES params.input)
+
+dune_add_test(NAME test_3p3cni_kuevette_box
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=KuevetteBox
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS --script fuzzy
+                       --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3cni_kuevette_box-reference.vtu
+                               ${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_box-00004.vtu
+                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_box params.input -Problem.Name test_3p3cni_kuevette_box")
+
+dune_add_test(NAME test_3p3cni_kuevette_tpfa
+              SOURCES main.cc
+              COMPILE_DEFINITIONS TYPETAG=KuevetteCCTpfa
+              COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
+              CMD_ARGS --script fuzzy
+                       --files ${CMAKE_SOURCE_DIR}/test/references/test_3p3cni_kuevette_tpfa-reference.vtu
+                               ${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_tpfa-00004.vtu
+                       --command "${CMAKE_CURRENT_BINARY_DIR}/test_3p3cni_kuevette_tpfa params.input -Problem.Name test_3p3cni_kuevette_tpfa")
+
+#install sources
+install(FILES
+main.cc
+spatialparams.hh
+problem.hh
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/implicit/3p3c/kuevette)
diff --git a/test/porousmediumflow/3p3c/implicit/kuevette/main.cc b/test/porousmediumflow/3p3c/implicit/kuevette/main.cc
new file mode 100644
index 0000000000..2da386eeed
--- /dev/null
+++ b/test/porousmediumflow/3p3c/implicit/kuevette/main.cc
@@ -0,0 +1,230 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ *
+ * \brief Test for the three-phase three-component box model
+ */
+#include <config.h>
+#include <ctime>
+#include <iostream>
+
+#include <dune/common/parallel/mpihelper.hh>
+#include <dune/common/timer.hh>
+#include <dune/grid/io/file/dgfparser/dgfexception.hh>
+#include <dune/grid/io/file/vtk.hh>
+
+#include <dumux/common/properties.hh>
+#include <dumux/common/parameters.hh>
+#include <dumux/common/dumuxmessage.hh>
+#include <dumux/common/defaultusagemessage.hh>
+#include <dumux/common/timeloop.hh>
+
+#include <dumux/linear/amgbackend.hh>
+#include <dumux/nonlinear/privarswitchnewtonsolver.hh>
+
+#include <dumux/assembly/fvassembler.hh>
+#include <dumux/assembly/diffmethod.hh>
+
+#include <dumux/discretization/methods.hh>
+
+#include <dumux/io/vtkoutputmodule.hh>
+#include <dumux/io/grid/gridmanager.hh>
+
+#include "problem.hh"
+
+/*!
+ * \brief Provides an interface for customizing error messages associated with
+ *        reading in parameters.
+ *
+ * \param progName  The name of the program, that was tried to be started.
+ * \param errorMsg  The error message that was issued by the start function.
+ *                  Comprises the thing that went wrong and a general help message.
+ */
+void usage(const char *progName, const std::string &errorMsg)
+{
+    if (errorMsg.size() > 0) {
+        std::string errorMessageOut = "\nUsage: ";
+                    errorMessageOut += progName;
+                    errorMessageOut += " [options]\n";
+                    errorMessageOut += errorMsg;
+                    errorMessageOut += "\n\nThe list of mandatory options for this program is:\n"
+                                        "\t-TimeManager.TEnd              End of the simulation [s] \n"
+                                        "\t-TimeManager.DtInitial         Initial timestep size [s] \n"
+                                        "\t-Grid.File                     Name of the file containing the grid \n"
+                                        "\t                               definition in DGF format\n";
+
+        std::cout << errorMessageOut
+                  << "\n";
+    }
+}
+
+int main(int argc, char** argv) try
+{
+
+    using namespace Dumux;
+
+    // define the type tag for this problem
+    using TypeTag = TTAG(TYPETAG);
+
+    ////////////////////////////////////////////////////////////
+    ////////////////////////////////////////////////////////////
+
+    // initialize MPI, finalize is done automatically on exit
+    const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
+
+    // print dumux start message
+    if (mpiHelper.rank() == 0)
+        DumuxMessage::print(/*firstCall=*/true);
+
+    // parse command line arguments and input file
+    Parameters::init(argc, argv, usage);
+
+    // try to create a grid (from the given grid file or the input file)
+    GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager;
+    gridManager.init();
+
+    ////////////////////////////////////////////////////////////
+    // run instationary non-linear problem on this grid
+    ////////////////////////////////////////////////////////////
+
+    // we compute on the leaf grid view
+    const auto& leafGridView = gridManager.grid().leafGridView();
+
+    // create the finite volume grid geometry
+    using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView);
+    fvGridGeometry->update();
+
+    // the problem (initial and boundary conditions)
+    using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
+    auto problem = std::make_shared<Problem>(fvGridGeometry);
+
+    // the solution vector
+    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+    SolutionVector x(fvGridGeometry->numDofs());
+    problem->applyInitialSolution(x);
+    auto xOld = x;
+
+    // the grid variables
+    using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
+    auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry);
+    gridVariables->init(x, xOld);
+
+    // get some time loop parameters
+    using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
+    const auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
+    const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
+    auto dt = getParam<Scalar>("TimeLoop.DtInitial");
+
+    // intialize the vtk output module
+    using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields);
+    VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name());
+    using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput);
+    vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables));
+    IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields
+    vtkWriter.write(0.0);
+
+    // instantiate time loop
+    auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd);
+    timeLoop->setMaxTimeStepSize(maxDt);
+    timeLoop->setPeriodicCheckPoint(getParam<Scalar>("TimeLoop.EpisodeLength", std::numeric_limits<Scalar>::max()));
+
+    // the assembler with time loop for instationary problem
+    using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
+    auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop);
+
+    // the linear solver
+    using LinearSolver = Dumux::AMGBackend<TypeTag>;
+    auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->dofMapper());
+
+    // the non-linear solver
+    using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver,
+                                                  typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>;
+    NewtonSolver nonLinearSolver(assembler, linearSolver);
+
+    // time loop
+    timeLoop->start();
+    while (!timeLoop->finished())
+    {
+        // set previous solution for storage evaluations
+        assembler->setPreviousSolution(xOld);
+
+        // solve the non-linear system with time step control
+        nonLinearSolver.solve(x, *timeLoop);
+
+        // make the new solution the old solution
+        xOld = x;
+        gridVariables->advanceTimeStep();
+
+        // advance to the time loop to the next step
+        timeLoop->advanceTimeStep();
+
+        // write vtk output
+        // if episode length was specificied output only at the end of episodes
+        if (!hasParam("TimeLoop.EpisodeLength") || timeLoop->isCheckPoint() || timeLoop->finished() || timeLoop->timeStepIndex() == 1)
+            vtkWriter.write(timeLoop->time());
+
+        // report statistics of this time step
+        timeLoop->reportTimeStep();
+
+        // set new dt as suggested by the newton solver
+        timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize()));
+    }
+
+    timeLoop->finalize(leafGridView.comm());
+
+    ////////////////////////////////////////////////////////////
+    // finalize, print dumux message to say goodbye
+    ////////////////////////////////////////////////////////////
+
+    // print dumux end message
+    if (mpiHelper.rank() == 0)
+    {
+        Parameters::print();
+        DumuxMessage::print(/*firstCall=*/false);
+    }
+
+    return 0;
+
+}
+catch (Dumux::ParameterException &e)
+{
+    std::cerr << std::endl << e << " ---> Abort!" << std::endl;
+    return 1;
+}
+catch (Dune::DGFException & e)
+{
+    std::cerr << "DGF exception thrown (" << e <<
+                 "). Most likely, the DGF file name is wrong "
+                 "or the DGF file is corrupted, "
+                 "e.g. missing hash at end of file or wrong number (dimensions) of entries."
+                 << " ---> Abort!" << std::endl;
+    return 2;
+}
+catch (Dune::Exception &e)
+{
+    std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl;
+    return 3;
+}
+catch (...)
+{
+    std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl;
+    return 4;
+}
diff --git a/test/porousmediumflow/3p3c/implicit/test_kuvette_fv.input b/test/porousmediumflow/3p3c/implicit/kuevette/params.input
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/test_kuvette_fv.input
rename to test/porousmediumflow/3p3c/implicit/kuevette/params.input
diff --git a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh b/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh
similarity index 99%
rename from test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh
rename to test/porousmediumflow/3p3c/implicit/kuevette/problem.hh
index 919689936d..cd10244385 100644
--- a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh
+++ b/test/porousmediumflow/3p3c/implicit/kuevette/problem.hh
@@ -36,7 +36,7 @@
 #include <dumux/porousmediumflow/3p3c/model.hh>
 #include <dumux/porousmediumflow/problem.hh>
 
-#include "kuevettespatialparams.hh"
+#include "spatialparams.hh"
 
 #define ISOTHERMAL 0
 
diff --git a/test/porousmediumflow/3p3c/implicit/kuevettespatialparams.hh b/test/porousmediumflow/3p3c/implicit/kuevette/spatialparams.hh
similarity index 100%
rename from test/porousmediumflow/3p3c/implicit/kuevettespatialparams.hh
rename to test/porousmediumflow/3p3c/implicit/kuevette/spatialparams.hh
diff --git a/test/references/infiltrationbox-reference.vtu b/test/references/test_3p3c_infiltration_box-reference.vtu
similarity index 100%
rename from test/references/infiltrationbox-reference.vtu
rename to test/references/test_3p3c_infiltration_box-reference.vtu
diff --git a/test/references/infiltrationcc-reference.vtu b/test/references/test_3p3c_infiltration_tpfa-reference.vtu
similarity index 100%
rename from test/references/infiltrationcc-reference.vtu
rename to test/references/test_3p3c_infiltration_tpfa-reference.vtu
diff --git a/test/references/column3p3cnibox-reference.vtu b/test/references/test_3p3cni_columnxylol_box-reference.vtu
similarity index 100%
rename from test/references/column3p3cnibox-reference.vtu
rename to test/references/test_3p3cni_columnxylol_box-reference.vtu
diff --git a/test/references/column3p3cnicc-reference.vtu b/test/references/test_3p3cni_columnxylol_tpfa-reference.vtu
similarity index 100%
rename from test/references/column3p3cnicc-reference.vtu
rename to test/references/test_3p3cni_columnxylol_tpfa-reference.vtu
diff --git a/test/references/kuevette3p3cnibox-reference.vtu b/test/references/test_3p3cni_kuevette_box-reference.vtu
similarity index 100%
rename from test/references/kuevette3p3cnibox-reference.vtu
rename to test/references/test_3p3cni_kuevette_box-reference.vtu
diff --git a/test/references/kuevette3p3cnicc-reference.vtu b/test/references/test_3p3cni_kuevette_tpfa-reference.vtu
similarity index 100%
rename from test/references/kuevette3p3cnicc-reference.vtu
rename to test/references/test_3p3cni_kuevette_tpfa-reference.vtu
-- 
GitLab