18 #ifdef LIBMESH_HAVE_OPENMP 26 std::shared_ptr<MooseApp>
27 createMooseApp(
const std::string & default_app_type,
int argc,
char * argv[])
42 if (std::regex_match(arg, std::regex(
"[A-Za-z0-9]*:Application/.*")))
44 "For command line argument '",
46 "': 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");
50 auto parser = std::make_unique<Parser>(input_filenames);
51 parser->setAppType(default_app_type);
52 if (input_filenames.size())
56 for (
const auto & entry : std::as_const(cl).getEntries())
57 if (!entry.subapp_name && entry.value &&
58 (entry.name ==
"--app" || entry.name ==
"Application/type"))
59 parser->setAppType(*entry.value);
61 const auto & app_type = parser->getAppType();
63 mooseError(
"'", app_type,
"' is not a registered application type.");
std::shared_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])
Create a MooseApp from command-line arguments.
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.
void populateCommandLineParams(InputParameters ¶ms)
Populates the command line input parameters from params.
static MooseAppPtr createAppShared(int argc, char **argv, std::unique_ptr< Parser > parser)
Helper function for creating a MooseApp from command-line arguments and a Parser. ...
static AppFactory & instance()
Get the instance of the AppFactory.
static void addAppParam(InputParameters ¶ms)
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()