diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index e812461f59fd7675fc9dbd5105159bb8d6339e19..84c0e818020841024068934b695efc7b479ec52d 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -476,22 +476,9 @@ public: * \brief Applies the initial solution for all degrees of freedom of the grid. * \param sol the initial solution vector */ - void applyInitialSolution(SolutionVector& sol, Scalar restartTime = 0) const - { - if (restartTime > 0) - { - // set initial values for a restarted simulation - asImp_().applyRestartSolution(sol); - } - else - { - // set the initial values by forwarding to a specialized method - applyInitialSolutionImpl_(sol, std::integral_constant<bool, isBox>()); - } - } - - void applyRestartSolution(SolutionVector& sol) const + void applyInitialSolution(SolutionVector& sol) const { + // set the initial values by forwarding to a specialized method applyInitialSolutionImpl_(sol, std::integral_constant<bool, isBox>()); } diff --git a/test/porousmediumflow/2p/implicit/incompressible/problem.hh b/test/porousmediumflow/2p/implicit/incompressible/problem.hh index 6336db97063d53b3b3fbe866977f21c318e846cc..5d630ec5953c05dc6cb4c51916c101732d4f64db 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/problem.hh +++ b/test/porousmediumflow/2p/implicit/incompressible/problem.hh @@ -29,8 +29,6 @@ #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> -#include <dumux/io/restart.hh> - #include <dumux/material/components/trichloroethene.hh> #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/fluidsystems/1pliquid.hh> @@ -232,14 +230,6 @@ public: return 293.15; // 10°C } - template <class SolutionVector> - void applyRestartSolution(SolutionVector& sol) const - { - using PvNames = typename GET_PROP_TYPE(TypeTag, PrimaryVariableNames); - - Restart::loadSolutionFromVtkFile(this->fvGridGeometry(), PvNames::get(), sol); - } - private: bool onLeftBoundary_(const GlobalPosition &globalPos) const { diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index 30c9011c4fe75f2b5263ff2ac77ee369acfea1cb..6419e8b9be5efec6ccb6adee55c2f85ef9ec33a4 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -51,6 +51,7 @@ #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/restart.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -133,7 +134,13 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x, restartTime); + if (restartTime > 0) + { + using PvNames = typename GET_PROP_TYPE(TypeTag, PrimaryVariableNames); + Restart::loadSolutionFromVtkFile(*fvGridGeometry, PvNames::get(), x); + } + else + problem->applyInitialSolution(x); auto xOld = x; // maybe update the interface parameters diff --git a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh index a78b72cec1adb332c793150a4551b27984232af4..56e2d8093cb6885b270618be5e43da62ac6c05e5 100644 --- a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh +++ b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh @@ -30,8 +30,6 @@ #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> -#include <dumux/io/restart.hh> - #include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/2p2c/model.hh> #include <dumux/material/fluidsystems/h2on2.hh> @@ -294,14 +292,6 @@ public: // \} - template <class SolutionVector> - void applyRestartSolution(SolutionVector& sol) const - { - using PvNames = typename GET_PROP_TYPE(TypeTag, PrimaryVariableNames); - - Restart::loadSolutionFromVtkFile(this->fvGridGeometry(), PvNames::get(), sol); - } - private: /*! * \brief Evaluates the initial values for a control volume diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index 1e80cd70e3aae51cc6744110efec7edeb6632717..fa0fe82b67d3bb52ddf8742baab0d9938a11ca26 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -47,6 +47,7 @@ #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/restart.hh> // the problem definitions #include "injectionproblem.hh" @@ -101,7 +102,13 @@ int main(int argc, char** argv) try // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x, restartTime); + if (restartTime > 0) + { + using PvNames = typename GET_PROP_TYPE(TypeTag, PrimaryVariableNames); + Restart::loadSolutionFromVtkFile(*fvGridGeometry, PvNames::get(), x); + } + else + problem->applyInitialSolution(x); auto xOld = x; // the grid variables