Line |
Branch |
Exec |
Source |
1 |
|
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 |
|
|
// vi: set et ts=4 sw=4 sts=4: |
3 |
|
|
// |
4 |
|
|
// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder |
5 |
|
|
// SPDX-License-Identifier: GPL-3.0-or-later |
6 |
|
|
// |
7 |
|
|
/*! |
8 |
|
|
* \file |
9 |
|
|
* \ingroup Core |
10 |
|
|
* \brief Function printing a default usage message |
11 |
|
|
*/ |
12 |
|
|
#ifndef DUMUX_DEFAULT_USAGE_MESSAGE_HH |
13 |
|
|
#define DUMUX_DEFAULT_USAGE_MESSAGE_HH |
14 |
|
|
|
15 |
|
|
#include <string> |
16 |
|
|
|
17 |
|
|
namespace Dumux { |
18 |
|
|
|
19 |
|
|
/*! |
20 |
|
|
* \ingroup Core |
21 |
|
|
* \brief Provides a general text block, that is part of error/ help messages. |
22 |
|
|
* |
23 |
|
|
* \return The string that is the help / error message. |
24 |
|
|
*/ |
25 |
|
✗ |
inline std::string defaultUsageMessage(const std::string& programName) |
26 |
|
|
{ |
27 |
|
✗ |
return "Usage: " + programName + " [options] \n" |
28 |
|
|
"Options usually are parameters given to the simulation, \n" |
29 |
|
|
"and have to be specified with this syntax: \n" |
30 |
|
|
"\t-GroupName.ParameterName VALUE, for example -TimeLoop.TEnd 100\n" |
31 |
|
|
"\n" |
32 |
|
|
"Parameters can also be defined in a parameter file that consists of\n" |
33 |
|
|
"lines of the form \n" |
34 |
|
|
"GroupName.ParameterName = VALUE # comment \n" |
35 |
|
|
"have to be used. More conveniently, group names can be specified in square brackets, \n" |
36 |
|
|
"such that each following parameter name belongs to that group, \n" |
37 |
|
|
"[GroupName] \n" |
38 |
|
|
"ParameterName = VALUE \n" |
39 |
|
|
"See files named `params.input` in the `test` folder for examples \n" |
40 |
|
|
"and the Dune documentation of ParameterTreeParser for the format specification. \n" |
41 |
|
|
"\n" |
42 |
|
|
"Parameters specified on the command line have priority over those in the parameter file.\n" |
43 |
|
|
"If no parameter file name is given, './<programname>.input' is chosen as first\n" |
44 |
|
|
"and './params.input' as second default.\n" |
45 |
|
|
"\n" |
46 |
|
|
"Important options include:\n" |
47 |
|
|
"\t-h, --help Print this usage message and exit\n" |
48 |
|
|
"\t-PrintParameters [true|false] Print the run-time modifiable parameters _after_ \n" |
49 |
|
|
"\t the simulation [default: true]\n" |
50 |
|
|
"\t-ParameterFile FILENAME File with parameter definitions\n" |
51 |
|
|
"\t-TimeLoop.Restart RESTARTTIME Restart simulation from a restart file\n" |
52 |
|
✗ |
"\n\n"; |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
} // end namespace Dumux |
56 |
|
|
|
57 |
|
|
#endif |
58 |
|
|
|