24#ifndef DUMUX_COMMON_START_HH
25#define DUMUX_COMMON_START_HH
30#include <dune/common/parallel/mpihelper.hh>
31#include <dune/grid/io/file/dgfparser/dgfexception.hh>
38#warning "start.hh is deprecated. Use new style main files see e.g. /test/porousmediumflow/1p."
54template <
class TypeTag>
57 void (*usage)(
const char *,
const std::string &))
65 const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
68 if (mpiHelper.rank() == 0)
90 auto tEnd = getParam<Scalar>(
"TimeManager.TEnd");
91 auto dt = getParam<Scalar>(
"TimeManager.DtInitial");
95 Scalar restartTime = 0;
99 restartTime = getParam<Scalar>(
"TimeManager.Restart");
104 Problem problem(timeManager, gridManager.
grid());
105 timeManager.
init(problem, restartTime, dt, tEnd, restart);
109 if (mpiHelper.rank() == 0)
126template <
class TypeTag>
129 void (*usage)(
const char *,
const std::string &))
132 return start_<TypeTag>(argc, argv, usage);
135 std::cerr << std::endl << e <<
". Abort!" << std::endl;
138 catch (Dune::DGFException & e) {
139 std::cerr <<
"DGF exception thrown (" << e <<
140 "). Most likely, the DGF file name is wrong "
141 "or the DGF file is corrupted, "
142 "e.g. missing hash at end of file or wrong number (dimensions) of entries."
146 catch (Dune::Exception &e) {
147 std::cerr <<
"Dune reported error: " << e << std::endl;
151 std::cerr <<
"Unknown exception thrown!\n";
Provides the class creating the famous DuMux start and end messages.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
int start(int argc, char **argv, void(*usage)(const char *, const std::string &))
Provides a main function with error handling.
Definition: start.hh:127
bool hasParam(const std::string ¶m)
Check whether a key exists in the parameter tree.
Definition: parameters.hh:366
int start_(int argc, char **argv, void(*usage)(const char *, const std::string &))
Provides a main function which reads in parameters from the command line and a parameter file.
Definition: start.hh:55
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type GetProp
get the type of a property
Definition: propertysystem.hh:141
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
static void print(bool firstCall=false)
Selects random messages to write out at the start and end of a simulation run.
Definition: dumuxmessage.hh:50
Exception thrown if a run-time parameter is not specified correctly.
Definition: exceptions.hh:60
static void init(int argc, char **argv, const Usage &usage)
Initialize the parameter tree singletons.
Definition: parameters.hh:57
Manages the handling of time dependent problems.
Definition: timemanager.hh:62
void run()
Runs the simulation using a given problem class.
Definition: timemanager.hh:376
void init(Problem &problem, Scalar tStart, Scalar dtInitial, Scalar tEnd, bool restart=false)
Initialize the model and problem and write the initial condition to disk.
Definition: timemanager.hh:100
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition: gridmanager_base.hh:322
Grid & grid()
Returns a reference to the grid.
Definition: gridmanager_base.hh:85
void init(const std::string &modelParamGroup="")
Make the grid. Implement this method in the specialization of this class for a grid type.
Definition: gridmanager_base.hh:74
Declares all properties used in Dumux.
Convience header that includes all grid manager specializations.