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...
 
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)
 Attach the relationship managers of the given type Note: Geometric relationship managers that are supposed to be attached late will be attached when Algebraic are attached. More...
 
const std::vector< std::shared_ptr< RelationshipManager > > & getReleationshipManagers ()
 Retrieve the relationship managers. More...
 
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...
 
void setBackupObject (std::shared_ptr< Backup > backup)
 Method for setting the backup object to be restored at a later time. 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::list< std::unique_ptr< MeshBase > * > _final_generated_meshes
 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 59 of file MooseApp.h.

Member Enumeration Documentation

◆ RegistrationType

Enumeration for holding the valid types of dynamic registrations allowed.

Enumerator
APPLICATION 
REGALL 

Definition at line 873 of file MooseApp.h.

874  {
875  APPLICATION,
876  REGALL
877  };

◆ 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 785 of file MooseApp.h.

786  {
787  OFF,
788  WARN_UNUSED,
enum MooseApp::UNUSED_CHECK _enable_unused_check

Constructor & Destructor Documentation

◆ ~MooseApp()

MooseApp::~MooseApp ( )
virtual

Definition at line 413 of file MooseApp.C.

414 {
416  _executioner.reset();
417  _the_warehouse.reset();
418 
420 
421 #ifdef LIBMESH_HAVE_DLOPEN
422  // Close any open dynamic libraries
423  for (const auto & it : _lib_handles)
424  dlclose(it.second);
425 #endif
426 }
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:879
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:761
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:837
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 259 of file MooseApp.C.

260  : ConsoleStreamInterface(*this),
261  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
262  "_comm")), // Can't call getParam() before pars is set
263  _name(parameters.get<std::string>("_app_name")),
264  _pars(parameters),
265  _type(getParam<std::string>("_type")),
266  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
267  _perf_graph(type() + " (" + name() + ')'),
268  _output_position_set(false),
269  _start_time_set(false),
270  _start_time(0.0),
271  _global_time_offset(0.0),
272  _output_warehouse(*this),
274  _action_factory(*this),
276  _parser(*this, _action_warehouse),
277  _use_nonlinear(true),
278  _use_eigen_value(false),
280  _factory(*this),
281  _error_overridden(false),
282  _ready_to_exit(false),
283  _initial_from_file(false),
285  _recover(false),
286  _restart(false),
287  _split_mesh(false),
288  _use_split(parameters.get<bool>("use_split")),
289 #ifdef DEBUG
290  _trap_fpe(true),
291 #else
292  _trap_fpe(false),
293 #endif
294  _recover_suffix("cpr"),
295  _half_transient(false),
296  _check_input(getParam<bool>("check_input")),
297  _restartable_data(libMesh::n_threads()),
299  isParamValid("_multiapp_level") ? parameters.get<unsigned int>("_multiapp_level") : 0),
301  isParamValid("_multiapp_number") ? parameters.get<unsigned int>("_multiapp_number") : 0),
302  _setup_timer(_perf_graph.registerSection("MooseApp::setup", 2)),
303  _setup_options_timer(_perf_graph.registerSection("MooseApp::setupOptions", 5)),
304  _run_input_file_timer(_perf_graph.registerSection("MooseApp::runInputFile", 3)),
305  _execute_timer(_perf_graph.registerSection("MooseApp::execute", 2)),
306  _execute_executioner_timer(_perf_graph.registerSection("MooseApp::executeExecutioner", 3)),
307  _restore_timer(_perf_graph.registerSection("MooseApp::restore", 2)),
308  _run_timer(_perf_graph.registerSection("MooseApp::run", 3)),
309  _execute_mesh_modifiers_timer(_perf_graph.registerSection("MooseApp::executeMeshModifiers", 1)),
311  _perf_graph.registerSection("MooseApp::executeMeshGenerators", 1)),
312  _restore_cached_backup_timer(_perf_graph.registerSection("MooseApp::restoreCachedBackup", 2)),
313  _create_minimal_app_timer(_perf_graph.registerSection("MooseApp::createMinimalApp", 3))
314 {
317 
318  _the_warehouse = libmesh_make_unique<TheWarehouse>();
319  _the_warehouse->registerAttribute<AttribMatrixTags>("matrix_tags", 0);
320  _the_warehouse->registerAttribute<AttribVectorTags>("vector_tags", 0);
321  _the_warehouse->registerAttribute<AttribExecOns>("exec_ons", 0);
322  _the_warehouse->registerAttribute<AttribSubdomains>("subdomains", 0);
323  _the_warehouse->registerAttribute<AttribBoundaries>("boundaries", 0);
324  _the_warehouse->registerAttribute<AttribThread>("thread", 0);
325  _the_warehouse->registerAttribute<AttribPreIC>("pre_ic", 0);
326  _the_warehouse->registerAttribute<AttribPreAux>("pre_aux", 0);
327  _the_warehouse->registerAttribute<AttribName>("name", "dummy");
328  _the_warehouse->registerAttribute<AttribSystem>("system", "dummy");
329  _the_warehouse->registerAttribute<AttribVar>("variable", 0);
330  _the_warehouse->registerAttribute<AttribInterfaces>("interfaces", 0);
331 
332  if (isParamValid("_argc") && isParamValid("_argv"))
333  {
334  int argc = getParam<int>("_argc");
335  char ** argv = getParam<char **>("_argv");
336 
337  _sys_info = libmesh_make_unique<SystemInfo>(argc, argv);
338  }
339  if (isParamValid("_command_line"))
340  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
341  else
342  mooseError("Valid CommandLine object required");
343 
344  if (_check_input && isParamValid("recover"))
345  mooseError("Cannot run --check-input with --recover. Recover files might not exist");
346 
347  if (isParamValid("start_in_debugger"))
348  {
349  auto command = getParam<std::string>("start_in_debugger");
350 
351  Moose::out << "Starting in debugger using: " << command << std::endl;
352 
354 
355  std::stringstream command_stream;
356 
357  // This will start XTerm and print out some info first... then run the debugger
358  command_stream << "xterm -e \"echo 'Rank: " << processor_id() << " Hostname: " << hostname
359  << " PID: " << getpid() << "'; echo ''; ";
360 
361  // Figure out how to run the debugger
362  if (command.find("lldb") != std::string::npos || command.find("gdb") != std::string::npos)
363  command_stream << command << " -p " << getpid();
364  else
365  mooseError("Unknown debugger: ",
366  command,
367  "\nIf this is truly what you meant then contact moose-users to have a discussion "
368  "about adding your debugger.");
369 
370  // Finish up the command
371  command_stream << "\""
372  << " & ";
373 
374  std::string command_string = command_stream.str();
375  Moose::out << "Running: " << command_string << std::endl;
376 
377  int ret = std::system(command_string.c_str());
378  libmesh_ignore(ret);
379 
380  // Sleep to allow time for the debugger to attach
381  std::this_thread::sleep_for(std::chrono::seconds(10));
382  }
383 
384  if (!parameters.isParamSetByAddParam("stop_for_debugger"))
385  {
386  Moose::out << "\nStopping for " << getParam<unsigned int>("stop_for_debugger")
387  << " seconds to allow attachment from a debugger.\n";
388 
389  Moose::out << "\nAll of the processes you can connect to:\n";
390  Moose::out << "rank - hostname - pid\n";
391 
393 
394  {
395  // The 'false' turns off the serialization warning
396  SerializerGuard sg(_communicator, false); // Guarantees that the processors print in order
397  Moose::err << processor_id() << " - " << hostname << " - " << getpid() << "\n";
398  }
399 
400  Moose::out << "\nWaiting...\n" << std::endl;
401 
402  // Sleep to allow time for the debugger to attach
403  std::this_thread::sleep_for(std::chrono::seconds(getParam<unsigned int>("stop_for_debugger")));
404  }
405 }
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:779
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
PerfID _run_timer
Definition: MooseApp.h:912
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:882
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:722
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:799
Storage container for all InputParamter objects.
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:867
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:749
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:737
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:879
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:86
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:776
PerfID _run_input_file_timer
Definition: MooseApp.h:908
PerfID _execute_mesh_generators_timer
Definition: MooseApp.h:914
PerfID _create_minimal_app_timer
Definition: MooseApp.h:916
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:746
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:814
PerfID _execute_timer
Definition: MooseApp.h:909
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:832
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:168
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:113
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:755
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:817
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:782
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:826
std::string hostname()
Get the hostname the current process is running on.
Definition: MooseUtils.C:375
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:770
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:153
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:743
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:913
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:752
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:808
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:761
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:764
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:907
PerfID _restore_timer
Definition: MooseApp.h:911
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:805
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:795
PerfID _execute_executioner_timer
Definition: MooseApp.h:910
PerfID _restore_cached_backup_timer
Definition: MooseApp.h:915
PerfGraph _perf_graph
The PerfGraph object for this applciation.
Definition: MooseApp.h:728
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:926
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:802
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:758
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:725
processor_id_type processor_id()
Definition: MooseApp.h:282
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
Definition: Moose.C:52
Factory _factory
Definition: MooseApp.h:792
std::string _name
The name of this object.
Definition: MooseApp.h:716
const std::string & type() const
Get the type of this object as a string.
Definition: MooseApp.h:93
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:885
PerfID registerSection(const std::string &section_name, unsigned int level)
Registers a named section of code.
Definition: PerfGraph.C:42
bool _ready_to_exit
Definition: MooseApp.h:796
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:906
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:823
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:811
static char addKnownLabel(const std::string &label)
addKnownLabel whitelists a label as valid for purposes of the checkLabels function.
Definition: Registry.C:159

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 1646 of file MooseApp.C.

Referenced by Factory::regExecFlag().

1647 {
1648  if (flag.id() == MooseEnumItem::INVALID_ID)
1649  {
1650  // It is desired that users when creating ExecFlagTypes should not worry about needing
1651  // to assign a name and an ID. However, the ExecFlagTypes created by users are global
1652  // constants and the ID to be assigned can't be known at construction time of this global
1653  // constant, it is only known when it is added to this object (ExecFlagEnum). Therefore,
1654  // this const cast allows the ID to be set after construction. This was the lesser of two
1655  // evils: const_cast or friend class with mutable members.
1656  ExecFlagType & non_const_flag = const_cast<ExecFlagType &>(flag);
1657  auto it = _execute_flags.find(flag.name());
1658  if (it != _execute_flags.items().end())
1659  non_const_flag.setID(it->id());
1660  else
1661  non_const_flag.setID(_execute_flags.getNextValidID());
1662  }
1664 }
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:903
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 1423 of file MooseApp.C.

Referenced by AddMeshGeneratorAction::act().

1426 {
1427  std::shared_ptr<MeshGenerator> mesh_generator =
1428  _factory.create<MeshGenerator>(generator_name, name, parameters);
1429 
1430  _mesh_generators.insert(std::make_pair(MooseUtils::shortName(name), mesh_generator));
1431 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
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:86
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:363
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:891
Factory _factory
Definition: MooseApp.h:792
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:31

◆ 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 1338 of file MooseApp.C.

Referenced by AddMeshModifierAction::act().

1341 {
1342  std::shared_ptr<MeshModifier> mesh_modifier =
1343  _factory.create<MeshModifier>(modifier_name, name, parameters);
1344 
1345  _mesh_modifiers.insert(std::make_pair(MooseUtils::shortName(name), mesh_modifier));
1346 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
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:86
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:363
Factory _factory
Definition: MooseApp.h:792
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:888

◆ 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 1677 of file MooseApp.C.

Referenced by SetAdaptivityOptionsAction::act(), AdaptivityAction::act(), AddPeriodicBCAction::act(), CreateDisplacedProblemAction::addProxyAlgebraicRelationshipManagers(), CreateDisplacedProblemAction::addProxyGeometricRelationshipManagers(), and Action::addRelationshipManagers().

1678 {
1679  // We don't need Geometric-only RelationshipManagers when we run with
1680  // ReplicatedMesh unless we are splitting the mesh.
1681  if (!_action_warehouse.mesh()->isDistributedMesh() && !_split_mesh &&
1682  (relationship_manager->isType(Moose::RelationshipManagerType::GEOMETRIC) &&
1683  !relationship_manager->isType(Moose::RelationshipManagerType::ALGEBRAIC)))
1684  return false;
1685 
1686  bool add = true;
1687  for (const auto & rm : _relationship_managers)
1688  {
1689  if (*rm == *relationship_manager)
1690  {
1691  add = false;
1692 
1693  auto & existing_for_whom = rm->forWhom();
1694 
1695  // Since the existing object is going to cover this one
1696  // Pass along who is needing it
1697  for (auto & fw : relationship_manager->forWhom())
1698  {
1699  if (std::find(existing_for_whom.begin(), existing_for_whom.end(), fw) ==
1700  existing_for_whom.end())
1701  rm->addForWhom(fw);
1702  }
1703 
1704  break;
1705  }
1706  }
1707 
1708  if (add)
1709  _relationship_managers.emplace_back(relationship_manager);
1710 
1711  // Inform the caller whether the object was added or not
1712  return add;
1713 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
std::shared_ptr< MooseMesh > & mesh()
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:811
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:834

◆ 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 1060 of file MooseApp.C.

Referenced by dynamicAppRegistration(), and dynamicRegistration().

1061 {
1062  std::string library_name(app_name);
1063 
1064  // Strip off the App part (should always be the last 3 letters of the name)
1065  size_t pos = library_name.find("App");
1066  if (pos != library_name.length() - 3)
1067  mooseError("Invalid application name: ", library_name);
1068  library_name.erase(pos);
1069 
1070  // Now get rid of the camel case, prepend lib, and append the method and suffix
1071  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
1072  QUOTE(METHOD) + ".la";
1073 }
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:319

◆ attachRelationshipManagers()

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

Attach the relationship managers of the given type Note: Geometric relationship managers that are supposed to be attached late will be attached when Algebraic are attached.

Definition at line 1716 of file MooseApp.C.

Referenced by AddRelationshipManager::act().

1717 {
1718  for (auto & rm : _relationship_managers)
1719  {
1720  if (rm->isType(rm_type))
1721  {
1722  // Will attach them later (during algebraic)
1723  if (rm_type == Moose::RelationshipManagerType::GEOMETRIC && !rm->attachGeometricEarly())
1724  continue;
1725 
1727  {
1728  // The problem is not built yet - so the ActionWarehouse currently owns the mesh
1729  auto & mesh = _action_warehouse.mesh();
1730 
1731  rm->init();
1732 
1733  if (rm->useDisplacedMesh() && _action_warehouse.displacedMesh())
1734  _action_warehouse.displacedMesh()->getMesh().add_ghosting_functor(*rm);
1735  else
1736  mesh->getMesh().add_ghosting_functor(*rm);
1737  }
1738 
1740  {
1741  // If it's also Geometric but didn't get attached early - then let's attach it now
1742  if (rm->isType(Moose::RelationshipManagerType::GEOMETRIC) && !rm->attachGeometricEarly())
1743  {
1744  // Now that the Problem is built we'll get the mesh from there
1745  auto & problem = _executioner->feProblem();
1746  auto & mesh = problem.mesh();
1747 
1748  rm->init();
1749 
1750  if (rm->useDisplacedMesh() && _action_warehouse.displacedMesh())
1751  _action_warehouse.displacedMesh()->getMesh().add_ghosting_functor(*rm);
1752  else
1753  mesh.getMesh().add_ghosting_functor(*rm);
1754  }
1755 
1756  auto & problem = _executioner->feProblem();
1757 
1758  // If it is not at all GEOMETRIC then it hasn't been inited
1760  rm->init();
1761 
1762  if (rm->useDisplacedMesh() && problem.getDisplacedProblem())
1763  {
1764  problem.getDisplacedProblem()->nlSys().dofMap().add_algebraic_ghosting_functor(*rm);
1765  problem.getDisplacedProblem()->auxSys().dofMap().add_algebraic_ghosting_functor(*rm);
1766  }
1767  else
1768  {
1769  problem.getNonlinearSystemBase().dofMap().add_algebraic_ghosting_functor(*rm);
1770  problem.getAuxiliarySystem().dofMap().add_algebraic_ghosting_functor(*rm);
1771  }
1772  }
1773  }
1774  }
1775 }
std::shared_ptr< MooseMesh > & displacedMesh()
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
std::shared_ptr< MooseMesh > & mesh()
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:834

◆ 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 894 of file MooseApp.C.

Referenced by restore(), and setBackupObject().

895 {
896  mooseAssert(_executioner, "Executioner is nullptr");
897  FEProblemBase & fe_problem = _executioner->feProblem();
898 
899  RestartableDataIO rdio(fe_problem);
900  return rdio.createBackup();
901 }
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:773

◆ checkInput()

bool MooseApp::checkInput ( ) const
inline

Returns whether the Application is running in check input mode.

Definition at line 615 of file MooseApp.h.

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

◆ checkRegistryLabels()

void MooseApp::checkRegistryLabels ( )
virtual

Definition at line 408 of file MooseApp.C.

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

409 {
411 }
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:136

◆ clearMeshGenerators()

void MooseApp::clearMeshGenerators ( )

Clear all mesh modifers.

Definition at line 1532 of file MooseApp.C.

1533 {
1534  _mesh_generators.clear();
1535 }
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:891

◆ clearMeshModifiers()

void MooseApp::clearMeshModifiers ( )

Clear all mesh modifers.

Definition at line 1417 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::completeSetup().

1418 {
1419  _mesh_modifiers.clear();
1420 }
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:888

◆ 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 294 of file MooseApp.h.

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

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

◆ 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 1572 of file MooseApp.C.

Referenced by setupOptions().

1573 {
1574  TIME_SECTION(_create_minimal_app_timer);
1575 
1576  // SetupMeshAction
1577  {
1578  // Build the Action parameters
1579  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
1580  action_params.set<std::string>("type") = "GeneratedMesh";
1581 
1582  // Create The Action
1583  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1584  _action_factory.create("SetupMeshAction", "Mesh", action_params));
1585 
1586  // Set the object parameters
1587  InputParameters & params = action->getObjectParams();
1588  params.set<MooseEnum>("dim") = "1";
1589  params.set<unsigned int>("nx") = 1;
1590 
1591  // Add Action to the warehouse
1593  }
1594 
1595  // Executioner
1596  {
1597  // Build the Action parameters
1598  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
1599  action_params.set<std::string>("type") = "Transient";
1600 
1601  // Create the action
1602  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1603  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
1604 
1605  // Set the object parameters
1606  InputParameters & params = action->getObjectParams();
1607  params.set<unsigned int>("num_steps") = 1;
1608  params.set<Real>("dt") = 1;
1609 
1610  // Add Action to the warehouse
1612  }
1613 
1614  // Problem
1615  {
1616  // Build the Action parameters
1617  InputParameters action_params = _action_factory.getValidParams("CreateProblemDefaultAction");
1618  action_params.set<bool>("_solve") = false;
1619 
1620  // Create the action
1621  std::shared_ptr<Action> action = std::static_pointer_cast<Action>(
1622  _action_factory.create("CreateProblemDefaultAction", "Problem", action_params));
1623 
1624  // Add Action to the warehouse
1626  }
1627 
1628  // Outputs
1629  {
1630  // Build the Action parameters
1631  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
1632  action_params.set<bool>("console") = false;
1633 
1634  // Create action
1635  std::shared_ptr<Action> action =
1636  _action_factory.create("CommonOutputAction", "Outputs", action_params);
1637 
1638  // Add Action to the warehouse
1640  }
1641 
1643 }
InputParameters getValidParams(const std::string &name)
Definition: ActionFactory.C:70
PerfID _create_minimal_app_timer
Definition: MooseApp.h:916
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:767
Base class for actions.
Definition: Action.h:36
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:764
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 931 of file MooseApp.C.

932 {
934 }
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 1133 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction().

1139 {
1140  Parameters params;
1141  params.set<std::string>("app_name") = app_name;
1142  params.set<RegistrationType>("reg_type") = REGALL;
1143  params.set<std::string>("registration_method") = app_name + "__registerAll";
1144  params.set<std::string>("library_path") = library_path;
1145  params.set<std::string>("library_name") = library_name;
1146 
1147  params.set<Factory *>("factory") = factory;
1148  params.set<Syntax *>("syntax") = syntax;
1149  params.set<ActionFactory *>("action_factory") = action_factory;
1150 
1151  dynamicRegistration(params);
1152 }
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:1155
Syntax & syntax()
Definition: MooseApp.h:144
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:873
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 1100 of file MooseApp.C.

Referenced by MultiApp::initialSetup().

1103 {
1104  Parameters params;
1105  params.set<std::string>("app_name") = app_name;
1106  params.set<RegistrationType>("reg_type") = APPLICATION;
1107  params.set<std::string>("registration_method") = app_name + "__registerApps";
1108  params.set<std::string>("library_path") = library_path;
1109  params.set<std::string>("library_name") = library_name;
1110 
1111  dynamicRegistration(params);
1112 
1113  // At this point the application should be registered so check it
1114  if (!AppFactory::instance().isRegistered(app_name))
1115  {
1116  std::ostringstream oss;
1117  std::set<std::string> paths = getLoadedLibraryPaths();
1118 
1119  oss << "Unable to locate library for \"" << app_name
1120  << "\".\nWe attempted to locate the library \"" << appNameToLibName(app_name)
1121  << "\" in the following paths:\n\t";
1122  std::copy(paths.begin(), paths.end(), infix_ostream_iterator<std::string>(oss, "\n\t"));
1123  oss << "\n\nMake sure you have compiled the library and either set the \"library_path\" "
1124  "variable "
1125  << "in your input file or exported \"MOOSE_LIBRARY_PATH\".\n"
1126  << "Compiled in debug mode to see the list of libraries checked for dynamic loading "
1127  "methods.";
1128  mooseError(oss.str());
1129  }
1130 }
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:1155
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:873
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:1060
std::set< std::string > getLoadedLibraryPaths() const
Return the loaded library filenames in a std::vector.
Definition: MooseApp.C:1315

◆ dynamicRegistration()

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

Helper method for dynamic loading of objects.

Definition at line 1155 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

1156 {
1157  std::string library_name;
1158  // was library name provided by the user?
1159  if (params.get<std::string>("library_name").empty())
1160  library_name = appNameToLibName(params.get<std::string>("app_name"));
1161  else
1162  library_name = params.get<std::string>("library_name");
1163 
1164  // Create a vector of paths that we can search inside for libraries
1165  std::vector<std::string> paths;
1166 
1167  std::string library_path = params.get<std::string>("library_path");
1168 
1169  if (library_path != "")
1170  MooseUtils::tokenize(library_path, paths, 1, ":");
1171 
1172  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
1173  if (moose_lib_path_env)
1174  {
1175  std::string moose_lib_path(moose_lib_path_env);
1176  std::vector<std::string> tmp_paths;
1177 
1178  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
1179 
1180  // merge the two vectors together (all possible search paths)
1181  paths.insert(paths.end(), tmp_paths.begin(), tmp_paths.end());
1182  }
1183 
1184  // Attempt to dynamically load the library
1185  for (const auto & path : paths)
1186  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
1187  loadLibraryAndDependencies(path + '/' + library_name, params);
1188  else
1189  mooseWarning("Unable to open library file \"",
1190  path + '/' + library_name,
1191  "\". Double check for spelling errors.");
1192 }
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:429
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:1195
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:146
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:1060

◆ 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 820 of file MooseApp.C.

Referenced by executeExecutioner(), and run().

821 {
822  bool warn = _enable_unused_check == WARN_UNUSED;
823  bool err = _enable_unused_check == ERROR_UNUSED;
824 
825  _parser.errorCheck(*_comm, warn, err);
826 
827  auto apps = _executioner->feProblem().getMultiAppWarehouse().getObjects();
828  for (auto app : apps)
829  for (unsigned int i = 0; i < app->numLocalApps(); i++)
830  app->localApp(i)->errorCheck();
831 }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:770
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
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:725
void errorCheck(const Parallel::Communicator &comm, bool warn_unused, bool err_unused)
Definition: Parser.C:582

◆ executeExecutioner()

void MooseApp::executeExecutioner ( )
virtual

Execute the Executioner that was built.

Definition at line 834 of file MooseApp.C.

Referenced by run().

835 {
836  TIME_SECTION(_execute_executioner_timer);
837 
838  // If ready to exit has been set, then just return
839  if (_ready_to_exit)
840  return;
841 
842  // run the simulation
843  if (_executioner)
844  {
845 #ifdef LIBMESH_HAVE_PETSC
847 #endif
848 
849  _executioner->init();
850  errorCheck();
851  _executioner->execute();
852  }
853  else
854  mooseError("No executioner was specified (go fix your input file)");
855 }
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:752
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
PerfID _execute_executioner_timer
Definition: MooseApp.h:910
PetscErrorCode petscSetupOutput(CommandLine *cmd_line)
Definition: PetscSupport.C:264
bool _ready_to_exit
Definition: MooseApp.h:796
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:820

◆ executeMeshGenerators()

void MooseApp::executeMeshGenerators ( )

Execute and clear the Mesh Generators data structure.

Definition at line 1459 of file MooseApp.C.

Referenced by ExecuteMeshGenerators::act().

1460 {
1461  if (!_mesh_generators.empty())
1462  {
1463  TIME_SECTION(_execute_mesh_generators_timer);
1464 
1466 
1467  // Add all of the dependencies into the resolver and sort them
1468  for (const auto & it : _mesh_generators)
1469  {
1470  // Make sure an item with no dependencies comes out too!
1471  resolver.addItem(it.second);
1472 
1473  std::vector<std::string> & generators = it.second->getDependencies();
1474  for (const auto & depend_name : generators)
1475  {
1476  auto depend_it = _mesh_generators.find(depend_name);
1477 
1478  if (depend_it == _mesh_generators.end())
1479  mooseError("The MeshGenerator \"",
1480  depend_name,
1481  "\" was not created, did you make a "
1482  "spelling mistake or forget to include it "
1483  "in your input file?");
1484 
1485  resolver.insertDependency(it.second, depend_it->second);
1486  }
1487  }
1488 
1489  const auto & ordered_generators = resolver.getSortedValues();
1490 
1491  if (ordered_generators.size())
1492  {
1493  // Grab the outputs from the final generator so MeshGeneratorMesh can pick them up
1494  auto final_generator_name = ordered_generators.back()->name();
1495 
1496  _final_generated_meshes.emplace_back(&getMeshGeneratorOutput(final_generator_name));
1497 
1498  // Need to grab two if we're going to be making a displaced mesh
1500  _final_generated_meshes.emplace_back(&getMeshGeneratorOutput(final_generator_name));
1501 
1502  // Run the MeshGenerators in the proper order
1503  for (const auto & generator : ordered_generators)
1504  {
1505  auto name = generator->name();
1506 
1507  auto current_mesh = generator->generate();
1508 
1509  // Now we need to possibly give this mesh to downstream generators
1510  auto & outputs = _mesh_generator_outputs[name];
1511 
1512  if (outputs.size())
1513  {
1514  auto & first_output = *outputs.begin();
1515 
1516  first_output = std::move(current_mesh);
1517 
1518  const auto & copy_from = *first_output;
1519 
1520  auto output_it = ++outputs.begin();
1521 
1522  // For all of the rest we need to make a copy
1523  for (; output_it != outputs.end(); ++output_it)
1524  (*output_it) = copy_from.clone();
1525  }
1526  }
1527  }
1528  }
1529 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
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.
Definition: MooseApp.C:1449
std::shared_ptr< MooseMesh > & displacedMesh()
PerfID _execute_mesh_generators_timer
Definition: MooseApp.h:914
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
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:891
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:894
void addItem(const T &value)
Add an independent item to the set.
std::list< std::unique_ptr< MeshBase > * > _final_generated_meshes
The final Mesh that is generated by the generators.
Definition: MooseApp.h:897
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 modifiers are run. The final preparation will be handled by the SetupMeshComplete Action.

Definition at line 1364 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::act().

1365 {
1366  if (!_mesh_modifiers.empty())
1367  {
1368  TIME_SECTION(_execute_mesh_modifiers_timer);
1369 
1371 
1372  // Add all of the dependencies into the resolver and sort them
1373  for (const auto & it : _mesh_modifiers)
1374  {
1375  // Make sure an item with no dependencies comes out too!
1376  resolver.addItem(it.second);
1377 
1378  std::vector<std::string> & modifiers = it.second->getDependencies();
1379  for (const auto & depend_name : modifiers)
1380  {
1381  auto depend_it = _mesh_modifiers.find(depend_name);
1382 
1383  if (depend_it == _mesh_modifiers.end())
1384  mooseError("The MeshModifier \"",
1385  depend_name,
1386  "\" was not created, did you make a "
1387  "spelling mistake or forget to include it "
1388  "in your input file?");
1389 
1390  resolver.insertDependency(it.second, depend_it->second);
1391  }
1392  }
1393 
1394  const auto & ordered_modifiers = resolver.getSortedValues();
1395 
1396  if (ordered_modifiers.size())
1397  {
1398  MooseMesh * mesh = _action_warehouse.mesh().get();
1399  MooseMesh * displaced_mesh = _action_warehouse.displacedMesh().get();
1400 
1401  // Run the MeshModifiers in the proper order
1402  for (const auto & modifier : ordered_modifiers)
1403  modifier->modifyMesh(mesh, displaced_mesh);
1404 
1409  mesh->prepared(false);
1410  if (displaced_mesh)
1411  displaced_mesh->prepared(false);
1412  }
1413  }
1414 }
bool prepared() const
Setter/getter for the _is_prepared flag.
Definition: MooseMesh.C:2293
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:767
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:913
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:75
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:888
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 254 of file MooseApp.h.

Referenced by setExecutioner().

255  {
256  mooseDeprecated("executioner() is deprecated. Use getExecutioner(), this interface will be "
257  "removed after 10/01/2018");
258 
259  return _executioner;
260  }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
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 287 of file MooseApp.h.

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

◆ getCheckpointDirectories()

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

Get all checkpoint directories.

Returns
A Set of checkpoint directories

Definition at line 983 of file MooseApp.C.

Referenced by getCheckpointFiles().

984 {
985  // Storage for the directory names
986  std::list<std::string> checkpoint_dirs;
987 
988  // Extract the CommonOutputAction
989  const auto & common_actions = _action_warehouse.getActionListByName("common_output");
990  mooseAssert(common_actions.size() == 1, "Should be only one common_output Action");
991 
992  const Action * common = *common_actions.begin();
993 
994  // If file_base is set in CommonOutputAction, add this file to the list of potential checkpoint
995  // files
996  if (common->isParamValid("file_base"))
997  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
998  // Case for normal application or master in a Multiapp setting
999  else if (getOutputFileBase().empty())
1000  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, "_out_cp"));
1001  // Case for a sub app in a Multiapp setting
1002  else
1003  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
1004 
1005  // Add the directories from any existing checkpoint objects
1006  const auto & actions = _action_warehouse.getActionListByName("add_output");
1007  for (const auto & action : actions)
1008  {
1009  // Get the parameters from the MooseObjectAction
1010  MooseObjectAction * moose_object_action = dynamic_cast<MooseObjectAction *>(action);
1011  if (!moose_object_action)
1012  continue;
1013 
1014  const InputParameters & params = moose_object_action->getObjectParams();
1015 
1016  // Loop through the actions and add the necessary directories to the list to check
1017  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
1018  {
1019  if (params.isParamValid("file_base"))
1020  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
1021  else
1022  {
1023  std::ostringstream oss;
1024  oss << "_" << action->name() << "_cp";
1025  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, oss.str()));
1026  }
1027  }
1028  }
1029 
1030  return checkpoint_dirs;
1031 }
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: Action.h:225
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:789
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
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 1034 of file MooseApp.C.

Referenced by setRecoverFileBase().

1035 {
1036  auto checkpoint_dirs = getCheckpointDirectories();
1037  return MooseUtils::getFilesInDirs(checkpoint_dirs);
1038 }
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:983
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:533

◆ 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 317 of file MooseApp.h.

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

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

◆ getExecuteOnEnum()

const ExecFlagEnum& MooseApp::getExecuteOnEnum ( ) const
inline

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

Definition at line 661 of file MooseApp.h.

Referenced by EigenExecutionerBase::normalizeSolution().

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

◆ 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 1048 of file MooseApp.C.

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

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

◆ getFPTrapFlag()

bool MooseApp::getFPTrapFlag ( ) const
inline

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

Definition at line 618 of file MooseApp.h.

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

◆ getFrameworkVersion()

std::string MooseApp::getFrameworkVersion ( ) const

Returns the framework version.

Definition at line 429 of file MooseApp.C.

430 {
431  return MOOSE_VERSION;
432 }

◆ 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 223 of file MooseApp.h.

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

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

◆ getInputFileName()

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

Returns the input file name that was set with setInputFileName.

Definition at line 154 of file MooseApp.h.

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

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

◆ getInputParameterWarehouse()

InputParameterWarehouse & MooseApp::getInputParameterWarehouse ( )

Get the InputParameterWarehouse for MooseObjects.

Definition at line 1326 of file MooseApp.C.

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

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

◆ getLoadedLibraryPaths()

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

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

Definition at line 1315 of file MooseApp.C.

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

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

◆ getMeshGenerator()

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

Get a mesh generator with its name.

Definition at line 1434 of file MooseApp.C.

1435 {
1436  return *_mesh_generators.find(MooseUtils::shortName(name))->second.get();
1437 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:363
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:891

◆ getMeshGeneratorMesh()

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

Get the generated mesh generated by executeMeshGenerators();.

Definition at line 595 of file MooseApp.h.

Referenced by MeshGeneratorMesh::buildMesh().

596  {
597  auto mesh_unique_ptr_ptr = _final_generated_meshes.front();
598 
599  // Because C++ is stupid
600  _final_generated_meshes.pop_front();
601 
602  return std::move(*mesh_unique_ptr_ptr);
603  }
std::list< std::unique_ptr< MeshBase > * > _final_generated_meshes
The final Mesh that is generated by the generators.
Definition: MooseApp.h:897

◆ 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 1440 of file MooseApp.C.

1441 {
1442  std::vector<std::string> names;
1443  for (auto & pair : _mesh_generators)
1444  names.push_back(pair.first);
1445  return names;
1446 }
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:891

◆ 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 1449 of file MooseApp.C.

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

1450 {
1451  auto & outputs = _mesh_generator_outputs[name];
1452 
1453  outputs.push_back(nullptr);
1454 
1455  return outputs.back();
1456 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
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:894

◆ getMeshModifier()

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

Get a mesh modifier with its name.

Definition at line 1349 of file MooseApp.C.

1350 {
1351  return *_mesh_modifiers.find(MooseUtils::shortName(name))->second.get();
1352 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:363
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:888

◆ 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 1355 of file MooseApp.C.

1356 {
1357  std::vector<std::string> names;
1358  for (auto & pair : _mesh_modifiers)
1359  names.push_back(pair.first);
1360  return names;
1361 }
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:888

◆ getOutputFileBase()

std::string MooseApp::getOutputFileBase ( ) const

Override the selection of the output file base name.

Definition at line 789 of file MooseApp.C.

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

790 {
791  return _output_file_base;
792 }
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:734

◆ 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 406 of file MooseApp.h.

Referenced by TransientMultiApp::setupApp().

406 { 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:829

◆ getOutputPosition()

Point MooseApp::getOutputPosition ( ) const
inline

Get the output position.

Returns
The position offset for the output.

Definition at line 193 of file MooseApp.h.

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

193 { return _output_position; }
Point _output_position
The output position.
Definition: MooseApp.h:740

◆ getOutputWarehouse()

OutputWarehouse & MooseApp::getOutputWarehouse ( )

◆ getParallelMeshOnCommandLine()

bool MooseApp::getParallelMeshOnCommandLine ( ) const
inline

Deprecated.

Call getDistributedMeshOnCommandLine() instead.

Definition at line 322 of file MooseApp.h.

323  {
324  mooseDeprecated("getParallelMeshOnCommandLine() is deprecated, call "
325  "getDistributedMeshOnCommandLine() instead.");
327  }
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:317
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 926 of file MooseApp.h.

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

927 {
928  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
929 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719

◆ getParam() [2/2]

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

Definition at line 933 of file MooseApp.h.

934 {
935  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
936 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719

◆ getPrintableName()

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

Get printable name of the application.

Definition at line 80 of file MooseApp.h.

Referenced by getPrintableVersion().

80 { return "Application"; }

◆ getPrintableVersion()

std::string MooseApp::getPrintableVersion ( ) const

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

Definition at line 441 of file MooseApp.C.

Referenced by setupOptions().

442 {
443  return getPrintableName() + " Version: " + getVersion();
444 }
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:80
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:435

◆ 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 481 of file MooseApp.h.

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

481 { 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:870

◆ getRecoverFileBase()

std::string MooseApp::getRecoverFileBase ( )
inline

The file_base for the recovery file.

Definition at line 357 of file MooseApp.h.

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

357 { 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:820

◆ getRecoverFileSuffix()

std::string MooseApp::getRecoverFileSuffix ( )
inline

The suffix for the recovery file.

Definition at line 373 of file MooseApp.h.

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

373 { 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:823

◆ getRelationshipManagerInfo()

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

Returns the Relationship managers info suitable for printing.

Definition at line 1778 of file MooseApp.C.

Referenced by ConsoleUtils::outputRelationshipManagerInformation().

1779 {
1780  std::vector<std::pair<std::string, std::string>> info_strings;
1781  info_strings.reserve(_relationship_managers.size());
1782 
1783  for (const auto & rm : _relationship_managers)
1784  {
1785  std::stringstream oss;
1786  oss << rm->getInfo();
1787 
1788  auto & for_whom = rm->forWhom();
1789 
1790  if (!for_whom.empty())
1791  {
1792  oss << " for ";
1793 
1794  std::copy(for_whom.begin(), for_whom.end(), infix_ostream_iterator<std::string>(oss, ", "));
1795  }
1796 
1797  info_strings.emplace_back(std::make_pair(Moose::stringify(rm->getType()), oss.str()));
1798  }
1799 
1800  return info_strings;
1801 }
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:61
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:834

◆ getReleationshipManagers()

const std::vector<std::shared_ptr<RelationshipManager> >& MooseApp::getReleationshipManagers ( )

Retrieve the relationship managers.

◆ 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 475 of file MooseApp.h.

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

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

◆ getStartTime()

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

Definition at line 211 of file MooseApp.h.

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

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

◆ getSystemInfo()

const SystemInfo* MooseApp::getSystemInfo ( ) const
inline

Get SystemInfo object.

Returns
A pointer to the SystemInformation object

Definition at line 417 of file MooseApp.h.

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

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

◆ getVersion()

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

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

Definition at line 435 of file MooseApp.C.

Referenced by getPrintableVersion().

436 {
437  return MOOSE_VERSION;
438 }

◆ halfTransient()

bool MooseApp::halfTransient ( )
inline

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

Definition at line 384 of file MooseApp.h.

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

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

◆ hasCachedBackup()

bool MooseApp::hasCachedBackup ( )
inlineprotected

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

Definition at line 676 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup().

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

◆ hasOutputPosition()

bool MooseApp::hasOutputPosition ( ) const
inline

Whether or not an output position has been set.

Returns
True if it has

Definition at line 187 of file MooseApp.h.

Referenced by Exodus::output().

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

◆ hasRecoverFileBase()

bool MooseApp::hasRecoverFileBase ( )

Return true if the recovery file base is set.

Definition at line 882 of file MooseApp.C.

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

◆ hasRelationshipManager()

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

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

Definition at line 1667 of file MooseApp.C.

1668 {
1669  return std::find_if(_relationship_managers.begin(),
1670  _relationship_managers.end(),
1671  [&name](const std::shared_ptr<RelationshipManager> & rm) {
1672  return rm->name() == name;
1673  }) != _relationship_managers.end();
1674 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:834

◆ hasStartTime()

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

Definition at line 206 of file MooseApp.h.

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

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

◆ header()

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

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

Definition at line 1332 of file MooseApp.C.

Referenced by setupOptions().

1333 {
1334  return std::string("");
1335 }

◆ isParamValid()

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

Definition at line 113 of file MooseApp.h.

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

113 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719
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 864 of file MooseApp.C.

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

865 {
866  return _restart;
867 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:808

◆ isSplitMesh()

bool MooseApp::isSplitMesh ( ) const

Whether or not this is a split mesh operation.

Definition at line 870 of file MooseApp.C.

Referenced by MooseMesh::init().

871 {
872  return _split_mesh;
873 }
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:811

◆ isUltimateMaster()

bool MooseApp::isUltimateMaster ( )
inline

Whether or not this app is the ultimate master app.

(ie level == 0)

Definition at line 522 of file MooseApp.h.

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

522 { 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:882

◆ isUseSplit()

bool MooseApp::isUseSplit ( ) const

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

Definition at line 876 of file MooseApp.C.

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

877 {
878  return _use_split;
879 }
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:814

◆ libNameToAppName()

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

Converts a library name to an application name:

Definition at line 1076 of file MooseApp.C.

1077 {
1078  std::string app_name(library_name);
1079 
1080  // Strip off the leading "lib" and trailing ".la"
1081  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
1082  mooseError("Invalid library name: ", app_name);
1083 
1084  return MooseUtils::underscoreToCamelCase(app_name, true);
1085 }
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:331

◆ 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 1195 of file MooseApp.C.

Referenced by dynamicRegistration().

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

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

511 { 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:882

◆ 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 517 of file MooseApp.h.

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

◆ 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 73 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().

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

◆ parameters()

InputParameters& MooseApp::parameters ( )
inline

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 86 of file MooseApp.h.

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

86 { return _pars; }
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719

◆ parser()

Parser& MooseApp::parser ( )
inline

Definition at line 142 of file MooseApp.h.

Referenced by MeshOnlyAction::act().

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

◆ perfGraph()

PerfGraph& MooseApp::perfGraph ( )
inline

Get the PerfGraph for this app.

Definition at line 98 of file MooseApp.h.

Referenced by PerfGraphOutput::output().

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

◆ processor_id()

processor_id_type MooseApp::processor_id ( )
inline

Definition at line 282 of file MooseApp.h.

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

282 { 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:725

◆ 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 888 of file MooseApp.C.

Referenced by Restartable::registerRecoverableDataOnApp().

889 {
890  _recoverable_data.insert(name);
891 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:870

◆ registerRestartableData()

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

Definition at line 1088 of file MooseApp.C.

Referenced by Restartable::registerRestartableDataOnApp().

1091 {
1092  auto & restartable_data = _restartable_data[tid];
1093  auto insert_pair = moose_try_emplace(restartable_data, name, std::move(data));
1094 
1095  if (!insert_pair.second)
1096  mooseError("Attempted to declare restartable twice with the same name: ", name);
1097 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:867
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 904 of file MooseApp.C.

Referenced by restoreCachedBackup().

905 {
906  TIME_SECTION(_restore_timer);
907 
908  mooseAssert(_executioner, "Executioner is nullptr");
909  FEProblemBase & fe_problem = _executioner->feProblem();
910 
911  RestartableDataIO rdio(fe_problem);
912  rdio.restoreBackup(backup, for_restart);
913 }
Class for doing restart.
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:894
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:773
PerfID _restore_timer
Definition: MooseApp.h:911

◆ restoreCachedBackup()

void MooseApp::restoreCachedBackup ( )
protected

Restore from a cached backup.

Definition at line 1558 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1559 {
1560  if (!_cached_backup.get())
1561  mooseError("No cached Backup to restore!");
1562 
1563  TIME_SECTION(_restore_cached_backup_timer);
1564 
1566 
1567  // Release our hold on this Backup
1568  _cached_backup.reset();
1569 }
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:900
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:864
PerfID _restore_cached_backup_timer
Definition: MooseApp.h:915
virtual void restore(std::shared_ptr< Backup > backup, bool for_restart=false)
Restore a Backup.
Definition: MooseApp.C:904

◆ run()

void MooseApp::run ( )
virtual

Run the application.

Definition at line 943 of file MooseApp.C.

944 {
945  TIME_SECTION(_run_timer);
946 
947  try
948  {
949  TIME_SECTION(_setup_timer);
950  setupOptions();
951  runInputFile();
952  }
953  catch (std::exception & err)
954  {
955  mooseError(err.what());
956  }
957 
958  if (!_check_input)
959  {
960  TIME_SECTION(_execute_timer);
962  }
963  else
964  {
965  errorCheck();
966  // Output to stderr, so it is easier for peacock to get the result
967  Moose::err << "Syntax OK" << std::endl;
968  }
969 }
PerfID _run_timer
Definition: MooseApp.h:912
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:447
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:909
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:832
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:834
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:795
PerfID _setup_timer
Timers.
Definition: MooseApp.h:906
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:820

◆ runInputFile()

void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 795 of file MooseApp.C.

Referenced by run().

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

◆ setBackupObject()

void MooseApp::setBackupObject ( std::shared_ptr< Backup backup)

Method for setting the backup object to be restored at a later time.

This method is called during simulation restart or recover before the application is completely setup. The backup object set here, will be restored when needed by a call to restoreCachedBackup().

Parameters
backupThe Backup holding the data for the app.

Definition at line 1552 of file MooseApp.C.

1553 {
1555 }
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:900
virtual std::shared_ptr< Backup > backup()
Create a Backup from the current App.
Definition: MooseApp.C:894

◆ 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 916 of file MooseApp.C.

Referenced by setupOptions().

917 {
924  if (_enable_unused_check != ERROR_UNUSED || warn_is_error)
925  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
926  else
927  mooseInfo("Ignoring request to turn off or warn about unused parameters.\n");
928 }
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 937 of file MooseApp.C.

Referenced by setupOptions().

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

◆ setExecutioner()

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

Set the Executioner for this App.

Definition at line 265 of file MooseApp.h.

Referenced by CreateExecutionerAction::act().

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

◆ 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 300 of file MooseApp.h.

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

300 { 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:799

◆ 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 217 of file MooseApp.h.

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

◆ setInputFileName()

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

Set the input file name.

Definition at line 783 of file MooseApp.C.

784 {
785  _input_filename = input_filename;
786 }
std::string _input_filename
Input file name used.
Definition: MooseApp.h:731

◆ setOutputFileBase()

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

Override the selection of the output file base name.

Definition at line 159 of file MooseApp.h.

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

◆ 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 394 of file MooseApp.h.

395  {
396  _output_file_numbers = numbers;
397  }
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:829

◆ setOutputPosition()

void MooseApp::setOutputPosition ( Point  p)

Tell the app to output in a specific position.

Definition at line 972 of file MooseApp.C.

973 {
974  _output_position_set = true;
975  _output_position = p;
977 
978  if (_executioner.get() != NULL)
979  _executioner->parentOutputPositionChanged();
980 }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:737
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:773
Point _output_position
The output position.
Definition: MooseApp.h:740
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:758

◆ setRecover()

void MooseApp::setRecover ( const bool &  value)

Definition at line 1546 of file MooseApp.C.

1547 {
1548  _recover = value;
1549 }
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:805

◆ setRecoverFileBase()

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

mutator for recover_base (set by RecoverBaseAction)

Definition at line 362 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act().

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

◆ setRecoverFileSuffix()

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

mutator for recover_suffix

Definition at line 378 of file MooseApp.h.

378 { _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:823

◆ setRestart()

void MooseApp::setRestart ( const bool &  value)

Sets the restart/recover flags.

Parameters
stateThe state to set the flag to

Definition at line 1538 of file MooseApp.C.

Referenced by FEProblemBase::setRestartFile().

1539 {
1540  _restart = value;
1541 
1542  std::shared_ptr<FEProblemBase> fe_problem = _action_warehouse.problemBase();
1543 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
std::shared_ptr< FEProblemBase > & problemBase()
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:808

◆ 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 1041 of file MooseApp.C.

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

1042 {
1043  _start_time_set = true;
1044  _start_time = time;
1045 }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:746
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:743

◆ setupOptions()

void MooseApp::setupOptions ( )
virtual

Setup options based on InputParameters.

Definition at line 447 of file MooseApp.C.

Referenced by run().

448 {
449  TIME_SECTION(_setup_options_timer);
450 
451  // MOOSE was updated to have the ability to register execution flags in similar fashion as
452  // objects. However, this change requires all *App.C/h files to be updated with the new
453  // registerExecFlags method. To avoid breaking all applications the default MOOSE flags
454  // are added if nothing has been added to this point. In the future this could go away or
455  // perhaps be a warning.
456  if (_execute_flags.items().empty())
458 
459  // Print the header, this is as early as possible
460  std::string hdr(header() + "\n");
461  if (multiAppLevel() > 0)
463  Moose::out << hdr << std::flush;
464 
465  if (getParam<bool>("error_unused"))
466  setCheckUnusedFlag(true);
467  else if (getParam<bool>("warn_unused"))
468  setCheckUnusedFlag(false);
469 
470  if (getParam<bool>("error_override"))
472 
473  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
474 
475  _half_transient = getParam<bool>("half_transient");
476 
477  // The no_timing flag takes precedence over the timing flag.
478  if (getParam<bool>("no_timing"))
479  {
480  _pars.set<bool>("timing") = false;
481 
482  _perf_graph.setActive(false);
483  }
484 
485  if (isParamValid("trap_fpe") && isParamValid("no_trap_fpe"))
486  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
487  if (isParamValid("trap_fpe"))
488  _trap_fpe = true;
489  else if (isParamValid("no_trap_fpe"))
490  _trap_fpe = false;
491 
492  // Turn all warnings in MOOSE to errors (almost see next logic block)
493  Moose::_warnings_are_errors = getParam<bool>("error");
494 
495  // Deprecated messages can be toggled to errors independently from everything else.
496  Moose::_deprecated_is_error = getParam<bool>("error_deprecated");
497 
498  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
499  {
500  // Toggle the color console off
501  Moose::setColorConsole(true, true); // set default color condition
502  if (getParam<bool>("no_color"))
503  Moose::setColorConsole(false);
504 
505  char * c_color = std::getenv("MOOSE_COLOR");
506  std::string color = "on";
507  if (c_color)
508  color = c_color;
509  if (getParam<std::string>("color") != "default-on")
510  color = getParam<std::string>("color");
511 
512  if (color == "auto")
514  else if (color == "on")
515  Moose::setColorConsole(true, true);
516  else if (color == "off")
517  Moose::setColorConsole(false);
518  else
519  mooseWarning("ignoring invalid --color arg (want 'auto', 'on', or 'off')");
520  }
521 
522  // this warning goes below --color processing to honor that setting for
523  // the warning. And below settings for warnings/error setup.
524  if (getParam<bool>("no_color"))
525  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
526 
527 // If there's no threading model active, but the user asked for
528 // --n-threads > 1 on the command line, throw a mooseError. This is
529 // intended to prevent situations where the user has potentially
530 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
531 // asking for multiple threads, not knowing that there will never be
532 // any threads launched.
533 #if !LIBMESH_USING_THREADS
534  if (libMesh::command_line_value("--n-threads", 1) > 1)
535  mooseError("You specified --n-threads > 1, but there is no threading model active!");
536 #endif
537 
538  // Build a minimal running application, ignoring the input file.
539  if (getParam<bool>("minimal"))
541 
542  else if (getParam<bool>("display_version"))
543  {
544  Moose::perf_log.disable_logging();
545  Moose::out << getPrintableVersion() << std::endl;
546  _ready_to_exit = true;
547  return;
548  }
549  else if (getParam<bool>("help"))
550  {
551  Moose::perf_log.disable_logging();
552 
553  _command_line->printUsage();
554  _ready_to_exit = true;
555  }
556  else if (isParamValid("dump"))
557  {
558  Moose::perf_log.disable_logging();
559 
560  // Get command line argument following --dump on command line
561  std::string following_arg = getParam<std::string>("dump");
562 
563  // The argument following --dump is a parameter search string,
564  // which can be empty.
565  std::string param_search;
566  if (!following_arg.empty() && (following_arg.find('-') != 0))
567  param_search = following_arg;
568 
569  JsonSyntaxTree tree(param_search);
571  JsonInputFileFormatter formatter;
572  Moose::out << "### START DUMP DATA ###\n"
573  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###\n";
574  _ready_to_exit = true;
575  }
576  else if (isParamValid("registry"))
577  {
578  Moose::out << "Label\tType\tName\tClass\tFile\n";
579 
580  auto & objmap = Registry::allObjects();
581  for (auto & entry : objmap)
582  {
583  for (auto & obj : entry.second)
584  {
585  std::string name = obj._name;
586  if (name.empty())
587  name = obj._alias;
588  if (name.empty())
589  name = obj._classname;
590 
591  Moose::out << entry.first << "\tobject\t" << name << "\t" << obj._classname << "\t"
592  << obj._file << "\n";
593  }
594  }
595 
596  auto & actmap = Registry::allActions();
597  for (auto & entry : actmap)
598  {
599  for (auto & act : entry.second)
600  Moose::out << entry.first << "\taction\t" << act._name << "\t" << act._classname << "\t"
601  << act._file << "\n";
602  }
603 
604  _ready_to_exit = true;
605  }
606  else if (isParamValid("registry_hit"))
607  {
608  Moose::out << "### START REGISTRY DATA ###\n";
609 
610  hit::Section root("");
611  auto sec = new hit::Section("registry");
612  root.addChild(sec);
613  auto objsec = new hit::Section("objects");
614  sec->addChild(objsec);
615 
616  auto & objmap = Registry::allObjects();
617  for (auto & entry : objmap)
618  {
619  for (auto & obj : entry.second)
620  {
621  std::string name = obj._name;
622  if (name.empty())
623  name = obj._alias;
624  if (name.empty())
625  name = obj._classname;
626 
627  auto ent = new hit::Section("entry");
628  objsec->addChild(ent);
629  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
630  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "object"));
631  ent->addChild(new hit::Field("name", hit::Field::Kind::String, name));
632  ent->addChild(new hit::Field("class", hit::Field::Kind::String, obj._classname));
633  ent->addChild(new hit::Field("file", hit::Field::Kind::String, obj._file));
634  }
635  }
636 
637  auto actsec = new hit::Section("actions");
638  sec->addChild(actsec);
639  auto & actmap = Registry::allActions();
640  for (auto & entry : actmap)
641  {
642  for (auto & act : entry.second)
643  {
644  auto ent = new hit::Section("entry");
645  actsec->addChild(ent);
646  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
647  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "action"));
648  ent->addChild(new hit::Field("task", hit::Field::Kind::String, act._name));
649  ent->addChild(new hit::Field("class", hit::Field::Kind::String, act._classname));
650  ent->addChild(new hit::Field("file", hit::Field::Kind::String, act._file));
651  }
652  }
653 
654  Moose::out << root.render();
655 
656  Moose::out << "\n### END REGISTRY DATA ###\n";
657  _ready_to_exit = true;
658  }
659  else if (isParamValid("definition"))
660  {
661  Moose::perf_log.disable_logging();
662  JsonSyntaxTree tree("");
664  SONDefinitionFormatter formatter;
665  Moose::out << formatter.toString(tree.getRoot()) << "\n";
666  _ready_to_exit = true;
667  }
668  else if (isParamValid("yaml"))
669  {
670  Moose::perf_log.disable_logging();
671 
673 
674  // Get command line argument following --yaml on command line
675  std::string yaml_following_arg = getParam<std::string>("yaml");
676 
677  // If the argument following --yaml is non-existent or begins with
678  // a dash, call buildFullTree() with an empty string, otherwise
679  // pass the argument following --yaml.
680  if (yaml_following_arg.empty() || (yaml_following_arg.find('-') == 0))
682  else
683  _parser.buildFullTree(yaml_following_arg);
684 
685  _ready_to_exit = true;
686  }
687  else if (isParamValid("json"))
688  {
689  Moose::perf_log.disable_logging();
690 
691  // Get command line argument following --json on command line
692  std::string json_following_arg = getParam<std::string>("json");
693 
694  // The argument following --json is a parameter search string,
695  // which can be empty.
696  std::string search;
697  if (!json_following_arg.empty() && (json_following_arg.find('-') != 0))
698  search = json_following_arg;
699 
700  JsonSyntaxTree tree(search);
702 
703  Moose::out << "**START JSON DATA**\n" << tree.getRoot() << "\n**END JSON DATA**\n";
704  _ready_to_exit = true;
705  }
706  else if (getParam<bool>("syntax"))
707  {
708  Moose::perf_log.disable_logging();
709 
710  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
711  Moose::out << "**START SYNTAX DATA**\n";
712  for (const auto & it : syntax)
713  Moose::out << it.first << "\n";
714  Moose::out << "**END SYNTAX DATA**\n" << std::endl;
715  _ready_to_exit = true;
716  }
717  else if (_input_filename != "" ||
718  isParamValid("input_file")) // They already specified an input filename
719  {
720  if (_input_filename == "")
721  _input_filename = getParam<std::string>("input_file");
722 
723  if (isParamValid("recover"))
724  {
725  // We need to set the flag manually here since the recover parameter is a string type (takes
726  // an optional filename)
727  _recover = true;
728 
729  // Get command line argument following --recover on command line
730  std::string recover_following_arg = getParam<std::string>("recover");
731 
732  // If the argument following --recover is non-existent or begins with
733  // a dash then we are going to eventually find the newest recovery file to use
734  if (!(recover_following_arg.empty() || (recover_following_arg.find('-') == 0)))
735  _recover_base = recover_following_arg;
736  }
737 
738  // Optionally get command line argument following --recoversuffix
739  // on command line. Currently this argument applies to both
740  // recovery and restart files.
741  if (isParamValid("recoversuffix"))
742  {
743  _recover_suffix = getParam<std::string>("recoversuffix");
744  }
745 
747 
748  if (isParamValid("mesh_only"))
749  {
750  _syntax.registerTaskName("mesh_only", true);
751  _syntax.addDependency("mesh_only", "setup_mesh_complete");
752  _action_warehouse.setFinalTask("mesh_only");
753  }
754  else if (isParamValid("split_mesh"))
755  {
756  _split_mesh = true;
757  _syntax.registerTaskName("split_mesh", true);
758  _syntax.addDependency("split_mesh", "setup_mesh_complete");
759  _action_warehouse.setFinalTask("split_mesh");
760  }
762  }
763  else if (getParam<bool>("apptype"))
764  {
765  Moose::perf_log.disable_logging();
766  Moose::out << "MooseApp Type: " << type() << std::endl;
767  _ready_to_exit = true;
768  }
769  else
770  {
771  Moose::perf_log.disable_logging();
772 
773  if (_check_input)
774  mooseError("You specified --check-input, but did not provide an input file. Add -i "
775  "<inputfile> to your command line.");
776 
777  _command_line->printUsage();
778  _ready_to_exit = true;
779  }
780 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
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:310
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:916
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:550
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:479
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:511
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:832
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:113
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:755
Syntax & syntax()
Definition: MooseApp.h:144
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:817
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:767
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:826
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:770
void initSyntaxFormatter(SyntaxFormatterType type, bool dump_mode)
Creates a syntax formatter for printing.
Definition: Parser.C:632
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:937
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:752
void registerExecFlags(Factory &factory)
Definition: Moose.C:350
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:552
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:907
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:805
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:731
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:728
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:719
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:820
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:802
ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:903
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:544
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:1332
Factory _factory
Definition: MooseApp.h:792
void buildJsonSyntaxTree(JsonSyntaxTree &tree) const
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
Definition: Parser.C:649
std::string _name
The name of this object.
Definition: MooseApp.h:716
const std::string & type() const
Get the type of this object as a string.
Definition: MooseApp.h:93
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:441
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:522
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:1572
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:796
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:823
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:811
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:482
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 144 of file MooseApp.h.

Referenced by dynamicAllRegistration(), and setupOptions().

144 { return _syntax; }
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:755

◆ theWarehouse()

TheWarehouse& MooseApp::theWarehouse ( )
inline

Definition at line 64 of file MooseApp.h.

Referenced by FEProblemBase::theWarehouse().

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

◆ 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 93 of file MooseApp.h.

Referenced by setupOptions().

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

◆ useEigenvalue()

bool& MooseApp::useEigenvalue ( )
inline

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

Definition at line 275 of file MooseApp.h.

Referenced by CreateProblemDefaultAction::act().

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

◆ useNonlinear()

bool& MooseApp::useNonlinear ( )
inline

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

Definition at line 270 of file MooseApp.h.

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

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

Friends And Related Function Documentation

◆ FEProblemBase

friend class FEProblemBase
friend

Definition at line 919 of file MooseApp.h.

◆ Restartable

friend class Restartable
friend

Definition at line 920 of file MooseApp.h.

◆ SubProblem

friend class SubProblem
friend

Definition at line 921 of file MooseApp.h.

Member Data Documentation

◆ _action_factory

ActionFactory MooseApp::_action_factory
protected

The Factory responsible for building Actions.

Definition at line 764 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 900 of file MooseApp.h.

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

◆ _check_input

bool MooseApp::_check_input
protected

true if we want to just check the input file

Definition at line 832 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 725 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 752 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(), MultiApp::backup(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualTags(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppVectorPostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppProjectionTransfer::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(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), PicardSolve::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), PicardSolve::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 916 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 802 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 795 of file MooseApp.h.

Referenced by setErrorOverridden().

◆ _execute_executioner_timer

PerfID MooseApp::_execute_executioner_timer
private

Definition at line 910 of file MooseApp.h.

Referenced by executeExecutioner().

◆ _execute_flags

ExecFlagEnum MooseApp::_execute_flags
private

Execution flags for this App.

Definition at line 903 of file MooseApp.h.

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

◆ _execute_mesh_generators_timer

PerfID MooseApp::_execute_mesh_generators_timer
private

Definition at line 914 of file MooseApp.h.

Referenced by executeMeshGenerators().

◆ _execute_mesh_modifiers_timer

PerfID MooseApp::_execute_mesh_modifiers_timer
private

Definition at line 913 of file MooseApp.h.

Referenced by executeMeshModifiers().

◆ _execute_timer

PerfID MooseApp::_execute_timer
private

Definition at line 909 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 773 of file MooseApp.h.

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

◆ _factory

Factory MooseApp::_factory
protected

◆ _final_generated_meshes

std::list<std::unique_ptr<MeshBase> *> MooseApp::_final_generated_meshes
private

The final Mesh that is generated by the generators.

Definition at line 897 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 749 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 826 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 799 of file MooseApp.h.

Referenced by setFileRestart().

◆ _input_filename

std::string MooseApp::_input_filename
protected

Input file name used.

Definition at line 731 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 761 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 837 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 894 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 891 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 888 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 882 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 885 of file MooseApp.h.

Referenced by multiAppNumber().

◆ _name

std::string MooseApp::_name
protected

The name of this object.

Definition at line 716 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 734 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 829 of file MooseApp.h.

Referenced by getOutputFileNumbers(), and setOutputFileNumbers().

◆ _output_position

Point MooseApp::_output_position
protected

The output position.

Definition at line 740 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 737 of file MooseApp.h.

Referenced by hasOutputPosition(), and setOutputPosition().

◆ _output_warehouse

OutputWarehouse MooseApp::_output_warehouse
protected

OutputWarehouse object for this App.

Definition at line 758 of file MooseApp.h.

Referenced by getOutputWarehouse(), and setOutputPosition().

◆ _pars

InputParameters MooseApp::_pars
protected

Parameters of this object.

Definition at line 719 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 770 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 728 of file MooseApp.h.

Referenced by perfGraph(), and setupOptions().

◆ _ready_to_exit

bool MooseApp::_ready_to_exit
protected

Definition at line 796 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 805 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 820 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 823 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 870 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 808 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 867 of file MooseApp.h.

Referenced by getRestartableData(), and registerRestartableData().

◆ _restore_cached_backup_timer

PerfID MooseApp::_restore_cached_backup_timer
private

Definition at line 915 of file MooseApp.h.

Referenced by restoreCachedBackup().

◆ _restore_timer

PerfID MooseApp::_restore_timer
private

Definition at line 911 of file MooseApp.h.

Referenced by restore().

◆ _run_input_file_timer

PerfID MooseApp::_run_input_file_timer
private

Definition at line 908 of file MooseApp.h.

Referenced by runInputFile().

◆ _run_timer

PerfID MooseApp::_run_timer
private

Definition at line 912 of file MooseApp.h.

Referenced by run().

◆ _setup_options_timer

PerfID MooseApp::_setup_options_timer
private

Definition at line 907 of file MooseApp.h.

Referenced by setupOptions().

◆ _setup_timer

PerfID MooseApp::_setup_timer
private

Timers.

Definition at line 906 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 811 of file MooseApp.h.

Referenced by addRelationshipManager(), isSplitMesh(), and setupOptions().

◆ _start_time

Real MooseApp::_start_time
protected

The time at which to start the simulation.

Definition at line 746 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 743 of file MooseApp.h.

Referenced by hasStartTime(), and setStartTime().

◆ _syntax

Syntax MooseApp::_syntax
protected

Syntax of the input file.

Definition at line 755 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 782 of file MooseApp.h.

Referenced by getSystemInfo(), and MooseApp().

◆ _the_warehouse

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

Definition at line 879 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 817 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 722 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 779 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 776 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 814 of file MooseApp.h.

Referenced by isUseSplit().


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