From 0a9319c1b72c3a5a3b9c54d20e83cfb6b70db4ce Mon Sep 17 00:00:00 2001 From: Klaus Mosthaf <klmos@env.dtu.dk> Date: Mon, 13 Feb 2012 09:25:51 +0000 Subject: [PATCH] stokes models use input file adapted test runs in CMakeLists.txt git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7724 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- CMakeLists.txt | 9 ++++-- test/freeflow/stokes/stokes.input | 24 +++++++++++++++ test/freeflow/stokes/test_stokes.cc | 33 ++++++++++++++++++++- test/freeflow/stokes2c/stokes2c.input | 24 +++++++++++++++ test/freeflow/stokes2c/test_stokes2c.cc | 33 ++++++++++++++++++++- test/freeflow/stokes2cni/stokes2cni.input | 24 +++++++++++++++ test/freeflow/stokes2cni/test_stokes2cni.cc | 33 ++++++++++++++++++++- 7 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 test/freeflow/stokes/stokes.input create mode 100644 test/freeflow/stokes2c/stokes2c.input create mode 100644 test/freeflow/stokes2cni/stokes2cni.input diff --git a/CMakeLists.txt b/CMakeLists.txt index ed33e4b253..5d7063a852 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -412,7 +412,10 @@ add_test(tutorial_coupled tutorial/tutorial_coupled 1 1) add_test(tutorial_decoupled tutorial/tutorial_decoupled 1) if(SUPERLU_FOUND) - add_test(test_stokes bin/runTest.sh references/stokes-reference.vtu stokes-00006.vtu test/freeflow/stokes/test_stokes test/freeflow/stokes/grids/test_stokes.dgf 10 1) - add_test(test_stokes2c bin/runTest.sh references/stokes2c-reference.vtu stokes2c-00006.vtu test/freeflow/stokes2c/test_stokes2c test/freeflow/stokes2c/grids/test_stokes2c.dgf 10 1) - add_test(test_stokes2cni bin/runTest.sh references/stokes2cni-reference.vtu stokes2cni-00006.vtu test/freeflow/stokes2cni/test_stokes2cni test/freeflow/stokes2cni/grids/test_stokes2cni.dgf 10 1) + add_test(test_stokes bin/runTest.sh references/stokes-reference.vtu stokes-00006.vtu test/freeflow/stokes/test_stokes +--parameter-file=test/freeflow/stokes/stokes.input) + add_test(test_stokes2c bin/runTest.sh references/stokes2c-reference.vtu stokes2c-00006.vtu test/freeflow/stokes2c/test_stokes2c +--parameter-file=test/freeflow/stokes2c/stokes2c.input) + add_test(test_stokes2cni bin/runTest.sh references/stokes2cni-reference.vtu stokes2cni-00006.vtu test/freeflow/stokes2cni/test_stokes2cni +--parameter-file=test/freeflow/stokes2cni/stokes2cni.input) endif(SUPERLU_FOUND) diff --git a/test/freeflow/stokes/stokes.input b/test/freeflow/stokes/stokes.input new file mode 100644 index 0000000000..e4492215f6 --- /dev/null +++ b/test/freeflow/stokes/stokes.input @@ -0,0 +1,24 @@ +############################################################# +# Parameter file for test_stokes # +# Everything behind a '#' is a comment # +# Groups can be ordered e.g. : [BoundaryConditions], # +# see ../2p2c/ for a more detailed example # +############################################################# + +############################################################# +# Mandatory arguments # +############################################################# +dtInitial =1 # seconds +tEnd =10 # seconds +gridFile =./grids/test_stokes.dgf + +########################################################################## +# Simulation restart # +# # +# DuMux simulations can be restarted from *.drs files # +# Set restart to the value of a specific file, e.g.: 'restart = 27184.1'# +# for the restart file # +# name_time=27184.1_rank=0.drs # +# Please comment in the below value, if restart is desired. # +########################################################################## +# restart= ... diff --git a/test/freeflow/stokes/test_stokes.cc b/test/freeflow/stokes/test_stokes.cc index be897dd9a8..ea6a98809e 100644 --- a/test/freeflow/stokes/test_stokes.cc +++ b/test/freeflow/stokes/test_stokes.cc @@ -19,15 +19,46 @@ * 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 Stokes box model. + */ #include "config.h" #include "stokestestproblem.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" + "\t-tEnd The end of the simulation. [s] \n" + "\t-dtInitial The initial timestep size. [s] \n" + "\t-gridFile The file name of the file containing the grid \n" + "\t definition in DGF format\n"; + + std::cout << errorMessageOut + << "\n"; + } +} + int main(int argc, char** argv) { #if HAVE_SUPERLU typedef TTAG(StokesTestProblem) ProblemTypeTag; - return Dumux::startFromDGF<ProblemTypeTag>(argc, argv); + return Dumux::start<ProblemTypeTag>(argc, argv, usage); #else #warning "No SuperLU installed. Stokes currently only works with SuperLU." std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl; diff --git a/test/freeflow/stokes2c/stokes2c.input b/test/freeflow/stokes2c/stokes2c.input new file mode 100644 index 0000000000..1a33cdd3e9 --- /dev/null +++ b/test/freeflow/stokes2c/stokes2c.input @@ -0,0 +1,24 @@ +############################################################# +# Parameter file for test_stokes2c # +# Everything behind a '#' is a comment # +# Groups can be ordered e.g. : [BoundaryConditions], # +# see ../2p2c/ for a more detailed example # +############################################################# + +############################################################# +# Mandatory arguments # +############################################################# +dtInitial =1 # seconds +tEnd =10 # seconds +gridFile =./grids/test_stokes2c.dgf + +########################################################################## +# Simulation restart # +# # +# DuMux simulations can be restarted from *.drs files # +# Set restart to the value of a specific file, e.g.: 'restart = 27184.1'# +# for the restart file # +# name_time=27184.1_rank=0.drs # +# Please comment in the below value, if restart is desired. # +########################################################################## +# restart= ... diff --git a/test/freeflow/stokes2c/test_stokes2c.cc b/test/freeflow/stokes2c/test_stokes2c.cc index 4605e7f521..eb4bdb1bd9 100644 --- a/test/freeflow/stokes2c/test_stokes2c.cc +++ b/test/freeflow/stokes2c/test_stokes2c.cc @@ -19,15 +19,46 @@ * 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 two-component Stokes box model. + */ #include "config.h" #include "stokes2ctestproblem.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" + "\t-tEnd The end of the simulation. [s] \n" + "\t-dtInitial The initial timestep size. [s] \n" + "\t-gridFile The file name of the file containing the grid \n" + "\t definition in DGF format\n"; + + std::cout << errorMessageOut + << "\n"; + } +} + int main(int argc, char** argv) { #if HAVE_SUPERLU typedef TTAG(Stokes2cTestProblem) ProblemTypeTag; - return Dumux::startFromDGF<ProblemTypeTag>(argc, argv); + return Dumux::start<ProblemTypeTag>(argc, argv, usage); #else #warning "No SuperLU installed. Stokes currently only works with SuperLU." std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl; diff --git a/test/freeflow/stokes2cni/stokes2cni.input b/test/freeflow/stokes2cni/stokes2cni.input new file mode 100644 index 0000000000..d5d9e718fd --- /dev/null +++ b/test/freeflow/stokes2cni/stokes2cni.input @@ -0,0 +1,24 @@ +############################################################# +# Parameter file for test_stokes2cni # +# Everything behind a '#' is a comment # +# Groups can be ordered e.g. : [BoundaryConditions], # +# see ../2p2c/ for a more detailed example # +############################################################# + +############################################################# +# Mandatory arguments # +############################################################# +dtInitial =1 # seconds +tEnd =10 # seconds +gridFile =./grids/test_stokes2cni.dgf + +########################################################################## +# Simulation restart # +# # +# DuMux simulations can be restarted from *.drs files # +# Set restart to the value of a specific file, e.g.: 'restart = 27184.1'# +# for the restart file # +# name_time=27184.1_rank=0.drs # +# Please comment in the below value, if restart is desired. # +########################################################################## +# restart= ... diff --git a/test/freeflow/stokes2cni/test_stokes2cni.cc b/test/freeflow/stokes2cni/test_stokes2cni.cc index 31f6bef8a0..0ac46974f0 100644 --- a/test/freeflow/stokes2cni/test_stokes2cni.cc +++ b/test/freeflow/stokes2cni/test_stokes2cni.cc @@ -19,15 +19,46 @@ * 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 non-isothermal two-component Stokes box model. + */ #include "config.h" #include "stokes2cnitestproblem.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" + "\t-tEnd The end of the simulation. [s] \n" + "\t-dtInitial The initial timestep size. [s] \n" + "\t-gridFile The file name of the file containing the grid \n" + "\t definition in DGF format\n"; + + std::cout << errorMessageOut + << "\n"; + } +} + int main(int argc, char** argv) { #if HAVE_SUPERLU typedef TTAG(Stokes2cniTestProblem) ProblemTypeTag; - return Dumux::startFromDGF<ProblemTypeTag>(argc, argv); + return Dumux::start<ProblemTypeTag>(argc, argv, usage); #else #warning "No SuperLU installed. Stokes currently only works with SuperLU." std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl; -- GitLab