Commit cc394262 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Dennis Gläser
Browse files

[io][restart] use restart functionality directly from main

parent 62eb5385
......@@ -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>());
}
......
......@@ -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
{
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment