18#ifdef LIBMESH_HAVE_OPENMP
26std::unique_ptr<MooseApp>
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.
bool isRegistered(const std::string &app_name) const
Returns a Boolean indicating whether an application type has been registered.
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.
static AppFactory & instance()
Get the instance of the AppFactory.
This class wraps provides and tracks access to command line parameters.
const std::vector< std::string > & getArguments()
void populateCommandLineParams(InputParameters ¶ms)
Populates the command line input parameters from params.
void parse()
Performs the parsing, which is the combining of arguments into [name, value] pairs.
static void addAppParam(InputParameters ¶ms)
static void addInputParam(InputParameters ¶ms)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
std::unique_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])
Create a MooseApp from command-line arguments.