www.mooseframework.org
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
MooseApp Class Reference

Base class for MOOSE-based applications. More...

#include <MooseApp.h>

Inheritance diagram for MooseApp:
[legend]

Public Member Functions

virtual ~MooseApp ()
 
TheWarehousetheWarehouse ()
 
const std::string & name () const
 Get the name of the object. More...
 
virtual void checkRegistryLabels ()
 
virtual std::string getPrintableName () const
 Get printable name of the application. More...
 
InputParametersparameters ()
 Get the parameters of the object. More...
 
const std::string & type () const
 Get the type of this object as a string. More...
 
PerfGraphperfGraph ()
 Get the PerfGraph for this app. More...
 
bool isParamValid (const std::string &name) const
 
virtual void run ()
 Run the application. More...
 
std::string getFrameworkVersion () const
 Returns the framework version. More...
 
virtual std::string getVersion () const
 Returns the current version of the framework or application (default: framework version). More...
 
std::string getPrintableVersion () const
 Non-virtual method for printing out the version string in a consistent format. More...
 
virtual void setupOptions ()
 Setup options based on InputParameters. More...
 
ActionWarehouseactionWarehouse ()
 
Parserparser ()
 
Syntaxsyntax ()
 
void setInputFileName (std::string input_file_name)
 Set the input file name. More...
 
std::string getInputFileName () const
 Returns the input file name that was set with setInputFileName. More...
 
void setOutputFileBase (std::string output_file_base)
 Override the selection of the output file base name. More...
 
std::string getOutputFileBase () const
 Override the selection of the output file base name. More...
 
void setOutputPosition (Point p)
 Tell the app to output in a specific position. More...
 
std::list< std::string > getCheckpointDirectories () const
 Get all checkpoint directories. More...
 
std::list< std::string > getCheckpointFiles () const
 Extract all possible checkpoint file names. More...
 
bool hasOutputPosition () const
 Whether or not an output position has been set. More...
 
Point getOutputPosition () const
 Get the output position. More...
 
void setStartTime (const Real time)
 Set the starting time for the simulation. More...
 
bool hasStartTime () const
 
Real getStartTime () const
 
void setGlobalTimeOffset (const Real offset)
 Each App has it's own local time. More...
 
Real getGlobalTimeOffset () const
 Each App has it's own local time. More...
 
std::string getFileName (bool stripLeadingPath=true) const
 Return the filename that was parsed. More...
 
void setCheckUnusedFlag (bool warn_is_error=false)
 Set a flag so that the parser will either warn or error when unused variables are seen after parsing is complete. More...
 
void setErrorOverridden ()
 Set a flag so that the parser will throw an error if overridden parameters are detected. More...
 
void disableCheckUnusedFlag ()
 Removes warnings and error checks for unrecognized variables in the input file. More...
 
ExecutionergetExecutioner () const
 Retrieve the Executioner for this App. More...
 
std::shared_ptr< Executioner > & executioner ()
 Retrieve the Executioner for this App. More...
 
void setExecutioner (std::shared_ptr< Executioner > &&executioner)
 Set the Executioner for this App. More...
 
bool & useNonlinear ()
 Set a Boolean indicating whether this app will use a Nonlinear or Eigen System. More...
 
bool & useEigenvalue ()
 Set a Boolean indicating whether this app will use an eigenvalue executioner. More...
 
FactorygetFactory ()
 Retrieve the Factory associated with this App. More...
 
processor_id_type processor_id ()
 
ActionFactorygetActionFactory ()
 Retrieve the ActionFactory associated with this App. More...
 
std::shared_ptr< CommandLinecommandLine () const
 Get the command line. More...
 
bool & setFileRestart ()
 This method is here so we can determine whether or not we need to use a separate reader to read the mesh BEFORE we create the mesh. More...
 
virtual void runInputFile ()
 Actually build everything in the input file. More...
 
virtual void executeExecutioner ()
 Execute the Executioner that was built. More...
 
bool getDistributedMeshOnCommandLine () const
 Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibility) on the command line and false otherwise. More...
 
bool getParallelMeshOnCommandLine () const
 Deprecated. More...
 
bool isRecovering () const
 Whether or not this is a "recover" calculation. More...
 
bool isRestarting () const
 Whether or not this is a "restart" calculation. More...
 
bool isSplitMesh () const
 Whether or not this is a split mesh operation. More...
 
bool isUseSplit () const
 Whether or not we are running with pre-split (distributed mesh) More...
 
bool hasRecoverFileBase ()
 Return true if the recovery file base is set. More...
 
std::string getRecoverFileBase ()
 The file_base for the recovery file. More...
 
void setRecoverFileBase (std::string recover_base)
 mutator for recover_base (set by RecoverBaseAction) More...
 
std::string getRecoverFileSuffix ()
 The suffix for the recovery file. More...
 
void setRecoverFileSuffix (std::string recover_suffix)
 mutator for recover_suffix More...
 
bool halfTransient ()
 Whether or not this simulation should only run half its transient (useful for testing recovery) More...
 
void setOutputFileNumbers (std::map< std::string, unsigned int > numbers)
 Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propagate down through the Multiapps. More...
 
std::map< std::string, unsigned int > & getOutputFileNumbers ()
 Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propogate down through the multiapps. More...
 
bool hasOutputWarehouse ()
 Return true if the output position has been set. More...
 
OutputWarehousegetOutputWarehouse ()
 Get the OutputWarehouse objects. More...
 
const SystemInfogetSystemInfo () const
 Get SystemInfo object. More...
 
std::string appNameToLibName (const std::string &app_name) const
 Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg) More...
 
std::string libNameToAppName (const std::string &library_name) const
 Converts a library name to an application name: More...
 
std::set< std::string > getLoadedLibraryPaths () const
 Return the loaded library filenames in a std::vector. More...
 
InputParameterWarehousegetInputParameterWarehouse ()
 Get the InputParameterWarehouse for MooseObjects. More...
 
void registerRestartableData (std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
 
const RestartableDatasgetRestartableData ()
 Return reference to the restatable data object. More...
 
std::set< std::string > & getRecoverableData ()
 Return a reference to the recoverable data object. More...
 
virtual std::shared_ptr< Backupbackup ()
 Create a Backup from the current App. More...
 
virtual void restore (std::shared_ptr< Backup > backup, bool for_restart=false)
 Restore a Backup. More...
 
virtual std::string header () const
 Returns a string to be printed at the beginning of a simulation. More...
 
unsigned int multiAppLevel () const
 The MultiApp Level. More...
 
unsigned int multiAppNumber () const
 The MultiApp number. More...
 
bool isUltimateMaster ()
 Whether or not this app is the ultimate master app. More...
 
void addMeshModifier (const std::string &modifier_name, const std::string &name, InputParameters parameters)
 Add a mesh modifier that will act on the meshes in the system. More...
 
const MeshModifiergetMeshModifier (const std::string &name) const
 Get a mesh modifier with its name. More...
 
std::vector< std::string > getMeshModifierNames () const
 Get names of all mesh modifiers Note: This function should be called after all mesh modifiers are added with the 'add_mesh_modifier' task. More...
 
void clearMeshModifiers ()
 Clear all mesh modifers. More...
 
void executeMeshModifiers ()
 Execute and clear the Mesh Modifiers data structure. More...
 
void addMeshGenerator (const std::string &generator_name, const std::string &name, InputParameters parameters)
 Add a mesh generator that will act on the meshes in the system. More...
 
const MeshGeneratorgetMeshGenerator (const std::string &name) const
 Get a mesh generator with its name. More...
 
std::vector< std::string > getMeshGeneratorNames () const
 Get names of all mesh generators Note: This function should be called after all mesh generators are added with the 'add_mesh_generator' task. More...
 
std::unique_ptr< MeshBase > & getMeshGeneratorOutput (const std::string &name)
 Get a refernce to a pointer that will be the output of the MeshGenerator named name. More...
 
void clearMeshGenerators ()
 Clear all mesh modifers. More...
 
void executeMeshGenerators ()
 Execute and clear the Mesh Generators data structure. More...
 
std::unique_ptr< MeshBase > getMeshGeneratorMesh ()
 Get the generated mesh generated by executeMeshGenerators();. More...
 
bool checkInput () const
 Returns whether the Application is running in check input mode. More...
 
bool getFPTrapFlag () const
 Returns whether FPE trapping is turned on (either because of debug or user requested) More...
 
void addExecFlag (const ExecFlagType &flag)
 WARNING: This is an internal method for MOOSE, if you need the add new ExecFlagTypes then use the registerExecFlag macro as done in Moose.C/h. More...
 
bool hasRelationshipManager (const std::string &name) const
 Returns a Boolean indicating whether a RelationshipManater exists with the same name. More...
 
bool addRelationshipManager (std::shared_ptr< RelationshipManager > relationship_manager)
 Transfers ownership of a RelationshipManager to the application for lifetime management. More...
 
void attachRelationshipManagers (Moose::RelationshipManagerType rm_type)
 
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo () const
 Returns the Relationship managers info suitable for printing. More...
 
const ExecFlagEnumgetExecuteOnEnum () const
 Return the app level ExecFlagEnum, this contains all the available flags for the app. More...
 
template<typename T >
const T & getParam (const std::string &name)
 Retrieve a parameter for the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 
void dynamicAllRegistration (const std::string &app_name, Factory *factory, ActionFactory *action_factory, Syntax *syntax, std::string library_path, const std::string &library_name)
 Thes methods are called to register applications or objects on demand. More...
 
void dynamicAppRegistration (const std::string &app_name, std::string library_path, const std::string &library_name)
 
void setRestart (const bool &value)
 Sets the restart/recover flags. More...
 
void setRecover (const bool &value)
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Types

enum  UNUSED_CHECK { OFF, WARN_UNUSED, ERROR_UNUSED }
 Indicates whether warnings, errors, or no output is displayed when unused parameters are detected. More...
 

Protected Member Functions

bool hasCachedBackup ()
 Whether or not this MooseApp has cached a Backup to use for restart / recovery. More...
 
void restoreCachedBackup ()
 Restore from a cached backup. More...
 
void dynamicRegistration (const Parameters &params)
 Helper method for dynamic loading of objects. More...
 
void loadLibraryAndDependencies (const std::string &library_filename, const Parameters &params)
 Recursively loads libraries and dependencies in the proper order to fully register a MOOSE application that may have several dependencies. More...
 
 MooseApp (InputParameters parameters)
 Constructor is protected so that this object is constructed through the AppFactory object. More...
 
void registerRecoverableData (std::string name)
 NOTE: This is an internal function meant for MOOSE use only! More...
 
void errorCheck ()
 Runs post-initialization error checking that cannot be run correctly unless the simulation has been fully set up and initialized. More...
 

Protected Attributes

std::string _name
 The name of this object. More...
 
InputParameters _pars
 Parameters of this object. More...
 
const std::string _type
 The string representation of the type of this object as registered (see registerApp(AppName)) More...
 
const std::shared_ptr< Parallel::Communicator > _comm
 The MPI communicator this App is going to use. More...
 
PerfGraph _perf_graph
 The PerfGraph object for this applciation. More...
 
std::string _input_filename
 Input file name used. More...
 
std::string _output_file_base
 The output file basename. More...
 
bool _output_position_set
 Whether or not an output position has been set for this app. More...
 
Point _output_position
 The output position. More...
 
bool _start_time_set
 Whether or not an start time has been set. More...
 
Real _start_time
 The time at which to start the simulation. More...
 
Real _global_time_offset
 Offset of the local App time to the "global" problem time. More...
 
std::shared_ptr< CommandLine_command_line
 Command line object. More...
 
Syntax _syntax
 Syntax of the input file. More...
 
OutputWarehouse _output_warehouse
 OutputWarehouse object for this App. More...
 
InputParameterWarehouse_input_parameter_warehouse
 Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly controlled) More...
 
ActionFactory _action_factory
 The Factory responsible for building Actions. More...
 
ActionWarehouse _action_warehouse
 Where built actions are stored. More...
 
Parser _parser
 Parser for parsing the input file. More...
 
std::shared_ptr< Executioner_executioner
 Pointer to the executioner of this run (typically build by actions) More...
 
bool _use_nonlinear
 Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) More...
 
bool _use_eigen_value
 Boolean to indicate whether to use an eigenvalue executioner. More...
 
std::unique_ptr< SystemInfo_sys_info
 System Information. More...
 
enum MooseApp::UNUSED_CHECK _enable_unused_check
 
Factory _factory
 
bool _error_overridden
 Indicates whether warnings or errors are displayed when overridden parameters are detected. More...
 
bool _ready_to_exit
 
bool _initial_from_file
 This variable indicates when a request has been made to restart from an Exodus file. More...
 
bool _distributed_mesh_on_command_line
 This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh. More...
 
bool _recover
 Whether or not this is a recovery run. More...
 
bool _restart
 Whether or not this is a restart run. More...
 
bool _split_mesh
 Whether or not we are performing a split mesh operation (–split-mesh) More...
 
const bool _use_split
 Whether or not we are using a (pre-)split mesh (automatically DistributedMesh) More...
 
bool _trap_fpe
 Whether or not FPE trapping should be turned on. More...
 
std::string _recover_base
 The base name to recover from. If blank then we will find the newest recovery file. More...
 
std::string _recover_suffix
 The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO. More...
 
bool _half_transient
 Whether or not this simulation should only run half its transient (useful for testing recovery) More...
 
std::map< std::string, unsigned int > _output_file_numbers
 Map of outputer name and file number (used by MultiApps to propagate file numbers down through the multiapps) More...
 
bool _check_input
 true if we want to just check the input file More...
 
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
 
std::map< std::pair< std::string, std::string >, void * > _lib_handles
 The library, registration method and the handle to the method. More...
 

Private Types

enum  RegistrationType { APPLICATION, REGALL }
 Enumeration for holding the valid types of dynamic registrations allowed. More...
 

Private Member Functions

void createMinimalApp ()
 Method for creating the minimum required actions for an application (no input file) More...
 

Private Attributes

RestartableDatas _restartable_data
 Where the restartable data is held (indexed on tid) More...
 
std::set< std::string > _recoverable_data
 Data names that will only be read from the restart file during RECOVERY. More...
 
std::unique_ptr< TheWarehouse_the_warehouse
 
unsigned int _multiapp_level
 Level of multiapp, the master is level 0. This used by the Console to indent output. More...
 
unsigned int _multiapp_number
 Numbering in all the sub-apps on the same level. More...
 
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
 Holds the mesh modifiers until they have completed, then this structure is cleared. More...
 
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
 Holds the mesh generators until they have completed, then this structure is cleared. More...
 
std::map< std::string, std::list< std::unique_ptr< MeshBase > > > _mesh_generator_outputs
 Holds the output for each mesh generator - including duplicates needed downstream. More...
 
std::unique_ptr< MeshBase > _final_generated_mesh
 The final Mesh that is generated by the generators. More...
 
std::shared_ptr< Backup_cached_backup
 Cache for a Backup to use for restart / recovery. More...
 
ExecFlagEnum _execute_flags
 Execution flags for this App. More...
 
PerfID _setup_timer
 Timers. More...
 
PerfID _setup_options_timer
 
PerfID _run_input_file_timer
 
PerfID _execute_timer
 
PerfID _execute_executioner_timer
 
PerfID _restore_timer
 
PerfID _run_timer
 
PerfID _execute_mesh_modifiers_timer
 
PerfID _execute_mesh_generators_timer
 
PerfID _restore_cached_backup_timer
 
PerfID _create_minimal_app_timer
 

Friends

class FEProblemBase
 
class Restartable
 
class SubProblem
 

Detailed Description

Base class for MOOSE-based applications.

This generic class for application provides:

Each application should register its own objects and register its own special syntax

Definition at line 58 of file MooseApp.h.

Member Enumeration Documentation

◆ RegistrationType

Enumeration for holding the valid types of dynamic registrations allowed.

Enumerator
APPLICATION 
REGALL 

Definition at line 850 of file MooseApp.h.

851  {
852  APPLICATION,
853  REGALL
854  };

◆ UNUSED_CHECK

enum MooseApp::UNUSED_CHECK
protected

Indicates whether warnings, errors, or no output is displayed when unused parameters are detected.

Enumerator
OFF 
WARN_UNUSED 
ERROR_UNUSED 

Definition at line 762 of file MooseApp.h.

763  {
764  OFF,
765  WARN_UNUSED,
enum MooseApp::UNUSED_CHECK _enable_unused_check

Constructor & Destructor Documentation

◆ ~MooseApp()

MooseApp::~MooseApp ( )
virtual

Definition at line 407 of file MooseApp.C.

408 {
410  _executioner.reset();
411  _the_warehouse.reset();
412 
414 
415 #ifdef LIBMESH_HAVE_DLOPEN
416  // Close any open dynamic libraries
417  for (const auto & it : _lib_handles)
418  dlclose(it.second);
419 #endif
420 }
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:856
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:738
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:814
void clear()
This method deletes all of the Actions in the warehouse.

◆ MooseApp()

MooseApp::MooseApp ( InputParameters  parameters)
protected

Constructor is protected so that this object is constructed through the AppFactory object.

Definition at line 255 of file MooseApp.C.

256  : ConsoleStreamInterface(*this),
257  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
258  "_comm")), // Can't call getParam() before pars is set
259  _name(parameters.get<std::string>("_app_name")),
260  _pars(parameters),
261  _type(getParam<std::string>("_type")),
262  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
263  _output_position_set(false),
264  _start_time_set(false),
265  _start_time(0.0),
266  _global_time_offset(0.0),
267  _output_warehouse(*this),
269  _action_factory(*this),
271  _parser(*this, _action_warehouse),
272  _use_nonlinear(true),
273  _use_eigen_value(false),
275  _factory(*this),
276  _error_overridden(false),
277  _ready_to_exit(false),
278  _initial_from_file(false),
280  _recover(false),
281  _restart(false),
282  _split_mesh(false),
283  _use_split(parameters.get<bool>("use_split")),
284 #ifdef DEBUG
285  _trap_fpe(true),
286 #else
287  _trap_fpe(false),
288 #endif
289  _recover_suffix("cpr"),
290  _half_transient(false),
291  _check_input(getParam<bool>("check_input")),
292  _restartable_data(libMesh::n_threads()),
294  isParamValid("_multiapp_level") ? parameters.get<unsigned int>("_multiapp_level") : 0),
296  isParamValid("_multiapp_number") ? parameters.get<unsigned int>("_multiapp_number") : 0),
297  _setup_timer(_perf_graph.registerSection("MooseApp::setup", 2)),
298  _setup_options_timer(_perf_graph.registerSection("MooseApp::setupOptions", 5)),
299  _run_input_file_timer(_perf_graph.registerSection("MooseApp::runInputFile", 3)),
300  _execute_timer(_perf_graph.registerSection("MooseApp::execute", 2)),
301  _execute_executioner_timer(_perf_graph.registerSection("MooseApp::executeExecutioner", 3)),
302  _restore_timer(_perf_graph.registerSection("MooseApp::restore", 2)),
303  _run_timer(_perf_graph.registerSection("MooseApp::run", 3)),
304  _execute_mesh_modifiers_timer(_perf_graph.registerSection("MooseApp::executeMeshModifiers", 1)),
306  _perf_graph.registerSection("MooseApp::executeMeshGenerators", 1)),
307  _restore_cached_backup_timer(_perf_graph.registerSection("MooseApp::restoreCachedBackup", 2)),
308  _create_minimal_app_timer(_perf_graph.registerSection("MooseApp::createMinimalApp", 3))
309 {
312 
313  _the_warehouse = libmesh_make_unique<TheWarehouse>();
314  _the_warehouse->registerAttribute<AttribMatrixTags>("matrix_tags", 0);
315  _the_warehouse->registerAttribute<AttribVectorTags>("vector_tags", 0);
316  _the_warehouse->registerAttribute<AttribExecOns>("exec_ons", 0);
317  _the_warehouse->registerAttribute<AttribSubdomains>("subdomains", 0);
318  _the_warehouse->registerAttribute<AttribBoundaries>("boundaries", 0);
319  _the_warehouse->registerAttribute<AttribThread>("thread", 0);
320  _the_warehouse->registerAttribute<AttribPreIC>("pre_ic", 0);
321  _the_warehouse->registerAttribute<AttribPreAux>("pre_aux", 0);
322  _the_warehouse->registerAttribute<AttribName>("name", "dummy");
323  _the_warehouse->registerAttribute<AttribSystem>("system", "dummy");
324  _the_warehouse->registerAttribute<AttribVar>("variable", 0);
325  _the_warehouse->registerAttribute<AttribInterfaces>("interfaces", 0);
326 
327  if (isParamValid("_argc") && isParamValid("_argv"))
328  {
329  int argc = getParam<int>("_argc");
330  char ** argv = getParam<char **>("_argv");
331 
332  _sys_info = libmesh_make_unique<SystemInfo>(argc, argv);
333  }
334  if (isParamValid("_command_line"))
335  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
336  else
337  mooseError("Valid CommandLine object required");
338 
339  if (_check_input && isParamValid("recover"))
340  mooseError("Cannot run --check-input with --recover. Recover files might not exist");
341 
342  if (isParamValid("start_in_debugger"))
343  {
344  auto command = getParam<std::string>("start_in_debugger");
345 
346  Moose::out << "Starting in debugger using: " << command << std::endl;
347 
349 
350  std::stringstream command_stream;
351 
352  // This will start XTerm and print out some info first... then run the debugger
353  command_stream << "xterm -e \"echo 'Rank: " << processor_id() << " Hostname: " << hostname
354  << " PID: " << getpid() << "'; echo ''; ";
355 
356  // Figure out how to run the debugger
357  if (command.find("lldb") != std::string::npos || command.find("gdb") != std::string::npos)
358  command_stream << command << " -p " << getpid();
359  else
360  mooseError("Unknown debugger: ",
361  command,
362  "\nIf this is truly what you meant then contact moose-users to have a discussion "
363  "about adding your debugger.");
364 
365  // Finish up the command
366  command_stream << "\""
367  << " & ";
368 
369  std::string command_string = command_stream.str();
370  Moose::out << "Running: " << command_string << std::endl;
371 
372  std::system(command_string.c_str());
373 
374  // Sleep to allow time for the debugger to attach
375  std::this_thread::sleep_for(std::chrono::seconds(10));
376  }
377 
378  if (!parameters.isParamSetByAddParam("stop_for_debugger"))
379  {
380  Moose::out << "\nStopping for " << getParam<unsigned int>("stop_for_debugger")
381  << " seconds to allow attachment from a debugger.\n";
382 
383  Moose::out << "\nAll of the processes you can connect to:\n";
384  Moose::out << "rank - hostname - pid\n";
385 
387 
388  {
389  // The 'false' turns off the serialization warning
390  SerializerGuard sg(_communicator, false); // Guarantees that the processors print in order
391  Moose::err << processor_id() << " - " << hostname << " - " << getpid() << "\n";
392  }
393 
394  Moose::out << "\nWaiting...\n" << std::endl;
395 
396  // Sleep to allow time for the debugger to attach
397  std::this_thread::sleep_for(std::chrono::seconds(getParam<unsigned int>("stop_for_debugger")));
398  }
399 }
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:756
PerfID _run_timer
Definition: MooseApp.h:889
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:859
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:699
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:776
Storage container for all InputParamter objects.
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:844
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:726
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:714
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:856
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:85
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:753
PerfID _run_input_file_timer
Definition: MooseApp.h:885
PerfID _execute_mesh_generators_timer
Definition: MooseApp.h:891
PerfID _create_minimal_app_timer
Definition: MooseApp.h:893
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:723
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:791
PerfID _execute_timer
Definition: MooseApp.h:886
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:809
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:167
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:112
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:732
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:794
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:759
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:803
std::string hostname()
Get the hostname the current process is running on.
Definition: MooseUtils.C:372
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:747
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:152
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:720
bool isParamSetByAddParam(const std::string &name) const
Returns whether or not the parameter was set due to addParam.
nl system()
PerfID _execute_mesh_modifiers_timer
Definition: MooseApp.h:890
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:729
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:785
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:738
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:741
ConsoleStreamInterface(MooseApp &app)
A class for providing a helper stream object for writting message to all the Output objects...
PerfID _setup_options_timer
Definition: MooseApp.h:884
PerfID _restore_timer
Definition: MooseApp.h:888
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:782
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:772
PerfID _execute_executioner_timer
Definition: MooseApp.h:887
PerfID _restore_cached_backup_timer
Definition: MooseApp.h:892
PerfGraph _perf_graph
The PerfGraph object for this applciation.
Definition: MooseApp.h:705
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:903
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:779
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:735
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:702
processor_id_type processor_id()
Definition: MooseApp.h:281
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
Definition: Moose.C:51
Factory _factory
Definition: MooseApp.h:769
std::string _name
The name of this object.
Definition: MooseApp.h:693
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:862
PerfID registerSection(const std::string &section_name, unsigned int level)
Registers a named section of code.
Definition: PerfGraph.C:41
bool _ready_to_exit
Definition: MooseApp.h:773
A scope guard that guarantees that whatever happens between when it gets created and when it is destr...
PerfID _setup_timer
Timers.
Definition: MooseApp.h:883
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:800
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:788
static char addKnownLabel(const std::string &label)
addKnownLabel whitelists a label as valid for purposes of the checkLabels function.
Definition: Registry.C:124

Member Function Documentation

◆ actionWarehouse()

ActionWarehouse& MooseApp::actionWarehouse ( )
inline

◆ addExecFlag()

void MooseApp::addExecFlag ( const ExecFlagType flag)

WARNING: This is an internal method for MOOSE, if you need the add new ExecFlagTypes then use the registerExecFlag macro as done in Moose.C/h.

Parameters
flagThe flag to add as available to the app level ExecFlagEnum.

Definition at line 1677 of file MooseApp.C.

Referenced by Factory::regExecFlag().

1678 {
1679  if (flag.id() == MooseEnumItem::INVALID_ID)
1680  {
1681  // It is desired that users when creating ExecFlagTypes should not worry about needing
1682  // to assign a name and an ID. However, the ExecFlagTypes created by users are global
1683  // constants and the ID to be assigned can't be known at construction time of this global
1684  // constant, it is only known when it is added to this object (ExecFlagEnum). Therefore,
1685  // this const cast allows the ID to be set after construction. This was the lesser of two
1686  // evils: const_cast or friend class with mutable members.
1687  ExecFlagType & non_const_flag = const_cast<ExecFlagType &>(flag);
1688  auto it = _execute_flags.find(flag.name());
1689  if (it != _execute_flags.items().end())
1690  non_const_flag.setID(it->id());
1691  else
1692  non_const_flag.setID(_execute_flags.getNextValidID());
1693  }
1695 }
int getNextValidID() const
Compute the next valid ID.
void setID(const int &id)
Method to change the ID of the item, but only if it is an INVALID_ID.
Definition: MooseEnumItem.C:81
const std::string & name() const
Definition: MooseEnumItem.h:38
static const int INVALID_ID
Definition: MooseEnumItem.h:25
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
Add additional execute_on flags to the list of possible flags.
Definition: ExecFlagEnum.h:85
const std::set< ExecFlagType > & items() const
Reference the all the available items.
Definition: ExecFlagEnum.h:74
const int & id() const
Return the numeric, name, or raw name.
Definition: MooseEnumItem.h:37
ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:880
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:22
std::set< MooseEnumItem >::const_iterator find(const MooseEnumItem &other) const
Locate an item.

◆ addMeshGenerator()

void MooseApp::addMeshGenerator ( const std::string &  generator_name,
const std::string &  name,
InputParameters  parameters 
)

Add a mesh generator that will act on the meshes in the system.

Definition at line 1425 of file MooseApp.C.

Referenced by AddMeshGeneratorAction::act().

1428 {
1429  std::shared_ptr<MeshGenerator> mesh_generator =
1430  _factory.create<MeshGenerator>(generator_name, name, parameters);
1431 
1432  _mesh_generators.insert(std::make_pair(MooseUtils::shortName(name), mesh_generator));
1433 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:85
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:868
Factory _factory
Definition: MooseApp.h:769
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:28

◆ addMeshModifier()

void MooseApp::addMeshModifier ( const std::string &  modifier_name,
const std::string &  name,
InputParameters  parameters 
)

Add a mesh modifier that will act on the meshes in the system.

Definition at line 1340 of file MooseApp.C.

Referenced by AddMeshModifierAction::act().

1343 {
1344  std::shared_ptr<MeshModifier> mesh_modifier =
1345  _factory.create<MeshModifier>(modifier_name, name, parameters);
1346 
1347  _mesh_modifiers.insert(std::make_pair(MooseUtils::shortName(name), mesh_modifier));
1348 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:85
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:26
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
Factory _factory
Definition: MooseApp.h:769
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:865

◆ addRelationshipManager()

bool MooseApp::addRelationshipManager ( std::shared_ptr< RelationshipManager relationship_manager)

Transfers ownership of a RelationshipManager to the application for lifetime management.

The RelationshipManager will NOT be duplicately added if an equivalent RelationshipManager is already active. In that case, it's possible that the object will be destroyed if the reference count drops to zero.

Definition at line 1708 of file MooseApp.C.

Referenced by MooseADObjectAction::addRelationshipManagers(), and MooseObjectAction::addRelationshipManagers().

1709 {
1710  bool add = true;
1711  for (const auto & rm : _relationship_managers)
1712  if (*rm == *relationship_manager)
1713  {
1714  add = false;
1715  break;
1716  }
1717 
1718  if (add)
1719  _relationship_managers.emplace_back(relationship_manager);
1720 
1721  // Inform the caller whether the object was added or not
1722  return add;
1723 }
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:811

◆ appNameToLibName()

std::string MooseApp::appNameToLibName ( const std::string &  app_name) const

Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg)

Definition at line 1062 of file MooseApp.C.

Referenced by dynamicAppRegistration(), and dynamicRegistration().

1063 {
1064  std::string library_name(app_name);
1065 
1066  // Strip off the App part (should always be the last 3 letters of the name)
1067  size_t pos = library_name.find("App");
1068  if (pos != library_name.length() - 3)
1069  mooseError("Invalid application name: ", library_name);
1070  library_name.erase(pos);
1071 
1072  // Now get rid of the camel case, prepend lib, and append the method and suffix
1073  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
1074  QUOTE(METHOD) + ".la";
1075 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::string camelCaseToUnderscore(const std::string &camel_case_name)
Function for converting a camel case name to a name containing underscores.
Definition: MooseUtils.C:316

◆ attachRelationshipManagers()

void MooseApp::attachRelationshipManagers ( Moose::RelationshipManagerType  rm_type)

Definition at line 1726 of file MooseApp.C.

Referenced by AddRelationshipManager::act().

1727 {
1728  for (auto & rm : _relationship_managers)
1729  rm->attachRelationshipManagers(rm_type);
1730 }
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:811

◆ backup()

std::shared_ptr< Backup > MooseApp::backup ( )
virtual

Create a Backup from the current App.

A Backup contains all the data necessary to be able to restore the state of an App.

This method should be overridden in external or MOOSE-wrapped applications.

Definition at line 888 of file MooseApp.C.

Referenced by restore().

889 {
890  FEProblemBase & fe_problem = _executioner->feProblem();
891 
892  RestartableDataIO rdio(fe_problem);
893 
894  return rdio.createBackup();
895 }
Class for doing restart.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750

◆ checkInput()

bool MooseApp::checkInput ( ) const
inline

Returns whether the Application is running in check input mode.

Definition at line 611 of file MooseApp.h.

611 { return _check_input; }
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:809

◆ checkRegistryLabels()

void MooseApp::checkRegistryLabels ( )
virtual

Definition at line 402 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup(), and Factory::reportUnregisteredError().

403 {
405 }
static void checkLabels(const std::set< std::string > &known_labels={})
This runs error checking to make sure that all objects and actions in the registry have valid labels...
Definition: Registry.C:101

◆ clearMeshGenerators()

void MooseApp::clearMeshGenerators ( )

Clear all mesh modifers.

Definition at line 1555 of file MooseApp.C.

1556 {
1557  _mesh_generators.clear();
1558 }
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:868

◆ clearMeshModifiers()

void MooseApp::clearMeshModifiers ( )

Clear all mesh modifers.

Definition at line 1419 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::completeSetup().

1420 {
1421  _mesh_modifiers.clear();
1422 }
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:865

◆ commandLine()

std::shared_ptr<CommandLine> MooseApp::commandLine ( ) const
inline

Get the command line.

Returns
The reference to the command line object Setup options based on InputParameters.

Definition at line 293 of file MooseApp.h.

Referenced by FEProblemBase::addMultiApp(), MultiApp::createApp(), Parser::errorCheck(), Parser::hitCLIFilter(), Parser::parse(), and ExodusFormatter::printInputFile().

293 { return _command_line; }
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:729

◆ createMinimalApp()

void MooseApp::createMinimalApp ( )
private

Method for creating the minimum required actions for an application (no input file)

Mimics the following input file:

[Mesh] type = GeneratedMesh dim = 1 nx = 1 []

[Executioner] type = Transient num_steps = 1 dt = 1 []

[Problem] solve = false []

[Outputs] console = false []

Definition at line 1589 of file MooseApp.C.

Referenced by setupOptions().

1590 {
1591  TIME_SECTION(_create_minimal_app_timer);
1592 
1593  // SetupMeshAction (setup_mesh)
1594  {
1595  // Build the Action parameters
1596  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
1597  action_params.set<std::string>("type") = "GeneratedMesh";
1598  action_params.set<std::string>("task") = "setup_mesh";
1599 
1600  // Create The Action
1601  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1602  _action_factory.create("SetupMeshAction", "Mesh", action_params));
1603 
1604  // Set the object parameters
1605  InputParameters & params = action->getObjectParams();
1606  params.set<MooseEnum>("dim") = "1";
1607  params.set<unsigned int>("nx") = 1;
1608 
1609  // Add Action to the warehouse
1611  }
1612 
1613  // SetupMeshAction (init_mesh)
1614  {
1615  // Action parameters
1616  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
1617  action_params.set<std::string>("type") = "GeneratedMesh";
1618  action_params.set<std::string>("task") = "init_mesh";
1619 
1620  // Build the action
1621  std::shared_ptr<Action> action =
1622  _action_factory.create("SetupMeshAction", "Mesh", action_params);
1624  }
1625 
1626  // Executioner
1627  {
1628  // Build the Action parameters
1629  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
1630  action_params.set<std::string>("type") = "Transient";
1631 
1632  // Create the action
1633  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1634  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
1635 
1636  // Set the object parameters
1637  InputParameters & params = action->getObjectParams();
1638  params.set<unsigned int>("num_steps") = 1;
1639  params.set<Real>("dt") = 1;
1640 
1641  // Add Action to the warehouse
1643  }
1644 
1645  // Problem
1646  {
1647  // Build the Action parameters
1648  InputParameters action_params = _action_factory.getValidParams("CreateProblemDefaultAction");
1649  action_params.set<bool>("_solve") = false;
1650 
1651  // Create the action
1652  std::shared_ptr<Action> action = std::static_pointer_cast<Action>(
1653  _action_factory.create("CreateProblemDefaultAction", "Problem", action_params));
1654 
1655  // Add Action to the warehouse
1657  }
1658 
1659  // Outputs
1660  {
1661  // Build the Action parameters
1662  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
1663  action_params.set<bool>("console") = false;
1664 
1665  // Create action
1666  std::shared_ptr<Action> action =
1667  _action_factory.create("CommonOutputAction", "Outputs", action_params);
1668 
1669  // Add Action to the warehouse
1671  }
1672 
1674 }
InputParameters getValidParams(const std::string &name)
Definition: ActionFactory.C:70
PerfID _create_minimal_app_timer
Definition: MooseApp.h:893
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addActionBlock(std::shared_ptr< Action > blk)
This method add an Action instance to the warehouse.
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
Base class for actions.
Definition: Action.h:36
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:741
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:32
void build()
Builds all auto-buildable tasks.
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters parameters)
Definition: ActionFactory.C:41

◆ disableCheckUnusedFlag()

void MooseApp::disableCheckUnusedFlag ( )

Removes warnings and error checks for unrecognized variables in the input file.

Definition at line 933 of file MooseApp.C.

934 {
936 }
enum MooseApp::UNUSED_CHECK _enable_unused_check

◆ dynamicAllRegistration()

void MooseApp::dynamicAllRegistration ( const std::string &  app_name,
Factory factory,
ActionFactory action_factory,
Syntax syntax,
std::string  library_path,
const std::string &  library_name 
)

Thes methods are called to register applications or objects on demand.

This method attempts to load a dynamic library and register it when it is needed. Throws an error if no suitable library is found that contains the app_name in question.

Definition at line 1135 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction().

1141 {
1142  Parameters params;
1143  params.set<std::string>("app_name") = app_name;
1144  params.set<RegistrationType>("reg_type") = REGALL;
1145  params.set<std::string>("registration_method") = app_name + "__registerAll";
1146  params.set<std::string>("library_path") = library_path;
1147  params.set<std::string>("library_name") = library_name;
1148 
1149  params.set<Factory *>("factory") = factory;
1150  params.set<Syntax *>("syntax") = syntax;
1151  params.set<ActionFactory *>("action_factory") = action_factory;
1152 
1153  dynamicRegistration(params);
1154 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:154
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:1157
Syntax & syntax()
Definition: MooseApp.h:143
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:65
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:850
Holding syntax for parsing input files.
Definition: Syntax.h:21

◆ dynamicAppRegistration()

void MooseApp::dynamicAppRegistration ( const std::string &  app_name,
std::string  library_path,
const std::string &  library_name 
)

Definition at line 1102 of file MooseApp.C.

Referenced by MultiApp::initialSetup().

1105 {
1106  Parameters params;
1107  params.set<std::string>("app_name") = app_name;
1108  params.set<RegistrationType>("reg_type") = APPLICATION;
1109  params.set<std::string>("registration_method") = app_name + "__registerApps";
1110  params.set<std::string>("library_path") = library_path;
1111  params.set<std::string>("library_name") = library_name;
1112 
1113  dynamicRegistration(params);
1114 
1115  // At this point the application should be registered so check it
1116  if (!AppFactory::instance().isRegistered(app_name))
1117  {
1118  std::ostringstream oss;
1119  std::set<std::string> paths = getLoadedLibraryPaths();
1120 
1121  oss << "Unable to locate library for \"" << app_name
1122  << "\".\nWe attempted to locate the library \"" << appNameToLibName(app_name)
1123  << "\" in the following paths:\n\t";
1124  std::copy(paths.begin(), paths.end(), infix_ostream_iterator<std::string>(oss, "\n\t"));
1125  oss << "\n\nMake sure you have compiled the library and either set the \"library_path\" "
1126  "variable "
1127  << "in your input file or exported \"MOOSE_LIBRARY_PATH\".\n"
1128  << "Compiled in debug mode to see the list of libraries checked for dynamic loading "
1129  "methods.";
1130  mooseError(oss.str());
1131  }
1132 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:1157
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:850
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:17
std::string appNameToLibName(const std::string &app_name) const
Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg)
Definition: MooseApp.C:1062
std::set< std::string > getLoadedLibraryPaths() const
Return the loaded library filenames in a std::vector.
Definition: MooseApp.C:1317

◆ dynamicRegistration()

void MooseApp::dynamicRegistration ( const Parameters &  params)
protected

Helper method for dynamic loading of objects.

Definition at line 1157 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

1158 {
1159  std::string library_name;
1160  // was library name provided by the user?
1161  if (params.get<std::string>("library_name").empty())
1162  library_name = appNameToLibName(params.get<std::string>("app_name"));
1163  else
1164  library_name = params.get<std::string>("library_name");
1165 
1166  // Create a vector of paths that we can search inside for libraries
1167  std::vector<std::string> paths;
1168 
1169  std::string library_path = params.get<std::string>("library_path");
1170 
1171  if (library_path != "")
1172  MooseUtils::tokenize(library_path, paths, 1, ":");
1173 
1174  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
1175  if (moose_lib_path_env)
1176  {
1177  std::string moose_lib_path(moose_lib_path_env);
1178  std::vector<std::string> tmp_paths;
1179 
1180  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
1181 
1182  // merge the two vectors together (all possible search paths)
1183  paths.insert(paths.end(), tmp_paths.begin(), tmp_paths.end());
1184  }
1185 
1186  // Attempt to dynamically load the library
1187  for (const auto & path : paths)
1188  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
1189  loadLibraryAndDependencies(path + '/' + library_name, params);
1190  else
1191  mooseWarning("Unable to open library file \"",
1192  path + '/' + library_name,
1193  "\". Double check for spelling errors.");
1194 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:377
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
void loadLibraryAndDependencies(const std::string &library_filename, const Parameters &params)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:1197
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:145
std::string appNameToLibName(const std::string &app_name) const
Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg)
Definition: MooseApp.C:1062

◆ errorCheck()

void MooseApp::errorCheck ( )
protected

Runs post-initialization error checking that cannot be run correctly unless the simulation has been fully set up and initialized.

Definition at line 814 of file MooseApp.C.

Referenced by executeExecutioner(), and run().

815 {
816  bool warn = _enable_unused_check == WARN_UNUSED;
817  bool err = _enable_unused_check == ERROR_UNUSED;
818 
819  _parser.errorCheck(*_comm, warn, err);
820 
821  auto apps = _executioner->feProblem().getMultiAppWarehouse().getObjects();
822  for (auto app : apps)
823  for (unsigned int i = 0; i < app->numLocalApps(); i++)
824  app->localApp(i)->errorCheck();
825 }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:747
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
enum MooseApp::UNUSED_CHECK _enable_unused_check
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:702
void errorCheck(const Parallel::Communicator &comm, bool warn_unused, bool err_unused)
Definition: Parser.C:590

◆ executeExecutioner()

void MooseApp::executeExecutioner ( )
virtual

Execute the Executioner that was built.

Definition at line 828 of file MooseApp.C.

Referenced by run().

829 {
830  TIME_SECTION(_execute_executioner_timer);
831 
832  // If ready to exit has been set, then just return
833  if (_ready_to_exit)
834  return;
835 
836  // run the simulation
837  if (_executioner)
838  {
839 #ifdef LIBMESH_HAVE_PETSC
841 #endif
842 
843  _executioner->init();
844  errorCheck();
845  _executioner->execute();
846  }
847  else
848  mooseError("No executioner was specified (go fix your input file)");
849 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:729
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
PerfID _execute_executioner_timer
Definition: MooseApp.h:887
PetscErrorCode petscSetupOutput(CommandLine *cmd_line)
Definition: PetscSupport.C:263
bool _ready_to_exit
Definition: MooseApp.h:773
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:814

◆ executeMeshGenerators()

void MooseApp::executeMeshGenerators ( )

Execute and clear the Mesh Generators data structure.

Definition at line 1461 of file MooseApp.C.

Referenced by ExecuteMeshGenerators::act().

1462 {
1463  if (!_mesh_generators.empty())
1464  {
1465  TIME_SECTION(_execute_mesh_generators_timer);
1466 
1468 
1469  // Add all of the dependencies into the resolver and sort them
1470  for (const auto & it : _mesh_generators)
1471  {
1472  // Make sure an item with no dependencies comes out too!
1473  resolver.addItem(it.second);
1474 
1475  std::vector<std::string> & generators = it.second->getDependencies();
1476  for (const auto & depend_name : generators)
1477  {
1478  auto depend_it = _mesh_generators.find(depend_name);
1479 
1480  if (depend_it == _mesh_generators.end())
1481  mooseError("The MeshGenerator \"",
1482  depend_name,
1483  "\" was not created, did you make a "
1484  "spelling mistake or forget to include it "
1485  "in your input file?");
1486 
1487  resolver.insertDependency(it.second, depend_it->second);
1488  }
1489  }
1490 
1491  const auto & ordered_generators = resolver.getSortedValues();
1492 
1493  if (ordered_generators.size())
1494  {
1495  // Run the MeshGenerators in the proper order
1496  for (const auto & generator : ordered_generators)
1497  {
1498  auto name = generator->name();
1499 
1500  _final_generated_mesh = generator->generate();
1501 
1502  // Now we need to possibly give this mesh to downstream generators
1503  auto & outputs = _mesh_generator_outputs[name];
1504 
1505  if (outputs.size())
1506  {
1507  auto & first_output = *outputs.begin();
1508 
1509  first_output = std::move(_final_generated_mesh);
1510 
1511  const auto & copy_from = *first_output;
1512 
1513  auto output_it = ++outputs.begin();
1514 
1515  // For all of the rest we need to make a copy
1516  for (; output_it != outputs.end(); ++output_it)
1517  {
1518  (*output_it) = copy_from.clone();
1519 
1520  (*output_it)->get_boundary_info() = copy_from.get_boundary_info();
1521 
1522  (*output_it)->set_subdomain_name_map() = copy_from.get_subdomain_name_map();
1523 
1524  // Get references to BoundaryInfo objects to make the code below cleaner...
1525  const BoundaryInfo & first_boundary_info = copy_from.get_boundary_info();
1526  BoundaryInfo & boundary_info = (*output_it)->get_boundary_info();
1527 
1528  // Use the first BoundaryInfo object to build the list of side boundary ids
1529  std::vector<boundary_id_type> side_boundaries;
1530  first_boundary_info.build_side_boundary_ids(side_boundaries);
1531 
1532  // Assign those boundary ids in our BoundaryInfo object
1533  for (const auto & side_bnd_id : side_boundaries)
1534  boundary_info.sideset_name(side_bnd_id) =
1535  first_boundary_info.get_sideset_name(side_bnd_id);
1536 
1537  // Do the same thing for node boundary ids
1538  std::vector<boundary_id_type> node_boundaries;
1539  first_boundary_info.build_node_boundary_ids(node_boundaries);
1540 
1541  for (const auto & node_bnd_id : node_boundaries)
1542  boundary_info.nodeset_name(node_bnd_id) =
1543  first_boundary_info.get_nodeset_name(node_bnd_id);
1544  }
1545  }
1546  }
1547  }
1548 
1549  // Prepare the final mesh
1550  _final_generated_mesh->prepare_for_use();
1551  }
1552 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
PerfID _execute_mesh_generators_timer
Definition: MooseApp.h:891
const std::vector< T > & getSortedValues()
This function also returns dependency resolved values but with a simpler single vector interface...
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:868
std::map< std::string, std::list< std::unique_ptr< MeshBase > > > _mesh_generator_outputs
Holds the output for each mesh generator - including duplicates needed downstream.
Definition: MooseApp.h:871
std::unique_ptr< MeshBase > _final_generated_mesh
The final Mesh that is generated by the generators.
Definition: MooseApp.h:874
void addItem(const T &value)
Add an independent item to the set.
void insertDependency(const T &key, const T &value)
Insert a dependency pair - the first value or the "key" depends on the second value or the "value"...

◆ executeMeshModifiers()

void MooseApp::executeMeshModifiers ( )

Execute and clear the Mesh Modifiers data structure.

Set preparation flag after modifers are run. The final preparation will be handled by the SetupMeshComplete Action.

Definition at line 1366 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::act().

1367 {
1368  if (!_mesh_modifiers.empty())
1369  {
1370  TIME_SECTION(_execute_mesh_modifiers_timer);
1371 
1373 
1374  // Add all of the dependencies into the resolver and sort them
1375  for (const auto & it : _mesh_modifiers)
1376  {
1377  // Make sure an item with no dependencies comes out too!
1378  resolver.addItem(it.second);
1379 
1380  std::vector<std::string> & modifiers = it.second->getDependencies();
1381  for (const auto & depend_name : modifiers)
1382  {
1383  auto depend_it = _mesh_modifiers.find(depend_name);
1384 
1385  if (depend_it == _mesh_modifiers.end())
1386  mooseError("The MeshModifier \"",
1387  depend_name,
1388  "\" was not created, did you make a "
1389  "spelling mistake or forget to include it "
1390  "in your input file?");
1391 
1392  resolver.insertDependency(it.second, depend_it->second);
1393  }
1394  }
1395 
1396  const auto & ordered_modifiers = resolver.getSortedValues();
1397 
1398  if (ordered_modifiers.size())
1399  {
1400  MooseMesh * mesh = _action_warehouse.mesh().get();
1401  MooseMesh * displaced_mesh = _action_warehouse.displacedMesh().get();
1402 
1403  // Run the MeshModifiers in the proper order
1404  for (const auto & modifier : ordered_modifiers)
1405  modifier->modifyMesh(mesh, displaced_mesh);
1406 
1411  mesh->prepared(false);
1412  if (displaced_mesh)
1413  displaced_mesh->prepared(false);
1414  }
1415  }
1416 }
bool prepared() const
Setter/getter for the _is_prepared flag.
Definition: MooseMesh.C:2243
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::shared_ptr< MooseMesh > & displacedMesh()
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
const std::vector< T > & getSortedValues()
This function also returns dependency resolved values but with a simpler single vector interface...
std::shared_ptr< MooseMesh > & mesh()
PerfID _execute_mesh_modifiers_timer
Definition: MooseApp.h:890
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:72
void addItem(const T &value)
Add an independent item to the set.
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:865
void insertDependency(const T &key, const T &value)
Insert a dependency pair - the first value or the "key" depends on the second value or the "value"...

◆ executioner()

std::shared_ptr<Executioner>& MooseApp::executioner ( )
inline

Retrieve the Executioner for this App.

Definition at line 253 of file MooseApp.h.

Referenced by setExecutioner().

254  {
255  mooseDeprecated("executioner() is deprecated. Use getExecutioner(), this interface will be "
256  "removed after 10/01/2018");
257 
258  return _executioner;
259  }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237

◆ getActionFactory()

ActionFactory& MooseApp::getActionFactory ( )
inline

Retrieve the ActionFactory associated with this App.

Definition at line 286 of file MooseApp.h.

286 { return _action_factory; }
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:741

◆ getCheckpointDirectories()

std::list< std::string > MooseApp::getCheckpointDirectories ( ) const

Get all checkpoint directories.

Returns
A Set of checkpoint directories

Definition at line 985 of file MooseApp.C.

Referenced by getCheckpointFiles().

986 {
987  // Storage for the directory names
988  std::list<std::string> checkpoint_dirs;
989 
990  // Extract the CommonOutputAction
991  const auto & common_actions = _action_warehouse.getActionListByName("common_output");
992  mooseAssert(common_actions.size() == 1, "Should be only one common_output Action");
993 
994  const Action * common = *common_actions.begin();
995 
996  // If file_base is set in CommonOutputAction, add this file to the list of potential checkpoint
997  // files
998  if (common->isParamValid("file_base"))
999  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
1000  // Case for normal application or master in a Multiapp setting
1001  else if (getOutputFileBase().empty())
1002  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, "_out_cp"));
1003  // Case for a sub app in a Multiapp setting
1004  else
1005  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
1006 
1007  // Add the directories from any existing checkpoint objects
1008  const auto & actions = _action_warehouse.getActionListByName("add_output");
1009  for (const auto & action : actions)
1010  {
1011  // Get the parameters from the MooseObjectAction
1012  MooseObjectAction * moose_object_action = dynamic_cast<MooseObjectAction *>(action);
1013  if (!moose_object_action)
1014  continue;
1015 
1016  const InputParameters & params = moose_object_action->getObjectParams();
1017 
1018  // Loop through the actions and add the necessary directories to the list to check
1019  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
1020  {
1021  if (params.isParamValid("file_base"))
1022  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
1023  else
1024  {
1025  std::ostringstream oss;
1026  oss << "_" << action->name() << "_cp";
1027  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, oss.str()));
1028  }
1029  }
1030  }
1031 
1032  return checkpoint_dirs;
1033 }
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: Action.h:211
static std::string getOutputFileBase(const MooseApp &app, std::string suffix="_out")
Returns the default output file base.
Definition: FileOutput.C:111
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string getOutputFileBase() const
Override the selection of the output file base name.
Definition: MooseApp.C:783
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
Base class for actions.
Definition: Action.h:36
InputParameters & getObjectParams()
Retreive the parameters of the object to be created by this action.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ getCheckpointFiles()

std::list< std::string > MooseApp::getCheckpointFiles ( ) const

Extract all possible checkpoint file names.

Returns
A Set of checkpoint filenames

Definition at line 1036 of file MooseApp.C.

Referenced by setRecoverFileBase().

1037 {
1038  auto checkpoint_dirs = getCheckpointDirectories();
1039  return MooseUtils::getFilesInDirs(checkpoint_dirs);
1040 }
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:985
std::list< std::string > getFilesInDirs(const std::list< std::string > &directory_list)
Retrieves the names of all of the files contained within the list of directories passed into the rout...
Definition: MooseUtils.C:542

◆ getDistributedMeshOnCommandLine()

bool MooseApp::getDistributedMeshOnCommandLine ( ) const
inline

Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibility) on the command line and false otherwise.

Definition at line 316 of file MooseApp.h.

Referenced by getParallelMeshOnCommandLine(), and MooseMesh::MooseMesh().

bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:779

◆ getExecuteOnEnum()

const ExecFlagEnum& MooseApp::getExecuteOnEnum ( ) const
inline

Return the app level ExecFlagEnum, this contains all the available flags for the app.

Definition at line 647 of file MooseApp.h.

Referenced by EigenExecutionerBase::normalizeSolution().

647 { return _execute_flags; }
ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:880

◆ getExecutioner()

Executioner* MooseApp::getExecutioner ( ) const
inline

◆ getFactory()

Factory& MooseApp::getFactory ( )
inline

◆ getFileName()

std::string MooseApp::getFileName ( bool  stripLeadingPath = true) const

Return the filename that was parsed.

Definition at line 1050 of file MooseApp.C.

Referenced by MultiApp::createApp(), and FileOutput::getOutputFileBase().

1051 {
1052  return _parser.getFileName(stripLeadingPath);
1053 }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:747
std::string getFileName(bool stripLeadingPath=true) const
Return the filename that was parsed.
Definition: Parser.C:289

◆ getFPTrapFlag()

bool MooseApp::getFPTrapFlag ( ) const
inline

Returns whether FPE trapping is turned on (either because of debug or user requested)

Definition at line 614 of file MooseApp.h.

614 { return _trap_fpe; }
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:794

◆ getFrameworkVersion()

std::string MooseApp::getFrameworkVersion ( ) const

Returns the framework version.

Definition at line 423 of file MooseApp.C.

424 {
425  return MOOSE_VERSION;
426 }

◆ getGlobalTimeOffset()

Real MooseApp::getGlobalTimeOffset ( ) const
inline

Each App has it's own local time.

The "global" time of the whole problem might be different. This offset is how far off the local App time is from the global time.

Definition at line 222 of file MooseApp.h.

Referenced by MultiApp::initialSetup(), Tecplot::output(), Nemesis::output(), Exodus::outputEmptyTimestep(), Exodus::outputNodalVariables(), and TransientMultiApp::solveStep().

222 { return _global_time_offset; }
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:726

◆ getInputFileName()

std::string MooseApp::getInputFileName ( ) const
inline

Returns the input file name that was set with setInputFileName.

Definition at line 153 of file MooseApp.h.

Referenced by FileOutput::getOutputFileBase(), and Console::outputInput().

153 { return _input_filename; }
std::string _input_filename
Input file name used.
Definition: MooseApp.h:708

◆ getInputParameterWarehouse()

InputParameterWarehouse & MooseApp::getInputParameterWarehouse ( )

Get the InputParameterWarehouse for MooseObjects.

Definition at line 1328 of file MooseApp.C.

Referenced by FEProblemBase::addMaterialHelper(), Factory::create(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), and Factory::releaseSharedObjects().

1329 {
1331 }
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:738

◆ getLoadedLibraryPaths()

std::set< std::string > MooseApp::getLoadedLibraryPaths ( ) const

Return the loaded library filenames in a std::vector.

Definition at line 1317 of file MooseApp.C.

Referenced by dynamicAppRegistration(), and Factory::reportUnregisteredError().

1318 {
1319  // Return the paths but not the open file handles
1320  std::set<std::string> paths;
1321  for (const auto & it : _lib_handles)
1322  paths.insert(it.first.first);
1323 
1324  return paths;
1325 }
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:814

◆ getMeshGenerator()

const MeshGenerator & MooseApp::getMeshGenerator ( const std::string &  name) const

Get a mesh generator with its name.

Definition at line 1436 of file MooseApp.C.

1437 {
1438  return *_mesh_generators.find(MooseUtils::shortName(name))->second.get();
1439 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:868

◆ getMeshGeneratorMesh()

std::unique_ptr<MeshBase> MooseApp::getMeshGeneratorMesh ( )
inline

Get the generated mesh generated by executeMeshGenerators();.

Definition at line 599 of file MooseApp.h.

Referenced by MeshGeneratorMesh::buildMesh().

599 { return std::move(_final_generated_mesh); }
std::unique_ptr< MeshBase > _final_generated_mesh
The final Mesh that is generated by the generators.
Definition: MooseApp.h:874

◆ getMeshGeneratorNames()

std::vector< std::string > MooseApp::getMeshGeneratorNames ( ) const

Get names of all mesh generators Note: This function should be called after all mesh generators are added with the 'add_mesh_generator' task.

The returned value will be undefined and depends on the ordering that mesh generators are added by MOOSE if the function is called during the 'add_mesh_generator' task.

Definition at line 1442 of file MooseApp.C.

1443 {
1444  std::vector<std::string> names;
1445  for (auto & pair : _mesh_generators)
1446  names.push_back(pair.first);
1447  return names;
1448 }
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:868

◆ getMeshGeneratorOutput()

std::unique_ptr< MeshBase > & MooseApp::getMeshGeneratorOutput ( const std::string &  name)

Get a refernce to a pointer that will be the output of the MeshGenerator named name.

Definition at line 1451 of file MooseApp.C.

Referenced by MeshGenerator::getMesh(), and MeshGenerator::getMeshByName().

1452 {
1453  auto & outputs = _mesh_generator_outputs[name];
1454 
1455  outputs.push_back(nullptr);
1456 
1457  return outputs.back();
1458 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::map< std::string, std::list< std::unique_ptr< MeshBase > > > _mesh_generator_outputs
Holds the output for each mesh generator - including duplicates needed downstream.
Definition: MooseApp.h:871

◆ getMeshModifier()

const MeshModifier & MooseApp::getMeshModifier ( const std::string &  name) const

Get a mesh modifier with its name.

Definition at line 1351 of file MooseApp.C.

1352 {
1353  return *_mesh_modifiers.find(MooseUtils::shortName(name))->second.get();
1354 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:865

◆ getMeshModifierNames()

std::vector< std::string > MooseApp::getMeshModifierNames ( ) const

Get names of all mesh modifiers Note: This function should be called after all mesh modifiers are added with the 'add_mesh_modifier' task.

The returned value will be undefined and depends on the ordering that mesh modifiers are added by MOOSE if the function is called during the 'add_mesh_modifier' task.

Definition at line 1357 of file MooseApp.C.

1358 {
1359  std::vector<std::string> names;
1360  for (auto & pair : _mesh_modifiers)
1361  names.push_back(pair.first);
1362  return names;
1363 }
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:865

◆ getOutputFileBase()

std::string MooseApp::getOutputFileBase ( ) const

Override the selection of the output file base name.

Definition at line 783 of file MooseApp.C.

Referenced by MultiApp::createApp(), getCheckpointDirectories(), and FileOutput::getOutputFileBase().

784 {
785  return _output_file_base;
786 }
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:711

◆ getOutputFileNumbers()

std::map<std::string, unsigned int>& MooseApp::getOutputFileNumbers ( )
inline

Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propogate down through the multiapps.

See also
MultiApp TransientMultiApp

Definition at line 405 of file MooseApp.h.

Referenced by TransientMultiApp::setupApp().

405 { return _output_file_numbers; }
std::map< std::string, unsigned int > _output_file_numbers
Map of outputer name and file number (used by MultiApps to propagate file numbers down through the mu...
Definition: MooseApp.h:806

◆ getOutputPosition()

Point MooseApp::getOutputPosition ( ) const
inline

Get the output position.

Returns
The position offset for the output.

Definition at line 192 of file MooseApp.h.

Referenced by MultiApp::createApp(), Exodus::output(), and MultiApp::parentOutputPositionChanged().

192 { return _output_position; }
Point _output_position
The output position.
Definition: MooseApp.h:717

◆ getOutputWarehouse()

OutputWarehouse & MooseApp::getOutputWarehouse ( )

◆ getParallelMeshOnCommandLine()

bool MooseApp::getParallelMeshOnCommandLine ( ) const
inline

Deprecated.

Call getDistributedMeshOnCommandLine() instead.

Definition at line 321 of file MooseApp.h.

322  {
323  mooseDeprecated("getParallelMeshOnCommandLine() is deprecated, call "
324  "getDistributedMeshOnCommandLine() instead.");
326  }
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:316
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237

◆ getParam() [1/2]

template<typename T >
const T & MooseApp::getParam ( const std::string &  name)

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 903 of file MooseApp.h.

Referenced by CommonOutputAction::act(), FEProblemBase::addOutput(), Console::Console(), MooseApp(), PerfGraphOutput::output(), and SetupMeshAction::setupMesh().

904 {
905  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
906 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696

◆ getParam() [2/2]

template<typename T >
const T & MooseApp::getParam ( const std::string &  name) const

Definition at line 910 of file MooseApp.h.

911 {
912  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
913 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696

◆ getPrintableName()

virtual std::string MooseApp::getPrintableName ( ) const
inlinevirtual

Get printable name of the application.

Definition at line 79 of file MooseApp.h.

Referenced by getPrintableVersion().

79 { return "Application"; }

◆ getPrintableVersion()

std::string MooseApp::getPrintableVersion ( ) const

Non-virtual method for printing out the version string in a consistent format.

Definition at line 435 of file MooseApp.C.

Referenced by setupOptions().

436 {
437  return getPrintableName() + " Version: " + getVersion();
438 }
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:79
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:429

◆ getRecoverableData()

std::set<std::string>& MooseApp::getRecoverableData ( )
inline

Return a reference to the recoverable data object.

Returns
A const reference to the recoverable data

Definition at line 485 of file MooseApp.h.

Referenced by Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

485 { return _recoverable_data; }
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:847

◆ getRecoverFileBase()

std::string MooseApp::getRecoverFileBase ( )
inline

The file_base for the recovery file.

Definition at line 356 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act(), MooseMesh::init(), and FEProblemBase::initialSetup().

356 { return _recover_base; }
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:797

◆ getRecoverFileSuffix()

std::string MooseApp::getRecoverFileSuffix ( )
inline

The suffix for the recovery file.

Definition at line 372 of file MooseApp.h.

Referenced by MooseMesh::init(), FEProblemBase::initialSetup(), and FEProblemBase::setRestartFile().

372 { return _recover_suffix; }
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:800

◆ getRelationshipManagerInfo()

std::vector< std::pair< std::string, std::string > > MooseApp::getRelationshipManagerInfo ( ) const

Returns the Relationship managers info suitable for printing.

Definition at line 1733 of file MooseApp.C.

Referenced by ConsoleUtils::outputRelationshipManagerInformation().

1734 {
1735  std::vector<std::pair<std::string, std::string>> info_strings;
1736  info_strings.reserve(_relationship_managers.size());
1737 
1738  for (const auto & rm : _relationship_managers)
1739  {
1740  auto info = rm->getInfo();
1741  if (info.size())
1742  info_strings.emplace_back(std::make_pair(Moose::stringify(rm->getType()), info));
1743  }
1744 
1745  return info_strings;
1746 }
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:58
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:811

◆ getRestartableData()

const RestartableDatas& MooseApp::getRestartableData ( )
inline

Return reference to the restatable data object.

Returns
A const reference to the restatable data object

Definition at line 479 of file MooseApp.h.

Referenced by RestartableDataIO::createBackup(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

479 { return _restartable_data; }
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:844

◆ getStartTime()

Real MooseApp::getStartTime ( ) const
inline
Returns
The start time

Definition at line 210 of file MooseApp.h.

Referenced by Transient::Transient().

210 { return _start_time; }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:723

◆ getSystemInfo()

const SystemInfo* MooseApp::getSystemInfo ( ) const
inline

Get SystemInfo object.

Returns
A pointer to the SystemInformation object

Definition at line 421 of file MooseApp.h.

Referenced by ConsoleUtils::outputFrameworkInformation(), and ExodusFormatter::printInputFile().

421 { return _sys_info.get(); }
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:759

◆ getVersion()

std::string MooseApp::getVersion ( ) const
virtual

Returns the current version of the framework or application (default: framework version).

Definition at line 429 of file MooseApp.C.

Referenced by getPrintableVersion().

430 {
431  return MOOSE_VERSION;
432 }

◆ halfTransient()

bool MooseApp::halfTransient ( )
inline

Whether or not this simulation should only run half its transient (useful for testing recovery)

Definition at line 383 of file MooseApp.h.

Referenced by TimeStepper::constrainStep(), Transient::execute(), TimeSequenceStepperBase::setupSequence(), and Transient::Transient().

383 { return _half_transient; }
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:803

◆ hasCachedBackup()

bool MooseApp::hasCachedBackup ( )
inlineprotected

Whether or not this MooseApp has cached a Backup to use for restart / recovery.

Definition at line 653 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup().

653 { return _cached_backup.get(); }
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:877

◆ hasOutputPosition()

bool MooseApp::hasOutputPosition ( ) const
inline

Whether or not an output position has been set.

Returns
True if it has

Definition at line 186 of file MooseApp.h.

Referenced by Exodus::output().

186 { return _output_position_set; }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:714

◆ hasOutputWarehouse()

bool MooseApp::hasOutputWarehouse ( )
inline

Return true if the output position has been set.

Definition at line 410 of file MooseApp.h.

410 { return _output_position_set; }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:714

◆ hasRecoverFileBase()

bool MooseApp::hasRecoverFileBase ( )

Return true if the recovery file base is set.

Definition at line 876 of file MooseApp.C.

877 {
878  return !_recover_base.empty();
879 }
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:797

◆ hasRelationshipManager()

bool MooseApp::hasRelationshipManager ( const std::string &  name) const

Returns a Boolean indicating whether a RelationshipManater exists with the same name.

Definition at line 1698 of file MooseApp.C.

Referenced by MooseADObjectAction::addRelationshipManagers(), and MooseObjectAction::addRelationshipManagers().

1699 {
1700  return std::find_if(_relationship_managers.begin(),
1701  _relationship_managers.end(),
1702  [&name](const std::shared_ptr<RelationshipManager> & rm) {
1703  return rm->name() == name;
1704  }) != _relationship_managers.end();
1705 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:811

◆ hasStartTime()

bool MooseApp::hasStartTime ( ) const
inline
Returns
Whether or not a start time has been programmatically set using setStartTime()

Definition at line 205 of file MooseApp.h.

Referenced by Transient::Transient().

205 { return _start_time_set; }
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:720

◆ header()

std::string MooseApp::header ( ) const
virtual

Returns a string to be printed at the beginning of a simulation.

Definition at line 1334 of file MooseApp.C.

Referenced by setupOptions().

1335 {
1336  return std::string("");
1337 }

◆ isParamValid()

bool MooseApp::isParamValid ( const std::string &  name) const
inline

Definition at line 112 of file MooseApp.h.

Referenced by MooseApp(), runInputFile(), and setupOptions().

112 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ isRecovering()

bool MooseApp::isRecovering ( ) const

◆ isRestarting()

bool MooseApp::isRestarting ( ) const

Whether or not this is a "restart" calculation.

Definition at line 858 of file MooseApp.C.

Referenced by MultiApp::createApp(), FileOutput::FileOutput(), Transient::init(), FEProblemBase::initialSetup(), InversePowerMethod::InversePowerMethod(), NonlinearEigen::NonlinearEigen(), restoreCachedBackup(), and TimeSequenceStepperBase::setupSequence().

859 {
860  return _restart;
861 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:785

◆ isSplitMesh()

bool MooseApp::isSplitMesh ( ) const

Whether or not this is a split mesh operation.

Definition at line 864 of file MooseApp.C.

Referenced by RelationshipManager::attachRelationshipManagers(), ElementSideNeighborLayers::attachRelationshipManagersInternal(), ElementPointNeighbors::attachRelationshipManagersInternal(), and MooseMesh::init().

865 {
866  return _split_mesh;
867 }
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:788

◆ isUltimateMaster()

bool MooseApp::isUltimateMaster ( )
inline

Whether or not this app is the ultimate master app.

(ie level == 0)

Definition at line 526 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act(), callMooseErrorRaw(), MooseMesh::init(), FEProblemBase::initialSetup(), and setupOptions().

526 { return !_multiapp_level; }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:859

◆ isUseSplit()

bool MooseApp::isUseSplit ( ) const

Whether or not we are running with pre-split (distributed mesh)

Definition at line 870 of file MooseApp.C.

Referenced by AdaptivityAction::act(), SetupMeshAction::act(), SetupMeshCompleteAction::act(), MooseMesh::MooseMesh(), and ConsoleUtils::outputMeshInformation().

871 {
872  return _use_split;
873 }
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:791

◆ libNameToAppName()

std::string MooseApp::libNameToAppName ( const std::string &  library_name) const

Converts a library name to an application name:

Definition at line 1078 of file MooseApp.C.

1079 {
1080  std::string app_name(library_name);
1081 
1082  // Strip off the leading "lib" and trailing ".la"
1083  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
1084  mooseError("Invalid library name: ", app_name);
1085 
1086  return MooseUtils::underscoreToCamelCase(app_name, true);
1087 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::string underscoreToCamelCase(const std::string &underscore_name, bool leading_upper_case)
Function for converting an underscore name to a camel case name.
Definition: MooseUtils.C:328

◆ loadLibraryAndDependencies()

void MooseApp::loadLibraryAndDependencies ( const std::string &  library_filename,
const Parameters &  params 
)
protected

Recursively loads libraries and dependencies in the proper order to fully register a MOOSE application that may have several dependencies.

REQUIRES: dynamic linking loader support.

Definition at line 1197 of file MooseApp.C.

Referenced by dynamicRegistration().

1199 {
1200  std::string line;
1201  std::string dl_lib_filename;
1202 
1203  // This RE looks for absolute path libtool filenames (i.e. begins with a slash and ends with a
1204  // .la)
1205  pcrecpp::RE re_deps("(/\\S*\\.la)");
1206 
1207  std::ifstream handle(library_filename.c_str());
1208  if (handle.is_open())
1209  {
1210  while (std::getline(handle, line))
1211  {
1212  // Look for the system dependent dynamic library filename to open
1213  if (line.find("dlname=") != std::string::npos)
1214  // Magic numbers are computed from length of this string "dlname=' and line minus that
1215  // string plus quotes"
1216  dl_lib_filename = line.substr(8, line.size() - 9);
1217 
1218  if (line.find("dependency_libs=") != std::string::npos)
1219  {
1220  pcrecpp::StringPiece input(line);
1221  pcrecpp::StringPiece depend_library;
1222  while (re_deps.FindAndConsume(&input, &depend_library))
1223  // Recurse here to load dependent libraries in depth-first order
1224  loadLibraryAndDependencies(depend_library.as_string(), params);
1225 
1226  // There's only one line in the .la file containing the dependency libs so break after
1227  // finding it
1228  break;
1229  }
1230  }
1231  handle.close();
1232  }
1233 
1234  std::string registration_method_name = params.get<std::string>("registration_method");
1235  // Time to load the library, First see if we've already loaded this particular dynamic library
1236  if (_lib_handles.find(std::make_pair(library_filename, registration_method_name)) ==
1237  _lib_handles.end() && // make sure we haven't already loaded this library
1238  dl_lib_filename != "") // AND make sure we have a library name (we won't for static linkage)
1239  {
1240  std::pair<std::string, std::string> lib_name_parts =
1241  MooseUtils::splitFileName(library_filename);
1242 
1243  // Assemble the actual filename using the base path of the *.la file and the dl_lib_filename
1244  std::string dl_lib_full_path = lib_name_parts.first + '/' + dl_lib_filename;
1245 
1246 #ifdef LIBMESH_HAVE_DLOPEN
1247  void * handle = dlopen(dl_lib_full_path.c_str(), RTLD_LAZY);
1248 #else
1249  void * handle = NULL;
1250 #endif
1251 
1252  if (!handle)
1253  mooseError("Cannot open library: ", dl_lib_full_path.c_str(), "\n");
1254 
1255 // get the pointer to the method in the library. The dlsym()
1256 // function returns a null pointer if the symbol cannot be found,
1257 // we also explicitly set the pointer to NULL if dlsym is not
1258 // available.
1259 #ifdef LIBMESH_HAVE_DLOPEN
1260  void * registration_method = dlsym(handle, registration_method_name.c_str());
1261 #else
1262  void * registration_method = NULL;
1263 #endif
1264 
1265  if (!registration_method)
1266  {
1267 // We found a dynamic library that doesn't have a dynamic
1268 // registration method in it. This shouldn't be an error, so
1269 // we'll just move on.
1270 #ifdef DEBUG
1271  mooseWarning("Unable to find extern \"C\" method \"",
1272  registration_method_name,
1273  "\" in library: ",
1274  dl_lib_full_path,
1275  ".\n",
1276  "This doesn't necessarily indicate an error condition unless you believe that "
1277  "the method should exist in that library.\n");
1278 #endif
1279 
1280 #ifdef LIBMESH_HAVE_DLOPEN
1281  dlclose(handle);
1282 #endif
1283  }
1284  else // registration_method is valid!
1285  {
1286  // TODO: Look into cleaning this up
1287  switch (params.get<RegistrationType>("reg_type"))
1288  {
1289  case APPLICATION:
1290  {
1291  typedef void (*register_app_t)();
1292  register_app_t * reg_ptr = reinterpret_cast<register_app_t *>(&registration_method);
1293  (*reg_ptr)();
1294  break;
1295  }
1296  case REGALL:
1297  {
1298  typedef void (*register_app_t)(Factory *, ActionFactory *, Syntax *);
1299  register_app_t * reg_ptr = reinterpret_cast<register_app_t *>(&registration_method);
1300  (*reg_ptr)(params.get<Factory *>("factory"),
1301  params.get<ActionFactory *>("action_factory"),
1302  params.get<Syntax *>("syntax"));
1303  break;
1304  }
1305  default:
1306  mooseError("Unhandled RegistrationType");
1307  }
1308 
1309  // Store the handle so we can close it later
1310  _lib_handles.insert(
1311  std::make_pair(std::make_pair(library_filename, registration_method_name), handle));
1312  }
1313  }
1314 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:154
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
void loadLibraryAndDependencies(const std::string &library_filename, const Parameters &params)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:1197
std::pair< std::string, std::string > splitFileName(std::string full_file)
Function for splitting path and filename.
Definition: MooseUtils.C:286
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:65
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:850
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:814
Holding syntax for parsing input files.
Definition: Syntax.h:21

◆ multiAppLevel()

unsigned int MooseApp::multiAppLevel ( ) const
inline

The MultiApp Level.

Returns
The current number of levels from the master app

Definition at line 515 of file MooseApp.h.

Referenced by FEProblemBase::checkNonlinearConvergence(), MultiApp::createApp(), Console::initialSetup(), OutputWarehouse::mooseConsole(), setupOptions(), and Console::write().

515 { return _multiapp_level; }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:859

◆ multiAppNumber()

unsigned int MooseApp::multiAppNumber ( ) const
inline

The MultiApp number.

Returns
The numbering in all the sub-apps on the same level

Definition at line 521 of file MooseApp.h.

521 { return _multiapp_number; }
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:862

◆ name()

const std::string& MooseApp::name ( ) const
inline

Get the name of the object.

In the case of MooseApp, the name of the object is NOT the name of the application. It's the name of the created application which is usually "main". If you have subapps, then each individual subapp will have a unique name which typically comes from the input file (e.g. sub0, sub1, etc...).

Returns
The name of the object

Definition at line 72 of file MooseApp.h.

Referenced by addMeshGenerator(), addMeshModifier(), callMooseErrorRaw(), FEProblemBase::checkNonlinearConvergence(), MultiApp::createApp(), executeMeshGenerators(), getMeshGenerator(), getMeshGeneratorOutput(), getMeshModifier(), getParam(), hasRelationshipManager(), Console::initialSetup(), isParamValid(), OutputWarehouse::mooseConsole(), Parser::parse(), registerRecoverableData(), registerRestartableData(), runInputFile(), setupOptions(), and Console::write().

72 { return _name; }
std::string _name
The name of this object.
Definition: MooseApp.h:693

◆ parameters()

InputParameters& MooseApp::parameters ( )
inline

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 85 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), SplitMeshAction::act(), SetupMeshAction::act(), addMeshGenerator(), addMeshModifier(), buildAction(), and MooseApp().

85 { return _pars; }
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696

◆ parser()

Parser& MooseApp::parser ( )
inline

Definition at line 141 of file MooseApp.h.

Referenced by MeshOnlyAction::act().

141 { return _parser; }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:747

◆ perfGraph()

PerfGraph& MooseApp::perfGraph ( )
inline

Get the PerfGraph for this app.

Definition at line 97 of file MooseApp.h.

Referenced by PerfGraphOutput::output().

97 { return _perf_graph; }
PerfGraph _perf_graph
The PerfGraph object for this applciation.
Definition: MooseApp.h:705

◆ processor_id()

processor_id_type MooseApp::processor_id ( )
inline

Definition at line 281 of file MooseApp.h.

Referenced by SetupMeshAction::act(), FileOutput::FileOutput(), and MooseApp().

281 { return cast_int<processor_id_type>(_comm->rank()); }
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:702

◆ registerRecoverableData()

void MooseApp::registerRecoverableData ( std::string  name)
protected

NOTE: This is an internal function meant for MOOSE use only!

Register a piece of recoverable data. This is data that will get written / read to / from a restart file.

However, this data will ONLY get read from the restart file during a RECOVERY operation!

Parameters
nameThe full (unique) name.

Definition at line 882 of file MooseApp.C.

Referenced by Restartable::registerRecoverableDataOnApp().

883 {
884  _recoverable_data.insert(name);
885 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:847

◆ registerRestartableData()

void MooseApp::registerRestartableData ( std::string  name,
std::unique_ptr< RestartableDataValue data,
THREAD_ID  tid 
)

Definition at line 1090 of file MooseApp.C.

Referenced by Restartable::registerRestartableDataOnApp().

1093 {
1094  auto & restartable_data = _restartable_data[tid];
1095  auto insert_pair = moose_try_emplace(restartable_data, name, std::move(data));
1096 
1097  if (!insert_pair.second)
1098  mooseError("Attempted to declare restartable twice with the same name: ", name);
1099 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:844
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::pair< typename M::iterator, bool > moose_try_emplace(M &m, const typename M::key_type &k, Args &&... args)
Function to mirror the behavior of the C++17 std::map::try_emplace() method (no hint).
Definition: Moose.h:65

◆ restore()

void MooseApp::restore ( std::shared_ptr< Backup backup,
bool  for_restart = false 
)
virtual

Restore a Backup.

This sets the App's state.

Parameters
backupThe Backup holding the data for the app
for_restartWhether this restoration is explicitly for the first restoration of restart data.

This method should be overridden in external or MOOSE-wrapped applications.

Definition at line 898 of file MooseApp.C.

Referenced by restoreCachedBackup().

899 {
900  TIME_SECTION(_restore_timer);
901 
902  // This means that a Backup is coming through to use for restart / recovery
903  // We should just cache it for now
904  if (!_executioner)
905  {
907  return;
908  }
909 
910  FEProblemBase & fe_problem = _executioner->feProblem();
911 
912  RestartableDataIO rdio(fe_problem);
913 
914  rdio.restoreBackup(backup, for_restart);
915 }
Class for doing restart.
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:877
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual std::shared_ptr< Backup > backup()
Create a Backup from the current App.
Definition: MooseApp.C:888
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
PerfID _restore_timer
Definition: MooseApp.h:888

◆ restoreCachedBackup()

void MooseApp::restoreCachedBackup ( )
protected

Restore from a cached backup.

Definition at line 1575 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1576 {
1577  if (!_cached_backup.get())
1578  mooseError("No cached Backup to restore!");
1579 
1580  TIME_SECTION(_restore_cached_backup_timer);
1581 
1583 
1584  // Release our hold on this Backup
1585  _cached_backup.reset();
1586 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:877
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:858
PerfID _restore_cached_backup_timer
Definition: MooseApp.h:892
virtual void restore(std::shared_ptr< Backup > backup, bool for_restart=false)
Restore a Backup.
Definition: MooseApp.C:898

◆ run()

void MooseApp::run ( )
virtual

Run the application.

Definition at line 945 of file MooseApp.C.

946 {
947  TIME_SECTION(_run_timer);
948 
949  try
950  {
951  TIME_SECTION(_setup_timer);
952  setupOptions();
953  runInputFile();
954  }
955  catch (std::exception & err)
956  {
957  mooseError(err.what());
958  }
959 
960  if (!_check_input)
961  {
962  TIME_SECTION(_execute_timer);
964  }
965  else
966  {
967  errorCheck();
968  // Output to stderr, so it is easier for peacock to get the result
969  Moose::err << "Syntax OK" << std::endl;
970  }
971 }
PerfID _run_timer
Definition: MooseApp.h:889
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:441
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
PerfID _execute_timer
Definition: MooseApp.h:886
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:809
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:828
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:789
PerfID _setup_timer
Timers.
Definition: MooseApp.h:883
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:814

◆ runInputFile()

void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 789 of file MooseApp.C.

Referenced by run().

790 {
791  TIME_SECTION(_run_input_file_timer);
792 
793  // If ready to exit has been set, then just return
794  if (_ready_to_exit)
795  return;
796 
798 
799  if (isParamValid("mesh_only") || isParamValid("split_mesh"))
800  _ready_to_exit = true;
801  else if (getParam<bool>("list_constructed_objects"))
802  {
803  // TODO: ask multiapps for their constructed objects
804  _ready_to_exit = true;
805  std::vector<std::string> obj_list = _factory.getConstructedObjects();
806  Moose::out << "**START OBJECT DATA**\n";
807  for (const auto & name : obj_list)
808  Moose::out << name << "\n";
809  Moose::out << "**END OBJECT DATA**\n" << std::endl;
810  }
811 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
PerfID _run_input_file_timer
Definition: MooseApp.h:885
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:112
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
std::vector< std::string > getConstructedObjects() const
Get a list of all constructed Moose Object types.
Definition: Factory.C:277
Factory _factory
Definition: MooseApp.h:769
void executeAllActions()
This method loops over all actions in the warehouse and executes them.
bool _ready_to_exit
Definition: MooseApp.h:773

◆ setCheckUnusedFlag()

void MooseApp::setCheckUnusedFlag ( bool  warn_is_error = false)

Set a flag so that the parser will either warn or error when unused variables are seen after parsing is complete.

_enable_unused_check is initialized to WARN_UNUSED. If an application chooses to promote this value to ERROR_UNUSED programmatically prior to running the simulation, we certainly don't want to allow it to fall back. Therefore, we won't set it if it's already at the highest value (i.e. error). If however a developer turns it off, it can still be turned on.

Definition at line 918 of file MooseApp.C.

Referenced by setupOptions().

919 {
926  if (_enable_unused_check != ERROR_UNUSED || warn_is_error)
927  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
928  else
929  mooseInfo("Ignoring request to turn off or warn about unused parameters.\n");
930 }
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
Definition: MooseError.h:253
enum MooseApp::UNUSED_CHECK _enable_unused_check

◆ setErrorOverridden()

void MooseApp::setErrorOverridden ( )

Set a flag so that the parser will throw an error if overridden parameters are detected.

Definition at line 939 of file MooseApp.C.

Referenced by setupOptions().

940 {
941  _error_overridden = true;
942 }
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:772

◆ setExecutioner()

void MooseApp::setExecutioner ( std::shared_ptr< Executioner > &&  executioner)
inline

Set the Executioner for this App.

Definition at line 264 of file MooseApp.h.

Referenced by CreateExecutionerAction::act().

std::shared_ptr< Executioner > & executioner()
Retrieve the Executioner for this App.
Definition: MooseApp.h:253
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750

◆ setFileRestart()

bool& MooseApp::setFileRestart ( )
inline

This method is here so we can determine whether or not we need to use a separate reader to read the mesh BEFORE we create the mesh.

Definition at line 299 of file MooseApp.h.

Referenced by CopyNodalVarsAction::act(), SetupMeshCompleteAction::act(), FileMesh::buildMesh(), and FEProblemBase::initialSetup().

299 { return _initial_from_file; }
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:776

◆ setGlobalTimeOffset()

void MooseApp::setGlobalTimeOffset ( const Real  offset)
inline

Each App has it's own local time.

The "global" time of the whole problem might be different. This offset is how far off the local App time is from the global time.

Definition at line 216 of file MooseApp.h.

216 { _global_time_offset = offset; }
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:726

◆ setInputFileName()

void MooseApp::setInputFileName ( std::string  input_file_name)

Set the input file name.

Definition at line 777 of file MooseApp.C.

778 {
779  _input_filename = input_filename;
780 }
std::string _input_filename
Input file name used.
Definition: MooseApp.h:708

◆ setOutputFileBase()

void MooseApp::setOutputFileBase ( std::string  output_file_base)
inline

Override the selection of the output file base name.

Definition at line 158 of file MooseApp.h.

158 { _output_file_base = output_file_base; }
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:711

◆ setOutputFileNumbers()

void MooseApp::setOutputFileNumbers ( std::map< std::string, unsigned int >  numbers)
inline

Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propagate down through the Multiapps.

Parameters
numbersMap of outputter names and file numbers
See also
MultiApp TransientMultiApp OutputWarehouse

Definition at line 393 of file MooseApp.h.

394  {
395  _output_file_numbers = numbers;
396  }
std::map< std::string, unsigned int > _output_file_numbers
Map of outputer name and file number (used by MultiApps to propagate file numbers down through the mu...
Definition: MooseApp.h:806

◆ setOutputPosition()

void MooseApp::setOutputPosition ( Point  p)

Tell the app to output in a specific position.

Definition at line 974 of file MooseApp.C.

975 {
976  _output_position_set = true;
977  _output_position = p;
979 
980  if (_executioner.get() != NULL)
981  _executioner->parentOutputPositionChanged();
982 }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:714
void meshChanged()
Calls the meshChanged method for every output object.
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:750
Point _output_position
The output position.
Definition: MooseApp.h:717
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:735

◆ setRecover()

void MooseApp::setRecover ( const bool &  value)

Definition at line 1569 of file MooseApp.C.

1570 {
1571  _recover = value;
1572 }
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:782

◆ setRecoverFileBase()

void MooseApp::setRecoverFileBase ( std::string  recover_base)
inline

mutator for recover_base (set by RecoverBaseAction)

Definition at line 361 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act().

362  {
363  if (recover_base.empty())
365  else
366  _recover_base = recover_base;
367  }
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:1036
std::string getLatestAppCheckpointFileBase(const std::list< std::string > &checkpoint_files)
Definition: MooseUtils.C:561
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:797

◆ setRecoverFileSuffix()

void MooseApp::setRecoverFileSuffix ( std::string  recover_suffix)
inline

mutator for recover_suffix

Definition at line 377 of file MooseApp.h.

377 { _recover_suffix = recover_suffix; }
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:800

◆ setRestart()

void MooseApp::setRestart ( const bool &  value)

Sets the restart/recover flags.

Parameters
stateThe state to set the flag to

Definition at line 1561 of file MooseApp.C.

Referenced by FEProblemBase::setRestartFile().

1562 {
1563  _restart = value;
1564 
1565  std::shared_ptr<FEProblemBase> fe_problem = _action_warehouse.problemBase();
1566 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
std::shared_ptr< FEProblemBase > & problemBase()
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:785

◆ setStartTime()

void MooseApp::setStartTime ( const Real  time)

Set the starting time for the simulation.

This will override any choice made in the input file.

Parameters
timeThe start time for the simulation.

Definition at line 1043 of file MooseApp.C.

Referenced by EigenExecutionerBase::EigenExecutionerBase(), and Transient::Transient().

1044 {
1045  _start_time_set = true;
1046  _start_time = time;
1047 }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:723
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:720

◆ setupOptions()

void MooseApp::setupOptions ( )
virtual

Setup options based on InputParameters.

Definition at line 441 of file MooseApp.C.

Referenced by run().

442 {
443  TIME_SECTION(_setup_options_timer);
444 
445  // MOOSE was updated to have the ability to register execution flags in similar fashion as
446  // objects. However, this change requires all *App.C/h files to be updated with the new
447  // registerExecFlags method. To avoid breaking all applications the default MOOSE flags
448  // are added if nothing has been added to this point. In the future this could go away or
449  // perhaps be a warning.
450  if (_execute_flags.items().empty())
452 
453  // Print the header, this is as early as possible
454  std::string hdr(header() + "\n");
455  if (multiAppLevel() > 0)
457  Moose::out << hdr << std::flush;
458 
459  if (getParam<bool>("error_unused"))
460  setCheckUnusedFlag(true);
461  else if (getParam<bool>("warn_unused"))
462  setCheckUnusedFlag(false);
463 
464  if (getParam<bool>("error_override"))
466 
467  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
468 
469  _half_transient = getParam<bool>("half_transient");
470 
471  // The no_timing flag takes precedence over the timing flag.
472  if (getParam<bool>("no_timing"))
473  {
474  _pars.set<bool>("timing") = false;
475 
476  _perf_graph.setActive(false);
477  }
478 
479  if (isParamValid("trap_fpe") && isParamValid("no_trap_fpe"))
480  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
481  if (isParamValid("trap_fpe"))
482  _trap_fpe = true;
483  else if (isParamValid("no_trap_fpe"))
484  _trap_fpe = false;
485 
486  // Turn all warnings in MOOSE to errors (almost see next logic block)
487  Moose::_warnings_are_errors = getParam<bool>("error");
488 
489  // Deprecated messages can be toggled to errors independently from everything else.
490  Moose::_deprecated_is_error = getParam<bool>("error_deprecated");
491 
492  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
493  {
494  // Toggle the color console off
495  Moose::setColorConsole(true, true); // set default color condition
496  if (getParam<bool>("no_color"))
497  Moose::setColorConsole(false);
498 
499  char * c_color = std::getenv("MOOSE_COLOR");
500  std::string color = "on";
501  if (c_color)
502  color = c_color;
503  if (getParam<std::string>("color") != "default-on")
504  color = getParam<std::string>("color");
505 
506  if (color == "auto")
508  else if (color == "on")
509  Moose::setColorConsole(true, true);
510  else if (color == "off")
511  Moose::setColorConsole(false);
512  else
513  mooseWarning("ignoring invalid --color arg (want 'auto', 'on', or 'off')");
514  }
515 
516  // this warning goes below --color processing to honor that setting for
517  // the warning. And below settings for warnings/error setup.
518  if (getParam<bool>("no_color"))
519  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
520 
521 // If there's no threading model active, but the user asked for
522 // --n-threads > 1 on the command line, throw a mooseError. This is
523 // intended to prevent situations where the user has potentially
524 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
525 // asking for multiple threads, not knowing that there will never be
526 // any threads launched.
527 #if !LIBMESH_USING_THREADS
528  if (libMesh::command_line_value("--n-threads", 1) > 1)
529  mooseError("You specified --n-threads > 1, but there is no threading model active!");
530 #endif
531 
532  // Build a minimal running application, ignoring the input file.
533  if (getParam<bool>("minimal"))
535 
536  else if (getParam<bool>("display_version"))
537  {
538  Moose::perf_log.disable_logging();
539  Moose::out << getPrintableVersion() << std::endl;
540  _ready_to_exit = true;
541  return;
542  }
543  else if (getParam<bool>("help"))
544  {
545  Moose::perf_log.disable_logging();
546 
547  _command_line->printUsage();
548  _ready_to_exit = true;
549  }
550  else if (isParamValid("dump"))
551  {
552  Moose::perf_log.disable_logging();
553 
554  // Get command line argument following --dump on command line
555  std::string following_arg = getParam<std::string>("dump");
556 
557  // The argument following --dump is a parameter search string,
558  // which can be empty.
559  std::string param_search;
560  if (!following_arg.empty() && (following_arg.find('-') != 0))
561  param_search = following_arg;
562 
563  JsonSyntaxTree tree(param_search);
565  JsonInputFileFormatter formatter;
566  Moose::out << "### START DUMP DATA ###\n"
567  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###\n";
568  _ready_to_exit = true;
569  }
570  else if (isParamValid("registry"))
571  {
572  Moose::out << "Label\tType\tName\tClass\tFile\n";
573 
574  auto & objmap = Registry::allObjects();
575  for (auto & entry : objmap)
576  {
577  for (auto & obj : entry.second)
578  {
579  std::string name = obj._name;
580  if (name.empty())
581  name = obj._alias;
582  if (name.empty())
583  name = obj._classname;
584 
585  Moose::out << entry.first << "\tobject\t" << name << "\t" << obj._classname << "\t"
586  << obj._file << "\n";
587  }
588  }
589 
590  auto & actmap = Registry::allActions();
591  for (auto & entry : actmap)
592  {
593  for (auto & act : entry.second)
594  Moose::out << entry.first << "\taction\t" << act._name << "\t" << act._classname << "\t"
595  << act._file << "\n";
596  }
597 
598  _ready_to_exit = true;
599  }
600  else if (isParamValid("registry_hit"))
601  {
602  Moose::out << "### START REGISTRY DATA ###\n";
603 
604  hit::Section root("");
605  auto sec = new hit::Section("registry");
606  root.addChild(sec);
607  auto objsec = new hit::Section("objects");
608  sec->addChild(objsec);
609 
610  auto & objmap = Registry::allObjects();
611  for (auto & entry : objmap)
612  {
613  for (auto & obj : entry.second)
614  {
615  std::string name = obj._name;
616  if (name.empty())
617  name = obj._alias;
618  if (name.empty())
619  name = obj._classname;
620 
621  auto ent = new hit::Section("entry");
622  objsec->addChild(ent);
623  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
624  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "object"));
625  ent->addChild(new hit::Field("name", hit::Field::Kind::String, name));
626  ent->addChild(new hit::Field("class", hit::Field::Kind::String, obj._classname));
627  ent->addChild(new hit::Field("file", hit::Field::Kind::String, obj._file));
628  }
629  }
630 
631  auto actsec = new hit::Section("actions");
632  sec->addChild(actsec);
633  auto & actmap = Registry::allActions();
634  for (auto & entry : actmap)
635  {
636  for (auto & act : entry.second)
637  {
638  auto ent = new hit::Section("entry");
639  actsec->addChild(ent);
640  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
641  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "action"));
642  ent->addChild(new hit::Field("task", hit::Field::Kind::String, act._name));
643  ent->addChild(new hit::Field("class", hit::Field::Kind::String, act._classname));
644  ent->addChild(new hit::Field("file", hit::Field::Kind::String, act._file));
645  }
646  }
647 
648  Moose::out << root.render();
649 
650  Moose::out << "\n### END REGISTRY DATA ###\n";
651  _ready_to_exit = true;
652  }
653  else if (isParamValid("definition"))
654  {
655  Moose::perf_log.disable_logging();
656  JsonSyntaxTree tree("");
658  SONDefinitionFormatter formatter;
659  Moose::out << formatter.toString(tree.getRoot()) << "\n";
660  _ready_to_exit = true;
661  }
662  else if (isParamValid("yaml"))
663  {
664  Moose::perf_log.disable_logging();
665 
667 
668  // Get command line argument following --yaml on command line
669  std::string yaml_following_arg = getParam<std::string>("yaml");
670 
671  // If the argument following --yaml is non-existent or begins with
672  // a dash, call buildFullTree() with an empty string, otherwise
673  // pass the argument following --yaml.
674  if (yaml_following_arg.empty() || (yaml_following_arg.find('-') == 0))
676  else
677  _parser.buildFullTree(yaml_following_arg);
678 
679  _ready_to_exit = true;
680  }
681  else if (isParamValid("json"))
682  {
683  Moose::perf_log.disable_logging();
684 
685  // Get command line argument following --json on command line
686  std::string json_following_arg = getParam<std::string>("json");
687 
688  // The argument following --json is a parameter search string,
689  // which can be empty.
690  std::string search;
691  if (!json_following_arg.empty() && (json_following_arg.find('-') != 0))
692  search = json_following_arg;
693 
694  JsonSyntaxTree tree(search);
696 
697  Moose::out << "**START JSON DATA**\n" << tree.getRoot() << "\n**END JSON DATA**\n";
698  _ready_to_exit = true;
699  }
700  else if (getParam<bool>("syntax"))
701  {
702  Moose::perf_log.disable_logging();
703 
704  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
705  Moose::out << "**START SYNTAX DATA**\n";
706  for (const auto & it : syntax)
707  Moose::out << it.first << "\n";
708  Moose::out << "**END SYNTAX DATA**\n" << std::endl;
709  _ready_to_exit = true;
710  }
711  else if (_input_filename != "" ||
712  isParamValid("input_file")) // They already specified an input filename
713  {
714  if (_input_filename == "")
715  _input_filename = getParam<std::string>("input_file");
716 
717  if (isParamValid("recover"))
718  {
719  // We need to set the flag manually here since the recover parameter is a string type (takes
720  // an optional filename)
721  _recover = true;
722 
723  // Get command line argument following --recover on command line
724  std::string recover_following_arg = getParam<std::string>("recover");
725 
726  // If the argument following --recover is non-existent or begins with
727  // a dash then we are going to eventually find the newest recovery file to use
728  if (!(recover_following_arg.empty() || (recover_following_arg.find('-') == 0)))
729  _recover_base = recover_following_arg;
730  }
731 
732  // Optionally get command line argument following --recoversuffix
733  // on command line. Currently this argument applies to both
734  // recovery and restart files.
735  if (isParamValid("recoversuffix"))
736  {
737  _recover_suffix = getParam<std::string>("recoversuffix");
738  }
739 
741 
742  if (isParamValid("mesh_only"))
743  {
744  _syntax.registerTaskName("mesh_only", true);
745  _syntax.addDependency("mesh_only", "setup_mesh_complete");
746  _action_warehouse.setFinalTask("mesh_only");
747  }
748  else if (isParamValid("split_mesh"))
749  {
750  _split_mesh = true;
751  _syntax.registerTaskName("split_mesh", true);
752  _syntax.addDependency("split_mesh", "setup_mesh_complete");
753  _action_warehouse.setFinalTask("split_mesh");
754  }
756  }
757  else if (getParam<bool>("apptype"))
758  {
759  Moose::perf_log.disable_logging();
760  Moose::out << "MooseApp Type: " << type() << std::endl;
761  _ready_to_exit = true;
762  }
763  else
764  {
765  Moose::perf_log.disable_logging();
766 
767  if (_check_input)
768  mooseError("You specified --check-input, but did not provide an input file. Add -i "
769  "<inputfile> to your command line.");
770 
771  _command_line->printUsage();
772  _ready_to_exit = true;
773  }
774 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:72
static const std::map< std::string, std::vector< RegistryEntry > > & allActions()
Returns a per-label keyed map of all Actions in the registry.
Definition: Registry.C:32
const std::multimap< std::string, ActionInfo > & getAssociatedActions() const
Return all Syntax to Action associations.
Definition: Syntax.C:301
if(nl->nonlinearSolver() ->matvec &&nl->nonlinearSolver() ->residual_and_jacobian_object)
void addDependency(const std::string &task, const std::string &pre_req)
Method to insert a new task in the list of existing tasks at the specified location.
Definition: Syntax.C:55
void setCheckUnusedFlag(bool warn_is_error=false)
Set a flag so that the parser will either warn or error when unused variables are seen after parsing ...
Definition: MooseApp.C:918
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:554
std::string toString(const moosecontrib::Json::Value &root)
Returns a string representation of the tree in input file format.
void registerTaskName(const std::string &task, bool should_auto_build=false)
Method to register a new task.
Definition: Syntax.C:20
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
void setFinalTask(const std::string &task)
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN)
Indents the supplied message given the prefix and color.
Definition: MooseUtils.C:488
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:515
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:809
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:112
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:732
Syntax & syntax()
Definition: MooseApp.h:143
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:794
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:744
This class produces a dump of the InputFileParameters in the Standard Object Notation (SON) format fo...
Holds the syntax in a Json::Value tree.
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:803
std::string toString(const JsonVal &root)
returns a string representation of the tree in input file format
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:747
void initSyntaxFormatter(SyntaxFormatterType type, bool dump_mode)
Creates a syntax formatter for printing.
Definition: Parser.C:634
const std::set< ExecFlagType > & items() const
Reference the all the available items.
Definition: ExecFlagEnum.h:74
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:939
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:729
void registerExecFlags(Factory &factory)
Definition: Moose.C:346
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:556
void setActive(bool active)
Turn on or off timing.
Definition: PerfGraph.h:108
PerfLog perf_log
Perflog to be used by applications.
PerfID _setup_options_timer
Definition: MooseApp.h:884
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:782
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237
std::string _input_filename
Input file name used.
Definition: MooseApp.h:708
This class produces produces a dump of the InputFileParameters that appears like the normal input fil...
PerfGraph _perf_graph
The PerfGraph object for this applciation.
Definition: MooseApp.h:705
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:696
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:797
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:779
ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:880
void build()
Builds all auto-buildable tasks.
bool setColorConsole(bool use_color, bool force=false)
Turns color escape sequences on/off for info written to stdout.
Definition: Moose.C:548
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:1334
Factory _factory
Definition: MooseApp.h:769
void buildJsonSyntaxTree(JsonSyntaxTree &tree) const
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
Definition: Parser.C:651
std::string _name
The name of this object.
Definition: MooseApp.h:693
const std::string & type() const
Get the type of this object as a string.
Definition: MooseApp.h:92
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:435
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:526
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:1589
static const std::map< std::string, std::vector< RegistryEntry > > & allObjects()
Returns a per-label keyed map of all MooseObjects in the registry.
Definition: Registry.C:27
bool _ready_to_exit
Definition: MooseApp.h:773
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:800
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:788
void parse(const std::string &input_filename)
Parse an input file consisting of hit syntax and setup objects in the MOOSE derived application...
Definition: Parser.C:495
void buildFullTree(const std::string &search_string)
Use MOOSE Factories to construct a full parse tree for documentation or echoing input.
Definition: Parser.C:767

◆ syntax()

Syntax& MooseApp::syntax ( )
inline

Definition at line 143 of file MooseApp.h.

Referenced by dynamicAllRegistration(), and setupOptions().

143 { return _syntax; }
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:732

◆ theWarehouse()

TheWarehouse& MooseApp::theWarehouse ( )
inline

Definition at line 63 of file MooseApp.h.

Referenced by FEProblemBase::theWarehouse().

63 { return *_the_warehouse; }
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:856

◆ type()

const std::string& MooseApp::type ( ) const
inline

Get the type of this object as a string.

This is a string version of the class name (e.g. MooseTestApp).

Returns
The the type of the object

Definition at line 92 of file MooseApp.h.

Referenced by setupOptions().

92 { return _type; }
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:699

◆ useEigenvalue()

bool& MooseApp::useEigenvalue ( )
inline

Set a Boolean indicating whether this app will use an eigenvalue executioner.

Definition at line 274 of file MooseApp.h.

Referenced by CreateProblemDefaultAction::act().

274 { return _use_eigen_value; }
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:756

◆ useNonlinear()

bool& MooseApp::useNonlinear ( )
inline

Set a Boolean indicating whether this app will use a Nonlinear or Eigen System.

Definition at line 269 of file MooseApp.h.

Referenced by CreateProblemAction::act(), and CreateProblemDefaultAction::act().

269 { return _use_nonlinear; }
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:753

Friends And Related Function Documentation

◆ FEProblemBase

friend class FEProblemBase
friend

Definition at line 896 of file MooseApp.h.

◆ Restartable

friend class Restartable
friend

Definition at line 897 of file MooseApp.h.

◆ SubProblem

friend class SubProblem
friend

Definition at line 898 of file MooseApp.h.

Member Data Documentation

◆ _action_factory

ActionFactory MooseApp::_action_factory
protected

The Factory responsible for building Actions.

Definition at line 741 of file MooseApp.h.

Referenced by createMinimalApp(), getActionFactory(), and MooseApp().

◆ _action_warehouse

ActionWarehouse MooseApp::_action_warehouse
protected

◆ _cached_backup

std::shared_ptr<Backup> MooseApp::_cached_backup
private

Cache for a Backup to use for restart / recovery.

Definition at line 877 of file MooseApp.h.

Referenced by hasCachedBackup(), restore(), and restoreCachedBackup().

◆ _check_input

bool MooseApp::_check_input
protected

true if we want to just check the input file

Definition at line 809 of file MooseApp.h.

Referenced by checkInput(), MooseApp(), run(), and setupOptions().

◆ _comm

const std::shared_ptr<Parallel::Communicator> MooseApp::_comm
protected

The MPI communicator this App is going to use.

Definition at line 702 of file MooseApp.h.

Referenced by errorCheck(), and processor_id().

◆ _command_line

std::shared_ptr<CommandLine> MooseApp::_command_line
protected

Command line object.

Definition at line 729 of file MooseApp.h.

Referenced by commandLine(), executeExecutioner(), MooseApp(), and setupOptions().

◆ _console

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 32 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualTags(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppVectorPostprocessorTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), FEProblemBase::FEProblemBase(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), PerfGraphOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _create_minimal_app_timer

PerfID MooseApp::_create_minimal_app_timer
private

Definition at line 893 of file MooseApp.h.

Referenced by createMinimalApp().

◆ _distributed_mesh_on_command_line

bool MooseApp::_distributed_mesh_on_command_line
protected

This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh.

Definition at line 779 of file MooseApp.h.

Referenced by getDistributedMeshOnCommandLine(), and setupOptions().

◆ _enable_unused_check

enum MooseApp::UNUSED_CHECK MooseApp::_enable_unused_check
protected

◆ _error_overridden

bool MooseApp::_error_overridden
protected

Indicates whether warnings or errors are displayed when overridden parameters are detected.

Definition at line 772 of file MooseApp.h.

Referenced by setErrorOverridden().

◆ _execute_executioner_timer

PerfID MooseApp::_execute_executioner_timer
private

Definition at line 887 of file MooseApp.h.

Referenced by executeExecutioner().

◆ _execute_flags

ExecFlagEnum MooseApp::_execute_flags
private

Execution flags for this App.

Definition at line 880 of file MooseApp.h.

Referenced by addExecFlag(), getExecuteOnEnum(), and setupOptions().

◆ _execute_mesh_generators_timer

PerfID MooseApp::_execute_mesh_generators_timer
private

Definition at line 891 of file MooseApp.h.

Referenced by executeMeshGenerators().

◆ _execute_mesh_modifiers_timer

PerfID MooseApp::_execute_mesh_modifiers_timer
private

Definition at line 890 of file MooseApp.h.

Referenced by executeMeshModifiers().

◆ _execute_timer

PerfID MooseApp::_execute_timer
private

Definition at line 886 of file MooseApp.h.

Referenced by run().

◆ _executioner

std::shared_ptr<Executioner> MooseApp::_executioner
protected

Pointer to the executioner of this run (typically build by actions)

Definition at line 750 of file MooseApp.h.

Referenced by backup(), errorCheck(), executeExecutioner(), executioner(), getExecutioner(), restore(), setExecutioner(), setOutputPosition(), and ~MooseApp().

◆ _factory

Factory MooseApp::_factory
protected

◆ _final_generated_mesh

std::unique_ptr<MeshBase> MooseApp::_final_generated_mesh
private

The final Mesh that is generated by the generators.

Definition at line 874 of file MooseApp.h.

Referenced by executeMeshGenerators(), and getMeshGeneratorMesh().

◆ _global_time_offset

Real MooseApp::_global_time_offset
protected

Offset of the local App time to the "global" problem time.

Definition at line 726 of file MooseApp.h.

Referenced by getGlobalTimeOffset(), and setGlobalTimeOffset().

◆ _half_transient

bool MooseApp::_half_transient
protected

Whether or not this simulation should only run half its transient (useful for testing recovery)

Definition at line 803 of file MooseApp.h.

Referenced by halfTransient(), and setupOptions().

◆ _initial_from_file

bool MooseApp::_initial_from_file
protected

This variable indicates when a request has been made to restart from an Exodus file.

Definition at line 776 of file MooseApp.h.

Referenced by setFileRestart().

◆ _input_filename

std::string MooseApp::_input_filename
protected

Input file name used.

Definition at line 708 of file MooseApp.h.

Referenced by getInputFileName(), setInputFileName(), and setupOptions().

◆ _input_parameter_warehouse

InputParameterWarehouse* MooseApp::_input_parameter_warehouse
protected

Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly controlled)

Definition at line 738 of file MooseApp.h.

Referenced by getInputParameterWarehouse(), and ~MooseApp().

◆ _lib_handles

std::map<std::pair<std::string, std::string>, void *> MooseApp::_lib_handles
protected

The library, registration method and the handle to the method.

Definition at line 814 of file MooseApp.h.

Referenced by getLoadedLibraryPaths(), loadLibraryAndDependencies(), and ~MooseApp().

◆ _mesh_generator_outputs

std::map<std::string, std::list<std::unique_ptr<MeshBase> > > MooseApp::_mesh_generator_outputs
private

Holds the output for each mesh generator - including duplicates needed downstream.

Definition at line 871 of file MooseApp.h.

Referenced by executeMeshGenerators(), and getMeshGeneratorOutput().

◆ _mesh_generators

std::map<std::string, std::shared_ptr<MeshGenerator> > MooseApp::_mesh_generators
private

Holds the mesh generators until they have completed, then this structure is cleared.

Definition at line 868 of file MooseApp.h.

Referenced by addMeshGenerator(), clearMeshGenerators(), executeMeshGenerators(), getMeshGenerator(), and getMeshGeneratorNames().

◆ _mesh_modifiers

std::map<std::string, std::shared_ptr<MeshModifier> > MooseApp::_mesh_modifiers
private

Holds the mesh modifiers until they have completed, then this structure is cleared.

Definition at line 865 of file MooseApp.h.

Referenced by addMeshModifier(), clearMeshModifiers(), executeMeshModifiers(), getMeshModifier(), and getMeshModifierNames().

◆ _multiapp_level

unsigned int MooseApp::_multiapp_level
private

Level of multiapp, the master is level 0. This used by the Console to indent output.

Definition at line 859 of file MooseApp.h.

Referenced by isUltimateMaster(), and multiAppLevel().

◆ _multiapp_number

unsigned int MooseApp::_multiapp_number
private

Numbering in all the sub-apps on the same level.

Definition at line 862 of file MooseApp.h.

Referenced by multiAppNumber().

◆ _name

std::string MooseApp::_name
protected

The name of this object.

Definition at line 693 of file MooseApp.h.

Referenced by name(), and setupOptions().

◆ _output_file_base

std::string MooseApp::_output_file_base
protected

The output file basename.

Definition at line 711 of file MooseApp.h.

Referenced by getOutputFileBase(), and setOutputFileBase().

◆ _output_file_numbers

std::map<std::string, unsigned int> MooseApp::_output_file_numbers
protected

Map of outputer name and file number (used by MultiApps to propagate file numbers down through the multiapps)

Definition at line 806 of file MooseApp.h.

Referenced by getOutputFileNumbers(), and setOutputFileNumbers().

◆ _output_position

Point MooseApp::_output_position
protected

The output position.

Definition at line 717 of file MooseApp.h.

Referenced by getOutputPosition(), and setOutputPosition().

◆ _output_position_set

bool MooseApp::_output_position_set
protected

Whether or not an output position has been set for this app.

Definition at line 714 of file MooseApp.h.

Referenced by hasOutputPosition(), hasOutputWarehouse(), and setOutputPosition().

◆ _output_warehouse

OutputWarehouse MooseApp::_output_warehouse
protected

OutputWarehouse object for this App.

Definition at line 735 of file MooseApp.h.

Referenced by getOutputWarehouse(), and setOutputPosition().

◆ _pars

InputParameters MooseApp::_pars
protected

Parameters of this object.

Definition at line 696 of file MooseApp.h.

Referenced by getParam(), isParamValid(), parameters(), and setupOptions().

◆ _parser

Parser MooseApp::_parser
protected

Parser for parsing the input file.

Definition at line 747 of file MooseApp.h.

Referenced by errorCheck(), getFileName(), parser(), and setupOptions().

◆ _perf_graph

PerfGraph MooseApp::_perf_graph
protected

The PerfGraph object for this applciation.

Definition at line 705 of file MooseApp.h.

Referenced by perfGraph(), and setupOptions().

◆ _ready_to_exit

bool MooseApp::_ready_to_exit
protected

Definition at line 773 of file MooseApp.h.

Referenced by executeExecutioner(), runInputFile(), and setupOptions().

◆ _recover

bool MooseApp::_recover
protected

Whether or not this is a recovery run.

Definition at line 782 of file MooseApp.h.

Referenced by isRecovering(), setRecover(), and setupOptions().

◆ _recover_base

std::string MooseApp::_recover_base
protected

The base name to recover from. If blank then we will find the newest recovery file.

Definition at line 797 of file MooseApp.h.

Referenced by getRecoverFileBase(), hasRecoverFileBase(), setRecoverFileBase(), and setupOptions().

◆ _recover_suffix

std::string MooseApp::_recover_suffix
protected

The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.

Definition at line 800 of file MooseApp.h.

Referenced by getRecoverFileSuffix(), setRecoverFileSuffix(), and setupOptions().

◆ _recoverable_data

std::set<std::string> MooseApp::_recoverable_data
private

Data names that will only be read from the restart file during RECOVERY.

Definition at line 847 of file MooseApp.h.

Referenced by getRecoverableData(), and registerRecoverableData().

◆ _relationship_managers

std::vector<std::shared_ptr<RelationshipManager> > MooseApp::_relationship_managers
protected

◆ _restart

bool MooseApp::_restart
protected

Whether or not this is a restart run.

Definition at line 785 of file MooseApp.h.

Referenced by isRestarting(), and setRestart().

◆ _restartable_data

RestartableDatas MooseApp::_restartable_data
private

Where the restartable data is held (indexed on tid)

Definition at line 844 of file MooseApp.h.

Referenced by getRestartableData(), and registerRestartableData().

◆ _restore_cached_backup_timer

PerfID MooseApp::_restore_cached_backup_timer
private

Definition at line 892 of file MooseApp.h.

Referenced by restoreCachedBackup().

◆ _restore_timer

PerfID MooseApp::_restore_timer
private

Definition at line 888 of file MooseApp.h.

Referenced by restore().

◆ _run_input_file_timer

PerfID MooseApp::_run_input_file_timer
private

Definition at line 885 of file MooseApp.h.

Referenced by runInputFile().

◆ _run_timer

PerfID MooseApp::_run_timer
private

Definition at line 889 of file MooseApp.h.

Referenced by run().

◆ _setup_options_timer

PerfID MooseApp::_setup_options_timer
private

Definition at line 884 of file MooseApp.h.

Referenced by setupOptions().

◆ _setup_timer

PerfID MooseApp::_setup_timer
private

Timers.

Definition at line 883 of file MooseApp.h.

Referenced by run().

◆ _split_mesh

bool MooseApp::_split_mesh
protected

Whether or not we are performing a split mesh operation (–split-mesh)

Definition at line 788 of file MooseApp.h.

Referenced by isSplitMesh(), and setupOptions().

◆ _start_time

Real MooseApp::_start_time
protected

The time at which to start the simulation.

Definition at line 723 of file MooseApp.h.

Referenced by getStartTime(), and setStartTime().

◆ _start_time_set

bool MooseApp::_start_time_set
protected

Whether or not an start time has been set.

Definition at line 720 of file MooseApp.h.

Referenced by hasStartTime(), and setStartTime().

◆ _syntax

Syntax MooseApp::_syntax
protected

Syntax of the input file.

Definition at line 732 of file MooseApp.h.

Referenced by MooseApp(), setupOptions(), and syntax().

◆ _sys_info

std::unique_ptr<SystemInfo> MooseApp::_sys_info
protected

System Information.

Definition at line 759 of file MooseApp.h.

Referenced by getSystemInfo(), and MooseApp().

◆ _the_warehouse

std::unique_ptr<TheWarehouse> MooseApp::_the_warehouse
private

Definition at line 856 of file MooseApp.h.

Referenced by MooseApp(), theWarehouse(), and ~MooseApp().

◆ _trap_fpe

bool MooseApp::_trap_fpe
protected

Whether or not FPE trapping should be turned on.

Definition at line 794 of file MooseApp.h.

Referenced by getFPTrapFlag(), and setupOptions().

◆ _type

const std::string MooseApp::_type
protected

The string representation of the type of this object as registered (see registerApp(AppName))

Definition at line 699 of file MooseApp.h.

Referenced by MooseApp(), and type().

◆ _use_eigen_value

bool MooseApp::_use_eigen_value
protected

Boolean to indicate whether to use an eigenvalue executioner.

Definition at line 756 of file MooseApp.h.

Referenced by useEigenvalue().

◆ _use_nonlinear

bool MooseApp::_use_nonlinear
protected

Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions)

Definition at line 753 of file MooseApp.h.

Referenced by useNonlinear().

◆ _use_split

const bool MooseApp::_use_split
protected

Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)

Definition at line 791 of file MooseApp.h.

Referenced by isUseSplit().


The documentation for this class was generated from the following files: