Skip to content
Snippets Groups Projects
Commit a226c323 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

cosserat-continuum.cc: Check whether argv[1] exists before using it

parent 530ff394
No related branches found
No related tags found
1 merge request!159cosserat-continuum.cc: Read input parameters as Python file
......@@ -120,6 +120,11 @@ int main (int argc, char *argv[]) try
std::cout << "MIXED_SPACE = 0" << std::endl;
#endif
}
// Check for appropriate number of command line arguments
if (argc < 3)
DUNE_THROW(Exception, "Usage: ./cosserat-continuum <python path> <parameter file>");
// Start Python interpreter
Python::start();
Python::Reference main = Python::import("__main__");
......@@ -137,9 +142,6 @@ int main (int argc, char *argv[]) try
// parse data file
ParameterTree parameterSet;
if (argc < 3)
DUNE_THROW(Exception, "Usage: ./cosserat-continuum <python path> <parameter file>");
ParameterTreeParser::readINITree(argv[2], parameterSet);
ParameterTreeParser::readOptions(argc, argv, parameterSet);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment