18 #ifdef LIBMESH_HAVE_OPENMP 26 std::unique_ptr<MooseApp>
27 createMooseApp(
const std::string & default_app_type,
int argc,
char * argv[])
43 if (std::regex_match(arg, std::regex(
"[A-Za-z0-9]*:Application/.*")))
45 "For command line argument '",
47 "': overriding the application type for MultiApps via command line is not allowed.");
49 const auto & input_filenames = command_line_params.get<std::vector<std::string>>(
"input_file");
53 auto command_line = std::make_unique<CommandLine>(argc, argv);
54 command_line->parse();
58 auto parser = std::make_unique<Parser>(input_filenames);
59 parser->setAppType(default_app_type);
60 parser->setCommandLineParams(command_line->buildHitParams());
64 for (
const auto & entry : std::as_const(*command_line).getEntries())
65 if (!entry.subapp_name && entry.value &&
66 (entry.name ==
"--app" || entry.name ==
"Application/type"))
67 parser->setAppType(*entry.value);
69 const auto & app_type = parser->getAppType();
71 mooseError(
"'", app_type,
"' is not a registered application type.");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
static void addInputParam(InputParameters ¶ms)
This class wraps provides and tracks access to command line parameters.
static std::unique_ptr< MooseApp > create(const std::string &app_type, const std::vector< std::string > &cli_args={})
Create an app with no input and command line arguments.
void populateCommandLineParams(InputParameters ¶ms)
Populates the command line input parameters from params.
static AppFactory & instance()
Get the instance of the AppFactory.
static void addAppParam(InputParameters ¶ms)
std::unique_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])
Create a MooseApp from command-line arguments.
void parse()
Performs the parsing, which is the combining of arguments into [name, value] pairs.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const std::vector< std::string > & getArguments()