diff --git a/CMakeLists.txt b/CMakeLists.txt index ed33e4b253cabe1975fa572eec589ed4db589a51..5d7063a852e9608fe1fffcc015475b3269189b1e 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 0000000000000000000000000000000000000000..e4492215f64f0b856a6a026e27dc51b48c3c8acc --- /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 be897dd9a850710e8cb25111cf73e95cc8d738a7..ea6a98809e48d07eee99e20e28d943e93a536eb9 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 0000000000000000000000000000000000000000..1a33cdd3e93f213a5b2e4b7285fd42c166706ca4 --- /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 4605e7f5210dc05239c127a8d7f43b37d7d73362..eb4bdb1bd9aa88d320d8190ddc6307084dc7a663 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 0000000000000000000000000000000000000000..d5d9e718fda58ed2f016c9751ddd16d397f6cc14 --- /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 31f6bef8a051ec238ae536c54f59fc3df2eec9e5..0ac46974f0e73f6451cfb45ea8e48fcc096a54c0 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;