12#ifndef DUMUX_ADAPTIVEGRIDRESTART_HH 
   13#define DUMUX_ADAPTIVEGRIDRESTART_HH 
   14#warning "This header is deprecated and will be removed after release 2.10." 
   17#include <dune/alugrid/grid.hh> 
   20#include <dune/grid/common/backuprestore.hh> 
   34struct GridRestartCheck
 
   36    static const bool allowRestart = 
false;
 
   41template<
int dim, 
int dimworld, Dune::ALUGr
idElementType elType, Dune::ALUGr
idRefinementType refinementType>
 
   42struct GridRestartCheck<Dune::ALUGrid<dim, dimworld, elType, refinementType> >
 
   44    static const bool allowRestart = 
true;
 
   53template <class Grid, bool allowGridRestart = GridRestartCheck<Grid>::allowRestart >
 
   60    template<
class Problem>
 
   63        DUNE_THROW(Dune::NotImplemented,
 
   64                   "Adaptive restart functionality currently only works for dune-ALUGrid.");
 
 
   70    template<
class Problem>
 
   73        DUNE_THROW(Dune::NotImplemented,
 
   74                   "Adaptive restart functionality currently only works for dune-ALUGrid.");
 
 
 
   88    template<
class Problem>
 
   91        std::string gridName = restartGridFileName_(problem);
 
   93        Dune::BackupRestoreFacility<Grid>::backup(problem.grid(), gridName);
 
   95        problem.grid().template writeGrid(gridName, problem.timeManager().time()
 
   96                                                    + problem.timeManager().timeStepSize());
 
 
  103    template<
class Problem>
 
  109    template<
class Problem>
 
  110    static const std::string restartGridFileName_(Problem& problem)
 
  112        int rank = problem.gridView().comm().rank();
 
  113        std::ostringstream oss;
 
  118        catch (ParameterException &e)
 
  120            std::cerr << e.what() << std::endl;
 
  121            std::cerr << 
"Taking name from problem.name(): " << problem.name() << std::endl;
 
  122            std::cerr << 
"Be sure to provide a parameter Problem.Name if you want to restart." << std::endl;
 
  123            oss << problem.name();
 
  125        oss << 
"_time=" << problem.timeManager().time() + problem.timeManager().timeStepSize()
 
  126            << 
"_rank=" << rank << 
".grs";
 
 
static void restartGrid(Problem &problem)
Restart the grid from the file.
Definition adaptivegridrestart.hh:104
static void serializeGrid(Problem &problem)
Write the grid to a file.
Definition adaptivegridrestart.hh:89
Indices denoting the different grid types.
Definition adaptivegridrestart.hh:55
static void restartGrid(Problem &problem)
Restart the grid from the file.
Definition adaptivegridrestart.hh:71
static void serializeGrid(Problem &problem)
Write the grid to a file.
Definition adaptivegridrestart.hh:61
Some exceptions thrown in DuMux
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:139
Definition gridcapabilities.hh:57
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.