test_navierstokes.cc 3.15 KB
Newer Older
1
/*****************************************************************************
2
 *   See the file COPYING for full copying permissions.                      *
3
4
5
6
7
8
9
10
 *                                                                           *
 *   This program is free software: you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation, either version 2 of the License, or       *
 *   (at your option) any later version.                                     *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
 * \brief Test for the isothermal Navier-Stokes box model; this test case is
 *        known as lid-driven cavity-flow in literature.
 */
#include "config.h"
#include "navierstokestestproblem.hh"
#include <dumux/common/start.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)
{
    if (errorMsg.size() > 0) {
        std::string errorMessageOut = "\nUsage: ";
                    errorMessageOut += progName;
                    errorMessageOut += " [options]\n";
                    errorMessageOut += errorMsg;
                    errorMessageOut += "\n\nThe List of Mandatory arguments for this program is:\n"
42
43
44
                                        "\t-TimeManager.TEnd                          The end of the simulation. [s] \n"
                                        "\t-TimeManager.DtInitial                     The initial timestep size. [s] \n"
                                        "\t-Grid.File                      The file name of the file containing the grid \n"
45
46
47
48
49
50
51
52
53
                                        "\t                                   definition in DGF format\n";

        std::cout << errorMessageOut
                  << "\n";
    }
}

int main(int argc, char** argv)
{
54
#if HAVE_SUPERLU && (HAVE_ALUGRID || HAVE_DUNE_ALUGRID || HAVE_UG)
55
56
57
    typedef TTAG(NavierStokesTestProblem) ProblemTypeTag;
    return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
Thomas Fetzer's avatar
Thomas Fetzer committed
58
59
#warning "You need to have SuperLU and ALUGrid or UG to run this test."
    std::cout << "You need to have SuperLU and ALUGrid or UG to run this test." << std::endl;
60
    return 77;
61
62
#endif
}