Skip to content
Snippets Groups Projects
Commit c2964b52 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[ex3] improve main file readability

parent 7d7f11bc
No related branches found
No related tags found
Loading
......@@ -18,8 +18,8 @@
*****************************************************************************/
/*!
* \file
*
* \brief DOC ME!
* \brief The main file for exercise 3. This solves an instationary problem
* with an implicit time discretization.
*/
#include <config.h>
......@@ -52,35 +52,6 @@
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.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) //TODO check usage
{
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"
"\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n"
"\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n"
"\t-Problem.Name String for naming of the output files \n"
"\n";
std::cout << errorMessageOut
<< "\n";
}
}
////////////////////////
// the main function
////////////////////////
......@@ -103,7 +74,7 @@ int main(int argc, char** argv) try
DumuxMessage::print(/*firstCall=*/true);
// parse command line arguments and input file
Parameters::init(argc, argv, usage);
Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file)
GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager;
......@@ -157,7 +128,7 @@ int main(int argc, char** argv) try
timeLoop->setMaxTimeStepSize(maxDt);
// the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric, /*implicit?*/true>;
auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop);
// the linear solver
......@@ -195,11 +166,10 @@ int main(int argc, char** argv) try
} while (!timeLoop->finished());
timeLoop->finalize(leafGridView.comm());
////////////////////////////////////////////////////////////
// finalize, print dumux message to say goodbye
////////////////////////////////////////////////////////////
timeLoop->finalize(leafGridView.comm());
// print dumux end message
if (mpiHelper.rank() == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment