www.mooseframework.org
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static 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]

Classes

struct  DynamicLibraryInfo
 
struct  FixedPointConfig
 Stores configuration options relating to the fixed-point solving capability. More...
 
struct  InterfaceRegistryObjects
 
struct  InterfaceRegistryObjectsBase
 

Public Member Functions

virtual ~MooseApp ()
 
TheWarehousetheWarehouse ()
 
virtual std::string getPrintableName () const
 Get printable name of the application. More...
 
virtual std::string appBinaryName () const
 
InputParametersparameters ()
 Get the parameters of the object. More...
 
const RankMaprankMap ()
 The RankMap is a useful object for determining how the processes are laid out on the physical nodes of the cluster. More...
 
PerfGraphperfGraph ()
 Get the PerfGraph for this app. More...
 
SolutionInvaliditysolutionInvalidity ()
 Get the SolutionInvalidity for this app. More...
 
template<typename T >
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 Retrieve a renamed parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) 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 ()
 Return a writable reference to the ActionWarehouse associated with this app. More...
 
const ActionWarehouseactionWarehouse () const
 Return a const reference to the ActionWarehouse associated with this app. More...
 
Moose::Builderbuilder ()
 Returns a writable reference to the builder. More...
 
Syntaxsyntax ()
 Returns a writable reference to the syntax object. More...
 
const std::vector< std::string > & getInputFileNames () const
 
const std::string & getLastInputFileName () const
 
void setOutputFileBase (const std::string &output_file_base)
 Override the selection of the output file base name. More...
 
std::string getOutputFileBase (bool for_non_moose_build_output=false) const
 Get the output file base name. More...
 
void setOutputPosition (const 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 (Real time)
 Set the starting time for the simulation. More...
 
bool hasStartTime () const
 
Real getStartTime () const
 
void setGlobalTimeOffset (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 primary (first) filename that was parsed Note: When stripLeadingPath is false, this function returns the same name as getInputFileName() method when the input file is not a link. 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...
 
ExecutorgetExecutor () const
 
NullExecutorgetNullExecutor () const
 
bool useExecutor () const
 
FEProblemBasefeProblem () const
 
void setExecutioner (std::shared_ptr< Executioner > &&executioner)
 Set the Executioner for this App. More...
 
void setExecutor (std::shared_ptr< Executor > &&executor)
 
void addExecutor (const std::string &type, const std::string &name, const InputParameters &params)
 
void addExecutorParams (const std::string &type, const std::string &name, const InputParameters &params)
 Adds the parameters for an Executor to the list of parameters. More...
 
Parserparser ()
 
void createExecutors ()
 After adding all of the Executor Params - this function will actually cause all of them to be built. More...
 
ExecutorgetExecutor (const std::string &name, bool fail_if_not_found=true)
 Get an Executor. More...
 
FixedPointConfigfixedPointConfig ()
 This info is stored here because we need a "globalish" place to put it in order to allow communication between a multiapp and solver-specific internals (i.e. More...
 
bool & useNonlinear ()
 Returns a writable Boolean indicating whether this app will use a Nonlinear or Eigen System. More...
 
bool & useEigenvalue ()
 Returns a writable Boolean indicating whether this app will use an eigenvalue executioner. More...
 
FactorygetFactory ()
 Retrieve a writable reference to the Factory associated with this App. More...
 
ActionFactorygetActionFactory ()
 Retrieve a writable reference to the ActionFactory associated with this App. More...
 
processor_id_type processor_id () const
 Returns the MPI processor ID of the current processor. More...
 
std::shared_ptr< CommandLinecommandLine () const
 Get the command line. More...
 
void setExodusFileRestart (bool flag)
 Set the flag to indicate whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh. More...
 
bool getExodusFileRestart () const
 Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh. More...
 
void setExReaderForRestart (std::shared_ptr< ExodusII_IO > &&exreader)
 Set the Exodus reader to restart variables from an Exodus mesh file. More...
 
ExodusII_IO * getExReaderForRestart () const
 Get the Exodus reader to restart variables from an Exodus mesh file. 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 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...
 
void setRestartRecoverFileBase (const std::string &file_base)
 mutator for recover_base (set by RecoverBaseAction) More...
 
bool testCheckpointHalfTransient () const
 Whether or not this simulation should only run half its transient (useful for testing recovery) More...
 
void setOutputFileNumbers (const 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...
 
const std::map< std::string, unsigned int > & getOutputFileNumbers () const
 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 paths of loaded libraries. More...
 
std::set< std::string > getLibrarySearchPaths (const std::string &library_path_from_param) const
 Return the paths searched by MOOSE when loading libraries. More...
 
InputParameterWarehousegetInputParameterWarehouse ()
 Get the InputParameterWarehouse for MooseObjects. More...
 
RestartableDataValueregisterRestartableData (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
 
RestartableDataValueregisterRestartableData (const std::string &name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
 
bool hasRestartableMetaData (const std::string &name, const RestartableDataMapName &metaname) const
 
RestartableDataValuegetRestartableMetaData (const std::string &name, const RestartableDataMapName &metaname, THREAD_ID tid)
 
void possiblyLoadRestartableMetaData (const RestartableDataMapName &name, const std::filesystem::path &folder_base)
 Loads the restartable meta data for name if it is available with the folder base folder_base. More...
 
void loadRestartableMetaData (const std::filesystem::path &folder_base)
 Loads all available restartable meta data if it is available with the folder base folder_base. More...
 
std::vector< std::filesystem::path > writeRestartableMetaData (const RestartableDataMapName &name, const std::filesystem::path &folder_base)
 Writes the restartable meta data for name with a folder base of folder_base. More...
 
std::vector< std::filesystem::path > writeRestartableMetaData (const std::filesystem::path &folder_base)
 Writes all available restartable meta data with a file base of file_base. More...
 
RestartableDataMapgetRestartableDataMap (const RestartableDataMapName &name)
 Return a reference to restartable data for the specific type flag. More...
 
bool hasRestartableDataMap (const RestartableDataMapName &name) const
 
void registerRestartableDataMapName (const RestartableDataMapName &name, std::string suffix="")
 Reserve a location for storing custom RestartableDataMap objects. More...
 
const std::string & getRestartableDataMapName (const RestartableDataMapName &name) const
 
const DataNamesgetRecoverableData () const
 Return a reference to the recoverable data object. More...
 
std::vector< std::filesystem::path > backup (const std::filesystem::path &folder_base)
 Backs up the application to the folder folder_base. More...
 
std::unique_ptr< Backupbackup ()
 Backs up the application memory in a Backup. More...
 
virtual void preBackup ()
 Insertion point for other apps that is called before backup() More...
 
void restore (const std::filesystem::path &folder_base, const bool for_restart)
 Restore an application from file. More...
 
void restore (std::unique_ptr< Backup > backup, const bool for_restart)
 Restore an application from the backup backup. More...
 
virtual void postRestore (const bool)
 Insertion point for other apps that is called after restore() More...
 
void restoreFromInitialBackup (const bool for_restart)
 Restores from a "initial" backup, that is, one set in _initial_backup. More...
 
std::unique_ptr< BackupfinalizeRestore ()
 Finalizes (closes) the restoration process done in restore(). 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 () const
 Whether or not this app is the ultimate master app. More...
 
const MooseMeshmasterMesh () const
 Returns a pointer to the master mesh. More...
 
const MooseMeshmasterDisplacedMesh () const
 Returns a pointer to the master displaced mesh. More...
 
MeshGeneratorSystemgetMeshGeneratorSystem ()
 Gets the system that manages the MeshGenerators. More...
 
void addMeshGenerator (const std::string &type, const std::string &name, const InputParameters &params)
 Add a mesh generator that will act on the meshes in the system. More...
 
bool hasMeshGenerator (const MeshGeneratorName &name) const
 
const MeshGeneratorgetMeshGenerator (const std::string &name) const
 
std::unique_ptr< MeshBase > getMeshGeneratorMesh ()
 
std::vector< std::string > getMeshGeneratorNames () const
 
const MeshGeneratorappendMeshGenerator (const std::string &type, const std::string &name, InputParameters params)
 Append a mesh generator that will act on the final mesh generator in the system. More...
 
virtual bool constructingMeshGenerators () const
 Whether this app is constructing mesh generators. 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...
 
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...
 
std::filesystem::path restartFolderBase (const std::filesystem::path &folder_base) const
 The file suffix for restartable data. More...
 
const hit::Node * getCurrentActionHitNode () const
 
void attachRelationshipManagers (Moose::RelationshipManagerType rm_type, bool attach_geometric_rm_final=false)
 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...
 
void attachRelationshipManagers (MeshBase &mesh, MooseMesh &moose_mesh)
 Attach geometric relationship managers to the given MeshBase object. 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...
 
bool hasInitialBackup () const
 
bool defaultAutomaticScaling () const
 Whether to enable automatic scaling by default. More...
 
const std::shared_ptr< Parallel::Communicator > getCommunicator () const
 
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers () const
 Return the container of relationship managers. More...
 
void checkMetaDataIntegrity () const
 Function to check the integrity of the restartable meta data structure. More...
 
virtual bool errorOnJacobianNonzeroReallocation () const
 Whether this application should by default error on Jacobian nonzero reallocations. More...
 
template<class T >
void registerInterfaceObject (T &interface)
 Registers an interface object for accessing with getInterfaceObjects. More...
 
template<class T >
const std::vector< T * > & getInterfaceObjects () const
 Gets the registered interface objects for a given interface. More...
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
MooseAppgetMooseApp () const
 Get the MooseApp this class is associated with. More...
 
const std::string & type () const
 Get the type of this class. More...
 
virtual const std::string & name () const
 Get the name of the class. More...
 
std::string typeAndName () const
 Get the class's combined type and name; useful in error handling. More...
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 Calls moose error with the message msg. 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
 
bool hasRestartRecoverFileBase () const
 Return true if the recovery file base is set. More...
 
bool hasRecoverFileBase () const
 
std::string getRestartRecoverFileBase () const
 The file_base for the recovery file. More...
 
std::string getRecoverFileBase () 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, bool lib_load_deps)
 
const std::vector< RestartableDataMap > & getRestartableData () const
 Return reference to the restartable data object. More...
 
std::vector< RestartableDataMap > & getRestartableData ()
 
void setRestart (bool value)
 Sets the restart/recover flags. More...
 
void setRecover (bool value)
 
auto getRestartableDataMapBegin ()
 Iterator based access to the extra RestartableDataMap objects; see Checkpoint.C for use case. More...
 
auto getRestartableDataMapEnd ()
 

Static Public Member Functions

static InputParameters validParams ()
 
static const std::string & checkpointSuffix ()
 The file suffix for the checkpoint mesh. More...
 
static std::filesystem::path metaDataFolderBase (const std::filesystem::path &folder_base, const std::string &map_suffix)
 The file suffix for meta data (header and data) More...
 
static void addAppParam (InputParameters &params)
 

Public Attributes

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

Static Public Attributes

static const RestartableDataMapName MESH_META_DATA = "MeshMetaData"
 
static const std::string MESH_META_DATA_SUFFIX = "mesh"
 

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

void dynamicRegistration (const Parameters &params)
 Helper method for dynamic loading of objects. More...
 
void loadLibraryAndDependencies (const std::string &library_filename, const Parameters &params, bool load_dependencies=true)
 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 registerRestartableNameWithFilter (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 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...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing. More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 Call to register a named section for timing. More...
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

const 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...
 
std::string _output_file_base
 The output file basename. More...
 
bool _file_base_set_by_user
 Whether or not file base is set through input or setOutputFileBase by MultiApp. 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...
 
std::unique_ptr< InputParameterWarehouse_input_parameter_warehouse
 Input parameter storage structure; unique_ptr so we can control its destruction order. More...
 
ActionFactory _action_factory
 The Factory responsible for building Actions. More...
 
ActionWarehouse _action_warehouse
 Where built actions are stored. More...
 
OutputWarehouse _output_warehouse
 OutputWarehouse object for this App. More...
 
const std::shared_ptr< Parser_parser
 Parser for parsing the input file. More...
 
Moose::Builder _builder
 Builder for building app related parser tree. More...
 
std::vector< RestartableDataMap_restartable_data
 Where the restartable data is held (indexed on tid) More...
 
DataNames _recoverable_data_names
 Data names that will only be read from the restart file during RECOVERY. More...
 
PerfGraph_perf_graph
 The PerfGraph object for this application (recoverable) More...
 
SolutionInvalidity_solution_invalidity
 The SolutionInvalidity object for this application. More...
 
const RankMap _rank_map
 The RankMap is a useful object for determining how the processes are laid out on the physical hardware. More...
 
std::shared_ptr< Executioner_executioner
 Pointer to the executioner of this run (typically build by actions) More...
 
std::shared_ptr< Executor_executor
 Pointer to the Executor of this run. More...
 
std::map< std::string, std::shared_ptr< Executor > > _executors
 Pointers to all of the Executors for this run. More...
 
std::unordered_map< std::string, std::pair< std::string, std::unique_ptr< InputParameters > > > _executor_params
 Used in building the Executors Maps the name of the Executor block to the <type, params> More...
 
FixedPointConfig _fixed_point_config
 Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and used by the executioner/executor system. More...
 
const bool _use_executor
 Indicates whether we are operating in the new/experimental executor mode instead of using the legacy executioner system. More...
 
std::shared_ptr< NullExecutor_null_executor
 Used to return an executor that does nothing. 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...
 
std::shared_ptr< ExodusII_IO > _ex_reader
 The Exodus reader when _initial_from_file is set to true. 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 _restart_recover_base
 The base name to restart/recover from. If blank then we will find the newest checkpoint file. More...
 
bool _test_checkpoint_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::set< std::shared_ptr< RelationshipManager > > _relationship_managers
 The relationship managers that have been added. More...
 
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
 The relationship managers that have been attached (type -> RMs) More...
 
std::unordered_map< RelationshipManager *, std::shared_ptr< GhostingFunctor > > _undisp_to_disp_rms
 A map from undisplaced relationship managers to their displaced clone (stored as the base GhostingFunctor). More...
 
std::unordered_map< std::string, DynamicLibraryInfo_lib_handles
 The library archive (name only), registration method and the handle to the method. More...
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph. More...
 
const std::string _prefix
 A prefix to use for all sections. More...
 
const Parallel::Communicator & _communicator
 
MooseApp_app
 The MOOSE application this is associated with. More...
 

Private Types

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

Private Member Functions

void recursivelyCreateExecutors (const std::string &current_executor_name, std::list< std::string > &possible_roots, std::list< std::string > &current_branch)
 Internal function used to recursively create the executor objects. More...
 
void removeRelationshipManager (std::shared_ptr< RelationshipManager > relationship_manager)
 Purge this relationship manager from meshes and DofMaps and finally from us. More...
 
void createMinimalApp ()
 Method for creating the minimum required actions for an application (no input file) 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...
 
bool hasRMClone (const RelationshipManager &template_rm, const MeshBase &mesh) const
 
RelationshipManagergetRMClone (const RelationshipManager &template_rm, const MeshBase &mesh) const
 Return the relationship manager clone originally created from the provided template relationship manager and mesh. More...
 
RelationshipManagercreateRMFromTemplateAndInit (const RelationshipManager &template_rm, MooseMesh &moose_mesh, MeshBase &mesh, const DofMap *dof_map=nullptr)
 Take an input relationship manager, clone it, and then initialize it with provided mesh and optional dof_map. More...
 
PerfGraphcreateRecoverablePerfGraph ()
 Creates a recoverable PerfGraph. More...
 
SolutionInvaliditycreateRecoverableSolutionInvalidity ()
 Creates a recoverable SolutionInvalidity. More...
 
bool showInputs () const
 Prints a message showing the installable inputs for a given application (if getInstallableInputs has been overridden for an application). More...
 
virtual std::string getInstallableInputs () const
 Method to retrieve the installable inputs from a given applications <app>Revision.h file. More...
 
bool copyInputs () const
 Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a readable installed directory) and recursively copies those files into a read/writable location for the user. More...
 
bool runInputs () const
 Handles the run input parameter logic: Checks to see whether a directory exists in user space and launches the TestHarness to process the given directory. More...
 

Private Attributes

std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
 General storage for custom RestartableData that can be added to from outside applications. More...
 
std::unique_ptr< TheWarehouse_the_warehouse
 The combined warehouse for storing any MooseObject based object. More...
 
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...
 
const MooseMesh *const _master_mesh
 The mesh from master app. More...
 
const MooseMesh *const _master_displaced_mesh
 The displaced mesh from master app. More...
 
MeshGeneratorSystem _mesh_generator_system
 The system that manages the MeshGenerators. More...
 
RestartableDataReader _rd_reader
 
const ExecFlagEnum _execute_flags
 Execution flags for this App. More...
 
std::streambuf * _output_buffer_cache
 Cache output buffer so the language server can turn it off then back on. More...
 
const bool _automatic_automatic_scaling
 Whether to turn on automatic scaling by default. More...
 
bool _cpu_profiling = false
 CPU profiling. More...
 
bool _heap_profiling = false
 Memory profiling. More...
 
std::map< const RelationshipManager *, std::map< const MeshBase *, std::unique_ptr< RelationshipManager > > > _template_to_clones
 Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase object and the clone of the template relationship manager, e.g. More...
 
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
 Registration for interface objects. More...
 
std::unique_ptr< Backup > *const _initial_backup
 The backup for use in initial setup; this will get set from the _initial_backup input parameter that typically gets set from a MultiApp that has a backup This is a pointer to a pointer because at the time of construction of the app, the backup will not be filled yet. More...
 

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

Member Enumeration Documentation

◆ RegistrationType

Enumeration for holding the valid types of dynamic registrations allowed.

Enumerator
APPLICATION 
REGALL 

Definition at line 1395 of file MooseApp.h.

1396  {
1397  APPLICATION,
1398  REGALL
1399  };

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

1199  {
1200  OFF,
1201  WARN_UNUSED,
1202  ERROR_UNUSED
enum MooseApp::UNUSED_CHECK _enable_unused_check

Constructor & Destructor Documentation

◆ ~MooseApp()

MooseApp::~MooseApp ( )
virtual

Definition at line 631 of file MooseApp.C.

632 {
633 #ifdef HAVE_GPERFTOOLS
634  // CPU profiling stop
635  if (_cpu_profiling)
636  ProfilerStop();
637  // Heap profiling stop
638  if (_heap_profiling)
639  HeapProfilerStop();
640 #endif
642  _executioner.reset();
643  _the_warehouse.reset();
644 
645  // Don't wait for implicit destruction of input parameter storage
647 
648  // This is dirty, but I don't know what else to do. Obviously, others
649  // have had similar problems if you look above. In specific, the
650  // dlclose below on macs is destructing some data that does not
651  // belong to it in garbage collection. So... don't even give
652  // dlclose an option
653  _restartable_data.clear();
654 
655 #ifdef LIBMESH_HAVE_DLOPEN
656  // Close any open dynamic libraries
657  for (const auto & lib_pair : _lib_handles)
658  dlclose(lib_pair.second.library_handle);
659 #endif
660 }
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1402
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1440
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1268
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1437
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1128
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 358 of file MooseApp.C.

359  : ConsoleStreamInterface(*this),
360  PerfGraphInterface(*this, "MooseApp"),
361  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
362  "_comm")), // Can't call getParam() before pars is set
363  MooseBase(parameters.get<std::string>("_type"),
364  parameters.get<std::string>("_app_name"),
365  *this,
366  _pars),
367  _pars(parameters),
368  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
369  _file_base_set_by_user(false),
370  _output_position_set(false),
371  _start_time_set(false),
372  _start_time(0.0),
373  _global_time_offset(0.0),
374  _input_parameter_warehouse(std::make_unique<InputParameterWarehouse>()),
375  _action_factory(*this),
377  _output_warehouse(*this),
378  _parser(parameters.get<std::shared_ptr<Parser>>("_parser")),
384  _use_executor(parameters.get<bool>("use_executor")),
385  _null_executor(NULL),
386  _use_nonlinear(true),
387  _use_eigen_value(false),
389  _factory(*this),
390  _error_overridden(false),
391  _ready_to_exit(false),
392  _initial_from_file(false),
394  _recover(false),
395  _restart(false),
396  _split_mesh(false),
397  _use_split(parameters.get<bool>("use_split")),
398 #ifdef DEBUG
399  _trap_fpe(true),
400 #else
401  _trap_fpe(false),
402 #endif
404  _check_input(getParam<bool>("check_input")),
406  isParamValid("_multiapp_level") ? parameters.get<unsigned int>("_multiapp_level") : 0),
408  isParamValid("_multiapp_number") ? parameters.get<unsigned int>("_multiapp_number") : 0),
409  _master_mesh(isParamValid("_master_mesh") ? parameters.get<const MooseMesh *>("_master_mesh")
410  : nullptr),
411  _master_displaced_mesh(isParamValid("_master_displaced_mesh")
412  ? parameters.get<const MooseMesh *>("_master_displaced_mesh")
413  : nullptr),
414  _mesh_generator_system(*this),
417  _output_buffer_cache(nullptr),
418  _automatic_automatic_scaling(getParam<bool>("automatic_automatic_scaling")),
419  _initial_backup(getParam<std::unique_ptr<Backup> *>("_initial_backup"))
420 {
421  // Set the TIMPI sync type via --timpi-sync
422  const auto & timpi_sync = parameters.get<std::string>("timpi_sync");
423  const_cast<Parallel::Communicator &>(comm()).sync_type(timpi_sync);
424 
425 #ifdef HAVE_GPERFTOOLS
426  if (isUltimateMaster())
427  {
428  bool has_cpu_profiling = false;
429  bool has_heap_profiling = false;
430  static std::string cpu_profile_file;
431  static std::string heap_profile_file;
432 
433  // For CPU profiling, users need to have environment 'MOOSE_PROFILE_BASE'
434  if (std::getenv("MOOSE_PROFILE_BASE"))
435  {
436  has_cpu_profiling = true;
437  cpu_profile_file =
438  std::getenv("MOOSE_PROFILE_BASE") + std::to_string(_comm->rank()) + ".prof";
439  // create directory if needed
440  auto name = MooseUtils::splitFileName(cpu_profile_file);
441  if (!name.first.empty())
442  {
443  if (processor_id() == 0)
444  MooseUtils::makedirs(name.first.c_str());
445  _comm->barrier();
446  }
447  }
448 
449  // For Heap profiling, users need to have 'MOOSE_HEAP_BASE'
450  if (std::getenv("MOOSE_HEAP_BASE"))
451  {
452  has_heap_profiling = true;
453  heap_profile_file = std::getenv("MOOSE_HEAP_BASE") + std::to_string(_comm->rank());
454  // create directory if needed
455  auto name = MooseUtils::splitFileName(heap_profile_file);
456  if (!name.first.empty())
457  {
458  if (processor_id() == 0)
459  MooseUtils::makedirs(name.first.c_str());
460  _comm->barrier();
461  }
462  }
463 
464  // turn on profiling only on selected ranks
465  if (isParamValid("gperf_profiler_on"))
466  {
467  auto rankstr = getParam<std::string>("gperf_profiler_on");
468  std::vector<processor_id_type> ranks;
469  bool success = MooseUtils::tokenizeAndConvert(rankstr, ranks, ", ");
470  if (!success)
471  mooseError("Invalid argument for --gperf-profiler-on: '", rankstr, "'");
472  for (auto & rank : ranks)
473  {
474  if (rank >= _comm->size())
475  mooseError("Invalid argument for --gperf-profiler-on: ",
476  rank,
477  " is greater than or equal to ",
478  _comm->size());
479  if (rank == _comm->rank())
480  {
481  _cpu_profiling = has_cpu_profiling;
482  _heap_profiling = has_heap_profiling;
483  }
484  }
485  }
486  else
487  {
488  _cpu_profiling = has_cpu_profiling;
489  _heap_profiling = has_heap_profiling;
490  }
491 
492  if (_cpu_profiling)
493  if (!ProfilerStart(cpu_profile_file.c_str()))
494  mooseError("CPU profiler is not started properly");
495 
496  if (_heap_profiling)
497  {
498  HeapProfilerStart(heap_profile_file.c_str());
499  if (!IsHeapProfilerRunning())
500  mooseError("Heap profiler is not started properly");
501  }
502  }
503 #else
504  if (std::getenv("MOOSE_PROFILE_BASE") || std::getenv("MOOSE_HEAP_BASE"))
505  mooseError("gperftool is not available for CPU or heap profiling");
506 #endif
507 
508  // If this will be a language server then turn off output until that starts
509  if (isParamValid("language_server"))
510  _output_buffer_cache = Moose::out.rdbuf(nullptr);
511 
514 
515  _the_warehouse = std::make_unique<TheWarehouse>();
516  _the_warehouse->registerAttribute<AttribMatrixTags>("matrix_tags", 0);
517  _the_warehouse->registerAttribute<AttribVectorTags>("vector_tags", 0);
518  _the_warehouse->registerAttribute<AttribExecOns>("exec_ons", 0);
519  _the_warehouse->registerAttribute<AttribSubdomains>("subdomains", 0);
520  _the_warehouse->registerAttribute<AttribBoundaries>("boundaries", 0);
521  _the_warehouse->registerAttribute<AttribThread>("thread", 0);
522  _the_warehouse->registerAttribute<AttribExecutionOrderGroup>("execution_order_group", 0);
523  _the_warehouse->registerAttribute<AttribPreIC>("pre_ic", 0);
524  _the_warehouse->registerAttribute<AttribPreAux>("pre_aux");
525  _the_warehouse->registerAttribute<AttribPostAux>("post_aux");
526  _the_warehouse->registerAttribute<AttribName>("name", "dummy");
527  _the_warehouse->registerAttribute<AttribSystem>("system", "dummy");
528  _the_warehouse->registerAttribute<AttribVar>("variable", -1);
529  _the_warehouse->registerAttribute<AttribInterfaces>("interfaces", 0);
530  _the_warehouse->registerAttribute<AttribSysNum>("sys_num", libMesh::invalid_uint);
531  _the_warehouse->registerAttribute<AttribResidualObject>("residual_object");
532  _the_warehouse->registerAttribute<AttribSorted>("sorted");
533  _the_warehouse->registerAttribute<AttribDisplaced>("displaced", -1);
534 
535  if (isParamValid("_argc") && isParamValid("_argv"))
536  {
537  int argc = getParam<int>("_argc");
538  char ** argv = getParam<char **>("_argv");
539 
540  _sys_info = std::make_unique<SystemInfo>(argc, argv);
541  }
542  if (isParamValid("_command_line"))
543  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
544  else
545  mooseError("Valid CommandLine object required");
546 
547  if (_check_input && isParamValid("recover"))
548  mooseError("Cannot run --check-input with --recover. Recover files might not exist");
549 
550  if (isParamValid("start_in_debugger") && _multiapp_level == 0)
551  {
552  auto command = getParam<std::string>("start_in_debugger");
553 
554  Moose::out << "Starting in debugger using: " << command << std::endl;
555 
557 
558  std::stringstream command_stream;
559 
560  // This will start XTerm and print out some info first... then run the debugger
561  command_stream << "xterm -e \"echo 'Rank: " << processor_id() << " Hostname: " << hostname
562  << " PID: " << getpid() << "'; echo ''; ";
563 
564  // Figure out how to run the debugger
565  if (command.find("lldb") != std::string::npos || command.find("gdb") != std::string::npos)
566  command_stream << command << " -p " << getpid();
567  else
568  mooseError("Unknown debugger: ",
569  command,
570  "\nIf this is truly what you meant then contact moose-users to have a discussion "
571  "about adding your debugger.");
572 
573  // Finish up the command
574  command_stream << "\""
575  << " & ";
576 
577  std::string command_string = command_stream.str();
578  Moose::out << "Running: " << command_string << std::endl;
579 
580  int ret = std::system(command_string.c_str());
581  libmesh_ignore(ret);
582 
583  // Sleep to allow time for the debugger to attach
584  std::this_thread::sleep_for(std::chrono::seconds(10));
585  }
586 
587  if (!parameters.isParamSetByAddParam("stop_for_debugger"))
588  {
589  Moose::out << "\nStopping for " << getParam<unsigned int>("stop_for_debugger")
590  << " seconds to allow attachment from a debugger.\n";
591 
592  Moose::out << "\nAll of the processes you can connect to:\n";
593  Moose::out << "rank - hostname - pid\n";
594 
596 
597  {
598  // The 'false' turns off the serialization warning
599  SerializerGuard sg(_communicator, false); // Guarantees that the processors print in order
600  Moose::err << processor_id() << " - " << hostname << " - " << getpid() << "\n";
601  }
602 
603  Moose::out << "\nWaiting...\n" << std::endl;
604 
605  // Sleep to allow time for the debugger to attach
606  std::this_thread::sleep_for(std::chrono::seconds(getParam<unsigned int>("stop_for_debugger")));
607  }
608 
609  if (_master_mesh && _multiapp_level == 0)
610  mooseError("Mesh can be passed in only for sub-apps");
611 
613  mooseError("_master_mesh should have been set when _master_displaced_mesh is set");
614 
615  // Data specifically associated with the mesh (meta-data) that will read from the restart
616  // file early during the simulation setup so that they are available to Actions and other objects
617  // that need them during the setup process. Most of the restartable data isn't made available
618  // until all objects have been created and all Actions have been executed (i.e. initialSetup).
620 
621  if (parameters.have_parameter<bool>("use_legacy_dirichlet_bc"))
622  mooseDeprecated("The parameter 'use_legacy_dirichlet_bc' is no longer valid.\n\n",
623  "All Dirichlet boundary conditions are preset by default.\n\n",
624  "Remove said parameter in ",
625  name(),
626  " to remove this deprecation warning.");
627 
628  Moose::out << std::flush;
629 }
ParallelObject(const Parallel::Communicator &comm_in)
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:1192
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1405
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1155
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:1094
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:805
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:1212
unsigned int n_threads()
PerfGraph & createRecoverablePerfGraph()
Creates a recoverable PerfGraph.
Definition: MooseApp.C:2811
const unsigned int invalid_uint
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1140
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:1118
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1103
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1106
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1402
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:122
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool tokenizeAndConvert(const std::string &str, std::vector< T > &tokenized_vector, const std::string &delimiter=" \\\)
tokenizeAndConvert splits a string using delimiter and then converts to type T.
Definition: MooseUtils.h:806
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:1189
static const RestartableDataMapName MESH_META_DATA
Definition: MooseApp.h:95
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:1115
This attribute describes sorting state.
Definition: TheWarehouse.h:112
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:1230
std::pair< std::filesystem::path, std::filesystem::path > splitFileName(const T &full_file)
Function for splitting path and filename.
Definition: MooseUtils.h:231
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1245
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:313
const Parallel::Communicator & comm() const
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1124
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1233
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
RestartableDataReader _rd_reader
Definition: MooseApp.h:1419
static ExecFlagRegistry & getExecFlagRegistry()
Return Singleton instance.
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:1195
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
SolutionInvalidity & _solution_invalidity
The SolutionInvalidity object for this application.
Definition: MooseApp.h:1158
std::string hostname()
Get the hostname the current process is running on.
Definition: MooseUtils.C:610
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146
const RankMap _rank_map
The RankMap is a useful object for determining how the processes are laid out on the physical hardwar...
Definition: MooseApp.h:1161
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:294
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1112
bool isParamSetByAddParam(const std::string &name) const
Returns whether or not the parameter was set due to addParam.
void libmesh_ignore(const Args &...)
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1186
Tracks the libmesh system number that a MooseObject is associated with.
Definition: Attributes.h:275
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1224
AttribBoundaries tracks all boundary IDs associated with an object.
Definition: Attributes.h:188
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:1131
ConsoleStreamInterface(MooseApp &app)
A class for providing a helper stream object for writting message to all the Output objects...
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1221
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1208
SolutionInvalidity & createRecoverableSolutionInvalidity()
Creates a recoverable SolutionInvalidity.
Definition: MooseApp.C:2829
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1440
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
Definition: MooseApp.h:1414
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:344
MooseBase(const std::string &type, const std::string &name, MooseApp &app, const InputParameters &params)
Definition: MooseBase.C:18
Residual objects have this attribute.
Definition: Attributes.h:411
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
const ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:1428
void registerRestartableDataMapName(const RestartableDataMapName &name, std::string suffix="")
Reserve a location for storing custom RestartableDataMap objects.
Definition: MooseApp.C:2792
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:1465
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1218
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1143
bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1239
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1137
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1431
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1097
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1437
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
static const std::string MESH_META_DATA_SUFFIX
Definition: MooseApp.h:96
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1434
Factory _factory
Definition: MooseApp.h:1205
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1128
Tracks whether the object is on the displaced mesh.
Definition: Attributes.h:481
void makedirs(const std::string &dir_name, bool throw_on_failure=false)
Recursively make directories.
Definition: MooseUtils.C:435
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:1408
bool _ready_to_exit
Definition: MooseApp.h:1209
const MooseMesh *const _master_mesh
The mesh from master app.
Definition: MooseApp.h:1411
A scope guard that guarantees that whatever happens between when it gets created and when it is destr...
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1227
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1183
static char addKnownLabel(const std::string &label)
addKnownLabel whitelists a label as valid for purposes of the checkLabels function.
Definition: Registry.C:82
std::unique_ptr< Backup > *const _initial_backup
The backup for use in initial setup; this will get set from the _initial_backup input parameter that ...
Definition: MooseApp.h:1455

Member Function Documentation

◆ actionWarehouse() [1/2]

ActionWarehouse& MooseApp::actionWarehouse ( )
inline

◆ actionWarehouse() [2/2]

const ActionWarehouse& MooseApp::actionWarehouse ( ) const
inline

Return a const reference to the ActionWarehouse associated with this app.

Definition at line 199 of file MooseApp.h.

199 { return _action_warehouse; }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134

◆ addAppParam()

void MooseApp::addAppParam ( InputParameters params)
static

Definition at line 85 of file MooseApp.C.

Referenced by AppFactory::createAppShared(), and validParams().

86 {
87  params.addCommandLineParam<std::string>(
88  "app_to_run",
89  "--app <AppName>",
90  "Specify the application that should be used to run the input file. This must match an "
91  "application name registered to the application factory. Note that this option is "
92  "case-sensitive.");
93 }
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)

◆ addExecutor()

void MooseApp::addExecutor ( const std::string &  type,
const std::string &  name,
const InputParameters params 
)

Definition at line 1326 of file MooseApp.C.

Referenced by recursivelyCreateExecutors().

1329 {
1330  std::shared_ptr<Executor> executor = _factory.create<Executor>(type, name, params);
1331 
1332  if (_executors.count(executor->name()) > 0)
1333  mooseError("an executor with name '", executor->name(), "' already exists");
1334  _executors[executor->name()] = executor;
1335 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1170
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
Factory _factory
Definition: MooseApp.h:1205
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26

◆ addExecutorParams()

void MooseApp::addExecutorParams ( const std::string &  type,
const std::string &  name,
const InputParameters params 
)

Adds the parameters for an Executor to the list of parameters.

This is done so that the Executors can be created in exactly the correct order.

Definition at line 1338 of file MooseApp.C.

Referenced by ReadExecutorParamsAction::act().

1341 {
1342  _executor_params[name] = std::make_pair(type, std::make_unique<InputParameters>(params));
1343 }
std::unordered_map< std::string, std::pair< std::string, std::unique_ptr< InputParameters > > > _executor_params
Used in building the Executors Maps the name of the Executor block to the <type, params> ...
Definition: MooseApp.h:1175
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51

◆ addMeshGenerator()

void MooseApp::addMeshGenerator ( const std::string &  type,
const std::string &  name,
const InputParameters params 
)
inline

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

Parameters
typeThe type of MeshGenerator
nameThe name of the MeshGenerator
paramsThe params used to construct the MeshGenerator

See MeshGeneratorSystem::addMeshGenerator()

Definition at line 831 of file MooseApp.h.

Referenced by AddMeshGeneratorAction::act(), and MeshGenerator::addMeshSubgenerator().

834  {
836  }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
void addMeshGenerator(const std::string &type, const std::string &name, const InputParameters &params)
Add a mesh generator that will act on the meshes in the system.
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51

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

Referenced by AdaptivityAction::act(), SetAdaptivityOptionsAction::act(), AddPeriodicBCAction::act(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), Action::addRelationshipManager(), FVFluxKernel::adjustRMGhostLayers(), and FunctorSmootherTempl< T >::FunctorSmootherTempl().

2343 {
2344  // We prefer to always add geometric RMs. There is no hurt to add RMs for replicated mesh
2345  // since MeshBase::delete_remote_elements{} is a no-op (empty) for replicated mesh.
2346  // The motivation here is that MooseMesh::_use_distributed_mesh may not be properly set
2347  // at the time we are adding geometric relationship managers. We deleted the following
2348  // old logic to add all geometric RMs regardless of there is a distributed mesh or not.
2349  // Otherwise, all geometric RMs will be improperly ignored for a distributed mesh generator.
2350 
2351  // if (!_action_warehouse.mesh()->isDistributedMesh() && !_split_mesh &&
2352  // (relationship_manager->isType(Moose::RelationshipManagerType::GEOMETRIC) &&
2353  // !(relationship_manager->isType(Moose::RelationshipManagerType::ALGEBRAIC) ||
2354  // relationship_manager->isType(Moose::RelationshipManagerType::COUPLING))))
2355  // return false;
2356 
2357  bool add = true;
2358 
2359  std::set<std::shared_ptr<RelationshipManager>> rms_to_erase;
2360 
2361  for (const auto & existing_rm : _relationship_managers)
2362  {
2363  if (*existing_rm >= *new_rm)
2364  {
2365  add = false;
2366  donateForWhom(*new_rm, *existing_rm);
2367  break;
2368  }
2369  // The new rm did not provide less or the same amount/type of ghosting as the existing rm, but
2370  // what about the other way around?
2371  else if (*new_rm >= *existing_rm)
2372  rms_to_erase.emplace(existing_rm);
2373  }
2374 
2375  if (add)
2376  {
2377  _relationship_managers.emplace(new_rm);
2378  for (const auto & rm_to_erase : rms_to_erase)
2379  {
2380  donateForWhom(*rm_to_erase, *new_rm);
2381  removeRelationshipManager(rm_to_erase);
2382  }
2383  }
2384 
2385  // Inform the caller whether the object was added or not
2386  return add;
2387 }
void removeRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Purge this relationship manager from meshes and DofMaps and finally from us.
Definition: MooseApp.C:2444
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248

◆ appBinaryName()

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

Definition at line 109 of file MooseApp.h.

Referenced by copyInputs(), run(), and runInputs().

110  {
112  name = name.substr(0, name.find_last_of("-"));
113  if (name.find_first_of("/") != std::string::npos)
114  name = name.substr(name.find_first_of("/") + 1, std::string::npos);
115  return name;
116  }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::string getExecutableName()
This function returns the name of the running executable.

◆ appendMeshGenerator()

const MeshGenerator& MooseApp::appendMeshGenerator ( const std::string &  type,
const std::string &  name,
InputParameters  params 
)
inline

Append a mesh generator that will act on the final mesh generator in the system.

Parameters
typeThe type of MeshGenerator
nameThe name of the MeshGenerator
paramsThe params used to construct the MeshGenerator

See MeshGeneratorSystem::appendMeshGenerator()

Definition at line 882 of file MooseApp.h.

883  {
885  }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const MeshGenerator & appendMeshGenerator(const std::string &type, const std::string &name, InputParameters params)
Append a mesh generator that will act on the current final mesh generator in the system.
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51

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

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

1773 {
1774  std::string library_name(app_name);
1775 
1776  // Strip off the App part (should always be the last 3 letters of the name)
1777  size_t pos = library_name.find("App");
1778  if (pos != library_name.length() - 3)
1779  mooseError("Invalid application name: ", library_name);
1780  library_name.erase(pos);
1781 
1782  // Now get rid of the camel case, prepend lib, and append the method and suffix
1783  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
1784  QUOTE(METHOD) + ".la";
1785 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::string camelCaseToUnderscore(const std::string &camel_case_name)
Function for converting a camel case name to a name containing underscores.
Definition: MooseUtils.C:554

◆ attachRelationshipManagers() [1/2]

void MooseApp::attachRelationshipManagers ( Moose::RelationshipManagerType  rm_type,
bool  attach_geometric_rm_final = false 
)

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

Referenced by AddRelationshipManager::act(), CouplingFunctorCheckAction::act(), and MooseMesh::buildTypedMesh().

2554 {
2555  for (auto & rm : _relationship_managers)
2556  {
2557  if (!rm->isType(rm_type))
2558  continue;
2559 
2560  // RM is already attached (this also handles the geometric early case)
2561  if (_attached_relationship_managers[rm_type].count(rm.get()))
2562  continue;
2563 
2565  {
2566  // The problem is not built yet - so the ActionWarehouse currently owns the mesh
2567  MooseMesh * const mesh = _action_warehouse.mesh().get();
2568 
2569  // "attach_geometric_rm_final = true" inidicate that it is the last chance to attach
2570  // geometric RMs. Therefore, we need to attach them.
2571  if (!rm->attachGeometricEarly() && !attach_geometric_rm_final)
2572  // Will attach them later (during algebraic). But also, we need to tell the mesh that we
2573  // shouldn't be deleting remote elements yet
2574  mesh->allowRemoteElementRemoval(false);
2575  else
2576  {
2577  MeshBase & undisp_mesh_base = mesh->getMesh();
2578  const DofMap * const undisp_nl_dof_map =
2579  _executioner ? &feProblem().systemBaseNonlinear(0).dofMap() : nullptr;
2580  undisp_mesh_base.add_ghosting_functor(
2581  createRMFromTemplateAndInit(*rm, *mesh, undisp_mesh_base, undisp_nl_dof_map));
2582 
2583  // In the final stage, if there is a displaced mesh, we need to
2584  // clone ghosting functors for displacedMesh
2585  if (auto & disp_moose_mesh = _action_warehouse.displacedMesh();
2586  attach_geometric_rm_final && disp_moose_mesh)
2587  {
2588  MeshBase & disp_mesh_base = disp_moose_mesh->getMesh();
2589  const DofMap * disp_nl_dof_map = nullptr;
2590  if (_executioner && feProblem().getDisplacedProblem())
2591  disp_nl_dof_map = &feProblem().getDisplacedProblem()->systemBaseNonlinear(0).dofMap();
2592  disp_mesh_base.add_ghosting_functor(
2593  createRMFromTemplateAndInit(*rm, *disp_moose_mesh, disp_mesh_base, disp_nl_dof_map));
2594  }
2595  else if (_action_warehouse.displacedMesh())
2596  mooseError("The displaced mesh should not yet exist at the time that we are attaching "
2597  "early geometric relationship managers.");
2598 
2599  // Mark this RM as attached
2600  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
2601  _attached_relationship_managers[rm_type].insert(rm.get());
2602  }
2603  }
2604  else // rm_type is algebraic or coupling
2605  {
2606  if (!_executioner && !_executor)
2607  mooseError("We must have an executioner by now or else we do not have to data to add "
2608  "algebraic or coupling functors to in MooseApp::attachRelationshipManagers");
2609 
2610  // Now we've built the problem, so we can use it
2611  auto & problem = feProblem();
2612  auto & undisp_moose_mesh = problem.mesh();
2613  auto & undisp_nl = problem.systemBaseNonlinear(0);
2614  auto & undisp_nl_dof_map = undisp_nl.dofMap();
2615  auto & undisp_mesh = undisp_moose_mesh.getMesh();
2616 
2617  if (rm->useDisplacedMesh() && problem.getDisplacedProblem())
2618  {
2620  // We actually need to add this to the FEProblemBase NonlinearSystemBase's DofMap
2621  // because the DisplacedProblem "nonlinear" DisplacedSystem doesn't have any matrices
2622  // for which to do coupling. It's actually horrifying to me that we are adding a
2623  // coupling functor, that is going to determine its couplings based on a displaced
2624  // MeshBase object, to a System associated with the undisplaced MeshBase object (there
2625  // is only ever one EquationSystems object per MeshBase object and visa versa). So here
2626  // I'm left with the choice of whether to pass in a MeshBase object that is *not* the
2627  // MeshBase object that will actually determine the couplings or to pass in the MeshBase
2628  // object that is inconsistent with the System DofMap that we are adding the coupling
2629  // functor for! Let's err on the side of *libMesh* consistency and pass properly paired
2630  // MeshBase-DofMap
2631  problem.addCouplingGhostingFunctor(
2632  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_nl_dof_map),
2633  /*to_mesh = */ false);
2634 
2635  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
2636  {
2637  auto & displaced_problem = *problem.getDisplacedProblem();
2638  auto & disp_moose_mesh = displaced_problem.mesh();
2639  auto & disp_mesh = disp_moose_mesh.getMesh();
2640  const DofMap * const disp_nl_dof_map = &displaced_problem.systemBaseNonlinear(0).dofMap();
2641  displaced_problem.addAlgebraicGhostingFunctor(
2642  createRMFromTemplateAndInit(*rm, disp_moose_mesh, disp_mesh, disp_nl_dof_map),
2643  /*to_mesh = */ false);
2644  }
2645  }
2646  else // undisplaced
2647  {
2649  problem.addCouplingGhostingFunctor(
2650  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_nl_dof_map),
2651  /*to_mesh = */ false);
2652 
2653  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
2654  problem.addAlgebraicGhostingFunctor(
2655  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_nl_dof_map),
2656  /*to_mesh = */ false);
2657  }
2658 
2659  // Mark this RM as attached
2660  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
2661  _attached_relationship_managers[rm_type].insert(rm.get());
2662  }
2663  }
2664 }
RelationshipManager & createRMFromTemplateAndInit(const RelationshipManager &template_rm, MooseMesh &moose_mesh, MeshBase &mesh, const DofMap *dof_map=nullptr)
Take an input relationship manager, clone it, and then initialize it with provided mesh and optional ...
Definition: MooseApp.C:2486
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
The relationship managers that have been attached (type -> RMs)
Definition: MooseApp.h:1252
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::shared_ptr< MooseMesh > & displacedMesh()
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
FEProblemBase & feProblem() const
Definition: MooseApp.C:1320
std::shared_ptr< MooseMesh > & mesh()
virtual DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1131
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override
Return the nonlinear system object as a base class reference given the system number.
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167

◆ attachRelationshipManagers() [2/2]

void MooseApp::attachRelationshipManagers ( MeshBase &  mesh,
MooseMesh moose_mesh 
)

Attach geometric relationship managers to the given MeshBase object.

This API is designed to work with MeshGenerators which are executed at the very beginning of a simulation. No attempt will be made to add relationship managers to a displaced mesh, because it doesn't exist yet.

Definition at line 2522 of file MooseApp.C.

2523 {
2524  for (auto & rm : _relationship_managers)
2525  {
2527  {
2528  if (rm->attachGeometricEarly())
2529  mesh.add_ghosting_functor(createRMFromTemplateAndInit(*rm, moose_mesh, mesh));
2530  else
2531  {
2532  // If we have a geometric ghosting functor that can't be attached early, then we have to
2533  // prevent the mesh from deleting remote elements
2534  moose_mesh.allowRemoteElementRemoval(false);
2535 
2536  if (const MeshBase * const moose_mesh_base = moose_mesh.getMeshPtr())
2537  {
2538  if (moose_mesh_base != &mesh)
2539  mooseError("The MooseMesh MeshBase and the MeshBase we're trying to attach "
2540  "relationship managers to are different");
2541  }
2542  else
2543  // The MeshBase isn't attached to the MooseMesh yet, so have to tell it not to remove
2544  // remote elements independently
2545  mesh.allow_remote_element_removal(false);
2546  }
2547  }
2548  }
2549 }
RelationshipManager & createRMFromTemplateAndInit(const RelationshipManager &template_rm, MooseMesh &moose_mesh, MeshBase &mesh, const DofMap *dof_map=nullptr)
Take an input relationship manager, clone it, and then initialize it with provided mesh and optional ...
Definition: MooseApp.C:2486
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
MeshBase & mesh
void allowRemoteElementRemoval(bool allow_removal)
Set whether to allow remote element removal.
Definition: MooseMesh.C:3663
const MeshBase * getMeshPtr() const
Definition: MooseMesh.C:3192
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248

◆ backup() [1/2]

std::vector< std::filesystem::path > MooseApp::backup ( const std::filesystem::path &  folder_base)

Backs up the application to the folder folder_base.

Returns
The files that are written in the backup

Definition at line 1208 of file MooseApp.C.

Referenced by Checkpoint::output().

1209 {
1210  TIME_SECTION("backup", 2, "Backing Up Application to File");
1211 
1212  preBackup();
1213 
1215  return writer.write(folder_base);
1216 }
Writer for restartable data, to be read by the RestartableDataReader.
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:724

◆ backup() [2/2]

std::unique_ptr< Backup > MooseApp::backup ( )

Backs up the application memory in a Backup.

Returns
The backup

Definition at line 1219 of file MooseApp.C.

Referenced by finalizeRestore(), and restore().

1220 {
1221  TIME_SECTION("backup", 2, "Backing Up Application");
1222 
1224 
1225  preBackup();
1226 
1227  auto backup = std::make_unique<Backup>();
1228  writer.write(*backup->header, *backup->data);
1229 
1230  return backup;
1231 }
Writer for restartable data, to be read by the RestartableDataReader.
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:724
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1219

◆ builder()

Moose::Builder& MooseApp::builder ( )
inline

Returns a writable reference to the builder.

Definition at line 204 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), SetupMeshAction::act(), and MultiApp::createLocalApp().

204 { return _builder; }
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1143

◆ callMooseError()

void MooseBase::callMooseError ( std::string  msg,
const bool  with_prefix 
) const
inherited

Calls moose error with the message msg.

Will prefix the message with the subapp name if one exists.

If with_prefix, then add the prefix from errorPrefix() to the error.

Definition at line 33 of file MooseBase.C.

Referenced by InputParameters::callMooseErrorHelper(), MooseBaseErrorInterface::mooseError(), MooseBaseErrorInterface::mooseErrorNonPrefixed(), and MooseBaseParameterInterface::paramError().

34 {
36  const std::string prefix = _app.isUltimateMaster() ? "" : _app.name();
37  if (with_prefix)
38  msg = errorPrefix("error") + msg;
39  moose::internal::mooseErrorRaw(msg, prefix);
40 }
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:805
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::string errorPrefix(const std::string &error_type) const
Definition: MooseBase.C:43
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
void mooseErrorRaw(std::string msg, const std::string prefix="")
Definition: MooseError.C:50
void mooseConsole()
Send current output buffer to Console output objects.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1766

◆ checkInput()

bool MooseApp::checkInput ( ) const
inline

Returns whether the Application is running in check input mode.

Definition at line 905 of file MooseApp.h.

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

◆ checkMetaDataIntegrity()

void MooseApp::checkMetaDataIntegrity ( ) const

Function to check the integrity of the restartable meta data structure.

Definition at line 2743 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act().

2744 {
2745  for (auto map_iter = _restartable_meta_data.begin(); map_iter != _restartable_meta_data.end();
2746  ++map_iter)
2747  {
2748  const RestartableDataMapName & name = map_iter->first;
2749  const RestartableDataMap & meta_data = map_iter->second.first;
2750 
2751  std::vector<std::string> not_declared;
2752 
2753  for (const auto & data : meta_data)
2754  if (!data.declared())
2755  not_declared.push_back(data.name());
2756 
2757  if (!not_declared.empty())
2758  {
2759  std::ostringstream oss;
2760  std::copy(
2761  not_declared.begin(), not_declared.end(), infix_ostream_iterator<std::string>(oss, ", "));
2762 
2763  mooseError("The following '",
2764  name,
2765  "' meta-data properties were retrieved but never declared: ",
2766  oss.str());
2767  }
2768  }
2769 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Storage for restartable data that is ordered based on insertion order.
std::string RestartableDataMapName
Definition: MooseTypes.h:203

◆ checkpointSuffix()

const std::string & MooseApp::checkpointSuffix ( )
static

The file suffix for the checkpoint mesh.

Definition at line 2390 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act(), MooseMesh::init(), and Checkpoint::output().

2391 {
2392  static const std::string suffix = "-mesh.cpr";
2393  return suffix;
2394 }

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

Referenced by FEProblemBase::addMultiApp(), Moose::Builder::build(), MultiApp::createApp(), MultiApp::createLocalApp(), Moose::Builder::errorCheck(), Moose::Builder::hitCLIFilter(), MooseServer::parseDocumentForDiagnostics(), and ExodusFormatter::printInputFile().

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

◆ constructingMeshGenerators()

bool MooseApp::constructingMeshGenerators ( ) const
virtual

Whether this app is constructing mesh generators.

This is virtual to allow MooseUnitApp to override it so that we can construct MeshGenerators in unit tests

Definition at line 2842 of file MooseApp.C.

Referenced by MeshGenerator::addChildMeshGenerator(), MeshGeneratorSystem::addMeshGenerator(), MeshGenerator::addMeshSubgenerator(), MeshGenerator::addParentMeshGenerator(), MeshGenerator::checkGetMesh(), MeshGeneratorSystem::createMeshGenerator(), MeshGeneratorSystem::createMeshGeneratorOrder(), MeshGenerator::declareMeshProperty(), MeshGenerator::declareNullMeshName(), and MeshGeneratorSystem::getMeshGeneratorOutput().

2843 {
2844  return _action_warehouse.getCurrentTaskName() == "create_added_mesh_generators" ||
2846 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
const std::string & getCurrentTaskName() const
bool appendingMeshGenerators() const
Whether or not mesh generators are currently being appended (append_mesh_generator task) ...

◆ copyInputs()

bool MooseApp::copyInputs ( ) const
private

Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a readable installed directory) and recursively copies those files into a read/writable location for the user.

Returns
a Boolean value used to indicate whether the application should exit early

Definition at line 1584 of file MooseApp.C.

Referenced by run().

1585 {
1586  if (isParamValid("copy_inputs"))
1587  {
1588  // Get command line argument following --copy-inputs on command line
1589  auto dir_to_copy = getParam<std::string>("copy_inputs");
1590 
1591  if (dir_to_copy.empty())
1592  mooseError("Error retrieving directory to copy");
1593  if (dir_to_copy.back() != '/')
1594  dir_to_copy += '/';
1595 
1596  // This binary name is the actual binary. That is, if we called a symlink it'll
1597  // be the name of what the symlink points to
1598  auto binname = appBinaryName();
1599  if (binname == "")
1600  mooseError("could not locate installed tests to run (unresolved binary/app name)");
1601 
1602  auto src_dir = MooseUtils::installedInputsDir(binname,
1603  dir_to_copy,
1604  "Rerun binary with " +
1605  _pars.getCommandLineSyntax("show_inputs")[0] +
1606  " to get a list of installable directories.");
1607 
1608  // Use the command line here because if we have a symlink to another binary,
1609  // we want to dump into a directory that is named after the symlink not the true binary
1610  auto dst_dir = _command_line->getExecutableNameBase() + "/" + dir_to_copy;
1611  auto cmdname = _command_line->getExecutableName();
1612  if (cmdname.find_first_of("/") != std::string::npos)
1613  cmdname = cmdname.substr(cmdname.find_first_of("/") + 1, std::string::npos);
1614 
1615  if (MooseUtils::pathExists(dst_dir))
1616  mooseError(
1617  "The directory \"./",
1618  dst_dir,
1619  "\" already exists.\nTo update/recopy the contents of this directory, rename (\"mv ",
1620  dst_dir,
1621  " new_dir_name\") or remove (\"rm -r ",
1622  dst_dir,
1623  "\") the existing directory.\nThen re-run \"",
1624  cmdname,
1625  " --copy-inputs ",
1626  dir_to_copy,
1627  "\".");
1628 
1629  std::string cmd = "mkdir -p " + dst_dir + "; rsync -av " + src_dir + " " + dst_dir;
1630 
1631  TIME_SECTION("copy_inputs", 2, "Copying Inputs");
1632 
1633  // Only perform the copy on the root processor
1634  int return_value = 0;
1635  if (processor_id() == 0)
1636  return_value = system(cmd.c_str());
1637  _communicator.broadcast(return_value);
1638 
1639  if (WIFEXITED(return_value) && WEXITSTATUS(return_value) != 0)
1640  mooseError("Failed to copy the requested directory.");
1641  Moose::out << "Directory successfully copied into ./" << dst_dir << '\n';
1642  return true;
1643  }
1644  return false;
1645 }
const std::vector< std::string > & getCommandLineSyntax(const std::string &name) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::string installedInputsDir(const std::string &app_name, const std::string &dir_name, const std::string &extra_error_msg="")
Returns the directory of any installed inputs or the empty string if none are found.
Definition: MooseUtils.C:98
virtual std::string appBinaryName() const
Definition: MooseApp.h:109
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
bool pathExists(const std::string &path)
Definition: MooseUtils.C:240

◆ createExecutors()

void MooseApp::createExecutors ( )

After adding all of the Executor Params - this function will actually cause all of them to be built.

Definition at line 1405 of file MooseApp.C.

Referenced by AddExecutorAction::act().

1406 {
1407  // Do we have any?
1408  if (_executor_params.empty())
1409  return;
1410 
1411  // Holds the names of Executors that may be the root executor
1412  std::list<std::string> possibly_root;
1413 
1414  // What is already built
1415  std::map<std::string, bool> already_built;
1416 
1417  // The Executors that are currently candidates for being roots
1418  std::list<std::string> possible_roots;
1419 
1420  // The current line of dependencies - used for finding cycles
1421  std::list<std::string> current_branch;
1422 
1423  // Build the NullExecutor
1424  {
1425  auto params = _factory.getValidParams("NullExecutor");
1426  _null_executor = _factory.create<NullExecutor>("NullExecutor", "_null_executor", params);
1427  }
1428 
1429  for (const auto & params_entry : _executor_params)
1430  {
1431  const auto & name = params_entry.first;
1432 
1433  // Did we already make this one?
1434  if (_executors.find(name) != _executors.end())
1435  continue;
1436 
1437  possible_roots.emplace_back(name);
1438 
1439  recursivelyCreateExecutors(name, possible_roots, current_branch);
1440  }
1441 
1442  // If there is more than one possible root - error
1443  if (possible_roots.size() > 1)
1444  {
1445  auto root_string_it = possible_roots.begin();
1446 
1447  std::stringstream roots_string;
1448 
1449  roots_string << *root_string_it++;
1450 
1451  for (; root_string_it != possible_roots.end(); ++root_string_it)
1452  roots_string << ", " << *root_string_it;
1453 
1454  mooseError("Multiple Executor roots found: ", roots_string.str());
1455  }
1456 
1457  // Set the root executor
1458  _executor = _executors[possible_roots.front()];
1459 }
std::unordered_map< std::string, std::pair< std::string, std::unique_ptr< InputParameters > > > _executor_params
Used in building the Executors Maps the name of the Executor block to the <type, params> ...
Definition: MooseApp.h:1175
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
void recursivelyCreateExecutors(const std::string &current_executor_name, std::list< std::string > &possible_roots, std::list< std::string > &current_branch)
Internal function used to recursively create the executor objects.
Definition: MooseApp.C:1353
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Definition: Factory.C:67
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1170
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1186
Factory _factory
Definition: MooseApp.h:1205
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167

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

Referenced by setupOptions().

2243 {
2244  TIME_SECTION("createMinimalApp", 3, "Creating Minimal App");
2245 
2246  // SetupMeshAction
2247  {
2248  // Build the Action parameters
2249  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
2250  action_params.set<std::string>("type") = "GeneratedMesh";
2251 
2252  // Create The Action
2253  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2254  _action_factory.create("SetupMeshAction", "Mesh", action_params));
2255 
2256  // Set the object parameters
2257  InputParameters & params = action->getObjectParams();
2258  params.set<MooseEnum>("dim") = "1";
2259  params.set<unsigned int>("nx") = 1;
2260 
2261  // Add Action to the warehouse
2263  }
2264 
2265  // Executioner
2266  {
2267  // Build the Action parameters
2268  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
2269  action_params.set<std::string>("type") = "Transient";
2270 
2271  // Create the action
2272  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2273  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
2274 
2275  // Set the object parameters
2276  InputParameters & params = action->getObjectParams();
2277  params.set<unsigned int>("num_steps") = 1;
2278  params.set<Real>("dt") = 1;
2279 
2280  // Add Action to the warehouse
2282  }
2283 
2284  // Problem
2285  {
2286  // Build the Action parameters
2287  InputParameters action_params = _action_factory.getValidParams("CreateProblemDefaultAction");
2288  action_params.set<bool>("_solve") = false;
2289 
2290  // Create the action
2291  std::shared_ptr<Action> action = std::static_pointer_cast<Action>(
2292  _action_factory.create("CreateProblemDefaultAction", "Problem", action_params));
2293 
2294  // Add Action to the warehouse
2296  }
2297 
2298  // Outputs
2299  {
2300  // Build the Action parameters
2301  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
2302  action_params.set<bool>("console") = false;
2303 
2304  // Create action
2305  std::shared_ptr<Action> action =
2306  _action_factory.create("CommonOutputAction", "Outputs", action_params);
2307 
2308  // Add Action to the warehouse
2310  }
2311 
2313 }
InputParameters getValidParams(const std::string &name)
Definition: ActionFactory.C:92
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:1134
Base class for actions.
Definition: Action.h:38
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
Definition: ActionFactory.C:39
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:1131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void build()
Builds all auto-buildable tasks.

◆ createRecoverablePerfGraph()

PerfGraph & MooseApp::createRecoverablePerfGraph ( )
private

Creates a recoverable PerfGraph.

This is a separate method so that it can be used in the constructor (multiple calls are required to declare it).

Definition at line 2811 of file MooseApp.C.

2812 {
2814 
2815  auto perf_graph =
2816  std::make_unique<RestartableData<PerfGraph>>("perf_graph",
2817  this,
2818  type() + " (" + name() + ')',
2819  *this,
2820  getParam<bool>("perf_graph_live_all"),
2821  !getParam<bool>("disable_perf_graph_live"));
2822 
2823  return dynamic_cast<RestartableData<PerfGraph> &>(
2824  registerRestartableData(std::move(perf_graph), 0, false))
2825  .set();
2826 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1193
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:1800
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
Concrete definition of a parameter value for a specified type.

◆ createRecoverableSolutionInvalidity()

SolutionInvalidity & MooseApp::createRecoverableSolutionInvalidity ( )
private

Creates a recoverable SolutionInvalidity.

This is a separate method so that it can be used in the constructor (multiple calls are required to declare it).

Definition at line 2829 of file MooseApp.C.

2830 {
2832 
2833  auto solution_invalidity =
2834  std::make_unique<RestartableData<SolutionInvalidity>>("solution_invalidity", nullptr, *this);
2835 
2836  return dynamic_cast<RestartableData<SolutionInvalidity> &>(
2837  registerRestartableData(std::move(solution_invalidity), 0, false))
2838  .set();
2839 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1193
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:1800
Concrete definition of a parameter value for a specified type.

◆ createRMFromTemplateAndInit()

RelationshipManager & MooseApp::createRMFromTemplateAndInit ( const RelationshipManager template_rm,
MooseMesh moose_mesh,
MeshBase &  mesh,
const DofMap *  dof_map = nullptr 
)
private

Take an input relationship manager, clone it, and then initialize it with provided mesh and optional dof_map.

Parameters
template_rmThe relationship manager template from which we will clone
moose_meshThe moose mesh to use for initialization
meshThe mesh to use for initialization
dof_mapAn optional parameter that, if provided, will be used to help init the cloned relationship manager
Returns
a reference to the cloned and initialized relationship manager

Definition at line 2486 of file MooseApp.C.

Referenced by attachRelationshipManagers().

2490 {
2491  auto & mesh_to_clone = _template_to_clones[&template_rm];
2492  auto it = mesh_to_clone.find(&mesh);
2493  if (it != mesh_to_clone.end())
2494  {
2495  // We've already created a clone for this mesh
2496  auto & clone_rm = *it->second;
2497  if (!clone_rm.dofMap() && dof_map)
2498  // We didn't have a DofMap before, but now we do, so we should re-init
2499  clone_rm.init(moose_mesh, mesh, dof_map);
2500  else if (clone_rm.dofMap() && dof_map && (clone_rm.dofMap() != dof_map))
2501  mooseError("Attempting to create and initialize an existing clone with a different DofMap. "
2502  "This should not happen.");
2503 
2504  return clone_rm;
2505  }
2506 
2507  // It's possible that this method is going to get called for multiple different MeshBase
2508  // objects. If that happens, then we *cannot* risk having a MeshBase object with a ghosting
2509  // functor that is init'd with another MeshBase object. So the safe thing to do is to make a
2510  // different RM for every MeshBase object that gets called here. Then the
2511  // RelationshipManagers stored here in MooseApp are serving as a template only
2512  auto pr = mesh_to_clone.emplace(
2513  std::make_pair(&const_cast<const MeshBase &>(mesh),
2514  dynamic_pointer_cast<RelationshipManager>(template_rm.clone())));
2515  mooseAssert(pr.second, "An insertion should have happened");
2516  auto & clone_rm = *pr.first->second;
2517  clone_rm.init(moose_mesh, mesh, dof_map);
2518  return clone_rm;
2519 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::map< const RelationshipManager *, std::map< const MeshBase *, std::unique_ptr< RelationshipManager > > > _template_to_clones
Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase...
Definition: MooseApp.h:1446
virtual std::unique_ptr< GhostingFunctor > clone() const

◆ defaultAutomaticScaling()

bool MooseApp::defaultAutomaticScaling ( ) const
inline

Whether to enable automatic scaling by default.

Definition at line 998 of file MooseApp.h.

const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1434

◆ disableCheckUnusedFlag()

void MooseApp::disableCheckUnusedFlag ( )

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

Definition at line 1314 of file MooseApp.C.

1315 {
1317 }
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 1989 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction().

1995 {
1996 #ifdef LIBMESH_HAVE_DLOPEN
1997  Parameters params;
1998  params.set<std::string>("app_name") = app_name;
1999  params.set<RegistrationType>("reg_type") = REGALL;
2000  params.set<std::string>("registration_method") = app_name + "__registerAll";
2001  params.set<std::string>("library_path") = library_path;
2002  params.set<std::string>("library_name") =
2003  library_name.empty() ? appNameToLibName(app_name) : library_name;
2004 
2005  params.set<Factory *>("factory") = factory;
2006  params.set<Syntax *>("syntax") = syntax;
2007  params.set<ActionFactory *>("action_factory") = action_factory;
2008  params.set<bool>("library_load_dependencies") = false;
2009 
2010  dynamicRegistration(params);
2011 #else
2012  libmesh_ignore(app_name, factory, action_factory, syntax, library_path, library_name);
2013  mooseError("Dynamic Loading is either not supported or was not detected by libMesh configure.");
2014 #endif
2015 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:28
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2018
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:209
void libmesh_ignore(const Args &...)
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:50
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1395
Holding syntax for parsing input files.
Definition: Syntax.h:21
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:1772

◆ dynamicAppRegistration()

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

Definition at line 1932 of file MooseApp.C.

Referenced by MultiApp::createApps().

1936 {
1937 #ifdef LIBMESH_HAVE_DLOPEN
1938  Parameters params;
1939  params.set<std::string>("app_name") = app_name;
1940  params.set<RegistrationType>("reg_type") = APPLICATION;
1941  params.set<std::string>("registration_method") = app_name + "__registerApps";
1942  params.set<std::string>("library_path") = library_path;
1943 
1944  const auto effective_library_name =
1945  library_name.empty() ? appNameToLibName(app_name) : library_name;
1946  params.set<std::string>("library_name") = effective_library_name;
1947  params.set<bool>("library_load_dependencies") = lib_load_deps;
1948 
1949  const auto paths = getLibrarySearchPaths(library_path);
1950  std::ostringstream oss;
1951 
1952  auto successfully_loaded = false;
1953  if (paths.empty())
1954  oss << '"' << app_name << "\" is not a registered application name.\n"
1955  << "No search paths were set. We made no attempts to locate the corresponding library "
1956  "file.\n";
1957  else
1958  {
1959  dynamicRegistration(params);
1960 
1961  // At this point the application should be registered so check it
1962  if (!AppFactory::instance().isRegistered(app_name))
1963  {
1964  oss << '"' << app_name << "\" is not a registered application name.\n"
1965  << "Unable to locate library archive for \"" << app_name
1966  << "\".\nWe attempted to locate the library archive \"" << effective_library_name
1967  << "\" in the following paths:\n\t";
1968  std::copy(paths.begin(), paths.end(), infix_ostream_iterator<std::string>(oss, "\n\t"));
1969  }
1970  else
1971  successfully_loaded = true;
1972  }
1973 
1974  if (!successfully_loaded)
1975  {
1976  oss << "\nMake sure you have compiled the library and either set the \"library_path\" "
1977  "variable in your input file or exported \"MOOSE_LIBRARY_PATH\".\n";
1978 
1979  mooseError(oss.str());
1980  }
1981 
1982 #else
1983  libmesh_ignore(app_name, library_path, library_name, lib_load_deps);
1984  mooseError("Dynamic Loading is either not supported or was not detected by libMesh configure.");
1985 #endif
1986 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2018
void libmesh_ignore(const Args &...)
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1395
std::set< std::string > getLibrarySearchPaths(const std::string &library_path_from_param) const
Return the paths searched by MOOSE when loading libraries.
Definition: MooseApp.C:2192
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:1772

◆ dynamicRegistration()

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

Helper method for dynamic loading of objects.

Definition at line 2018 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

2019 {
2020  const auto paths = getLibrarySearchPaths(params.get<std::string>("library_path"));
2021  const auto library_name = params.get<std::string>("library_name");
2022 
2023  // Attempt to dynamically load the library
2024  for (const auto & path : paths)
2025  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
2027  path + '/' + library_name, params, params.get<bool>("library_load_dependencies"));
2028 }
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:256
std::set< std::string > getLibrarySearchPaths(const std::string &library_path_from_param) const
Return the paths searched by MOOSE when loading libraries.
Definition: MooseApp.C:2192
void loadLibraryAndDependencies(const std::string &library_filename, const Parameters &params, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:2031

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

Referenced by executeExecutioner(), and run().

1117 {
1118  bool warn = _enable_unused_check == WARN_UNUSED;
1120 
1121  _builder.errorCheck(*_comm, warn, err);
1122 
1123  auto apps = feProblem().getMultiAppWarehouse().getObjects();
1124  for (auto app : apps)
1125  for (unsigned int i = 0; i < app->numLocalApps(); i++)
1126  app->localApp(i)->errorCheck();
1127 }
OStreamProxy err
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
FEProblemBase & feProblem() const
Definition: MooseApp.C:1320
const std::vector< std::shared_ptr< T > > & getObjects(THREAD_ID tid=0) const
Retrieve complete vector to the all/block/boundary restricted objects for a given thread...
enum MooseApp::UNUSED_CHECK _enable_unused_check
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1143
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1097
void errorCheck(const Parallel::Communicator &comm, bool warn_unused, bool err_unused)
Definition: Builder.C:497

◆ errorOnJacobianNonzeroReallocation()

virtual bool MooseApp::errorOnJacobianNonzeroReallocation ( ) const
inlinevirtual

Whether this application should by default error on Jacobian nonzero reallocations.

The application level setting can always be overridden by setting the error_on_jacobian_nonzero_reallocation parameter in the Problem block of the input file

Definition at line 1032 of file MooseApp.h.

1032 { return false; }

◆ errorPrefix()

std::string MooseBase::errorPrefix ( const std::string &  error_type) const
inherited
Returns
A prefix to be used in errors that contains the input file location associated with this object (if any) and the name and type of the object.

Definition at line 43 of file MooseBase.C.

Referenced by MooseBase::callMooseError(), MooseBaseErrorInterface::mooseWarning(), and MooseBaseParameterInterface::paramErrorMsg().

44 {
45  std::stringstream oss;
46  if (const auto node = _params.getHitNode())
47  if (!node->isRoot())
48  oss << node->fileLocation() << ":\n";
49  oss << "The following " << error_type << " occurred in the ";
50  if (const auto base_ptr = _params.getBase())
51  oss << *base_ptr;
52  else
53  oss << "object";
54  oss << " '" << name() << "' of type " << type() << ".\n\n";
55  return oss.str();
56 }
const hit::Node * getHitNode(const std::string &param) const
std::optional< std::string > getBase() const
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const InputParameters & _params
The object&#39;s parameteres.
Definition: MooseBase.h:94
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51

◆ executeExecutioner()

void MooseApp::executeExecutioner ( )
virtual

Execute the Executioner that was built.

Definition at line 1130 of file MooseApp.C.

Referenced by run().

1131 {
1132  TIME_SECTION("executeExecutioner", 3);
1133 
1134  // If ready to exit has been set, then just return
1135  if (_ready_to_exit)
1136  return;
1137 
1138  // run the simulation
1139  if (_use_executor && _executor)
1140  {
1142 
1143  _executor->init();
1144  errorCheck();
1145  auto result = _executor->exec();
1146  if (!result.convergedAll())
1147  mooseError(result.str());
1148  }
1149  else if (_executioner)
1150  {
1152  _executioner->init();
1153  errorCheck();
1154  _executioner->execute();
1155  }
1156  else
1157  mooseError("No executioner was specified (go fix your input file)");
1158 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164
PetscErrorCode petscSetupOutput(CommandLine *cmd_line)
Definition: PetscSupport.C:260
bool _ready_to_exit
Definition: MooseApp.h:1209
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1183
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:1116

◆ feProblem()

FEProblemBase & MooseApp::feProblem ( ) const

Definition at line 1320 of file MooseApp.C.

Referenced by attachRelationshipManagers(), MooseMesh::cacheFaceInfoVariableOwnership(), MooseMesh::cacheFVElementalDoFs(), errorCheck(), AutomaticMortarGeneration::initOutput(), removeRelationshipManager(), and setOutputFileBase().

1321 {
1322  return _executor.get() ? _executor->feProblem() : _executioner->feProblem();
1323 }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167

◆ finalizeRestore()

std::unique_ptr< Backup > MooseApp::finalizeRestore ( )

Finalizes (closes) the restoration process done in restore().

Returns
The underlying Backup that was used to do the restoration (if any, will be null when backed up from file); can be ignored to destruct it

This releases access to the stream in which the restore was loaded from and makes it no longer possible to restore additional data.

Definition at line 1276 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1277 {
1278  if (!_rd_reader.isRestoring())
1279  mooseError("MooseApp::finalizeRestore(): Not currently restoring");
1280 
1281  // This gives us access to the underlying streams so that we can return it if needed
1282  auto input_streams = _rd_reader.clear();
1283 
1284  std::unique_ptr<Backup> backup;
1285 
1286  // Give them back a backup if this restore started from a Backup, in which case
1287  // the two streams in the Backup are formed into StringInputStreams
1288  if (auto header_string_input = dynamic_cast<StringInputStream *>(input_streams.header.get()))
1289  {
1290  auto data_string_input = dynamic_cast<StringInputStream *>(input_streams.data.get());
1291  mooseAssert(data_string_input, "Should also be a string input");
1292 
1293  auto header_sstream = header_string_input->release();
1294  mooseAssert(header_sstream, "Header not available");
1295 
1296  auto data_sstream = data_string_input->release();
1297  mooseAssert(data_sstream, "Data not available");
1298 
1299  backup = std::make_unique<Backup>();
1300  backup->header = std::move(header_sstream);
1301  backup->data = std::move(data_sstream);
1302  }
1303 
1304  return backup;
1305 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
RestartableDataReader _rd_reader
Definition: MooseApp.h:1419
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1219
Helper class that hands out input streams to a stringstream.
InputStreams clear()
Clears the contents of the reader (header stream, data stream, header)

◆ fixedPointConfig()

FixedPointConfig& MooseApp::fixedPointConfig ( )
inline

This info is stored here because we need a "globalish" place to put it in order to allow communication between a multiapp and solver-specific internals (i.e.

relating to fixed-point inner loops like picard, etc.) for handling subapp-specific modifications necessary for those solve processes.

Definition at line 381 of file MooseApp.h.

Referenced by FixedPointSolve::FixedPointSolve().

381 { return _fixed_point_config; }
FixedPointConfig _fixed_point_config
Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and u...
Definition: MooseApp.h:1179

◆ getActionFactory()

ActionFactory& MooseApp::getActionFactory ( )
inline

Retrieve a writable reference to the ActionFactory associated with this App.

Definition at line 401 of file MooseApp.h.

Referenced by Action::Action().

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

◆ getCheckpointDirectories()

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

Get all checkpoint directories.

Returns
A Set of checkpoint directories

Definition at line 1714 of file MooseApp.C.

Referenced by getCheckpointFiles().

1715 {
1716  // Storage for the directory names
1717  std::list<std::string> checkpoint_dirs;
1718 
1719  // Add the directories added with Outputs/checkpoint=true input syntax
1720  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
1721 
1722  // Add the directories from any existing checkpoint output objects
1723  const auto & actions = _action_warehouse.getActionListByName("add_output");
1724  for (const auto & action : actions)
1725  {
1726  // Get the parameters from the MooseObjectAction
1727  MooseObjectAction * moose_object_action = dynamic_cast<MooseObjectAction *>(action);
1728  if (!moose_object_action)
1729  continue;
1730 
1731  const InputParameters & params = moose_object_action->getObjectParams();
1732  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
1733  {
1734  // Unless file_base was explicitly set by user, we cannot rely on it, as it will be changed
1735  // later
1736  const std::string cp_dir =
1737  _file_base_set_by_user ? params.get<std::string>("file_base")
1738  : (getOutputFileBase(true) + "_" + moose_object_action->name());
1739  checkpoint_dirs.push_back(cp_dir + "_cp");
1740  }
1741  }
1742  return checkpoint_dirs;
1743 }
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1103
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
Definition: MooseApp.C:1066
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
InputParameters & getObjectParams()
Retreive the parameters of the object to be created by this action.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.

◆ getCheckpointFiles()

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

Extract all possible checkpoint file names.

Returns
A Set of checkpoint filenames

Definition at line 1746 of file MooseApp.C.

Referenced by setRestartRecoverFileBase().

1747 {
1748  auto checkpoint_dirs = getCheckpointDirectories();
1749  return MooseUtils::getFilesInDirs(checkpoint_dirs, false);
1750 }
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:1714
std::list< std::string > getFilesInDirs(const std::list< std::string > &directory_list, const bool files_only=true)
Retrieves the names of all of the files contained within the list of directories passed into the rout...
Definition: MooseUtils.C:794

◆ getCommunicator()

const std::shared_ptr<Parallel::Communicator> MooseApp::getCommunicator ( ) const
inline

Definition at line 1001 of file MooseApp.h.

Referenced by MooseServer::parseDocumentForDiagnostics().

1001 { return _comm; }
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1097

◆ getCurrentActionHitNode()

const hit::Node * MooseApp::getCurrentActionHitNode ( ) const
Returns
The hit node that is responsible for creating the current action that is running, if any

Can be used to link objects that are created by an action to the action that created them in input

Definition at line 2413 of file MooseApp.C.

Referenced by ActionFactory::create(), and Factory::initialize().

2414 {
2415  if (const auto action = _action_warehouse.getCurrentAction())
2416  return action->parameters().getHitNode();
2417  return nullptr;
2418 }
const Action * getCurrentAction() const
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134

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

Referenced by MooseMesh::determineUseDistributedMesh().

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

◆ getExecuteOnEnum()

const ExecFlagEnum& MooseApp::getExecuteOnEnum ( ) const
inline

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

Definition at line 983 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup(), and EigenExecutionerBase::normalizeSolution().

983 { return _execute_flags; }
const ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:1428

◆ getExecutioner()

Executioner * MooseApp::getExecutioner ( ) const

◆ getExecutor() [1/2]

Executor* MooseApp::getExecutor ( ) const
inline

Definition at line 319 of file MooseApp.h.

Referenced by CheckIntegrityAction::act(), ExecutorInterface::getExecutor(), FEProblemBase::getExecutor(), and ExecutorInterface::getExecutorByName().

319 { return _executor.get(); }
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167

◆ getExecutor() [2/2]

Executor & MooseApp::getExecutor ( const std::string &  name,
bool  fail_if_not_found = true 
)

Get an Executor.

Parameters
nameThe name of the Executor
fail_if_not_foundWhether or not to fail if the executor doesn't exist. If this is false then this function will return a NullExecutor

Definition at line 1462 of file MooseApp.C.

1463 {
1464  auto it = _executors.find(name);
1465 
1466  if (it != _executors.end())
1467  return *it->second;
1468 
1469  if (fail_if_not_found)
1470  mooseError("Executor not found: ", name);
1471 
1472  return *_null_executor;
1473 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
if(subdm)
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1170
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1186

◆ getExodusFileRestart()

bool MooseApp::getExodusFileRestart ( ) const
inline

Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh.

Definition at line 425 of file MooseApp.h.

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

425 { 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:1212

◆ getExReaderForRestart()

ExodusII_IO* MooseApp::getExReaderForRestart ( ) const
inline

Get the Exodus reader to restart variables from an Exodus mesh file.

Definition at line 435 of file MooseApp.h.

Referenced by FEProblemBase::checkICRestartError(), and FEProblemBase::initialSetup().

435 { return _ex_reader.get(); }
std::shared_ptr< ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
Definition: MooseApp.h:1215

◆ getFactory()

Factory& MooseApp::getFactory ( )
inline

◆ getFileName()

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

Return the primary (first) filename that was parsed Note: When stripLeadingPath is false, this function returns the same name as getInputFileName() method when the input file is not a link.

Definition at line 1760 of file MooseApp.C.

Referenced by ProgressOutput::output().

1761 {
1762  return _builder.getPrimaryFileName(stripLeadingPath);
1763 }
std::string getPrimaryFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed.
Definition: Builder.C:197
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1143

◆ getFPTrapFlag()

bool MooseApp::getFPTrapFlag ( ) const
inline

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

Definition at line 908 of file MooseApp.h.

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

◆ getFrameworkVersion()

std::string MooseApp::getFrameworkVersion ( ) const

Returns the framework version.

Definition at line 663 of file MooseApp.C.

664 {
665  return MOOSE_VERSION;
666 }

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

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

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

◆ getInputFileNames()

const std::vector< std::string > & MooseApp::getInputFileNames ( ) const
Returns
the input file names set in the Parser

Definition at line 1052 of file MooseApp.C.

Referenced by Console::outputInput(), and setupOptions().

1053 {
1054  mooseAssert(_parser, "Parser is not set");
1055  return _parser->getInputFileNames();
1056 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1140

◆ getInputParameterWarehouse()

InputParameterWarehouse & MooseApp::getInputParameterWarehouse ( )

Get the InputParameterWarehouse for MooseObjects.

Definition at line 2218 of file MooseApp.C.

Referenced by FEProblemBase::addMaterialHelper(), MooseBaseParameterInterface::connectControllableParams(), ActionFactory::create(), Factory::initialize(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), ActionWarehouse::printInputFile(), and Factory::releaseSharedObjects().

2219 {
2221 }
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1128

◆ getInstallableInputs()

std::string MooseApp::getInstallableInputs ( ) const
privatevirtual

Method to retrieve the installable inputs from a given applications <app>Revision.h file.

Definition at line 1578 of file MooseApp.C.

Referenced by showInputs().

1579 {
1580  return "tests";
1581 }

◆ getInterfaceObjects()

template<class T >
const std::vector< T * > & MooseApp::getInterfaceObjects ( ) const

Gets the registered interface objects for a given interface.

For this to work, the interface must register itself using registerInterfaceObject.

Definition at line 1526 of file MooseApp.h.

Referenced by DeclareLateReportersAction::act(), ResolveOptionalMaterialPropertiesAction::act(), Coupleable::checkWritableVar(), PetscOutputInterface::petscLinearOutput(), PetscOutputInterface::petscNonlinearOutput(), and PetscOutput::solveSetup().

1527 {
1528  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1529 
1530  const auto it = _interface_registry.find(typeid(T));
1531  if (it != _interface_registry.end())
1532  return static_cast<InterfaceRegistryObjects<T> *>(it->second.get())->_objects;
1533  const static std::vector<T *> empty;
1534  return empty;
1535 }
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1449

◆ getLastInputFileName()

const std::string & MooseApp::getLastInputFileName ( ) const
Returns
The last input filename set (if any)

Definition at line 1059 of file MooseApp.C.

Referenced by setupOptions().

1060 {
1061  mooseAssert(_parser, "Parser is not set");
1062  return _parser->getLastInputFileName();
1063 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1140

◆ getLibrarySearchPaths()

std::set< std::string > MooseApp::getLibrarySearchPaths ( const std::string &  library_path_from_param) const

Return the paths searched by MOOSE when loading libraries.

Definition at line 2192 of file MooseApp.C.

Referenced by dynamicAppRegistration(), and dynamicRegistration().

2193 {
2194  std::set<std::string> paths;
2195 
2196  if (!library_path.empty())
2197  {
2198  std::vector<std::string> tmp_paths;
2199  MooseUtils::tokenize(library_path, tmp_paths, 1, ":");
2200 
2201  paths.insert(tmp_paths.begin(), tmp_paths.end());
2202  }
2203 
2204  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
2205  if (moose_lib_path_env)
2206  {
2207  std::string moose_lib_path(moose_lib_path_env);
2208  std::vector<std::string> tmp_paths;
2209  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
2210 
2211  paths.insert(tmp_paths.begin(), tmp_paths.end());
2212  }
2213 
2214  return paths;
2215 }
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:779

◆ getLoadedLibraryPaths()

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

Return the paths of loaded libraries.

Definition at line 2181 of file MooseApp.C.

Referenced by Factory::reportUnregisteredError().

2182 {
2183  // Return the paths but not the open file handles
2184  std::set<std::string> paths;
2185  for (const auto & it : _lib_handles)
2186  paths.insert(it.first);
2187 
2188  return paths;
2189 }
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1268

◆ getMeshGenerator()

const MeshGenerator& MooseApp::getMeshGenerator ( const std::string &  name) const
inline
Returns
The MeshGenerator with the name name.

Definition at line 849 of file MooseApp.h.

Referenced by MeshGenerator::generateInternal().

850  {
852  }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
const MeshGenerator & getMeshGenerator(const std::string &name) const

◆ getMeshGeneratorMesh()

std::unique_ptr<MeshBase> MooseApp::getMeshGeneratorMesh ( )
inline
Returns
The final mesh generated by the mesh generator system

Definition at line 857 of file MooseApp.h.

858  {
860  }
std::unique_ptr< MeshBase > getSavedMesh(const std::string &name)
Get the saved mesh by name.
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
static std::string mainMeshGeneratorName()
The name reserved for the "main" mesh generator which is the one used for the numerical solver downst...

◆ getMeshGeneratorNames()

std::vector<std::string> MooseApp::getMeshGeneratorNames ( ) const
inline
Returns
The names of all mesh generators

See MeshGeneratorSystem::getMeshGeneratorNames()

Definition at line 867 of file MooseApp.h.

Referenced by SetupMeshAction::act().

868  {
870  }
std::vector< std::string > getMeshGeneratorNames() const
Get names of all mesh generators Note: This function should be called after all mesh generators are a...
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417

◆ getMeshGeneratorSystem()

MeshGeneratorSystem& MooseApp::getMeshGeneratorSystem ( )
inline

Gets the system that manages the MeshGenerators.

Definition at line 820 of file MooseApp.h.

Referenced by ExecuteMeshGenerators::act(), SetupMeshAction::act(), CreateAddedMeshGenerators::act(), MeshGenerator::checkGetMesh(), ExtraNodesetGenerator::generate(), SideSetsFromNormalsGenerator::generate(), MeshGenerator::getMeshByName(), and MeshGenerator::MeshGenerator().

820 { return _mesh_generator_system; }
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417

◆ getMooseApp()

MooseApp& MooseBase::getMooseApp ( ) const
inlineinherited

◆ getNullExecutor()

NullExecutor* MooseApp::getNullExecutor ( ) const
inline

Definition at line 320 of file MooseApp.h.

Referenced by ExecutorInterface::getExecutor().

320 { return _null_executor.get(); }
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1186

◆ getOutputFileBase()

std::string MooseApp::getOutputFileBase ( bool  for_non_moose_build_output = false) const

Get the output file base name.

Parameters
for_non_moose_build_outputTrue for getting the file base for outputs generated with Outputs/[outputname] input syntax.
Returns
The file base name used by output objects Note: for_non_moose_build_output does not affect the returned value when this is a subapp. for_non_moose_build_output also does not affect the returned value when Outputs/file_base parameter is available. When for_non_moose_build_output does affect the returned value, i.e. master without Outputs/file_base, the suffix _out is removed.

Definition at line 1066 of file MooseApp.C.

Referenced by getCheckpointDirectories(), OutputWarehouse::resetFileBase(), and MultiApp::setAppOutputFileBase().

1067 {
1068  if (_file_base_set_by_user || for_non_moose_build_output || _multiapp_level)
1069  return _output_file_base;
1070  else
1071  return _output_file_base + "_out";
1072 }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1405
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1103
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1100

◆ getOutputFileNumbers()

const std::map<std::string, unsigned int>& MooseApp::getOutputFileNumbers ( ) const
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 532 of file MooseApp.h.

Referenced by TransientMultiApp::setupApp().

533  {
534  return _output_file_numbers;
535  }
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:1242

◆ getOutputPosition()

Point MooseApp::getOutputPosition ( ) const
inline

Get the output position.

Returns
The position offset for the output.

Definition at line 266 of file MooseApp.h.

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

266 { return _output_position; }
Point _output_position
The output position.
Definition: MooseApp.h:1109

◆ getOutputWarehouse()

OutputWarehouse & MooseApp::getOutputWarehouse ( )

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

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

1466 {
1467  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
1468 }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type, const MooseBase *moose_base=nullptr)

◆ getParam() [2/2]

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

Definition at line 1472 of file MooseApp.h.

1473 {
1474  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0), this);
1475 }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type, const MooseBase *moose_base=nullptr)

◆ getPrintableName()

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

Get printable name of the application.

Definition at line 107 of file MooseApp.h.

Referenced by getPrintableVersion().

107 { return "Application"; }

◆ getPrintableVersion()

std::string MooseApp::getPrintableVersion ( ) const

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

Definition at line 675 of file MooseApp.C.

Referenced by setupOptions().

676 {
677  return getPrintableName() + " Version: " + getVersion();
678 }
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:107
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:669

◆ getRecoverableData()

const DataNames& MooseApp::getRecoverableData ( ) const
inline

Return a reference to the recoverable data object.

Returns
A const reference to the recoverable data

Definition at line 706 of file MooseApp.h.

Referenced by restore().

706 { return _recoverable_data_names; }
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:1152

◆ getRecoverFileBase()

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

Definition at line 487 of file MooseApp.h.

488  {
489  mooseDeprecated("MooseApp::getRecoverFileBase is deprecated, use "
490  "MooseApp::getRestartRecoverFileBase() instead.");
491  return _restart_recover_base;
492  }
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313

◆ getRelationshipManagerInfo()

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

Returns the Relationship managers info suitable for printing.

Definition at line 2667 of file MooseApp.C.

Referenced by ConsoleUtils::outputRelationshipManagerInformation().

2668 {
2669  std::vector<std::pair<std::string, std::string>> info_strings;
2670  info_strings.reserve(_relationship_managers.size());
2671 
2672  for (const auto & rm : _relationship_managers)
2673  {
2674  std::stringstream oss;
2675  oss << rm->getInfo();
2676 
2677  auto & for_whom = rm->forWhom();
2678 
2679  if (!for_whom.empty())
2680  {
2681  oss << " for ";
2682 
2683  std::copy(for_whom.begin(), for_whom.end(), infix_ostream_iterator<std::string>(oss, ", "));
2684  }
2685 
2686  info_strings.emplace_back(std::make_pair(Moose::stringify(rm->getType()), oss.str()));
2687  }
2688 
2689  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
2690  // Ghosting Functors are also attached to the mesh. This should catch them all.
2691  const auto & mesh = _action_warehouse.getMesh();
2692  if (mesh)
2693  {
2694  // Let us use an ordered map to avoid stochastic console behaviors.
2695  // I believe we won't have many RMs, and there is no performance issue.
2696  // Deterministic behaviors are good for setting up regression tests
2697  std::map<std::string, unsigned int> counts;
2698 
2699  for (auto & gf : as_range(mesh->getMesh().ghosting_functors_begin(),
2700  mesh->getMesh().ghosting_functors_end()))
2701  {
2702  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
2703  if (!gf_ptr)
2704  // Count how many occurences of the same Ghosting Functor types we are encountering
2705  counts[demangle(typeid(*gf).name())]++;
2706  }
2707 
2708  for (const auto & pair : counts)
2709  info_strings.emplace_back(std::make_pair(
2710  "Default", pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "")));
2711  }
2712 
2713  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
2714  // Ghosting Functors are also attached to the mesh. This should catch them all.
2715  const auto & d_mesh = _action_warehouse.getDisplacedMesh();
2716  if (d_mesh)
2717  {
2718  // Let us use an ordered map to avoid stochastic console behaviors.
2719  // I believe we won't have many RMs, and there is no performance issue.
2720  // Deterministic behaviors are good for setting up regression tests
2721  std::map<std::string, unsigned int> counts;
2722 
2723  for (auto & gf : as_range(d_mesh->getMesh().ghosting_functors_begin(),
2724  d_mesh->getMesh().ghosting_functors_end()))
2725  {
2726  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
2727  if (!gf_ptr)
2728  // Count how many occurences of the same Ghosting Functor types we are encountering
2729  counts[demangle(typeid(*gf).name())]++;
2730  }
2731 
2732  for (const auto & pair : counts)
2733  info_strings.emplace_back(
2734  std::make_pair("Default",
2735  pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "") +
2736  " for DisplacedMesh"));
2737  }
2738 
2739  return info_strings;
2740 }
const std::shared_ptr< MooseMesh > & getMesh() const
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62
std::string demangle(const char *name)
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
const std::shared_ptr< MooseMesh > & getDisplacedMesh() const
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248

◆ getReleationshipManagers()

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

Retrieve the relationship managers.

◆ getRenamedParam()

template<typename T >
const T & MooseApp::getRenamedParam ( const std::string &  old_name,
const std::string &  new_name 
) const

Retrieve a renamed parameter for the object.

This helper makes sure we check both names before erroring, and that only one parameter is passed to avoid silent errors

Parameters
old_namethe old name for the parameter
new_namethe new name for the parameter

Definition at line 1479 of file MooseApp.h.

1480 {
1481  // this enables having a default on the new parameter but bypassing it with the old one
1482  // Most important: accept new parameter
1483  if (isParamSetByUser(new_name) && !isParamValid(old_name))
1484  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1485  // Second most: accept old parameter
1486  else if (isParamValid(old_name) && !isParamSetByUser(new_name))
1487  return InputParameters::getParamHelper(old_name, _pars, static_cast<T *>(0), this);
1488  // Third most: accept default for new parameter
1489  else if (isParamValid(new_name) && !isParamValid(old_name))
1490  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1491  // Refuse: no default, no value passed
1492  else if (!isParamValid(old_name) && !isParamValid(new_name))
1493  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1494  "' is being retrieved without being set.\n"
1495  "Did you mispell it?");
1496  // Refuse: both old and new parameters set by user
1497  else
1498  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1499  "' may not be provided alongside former parameter '" + old_name + "'");
1500 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
std::string blockFullpath() const
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:165
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type, const MooseBase *moose_base=nullptr)

◆ getRestartableData() [1/2]

const std::vector<RestartableDataMap>& MooseApp::getRestartableData ( ) const
inline

Return reference to the restartable data object.

Returns
A reference to the restartable data object

Definition at line 672 of file MooseApp.h.

672 { return _restartable_data; }
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146

◆ getRestartableData() [2/2]

std::vector<RestartableDataMap>& MooseApp::getRestartableData ( )
inline

Definition at line 673 of file MooseApp.h.

673 { return _restartable_data; }
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146

◆ getRestartableDataMap()

RestartableDataMap & MooseApp::getRestartableDataMap ( const RestartableDataMapName name)

Return a reference to restartable data for the specific type flag.

Definition at line 2775 of file MooseApp.C.

Referenced by getRestartableMetaData(), possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

2776 {
2777  auto iter = _restartable_meta_data.find(name);
2778  if (iter == _restartable_meta_data.end())
2779  mooseError("Unable to find RestartableDataMap object for the supplied name '",
2780  name,
2781  "', did you call registerRestartableDataMapName in the application constructor?");
2782  return iter->second.first;
2783 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57

◆ getRestartableDataMapBegin()

auto MooseApp::getRestartableDataMapBegin ( )
inline

Iterator based access to the extra RestartableDataMap objects; see Checkpoint.C for use case.

These are MOOSE internal functions and should not be used otherwise.

Definition at line 1022 of file MooseApp.h.

Referenced by SetupDebugAction::act().

1022 { return _restartable_meta_data.begin(); }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392

◆ getRestartableDataMapEnd()

auto MooseApp::getRestartableDataMapEnd ( )
inline

Definition at line 1024 of file MooseApp.h.

Referenced by SetupDebugAction::act().

1024 { return _restartable_meta_data.end(); }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392

◆ getRestartableDataMapName()

const std::string & MooseApp::getRestartableDataMapName ( const RestartableDataMapName name) const
Returns
The output name for the restartable data with name name

Definition at line 2802 of file MooseApp.C.

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

2803 {
2804  const auto it = _restartable_meta_data.find(name);
2805  if (it == _restartable_meta_data.end())
2806  mooseError("MooseApp::getRestartableDataMapName: The name '", name, "' is not registered");
2807  return it->second.second;
2808 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57

◆ getRestartableMetaData()

RestartableDataValue & MooseApp::getRestartableMetaData ( const std::string &  name,
const RestartableDataMapName metaname,
THREAD_ID  tid 
)

Definition at line 1862 of file MooseApp.C.

Referenced by MeshMetaDataInterface::getMeshPropertyInternal(), and MeshGenerator::setMeshPropertyHelper().

1865 {
1866  if (tid != 0)
1867  mooseError(
1868  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
1869 
1870  // Get metadata reference from RestartableDataMap and return a (non-const) reference to its value
1871  auto & restartable_data_map = getRestartableDataMap(metaname);
1872  RestartableDataValue * const data = restartable_data_map.findData(name);
1873  if (!data)
1874  mooseError("Unable to find RestartableDataValue object with name " + name +
1875  " in RestartableDataMap");
1876 
1877  return *data;
1878 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:2775
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Abstract definition of a RestartableData value.

◆ getRestartRecoverFileBase()

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

The file_base for the recovery file.

Definition at line 486 of file MooseApp.h.

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

486 { return _restart_recover_base; }
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236

◆ getRMClone()

RelationshipManager & MooseApp::getRMClone ( const RelationshipManager template_rm,
const MeshBase &  mesh 
) const
private

Return the relationship manager clone originally created from the provided template relationship manager and mesh.

Definition at line 2429 of file MooseApp.C.

Referenced by removeRelationshipManager().

2430 {
2431  auto outer_it = _template_to_clones.find(&template_rm);
2432  if (outer_it == _template_to_clones.end())
2433  mooseError("The template rm does not exist in our _template_to_clones map");
2434 
2435  auto & mesh_to_clone_map = outer_it->second;
2436  auto inner_it = mesh_to_clone_map.find(&mesh);
2437  if (inner_it == mesh_to_clone_map.end())
2438  mooseError("We should have the mesh key in our mesh");
2439 
2440  return *inner_it->second;
2441 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::map< const RelationshipManager *, std::map< const MeshBase *, std::unique_ptr< RelationshipManager > > > _template_to_clones
Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase...
Definition: MooseApp.h:1446

◆ getStartTime()

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

Definition at line 284 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup(), and Transient::Transient().

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

◆ getSystemInfo()

const SystemInfo* MooseApp::getSystemInfo ( ) const
inline

Get SystemInfo object.

Returns
A pointer to the SystemInformation object

Definition at line 546 of file MooseApp.h.

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

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

◆ getVersion()

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

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

Definition at line 669 of file MooseApp.C.

Referenced by getPrintableVersion().

670 {
671  return MOOSE_VERSION;
672 }

◆ hasInitialBackup()

bool MooseApp::hasInitialBackup ( ) const
inline
Returns
Whether or not this app currently has an "initial" backup

See _initial_backup and restoreFromInitialBackup() for more info.

Definition at line 990 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup(), and restoreFromInitialBackup().

991  {
992  return _initial_backup != nullptr && *_initial_backup != nullptr;
993  }
std::unique_ptr< Backup > *const _initial_backup
The backup for use in initial setup; this will get set from the _initial_backup input parameter that ...
Definition: MooseApp.h:1455

◆ hasMeshGenerator()

bool MooseApp::hasMeshGenerator ( const MeshGeneratorName &  name) const
inline
Returns
Whether or not a mesh generator exists with the name name.

Definition at line 841 of file MooseApp.h.

842  {
844  }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1417
bool hasMeshGenerator(const MeshGeneratorName &name) const

◆ hasOutputPosition()

bool MooseApp::hasOutputPosition ( ) const
inline

Whether or not an output position has been set.

Returns
True if it has

Definition at line 260 of file MooseApp.h.

Referenced by Exodus::output().

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

◆ hasRecoverFileBase()

bool MooseApp::hasRecoverFileBase ( ) const

Definition at line 1185 of file MooseApp.C.

1186 {
1187  mooseDeprecated("MooseApp::hasRecoverFileBase is deprecated, use "
1188  "MooseApp::hasRestartRecoverFileBase() instead.");
1189  return !_restart_recover_base.empty();
1190 }
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313

◆ hasRelationshipManager()

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

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

Definition at line 2316 of file MooseApp.C.

2317 {
2318  return std::find_if(_relationship_managers.begin(),
2319  _relationship_managers.end(),
2320  [&name](const std::shared_ptr<RelationshipManager> & rm)
2321  { return rm->name() == name; }) != _relationship_managers.end();
2322 }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248

◆ hasRestartableDataMap()

bool MooseApp::hasRestartableDataMap ( const RestartableDataMapName name) const
Returns
Whether or not the restartable data has the given name registered.

Definition at line 2786 of file MooseApp.C.

2787 {
2788  return _restartable_meta_data.count(name);
2789 }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57

◆ hasRestartableMetaData()

bool MooseApp::hasRestartableMetaData ( const std::string &  name,
const RestartableDataMapName metaname 
) const

Definition at line 1852 of file MooseApp.C.

Referenced by MeshMetaDataInterface::hasMeshProperty().

1854 {
1855  auto it = _restartable_meta_data.find(metaname);
1856  if (it == _restartable_meta_data.end())
1857  return false;
1858  return it->second.first.hasData(name);
1859 }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57

◆ hasRestartRecoverFileBase()

bool MooseApp::hasRestartRecoverFileBase ( ) const

Return true if the recovery file base is set.

Definition at line 1179 of file MooseApp.C.

1180 {
1181  return !_restart_recover_base.empty();
1182 }
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236

◆ hasRMClone()

bool MooseApp::hasRMClone ( const RelationshipManager template_rm,
const MeshBase &  mesh 
) const
private
Returns
whether we have created any clones for the provided template relationship manager and mesh yet. This may be false for instance when we are in the initial add relationship manager stage and haven't attempted attaching any relationship managers to the mesh or dof map yet (which is when we generate the clones). It's also maybe possible that we've created a clone of a given template_rm but not for the provided mesh so we return false in that case as well

Definition at line 2421 of file MooseApp.C.

Referenced by removeRelationshipManager().

2422 {
2423  auto it = _template_to_clones.find(&template_rm);
2424  // C++ does short circuiting so we're safe here
2425  return (it != _template_to_clones.end()) && (it->second.find(&mesh) != it->second.end());
2426 }
std::map< const RelationshipManager *, std::map< const MeshBase *, std::unique_ptr< RelationshipManager > > > _template_to_clones
Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase...
Definition: MooseApp.h:1446

◆ hasStartTime()

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

Definition at line 279 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup(), and Transient::Transient().

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

◆ header()

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

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

Definition at line 2224 of file MooseApp.C.

Referenced by restore(), and setupOptions().

2225 {
2226  return std::string("");
2227 }

◆ isParamSetByUser()

bool MooseApp::isParamSetByUser ( const std::string &  nm) const
inline

Definition at line 165 of file MooseApp.h.

Referenced by getRenamedParam().

165 { return _pars.isParamSetByUser(nm); }
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091

◆ isParamValid()

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

Definition at line 163 of file MooseApp.h.

Referenced by copyInputs(), getRenamedParam(), MooseApp(), run(), runInputFile(), runInputs(), setupOptions(), Output::setWallTimeIntervalFromCommandLineParam(), and showInputs().

163 { return _pars.isParamValid(name); }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
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.

More specifically whether this has been restarted using the Problem/restart_file_base parameter. Note that this will only return true when doing checkpoint restart. This will be false if doing exodus restart. Finally this will never return true when isRecovering is true

Definition at line 1167 of file MooseApp.C.

Referenced by SetupMeshAction::act(), FEProblemBase::checkICRestartError(), MultiApp::createApp(), FileOutput::FileOutput(), FEProblemBase::initialSetup(), Transient::preExecute(), TimeSequenceStepperBase::setupSequence(), and TransientMultiApp::solveStep().

1168 {
1169  return _restart;
1170 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1224

◆ isSplitMesh()

bool MooseApp::isSplitMesh ( ) const

Whether or not this is a split mesh operation.

Definition at line 1173 of file MooseApp.C.

Referenced by MooseMesh::init().

1174 {
1175  return _split_mesh;
1176 }
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1227

◆ isUltimateMaster()

bool MooseApp::isUltimateMaster ( ) const
inline

◆ libNameToAppName()

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

Converts a library name to an application name:

Definition at line 1788 of file MooseApp.C.

1789 {
1790  std::string app_name(library_name);
1791 
1792  // Strip off the leading "lib" and trailing ".la"
1793  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
1794  mooseError("Invalid library name: ", app_name);
1795 
1796  return MooseUtils::underscoreToCamelCase(app_name, true);
1797 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
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:566

◆ loadLibraryAndDependencies()

void MooseApp::loadLibraryAndDependencies ( const std::string &  library_filename,
const Parameters &  params,
bool  load_dependencies = true 
)
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 2031 of file MooseApp.C.

Referenced by dynamicRegistration().

2034 {
2035  std::string line;
2036  std::string dl_lib_filename;
2037 
2038  // This RE looks for absolute path libtool filenames (i.e. begins with a slash and ends with a
2039  // .la)
2040  pcrecpp::RE re_deps("(/\\S*\\.la)");
2041 
2042  std::ifstream la_handle(library_filename.c_str());
2043  if (la_handle.is_open())
2044  {
2045  while (std::getline(la_handle, line))
2046  {
2047  // Look for the system dependent dynamic library filename to open
2048  if (line.find("dlname=") != std::string::npos)
2049  // Magic numbers are computed from length of this string "dlname=' and line minus that
2050  // string plus quotes"
2051  dl_lib_filename = line.substr(8, line.size() - 9);
2052 
2053  if (line.find("dependency_libs=") != std::string::npos)
2054  {
2055  if (load_dependencies)
2056  {
2057  pcrecpp::StringPiece input(line);
2058  pcrecpp::StringPiece depend_library;
2059  while (re_deps.FindAndConsume(&input, &depend_library))
2060  // Recurse here to load dependent libraries in depth-first order
2061  loadLibraryAndDependencies(depend_library.as_string(), params, load_dependencies);
2062  }
2063 
2064  // There's only one line in the .la file containing the dependency libs so break after
2065  // finding it
2066  break;
2067  }
2068  }
2069  la_handle.close();
2070  }
2071 
2072  // This should only occur if we have static linkage.
2073  if (dl_lib_filename.empty())
2074  return;
2075 
2076  const auto & [dir, file_name] = MooseUtils::splitFileName(library_filename);
2077 
2078  // Time to load the library, First see if we've already loaded this particular dynamic library
2079  // 1) make sure we haven't already loaded this library
2080  // AND 2) make sure we have a library name (we won't for static linkage)
2081  // Note: Here was are going to assume uniqueness based on the filename alone. This has significant
2082  // implications for applications that have "diamond" inheritance of libraries (usually
2083  // modules). We will only load one of those libraries, versions be damned.
2084  auto dyn_lib_it = _lib_handles.find(file_name);
2085  if (dyn_lib_it == _lib_handles.end())
2086  {
2087  // Assemble the actual filename using the base path of the *.la file and the dl_lib_filename
2088  const auto dl_lib_full_path = MooseUtils::pathjoin(dir, dl_lib_filename);
2089 
2090  MooseUtils::checkFileReadable(dl_lib_full_path, false, /*throw_on_unreadable=*/true);
2091 
2092 #ifdef LIBMESH_HAVE_DLOPEN
2093  void * const lib_handle = dlopen(dl_lib_full_path.c_str(), RTLD_LAZY);
2094 #else
2095  void * const lib_handle = nullptr;
2096 #endif
2097 
2098  if (!lib_handle)
2099  mooseError("The library file \"",
2100  dl_lib_full_path,
2101  "\" exists and has proper permissions, but cannot by dynamically loaded.\nThis "
2102  "generally means that the loader was unable to load one or more of the "
2103  "dependencies listed in the supplied library (see otool or ldd).\n",
2104  dlerror());
2105 
2106  DynamicLibraryInfo lib_info;
2107  lib_info.library_handle = lib_handle;
2108  lib_info.full_path = library_filename;
2109 
2110  auto insert_ret = _lib_handles.insert(std::make_pair(file_name, lib_info));
2111  mooseAssert(insert_ret.second == true, "Error inserting into lib_handles map");
2112 
2113  dyn_lib_it = insert_ret.first;
2114  }
2115 
2116  // Library has been loaded, check to see if we've called the requested registration method
2117  const auto registration_method = params.get<std::string>("registration_method");
2118  auto & entry_sym_from_curr_lib = dyn_lib_it->second.entry_symbols;
2119 
2120  if (entry_sym_from_curr_lib.find(registration_method) == entry_sym_from_curr_lib.end())
2121  {
2122  // get the pointer to the method in the library. The dlsym()
2123  // function returns a null pointer if the symbol cannot be found,
2124  // we also explicitly set the pointer to NULL if dlsym is not
2125  // available.
2126 #ifdef LIBMESH_HAVE_DLOPEN
2127  void * registration_handle =
2128  dlsym(dyn_lib_it->second.library_handle, registration_method.c_str());
2129 #else
2130  void * registration_handle = nullptr;
2131 #endif
2132 
2133  if (registration_handle)
2134  {
2135  switch (params.get<RegistrationType>("reg_type"))
2136  {
2137  case APPLICATION:
2138  {
2139  using register_app_t = void (*)();
2140  register_app_t * const reg_ptr = reinterpret_cast<register_app_t *>(&registration_handle);
2141  (*reg_ptr)();
2142  break;
2143  }
2144  case REGALL:
2145  {
2146  using register_app_t = void (*)(Factory *, ActionFactory *, Syntax *);
2147  register_app_t * const reg_ptr = reinterpret_cast<register_app_t *>(&registration_handle);
2148  (*reg_ptr)(params.get<Factory *>("factory"),
2149  params.get<ActionFactory *>("action_factory"),
2150  params.get<Syntax *>("syntax"));
2151  break;
2152  }
2153  default:
2154  mooseError("Unhandled RegistrationType");
2155  }
2156 
2157  entry_sym_from_curr_lib.insert(registration_method);
2158  }
2159  else
2160  {
2161 
2162 #if defined(DEBUG) && defined(LIBMESH_HAVE_DLOPEN)
2163  // We found a dynamic library that doesn't have a dynamic
2164  // registration method in it. This shouldn't be an error, so
2165  // we'll just move on.
2166  if (!registration_handle)
2167  mooseWarning("Unable to find extern \"C\" method \"",
2168  registration_method,
2169  "\" in library: ",
2170  dyn_lib_it->first,
2171  ".\n",
2172  "This doesn't necessarily indicate an error condition unless you believe that "
2173  "the method should exist in that library.\n",
2174  dlerror());
2175 #endif
2176  }
2177  }
2178 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:28
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:296
std::pair< std::filesystem::path, std::filesystem::path > splitFileName(const T &full_file)
Function for splitting path and filename.
Definition: MooseUtils.h:231
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:50
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:256
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1395
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1268
std::filesystem::path pathjoin(const std::filesystem::path &p)
Definition: MooseUtils.C:58
Holding syntax for parsing input files.
Definition: Syntax.h:21
class infix_ostream_iterator if void
Definition: InfixIterator.h:26
void loadLibraryAndDependencies(const std::string &library_filename, const Parameters &params, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:2031

◆ loadRestartableMetaData()

void MooseApp::loadRestartableMetaData ( const std::filesystem::path &  folder_base)

Loads all available restartable meta data if it is available with the folder base folder_base.

Definition at line 1896 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act().

1897 {
1898  for (const auto & name_map_pair : _restartable_meta_data)
1899  possiblyLoadRestartableMetaData(name_map_pair.first, folder_base);
1900 }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
void possiblyLoadRestartableMetaData(const RestartableDataMapName &name, const std::filesystem::path &folder_base)
Loads the restartable meta data for name if it is available with the folder base folder_base.
Definition: MooseApp.C:1881

◆ masterDisplacedMesh()

const MooseMesh* MooseApp::masterDisplacedMesh ( ) const
inline

Returns a pointer to the master displaced mesh.

Definition at line 815 of file MooseApp.h.

Referenced by SetupMeshAction::act().

815 { return _master_displaced_mesh; }
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
Definition: MooseApp.h:1414

◆ masterMesh()

const MooseMesh* MooseApp::masterMesh ( ) const
inline

Returns a pointer to the master mesh.

Definition at line 810 of file MooseApp.h.

Referenced by ExecuteMeshGenerators::act(), SetupMeshCompleteAction::act(), and SetupMeshAction::act().

810 { return _master_mesh; }
const MooseMesh *const _master_mesh
The mesh from master app.
Definition: MooseApp.h:1411

◆ metaDataFolderBase()

std::filesystem::path MooseApp::metaDataFolderBase ( const std::filesystem::path &  folder_base,
const std::string &  map_suffix 
)
static

The file suffix for meta data (header and data)

Definition at line 2397 of file MooseApp.C.

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

2399 {
2400  return RestartableDataIO::restartableDataFolder(folder_base /
2401  std::filesystem::path("meta_data" + map_suffix));
2402 }
static std::filesystem::path restartableDataFolder(const std::filesystem::path &folder_base)

◆ multiAppLevel()

unsigned int MooseApp::multiAppLevel ( ) const
inline

The MultiApp Level.

Returns
The current number of levels from the master app

Definition at line 794 of file MooseApp.h.

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

794 { 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:1405

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

Referenced by FileOutput::FileOutput(), and Console::outputSystemInformation().

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

◆ name()

virtual const std::string& MooseBase::name ( ) const
inlinevirtualinherited

Get the name of the class.

Returns
The name of the class

Reimplemented in MooseVariableBase.

Definition at line 57 of file MooseBase.h.

Referenced by HierarchicalGridPartitioner::_do_partition(), CopyNodalVarsAction::act(), AddElementalFieldAction::act(), AdaptivityAction::act(), AddTimeStepperAction::act(), DeprecatedBlockAction::act(), DisplayGhostingAction::act(), AddVariableAction::act(), AddPeriodicBCAction::act(), MaterialOutputAction::act(), FEProblemBase::addAnyRedistributers(), Executioner::addAttributeReporter(), FEProblemBase::addAuxKernel(), FEProblemBase::addAuxScalarKernel(), DisplacedProblem::addAuxVariable(), FEProblemBase::addBoundaryCondition(), FEProblemBase::addConstraint(), FEProblemBase::addDamper(), FEProblemBase::addDGKernel(), FEProblemBase::addDiracKernel(), FEProblemBase::addDistribution(), addExecutor(), addExecutorParams(), FEProblemBase::addFunction(), SubProblem::addFunctor(), FEProblemBase::addFunctorMaterial(), FunctorMaterial::addFunctorProperty(), FunctorMaterial::addFunctorPropertyByBlocks(), FEProblemBase::addFVBC(), FEProblemBase::addFVInitialCondition(), FEProblemBase::addFVInterfaceKernel(), FEProblemBase::addFVKernel(), ADDGKernel::ADDGKernel(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addInterfaceKernel(), FEProblemBase::addInterfaceMaterial(), FEProblemBase::addKernel(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), FEProblemBase::addMaterialHelper(), FEProblemBase::addMeshDivision(), addMeshGenerator(), MeshGenerator::addMeshSubgenerator(), FEProblemBase::addMultiApp(), FEProblemBase::addNodalKernel(), FEProblemBase::addObject(), SubProblem::addPiecewiseByBlockLambdaFunctor(), FEProblemBase::addPostprocessor(), InitialConditionBase::addPostprocessorDependencyHelper(), UserObject::addPostprocessorDependencyHelper(), FEProblemBase::addPredictor(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), Action::addRelationshipManager(), FEProblemBase::addReporter(), FEProblemBase::addSampler(), FEProblemBase::addScalarKernel(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), InitialConditionBase::addUserObjectDependencyHelper(), UserObject::addUserObjectDependencyHelper(), AuxKernelTempl< Real >::addUserObjectDependencyHelper(), DisplacedProblem::addVariable(), FEProblemBase::addVectorPostprocessor(), UserObject::addVectorPostprocessorDependencyHelper(), FVFluxKernel::adjustRMGhostLayers(), Output::advancedExecuteOn(), AdvancedExtruderGenerator::AdvancedExtruderGenerator(), appBinaryName(), appendMeshGenerator(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), ArrayDGKernel::ArrayDGKernel(), ArrayParsedAux::ArrayParsedAux(), AStableDirk4::AStableDirk4(), AuxKernelTempl< Real >::AuxKernelTempl(), Function::average(), MultiApp::backup(), Moose::Builder::build(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), PiecewiseTabularBase::buildFromFile(), MultiAppVariableValueSamplePostprocessorTransfer::cacheElemToPostprocessorData(), MooseBase::callMooseError(), ChangeOverFixedPointPostprocessor::ChangeOverFixedPointPostprocessor(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), FEProblemBase::checkDependMaterialsHelper(), ReporterTransferInterface::checkHasReporterValue(), FEProblemBase::checkICRestartError(), Material::checkMaterialProperty(), checkMetaDataIntegrity(), Damper::checkMinDamping(), FEProblemBase::checkNonlinearConvergence(), Coupleable::checkWritableVar(), CompositeFunction::CompositeFunction(), MaterialBase::computeProperties(), FEProblemBase::computeUserObjectByName(), VectorPostprocessorVisualizationAux::computeValue(), MooseBaseParameterInterface::connectControllableParams(), BatchMaterial< Tuple, Output, Input >::construct(), MultiApp::createApp(), createExecutors(), AddVariableAction::createInitialConditionAction(), MultiApp::createLocalApp(), MeshGeneratorSystem::createMeshGeneratorOrder(), createRecoverablePerfGraph(), MaterialBase::declareADProperty(), MeshGenerator::declareMeshesForSubByName(), MeshGenerator::declareNullMeshName(), MaterialBase::declareProperty(), DOFMapOutput::demangle(), DerivativeSumMaterialTempl< is_ad >::DerivativeSumMaterialTempl(), DGKernel::DGKernel(), DGKernelBase::DGKernelBase(), DomainUserObject::DomainUserObject(), DumpObjectsProblem::dumpObjectHelper(), ElementGroupCentroidPositions::ElementGroupCentroidPositions(), ElementValueSampler::ElementValueSampler(), MooseMesh::errorIfDistributedMesh(), MooseBase::errorPrefix(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), RestartableDataReporter::execute(), PointValue::execute(), MultiAppNearestNodeTransfer::execute(), ActionWarehouse::executeActionsWithAction(), Exodus::Exodus(), ExtraIDIntegralVectorPostprocessor::ExtraIDIntegralVectorPostprocessor(), MultiApp::fillPositions(), PointSamplerBase::finalize(), FunctionDT::FunctionDT(), FVFunctionIC::functionName(), FunctionIC::functionName(), FunctorPositions::FunctorPositions(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), FVOneVarDiffusionInterface::FVOneVarDiffusionInterface(), MooseServer::gatherDocumentSymbols(), BoundaryDeletionGenerator::generate(), RenameBlockGenerator::generate(), RenameBoundaryGenerator::generate(), BreakMeshByBlockGenerator::generate(), GeneratedMeshGenerator::generate(), ParsedSubdomainMeshGenerator::generate(), StitchedMeshGenerator::generate(), XYDelaunayGenerator::generate(), SubdomainBoundingBoxGenerator::generate(), MeshGenerator::generateInternal(), InterfaceMaterial::getADMaterialProperty(), Material::getADMaterialProperty(), MultiAppTransfer::getAppInfo(), MultiApp::getBoundingBox(), getCheckpointDirectories(), Control::getControllableParameterByName(), Control::getControllableValue(), Control::getControllableValueByName(), UserObject::getDependObjects(), DistributionInterface::getDistribution(), FEProblemBase::getDistribution(), DistributionInterface::getDistributionByName(), ElementUOProvider::getElementalValueLong(), ElementUOProvider::getElementalValueReal(), MultiApp::getExecutioner(), getExecutor(), FEProblemBase::getExecutor(), OutputWarehouse::getFileNumbers(), FEProblemBase::getFunction(), SubProblem::getFunctor(), NodalPatchRecovery::getGenericMaterialProperty(), InterfaceMaterial::getGenericMaterialProperty(), Material::getGenericMaterialProperty(), AuxKernelTempl< Real >::getGenericMaterialProperty(), InterfaceMaterial::getGenericNeighborMaterialProperty(), InterfaceMaterial::getGenericNeighborMaterialPropertyByName(), Material::getGenericOptionalMaterialProperty(), MaterialBase::getGenericZeroMaterialProperty(), BatchMaterial< Tuple, Output, Input >::getIndex(), SolutionUserObject::getLocalVarIndex(), Marker::getMarkerValue(), Material::getMaterial(), FEProblemBase::getMaterial(), Material::getMaterialByName(), NodalPatchRecovery::getMaterialProperty(), InterfaceMaterial::getMaterialProperty(), Material::getMaterialProperty(), AuxKernelTempl< Real >::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), NodalPatchRecovery::getMaterialPropertyOld(), InterfaceMaterial::getMaterialPropertyOld(), Material::getMaterialPropertyOld(), AuxKernelTempl< Real >::getMaterialPropertyOld(), NodalPatchRecovery::getMaterialPropertyOlder(), InterfaceMaterial::getMaterialPropertyOlder(), Material::getMaterialPropertyOlder(), AuxKernelTempl< Real >::getMaterialPropertyOlder(), MeshGenerator::getMesh(), FEProblemBase::getMeshDivision(), MeshGenerator::getMeshesByName(), getMeshGenerator(), MeshGenerator::getMeshGeneratorNameFromParam(), MeshGenerator::getMeshGeneratorNamesFromParam(), ActionWarehouse::getMooseAppName(), MultiAppTransfer::getMultiApp(), InterfaceMaterial::getNeighborADMaterialProperty(), InterfaceMaterial::getNeighborMaterialProperty(), InterfaceMaterial::getNeighborMaterialPropertyOld(), InterfaceMaterial::getNeighborMaterialPropertyOlder(), MooseServer::getObjectParameters(), Material::getOptionalADMaterialProperty(), Material::getOptionalMaterialProperty(), Material::getOptionalMaterialPropertyOld(), Material::getOptionalMaterialPropertyOlder(), OutputWarehouse::getOutput(), getParam(), FEProblemBase::getPositionsObject(), FEProblemBase::getPostprocessorValueByName(), ReporterData::getReporterInfo(), getRestartableDataMap(), getRestartableDataMapName(), getRestartableMetaData(), FEProblemBase::getSampler(), Transient::getTimeStepperName(), ProjectedStatefulMaterialStorageAction::getTypeEnum(), FEProblemBase::getUserObject(), FEProblemBase::getUserObjectBase(), Terminator::handleMessage(), FEProblemBase::hasFunction(), SubProblem::hasFunctor(), SubProblem::hasFunctorWithType(), hasMeshGenerator(), AdvancedOutput::hasOutputHelper(), FEProblemBase::hasPostprocessor(), FEProblemBase::hasPostprocessorValueByName(), hasRelationshipManager(), hasRestartableDataMap(), hasRestartableMetaData(), FEProblemBase::hasUserObject(), IterationAdaptiveDT::init(), AdvancedOutput::init(), FEProblemBase::init(), AdvancedOutput::initExecutionTypes(), AttribName::initFrom(), NestedDivision::initialize(), TransformedPositions::initialize(), SolutionScalarAux::initialSetup(), MultiAppProjectionTransfer::initialSetup(), NodalVariableValue::initialSetup(), Console::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), MaterialBase::initStatefulProperties(), Function::integral(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), MeshGenerator::isChildMeshGenerator(), MeshGenerator::isNullMeshName(), isParamValid(), MeshGenerator::isParentMeshGenerator(), LinearCombinationFunction::LinearCombinationFunction(), FEProblemBase::logAdd(), Marker::Marker(), MatDiffusionBase< Real >::MatDiffusionBase(), Material::Material(), MaterialDerivativeTestKernelBase< Real >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), Distribution::median(), MemoryUsageReporter::MemoryUsageReporter(), MeshGenerator::meshPropertyPrefix(), MooseApp(), OutputWarehouse::mooseConsole(), MooseVariableInterface< Real >::MooseVariableInterface(), MultiAppGeneralFieldTransfer::MultiAppGeneralFieldTransfer(), MultiAppUserObjectTransfer::MultiAppUserObjectTransfer(), NodalPatchRecoveryAuxBase::NodalPatchRecoveryAuxBase(), NodalValueSampler::NodalValueSampler(), PhysicsBase::nonlinearVariableExists(), Registry::objData(), MeshGenerator::Comparator::operator()(), ProgressOutput::output(), DOFMapOutput::output(), Output::Output(), AdvancedOutput::outputElementalVariables(), ConsoleUtils::outputExecutionInformation(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), TableOutput::outputReporter(), AdvancedOutput::outputReporters(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), ParsedAux::ParsedAux(), ParsedCurveGenerator::ParsedCurveGenerator(), ParsedGenerateSideset::ParsedGenerateSideset(), MooseServer::parseDocumentForDiagnostics(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseByBlockFunctorMaterialTempl< T >::PiecewiseByBlockFunctorMaterialTempl(), PointVariableSamplerBase::PointVariableSamplerBase(), possiblyLoadRestartableMetaData(), PhysicsBase::prefix(), PerfGraphLivePrint::printStats(), MultiApp::readCommandLineArguments(), Receiver::Receiver(), Executor::Result::record(), Registry::registerObjectsTo(), FEProblemBase::registerRandomInterface(), registerRestartableDataMapName(), registerRestartableNameWithFilter(), GlobalParamsAction::remove(), MaterialBase::resetQpProperties(), MultiApp::restore(), runInputFile(), ScalarComponentIC::ScalarComponentIC(), MultiApp::setAppOutputFileBase(), MooseMesh::setBoundaryName(), Control::setControllableValue(), Control::setControllableValueByName(), GlobalParamsAction::setDoubleIndexParam(), OutputWarehouse::setFileNumbers(), GlobalParamsAction::setParam(), FEProblemBase::setPostprocessorValueByName(), GlobalParamsAction::setScalarParam(), MooseMesh::setSubdomainName(), GlobalParamsAction::setTripleIndexParam(), Split::setup(), SideSetsGeneratorBase::setup(), TransientMultiApp::setupApp(), GlobalParamsAction::setVectorParam(), FullSolveMultiApp::showStatusMessage(), SideSetExtruderGenerator::SideSetExtruderGenerator(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), StitchedMesh::StitchedMesh(), SubProblem::storeBoundaryDelayedCheckMatProp(), SubProblem::storeBoundaryMatPropName(), SubProblem::storeBoundaryZeroMatProp(), SubProblem::storeSubdomainDelayedCheckMatProp(), SubProblem::storeSubdomainMatPropName(), SubProblem::storeSubdomainZeroMatProp(), MaterialBase::subdomainSetup(), TaggingInterface::TaggingInterface(), VectorPostprocessorVisualizationAux::timestepSetup(), to_json(), MultiAppDofCopyTransfer::transfer(), TransientMultiApp::TransientMultiApp(), MooseServer::traverseParseTreeAndFillSymbols(), MooseBase::typeAndName(), MooseBaseParameterInterface::uniqueParameterName(), FVFluxBC::uOnGhost(), FVFluxBC::uOnUSub(), UserObject::UserObject(), UserObjectInterface::userObjectName(), MultiAppTransfer::variableIntegrityCheck(), VectorMagnitudeFunctorMaterialTempl< is_ad >::VectorMagnitudeFunctorMaterialTempl(), AdvancedOutput::wantOutput(), Coupleable::writableCoupledValue(), Coupleable::writableVariable(), Console::write(), and writeRestartableMetaData().

57 { return _name; }
const std::string _name
The name of this class.
Definition: MooseBase.h:90

◆ parameters()

InputParameters& MooseApp::parameters ( )
inline

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 122 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), SplitMeshAction::act(), CommonOutputAction::act(), MeshGeneratorSystem::hasDataDrivenAllowed(), MooseApp(), ConsoleUtils::outputLegacyInformation(), and MooseServer::parseDocumentForDiagnostics().

122 { return _pars; }
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091

◆ parser()

Parser & MooseApp::parser ( )
Returns
The Parser

Definition at line 1346 of file MooseApp.C.

Referenced by ActionFactory::create().

1347 {
1348  mooseAssert(_parser, "Not set");
1349  return *_parser;
1350 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1140

◆ perfGraph()

PerfGraph& MooseApp::perfGraph ( )
inline

Get the PerfGraph for this app.

Definition at line 133 of file MooseApp.h.

Referenced by PerfGraphInterface::perfGraph().

133 { return _perf_graph; }
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1155

◆ possiblyLoadRestartableMetaData()

void MooseApp::possiblyLoadRestartableMetaData ( const RestartableDataMapName name,
const std::filesystem::path &  folder_base 
)

Loads the restartable meta data for name if it is available with the folder base folder_base.

Definition at line 1881 of file MooseApp.C.

Referenced by FileMesh::buildMesh(), FileMeshGenerator::generate(), and loadRestartableMetaData().

1883 {
1884  const auto & map_name = getRestartableDataMapName(name);
1885  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
1886  if (RestartableDataReader::isAvailable(meta_data_folder_base))
1887  {
1889  reader.setErrorOnLoadWithDifferentNumberOfProcessors(false);
1890  reader.setInput(meta_data_folder_base);
1891  reader.restore();
1892  }
1893 }
Reader for restartable data written by the RestartableDataWriter.
static std::filesystem::path metaDataFolderBase(const std::filesystem::path &folder_base, const std::string &map_suffix)
The file suffix for meta data (header and data)
Definition: MooseApp.C:2397
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:2775
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const std::string & getRestartableDataMapName(const RestartableDataMapName &name) const
Definition: MooseApp.C:2802
static bool isAvailable(const std::filesystem::path &folder_base)

◆ postRestore()

virtual void MooseApp::postRestore ( const bool  )
inlinevirtual

Insertion point for other apps that is called after restore()

Parameters
for_restartWhether this restoration is explicitly for the first restoration of restart data

Definition at line 758 of file MooseApp.h.

Referenced by restore().

758 {}

◆ preBackup()

virtual void MooseApp::preBackup ( )
inlinevirtual

Insertion point for other apps that is called before backup()

Definition at line 724 of file MooseApp.h.

Referenced by backup().

724 {}

◆ processor_id()

processor_id_type MooseApp::processor_id ( ) const
inline

Returns the MPI processor ID of the current processor.

Definition at line 406 of file MooseApp.h.

Referenced by copyInputs(), MooseApp(), restartFolderBase(), runInputs(), FileOutput::setFileBaseInternal(), and writeRestartableMetaData().

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

◆ rankMap()

const RankMap& MooseApp::rankMap ( )
inline

The RankMap is a useful object for determining how the processes are laid out on the physical nodes of the cluster.

Definition at line 128 of file MooseApp.h.

128 { return _rank_map; }
const RankMap _rank_map
The RankMap is a useful object for determining how the processes are laid out on the physical hardwar...
Definition: MooseApp.h:1161

◆ recursivelyCreateExecutors()

void MooseApp::recursivelyCreateExecutors ( const std::string &  current_executor_name,
std::list< std::string > &  possible_roots,
std::list< std::string > &  current_branch 
)
private

Internal function used to recursively create the executor objects.

Called by createExecutors

Parameters
current_executor_nameThe name of the executor currently needing to be built
possible_rootsThe names of executors that are currently candidates for being the root

Definition at line 1353 of file MooseApp.C.

Referenced by createExecutors().

1356 {
1357  // Did we already make this one?
1358  if (_executors.find(current_executor_name) != _executors.end())
1359  return;
1360 
1361  // Is this one already on the current branch (i.e. there is a cycle)
1362  if (std::find(current_branch.begin(), current_branch.end(), current_executor_name) !=
1363  current_branch.end())
1364  {
1365  std::stringstream exec_names_string;
1366 
1367  auto branch_it = current_branch.begin();
1368 
1369  exec_names_string << *branch_it++;
1370 
1371  for (; branch_it != current_branch.end(); ++branch_it)
1372  exec_names_string << ", " << *branch_it;
1373 
1374  exec_names_string << ", " << current_executor_name;
1375 
1376  mooseError("Executor cycle detected: ", exec_names_string.str());
1377  }
1378 
1379  current_branch.push_back(current_executor_name);
1380 
1381  // Build the dependencies first
1382  const auto & params = *_executor_params[current_executor_name].second;
1383 
1384  for (const auto & param : params)
1385  {
1386  if (params.have_parameter<ExecutorName>(param.first))
1387  {
1388  const auto & dependency_name = params.get<ExecutorName>(param.first);
1389 
1390  possible_roots.remove(dependency_name);
1391 
1392  if (!dependency_name.empty())
1393  recursivelyCreateExecutors(dependency_name, possible_roots, current_branch);
1394  }
1395  }
1396 
1397  // Add this Executor
1398  const auto & type = _executor_params[current_executor_name].first;
1399  addExecutor(type, current_executor_name, params);
1400 
1401  current_branch.pop_back();
1402 }
std::unordered_map< std::string, std::pair< std::string, std::unique_ptr< InputParameters > > > _executor_params
Used in building the Executors Maps the name of the Executor block to the <type, params> ...
Definition: MooseApp.h:1175
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void recursivelyCreateExecutors(const std::string &current_executor_name, std::list< std::string > &possible_roots, std::list< std::string > &current_branch)
Internal function used to recursively create the executor objects.
Definition: MooseApp.C:1353
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1170
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
void addExecutor(const std::string &type, const std::string &name, const InputParameters &params)
Definition: MooseApp.C:1326

◆ registerInterfaceObject()

template<class T >
void MooseApp::registerInterfaceObject ( T &  interface)

Registers an interface object for accessing with getInterfaceObjects.

This should be called within the constructor of the interface in interest.

Definition at line 1504 of file MooseApp.h.

Referenced by Coupleable::Coupleable(), MaterialPropertyInterface::MaterialPropertyInterface(), PetscOutputInterface::PetscOutputInterface(), and Reporter::Reporter().

1505 {
1506  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1507 
1508  InterfaceRegistryObjects<T> * registry = nullptr;
1509  auto it = _interface_registry.find(typeid(T));
1510  if (it == _interface_registry.end())
1511  {
1512  auto new_registry = std::make_unique<InterfaceRegistryObjects<T>>();
1513  registry = new_registry.get();
1514  _interface_registry.emplace(typeid(T), std::move(new_registry));
1515  }
1516  else
1517  registry = static_cast<InterfaceRegistryObjects<T> *>(it->second.get());
1518 
1519  mooseAssert(std::count(registry->_objects.begin(), registry->_objects.end(), &interface) == 0,
1520  "Interface already registered");
1521  registry->_objects.push_back(&interface);
1522 }
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1449

◆ registerRestartableData() [1/2]

RestartableDataValue & MooseApp::registerRestartableData ( std::unique_ptr< RestartableDataValue data,
THREAD_ID  tid,
bool  read_only,
const RestartableDataMapName metaname = "" 
)

Definition at line 1800 of file MooseApp.C.

Referenced by createRecoverablePerfGraph(), createRecoverableSolutionInvalidity(), MeshGenerator::declareMeshProperty(), ReporterData::getRestartableDataHelper(), and Restartable::registerRestartableDataOnApp().

1804 {
1805  if (!metaname.empty() && tid != 0)
1806  mooseError(
1807  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
1808 
1809  mooseAssert(metaname.empty() ||
1810  _restartable_meta_data.find(metaname) != _restartable_meta_data.end(),
1811  "The desired meta data name does not exist: " + metaname);
1812 
1813  // Select the data store for saving this piece of restartable data (mesh or everything else)
1814  auto & data_map =
1815  metaname.empty() ? _restartable_data[tid] : _restartable_meta_data[metaname].first;
1816 
1817  RestartableDataValue * stored_data = data_map.findData(data->name());
1818  if (stored_data)
1819  {
1820  if (data->typeId() != stored_data->typeId())
1821  mooseError("Type mismatch found in RestartableData registration of '",
1822  data->name(),
1823  "'\n\n Stored type: ",
1824  stored_data->type(),
1825  "\n New type: ",
1826  data->type());
1827  }
1828  else
1829  stored_data = &data_map.addData(std::move(data));
1830 
1831  if (!read_only)
1832  stored_data->setDeclared({});
1833 
1834  return *stored_data;
1835 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::type_info & typeId() const =0
The type ID of the underlying data.
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1146
virtual std::string type() const =0
String identifying the type of parameter stored.
void setDeclared(const SetDeclaredKey)
Sets that this restartable value has been declared.
Abstract definition of a RestartableData value.

◆ registerRestartableData() [2/2]

RestartableDataValue& MooseApp::registerRestartableData ( const std::string &  name,
std::unique_ptr< RestartableDataValue data,
THREAD_ID  tid,
bool  read_only,
const RestartableDataMapName metaname = "" 
)

◆ registerRestartableDataMapName()

void MooseApp::registerRestartableDataMapName ( const RestartableDataMapName name,
std::string  suffix = "" 
)

Reserve a location for storing custom RestartableDataMap objects.

This should be called in the constructor of an application.

Parameters
nameA key to use for accessing the data object
suffixThe suffix to use when appending to checkpoint output, if not supplied the given name is used to generate the suffix (MyMetaData -> _mymetadata)

Definition at line 2792 of file MooseApp.C.

Referenced by MooseApp().

2793 {
2794  if (!suffix.empty())
2795  std::transform(suffix.begin(), suffix.end(), suffix.begin(), ::tolower);
2796  suffix.insert(0, "_");
2797  _restartable_meta_data.emplace(
2798  std::make_pair(name, std::make_pair(RestartableDataMap(), suffix)));
2799 }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Storage for restartable data that is ordered based on insertion order.

◆ registerRestartableNameWithFilter()

void MooseApp::registerRestartableNameWithFilter ( const std::string &  name,
Moose::RESTARTABLE_FILTER  filter 
)
protected

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

Register a piece of restartable data that will be used in a filter in/out during deserialization. Note however that this data will always be written to the restart file.

Parameters
nameThe full (unique) name.
filterThe filter name where to direct the name

Definition at line 1193 of file MooseApp.C.

Referenced by createRecoverablePerfGraph(), createRecoverableSolutionInvalidity(), and Restartable::registerRestartableNameWithFilterOnApp().

1195 {
1197  switch (filter)
1198  {
1199  case RESTARTABLE_FILTER::RECOVERABLE:
1200  _recoverable_data_names.insert(name);
1201  break;
1202  default:
1203  mooseError("Unknown filter");
1204  }
1205 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
Definition: MooseTypes.h:704
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:1152

◆ registerTimedSection() [1/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 53 of file PerfGraphInterface.C.

55 {
56  const auto timed_section_name = timedSectionName(section_name);
57  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
58  return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
59  else
60  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
61 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ registerTimedSection() [2/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level,
const std::string &  live_message,
const bool  print_dots = true 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
live_messageThe message to be printed to the screen during execution
print_dotsWhether or not progress dots should be printed for this section
Returns
The ID of the section - use when starting timing

Definition at line 64 of file PerfGraphInterface.C.

68 {
69  const auto timed_section_name = timedSectionName(section_name);
70  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
72  timedSectionName(section_name), level, live_message, print_dots);
73  else
74  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
75 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ relationshipManagers()

const std::set<std::shared_ptr<RelationshipManager> >& MooseApp::relationshipManagers ( ) const
inline

Return the container of relationship managers.

Definition at line 1006 of file MooseApp.h.

Referenced by NumRelationshipManagers::getValue().

1007  {
1008  return _relationship_managers;
1009  }
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248

◆ removeRelationshipManager()

void MooseApp::removeRelationshipManager ( std::shared_ptr< RelationshipManager relationship_manager)
private

Purge this relationship manager from meshes and DofMaps and finally from us.

This method is private because only this object knows when we should remove relationship managers: when we are adding relationship managers to this object's storage, we perform an operator>= comparison between our existing RMs and the RM we are trying to add. If any comparison returns true, we do not add the new RM because the comparison indicates that we would gain no new coverage. However, if no comparison return true, then we add the new RM and we turn the comparison around! Consequently if our new RM is >= than any of our preexisting RMs, we remove those preexisting RMs using this method

Definition at line 2444 of file MooseApp.C.

Referenced by addRelationshipManager().

2445 {
2446  auto * const mesh = _action_warehouse.mesh().get();
2447  if (!mesh)
2448  mooseError("The MooseMesh should exist");
2449 
2450  const MeshBase * const undisp_lm_mesh = mesh->getMeshPtr();
2451  RelationshipManager * undisp_clone = nullptr;
2452  if (undisp_lm_mesh && hasRMClone(*rm, *undisp_lm_mesh))
2453  {
2454  undisp_clone = &getRMClone(*rm, *undisp_lm_mesh);
2455  const_cast<MeshBase *>(undisp_lm_mesh)->remove_ghosting_functor(*undisp_clone);
2456  }
2457 
2458  auto & displaced_mesh = _action_warehouse.displacedMesh();
2459  MeshBase * const disp_lm_mesh = displaced_mesh ? &displaced_mesh->getMesh() : nullptr;
2460  RelationshipManager * disp_clone = nullptr;
2461  if (disp_lm_mesh && hasRMClone(*rm, *disp_lm_mesh))
2462  {
2463  disp_clone = &getRMClone(*rm, *disp_lm_mesh);
2464  disp_lm_mesh->remove_ghosting_functor(*disp_clone);
2465  }
2466 
2467  if (_executioner)
2468  {
2469  auto & problem = feProblem();
2470  if (undisp_clone)
2471  {
2472  problem.removeAlgebraicGhostingFunctor(*undisp_clone);
2473  problem.removeCouplingGhostingFunctor(*undisp_clone);
2474  }
2475 
2476  auto * dp = problem.getDisplacedProblem().get();
2477  if (dp && disp_clone)
2478  dp->removeAlgebraicGhostingFunctor(*disp_clone);
2479  }
2480 
2482  _relationship_managers.erase(rm);
2483 }
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Definition: MooseApp.C:2421
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::shared_ptr< MooseMesh > & displacedMesh()
RelationshipManager & getRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Return the relationship manager clone originally created from the provided template relationship mana...
Definition: MooseApp.C:2429
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
FEProblemBase & feProblem() const
Definition: MooseApp.C:1320
std::shared_ptr< MooseMesh > & mesh()
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164
void releaseSharedObjects(const MooseObject &moose_object, THREAD_ID tid=0)
Releases any shared resources created as a side effect of creating an object through the Factory::cre...
Definition: Factory.C:126
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1248
Factory _factory
Definition: MooseApp.h:1205

◆ restartFolderBase()

std::filesystem::path MooseApp::restartFolderBase ( const std::filesystem::path &  folder_base) const

The file suffix for restartable data.

Definition at line 2405 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup(), and Checkpoint::output().

2406 {
2407  auto folder = folder_base;
2408  folder += "-restart-" + std::to_string(processor_id());
2410 }
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406
static std::filesystem::path restartableDataFolder(const std::filesystem::path &folder_base)

◆ restore() [1/2]

void MooseApp::restore ( const std::filesystem::path &  folder_base,
const bool  for_restart 
)

Restore an application from file.

Parameters
folder_baseThe backup folder base
for_restartWhether this restoration is explicitly for the first restoration of restart data

You must call finalizeRestore() after this in order to finalize the restoration. The restore process is kept open in order to restore additional data after the initial restore (that is, the restoration of data that has already been declared).

Definition at line 1234 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup(), and restoreFromInitialBackup().

1235 {
1236  TIME_SECTION("restore", 2, "Restoring Application from File");
1237 
1238  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1239 
1240  _rd_reader.setInput(folder_base);
1241  _rd_reader.restore(filter_names);
1242 
1243  postRestore(for_restart);
1244 }
void setInput(std::unique_ptr< std::stringstream > header_stream, std::unique_ptr< std::stringstream > data_stream)
Sets the input stream for reading from the stringstreams header_stream and data_stream for the header...
RestartableDataReader _rd_reader
Definition: MooseApp.h:1419
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:758
std::unordered_set< std::string > DataNames
void restore(const DataNames &filter_names={})
Restores the restartable data.
const DataNames & getRecoverableData() const
Return a reference to the recoverable data object.
Definition: MooseApp.h:706

◆ restore() [2/2]

void MooseApp::restore ( std::unique_ptr< Backup backup,
const bool  for_restart 
)

Restore an application from the backup backup.

Parameters
backupThe backup
for_restartWhether this restoration is explicitly for the first restoration of restart data

You must call finalizeRestore() after this in order to finalize the restoration. The restore process is kept open in order to restore additional data after the initial restore (that is, the restoration of data that has already been declared).

Definition at line 1247 of file MooseApp.C.

1248 {
1249  TIME_SECTION("restore", 2, "Restoring Application");
1250 
1251  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1252 
1253  if (!backup)
1254  mooseError("MooseApp::resore(): Provided backup is not initialized");
1255 
1256  auto header = std::move(backup->header);
1257  mooseAssert(header, "Header not available");
1258 
1259  auto data = std::move(backup->data);
1260  mooseAssert(data, "Data not available");
1261 
1262  _rd_reader.setInput(std::move(header), std::move(data));
1263  _rd_reader.restore(filter_names);
1264 
1265  postRestore(for_restart);
1266 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void setInput(std::unique_ptr< std::stringstream > header_stream, std::unique_ptr< std::stringstream > data_stream)
Sets the input stream for reading from the stringstreams header_stream and data_stream for the header...
RestartableDataReader _rd_reader
Definition: MooseApp.h:1419
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:758
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1219
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2224
std::unordered_set< std::string > DataNames
void restore(const DataNames &filter_names={})
Restores the restartable data.
const DataNames & getRecoverableData() const
Return a reference to the recoverable data object.
Definition: MooseApp.h:706

◆ restoreFromInitialBackup()

void MooseApp::restoreFromInitialBackup ( const bool  for_restart)

Restores from a "initial" backup, that is, one set in _initial_backup.

Parameters
for_restartWhether this restoration is explicitly for the first restoration of restart data

This is only used for restoration of multiapp subapps, which have been given a Backup from their parent on initialization. Said Backup is passed to this app via the "_initial_backup" private input parameter.

See restore() for more information

Definition at line 1269 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1270 {
1271  mooseAssert(hasInitialBackup(), "Missing initial backup");
1272  restore(std::move(*_initial_backup), for_restart);
1273 }
bool hasInitialBackup() const
Definition: MooseApp.h:990
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
Definition: MooseApp.C:1234
std::unique_ptr< Backup > *const _initial_backup
The backup for use in initial setup; this will get set from the _initial_backup input parameter that ...
Definition: MooseApp.h:1455

◆ run()

void MooseApp::run ( )
virtual

Run the application.

Definition at line 1488 of file MooseApp.C.

1489 {
1490  TIME_SECTION("run", 3);
1491  if (isParamValid("show_docs") && getParam<bool>("show_docs"))
1492  {
1493  auto binname = appBinaryName();
1494  if (binname == "")
1495  mooseError("could not locate installed tests to run (unresolved binary/app name)");
1496  auto docspath = MooseUtils::docsDir(binname);
1497  if (docspath == "")
1498  mooseError("no installed documentation found");
1499 
1500  auto docmsgfile = MooseUtils::pathjoin(docspath, "docmsg.txt");
1501  std::string docmsg = "file://" + MooseUtils::realpath(docspath) + "/index.html";
1502  if (MooseUtils::pathExists(docmsgfile) && MooseUtils::checkFileReadable(docmsgfile))
1503  {
1504  std::ifstream ifs(docmsgfile);
1505  std::string content((std::istreambuf_iterator<char>(ifs)),
1506  (std::istreambuf_iterator<char>()));
1507  content.replace(content.find("$LOCAL_SITE_HOME"), content.length(), docmsg);
1508  docmsg = content;
1509  }
1510 
1511  Moose::out << docmsg << "\n";
1512  _ready_to_exit = true;
1513  return;
1514  }
1515 
1516  if (showInputs() || copyInputs() || runInputs())
1517  {
1518  _ready_to_exit = true;
1519  return;
1520  }
1521 
1522  try
1523  {
1524  TIME_SECTION("setup", 2, "Setting Up");
1525  setupOptions();
1526  runInputFile();
1527  }
1528  catch (std::exception & err)
1529  {
1530  mooseError(err.what());
1531  }
1532 
1533  if (!_check_input)
1534  {
1535  TIME_SECTION("execute", 2, "Executing");
1537  }
1538  else
1539  {
1540  errorCheck();
1541  // Output to stderr, so it is easier for peacock to get the result
1542  Moose::err << "Syntax OK" << std::endl;
1543  }
1544 }
OStreamProxy err
std::string docsDir(const std::string &app_name)
Returns the directory of any installed docs/site.
Definition: MooseUtils.C:120
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:681
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual std::string appBinaryName() const
Definition: MooseApp.h:109
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1245
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
std::string realpath(const std::string &path)
Wrapper around PetscGetRealPath, which is a cross-platform replacement for realpath.
Definition: MooseUtils.C:1220
bool copyInputs() const
Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a ...
Definition: MooseApp.C:1584
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
Definition: MooseApp.C:1547
bool runInputs() const
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
Definition: MooseApp.C:1648
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:256
std::filesystem::path pathjoin(const std::filesystem::path &p)
Definition: MooseUtils.C:58
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:1130
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:1091
bool pathExists(const std::string &path)
Definition: MooseUtils.C:240
bool _ready_to_exit
Definition: MooseApp.h:1209
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:1116

◆ runInputFile()

void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 1091 of file MooseApp.C.

Referenced by run().

1092 {
1093  TIME_SECTION("runInputFile", 3);
1094 
1095  // If ready to exit has been set, then just return
1096  if (_ready_to_exit)
1097  return;
1098 
1100 
1101  if (isParamValid("mesh_only") || isParamValid("split_mesh"))
1102  _ready_to_exit = true;
1103  else if (getParam<bool>("list_constructed_objects"))
1104  {
1105  // TODO: ask multiapps for their constructed objects
1106  _ready_to_exit = true;
1107  std::vector<std::string> obj_list = _factory.getConstructedObjects();
1108  Moose::out << "**START OBJECT DATA**\n";
1109  for (const auto & name : obj_list)
1110  Moose::out << name << "\n";
1111  Moose::out << "**END OBJECT DATA**\n" << std::endl;
1112  }
1113 }
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::vector< std::string > getConstructedObjects() const
Get a list of all constructed Moose Object types.
Definition: Factory.C:244
Factory _factory
Definition: MooseApp.h:1205
void executeAllActions()
This method loops over all actions in the warehouse and executes them.
bool _ready_to_exit
Definition: MooseApp.h:1209

◆ runInputs()

bool MooseApp::runInputs ( ) const
private

Handles the run input parameter logic: Checks to see whether a directory exists in user space and launches the TestHarness to process the given directory.

Returns
a Boolean value used to indicate whether the application should exit early

Definition at line 1648 of file MooseApp.C.

Referenced by run().

1649 {
1650  if (isParamValid("run"))
1651  {
1652  // Here we are going to pass everything after --run on the cli to the TestHarness. That means
1653  // cannot validate these CLIs.
1654  auto it = _command_line->find("run");
1655 
1656  std::string test_args;
1657  if (it != _command_line->end())
1658  {
1659  // Preincrement here to skip over --run
1660  while (++it != _command_line->end())
1661  test_args += " " + *it;
1662  }
1663 
1664  auto cmd = MooseUtils::runTestsExecutable() + test_args;
1665  auto working_dir = MooseUtils::getCurrentWorkingDir();
1666 
1667  if (MooseUtils::findTestRoot() == "")
1668  {
1669  auto bin_name = appBinaryName();
1670  if (bin_name == "")
1671  mooseError("Could not locate binary name relative to installed location");
1672 
1673  auto cmd_name = Moose::getExecutableName();
1674  mooseError(
1675  "Could not locate installed tests from the current working directory:",
1676  working_dir,
1677  ".\nMake sure you are executing this command from within a writable installed inputs ",
1678  "directory.\nRun \"",
1679  cmd_name,
1680  " --copy-inputs <dir>\" to copy the contents of <dir> to a \"./",
1681  bin_name,
1682  "_<dir>\" directory.\nChange into that directory and try \"",
1683  cmd_name,
1684  " --run <dir>\" again.");
1685  }
1686 
1687  // Only launch the tests on the root processor
1688  Moose::out << "Working Directory: " << working_dir << "\nRunning Command: " << cmd << std::endl;
1689  int return_value = 0;
1690  if (processor_id() == 0)
1691  return_value = system(cmd.c_str());
1692  _communicator.broadcast(return_value);
1693 
1694  if (WIFEXITED(return_value) && WEXITSTATUS(return_value) != 0)
1695  mooseError("Run failed");
1696  return true;
1697  }
1698 
1699  return false;
1700 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual std::string appBinaryName() const
Definition: MooseApp.h:109
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
std::string runTestsExecutable()
Returns the location of either a local repo run_tests script - or an installed test executor script i...
Definition: MooseUtils.C:64
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
std::string getCurrentWorkingDir()
Returns the current working directory as a string.
Definition: MooseUtils.C:422
std::string getExecutableName()
This function returns the name of the running executable.
std::string findTestRoot()
Searches in the current working directory and then recursively up in each parent directory looking fo...
Definition: MooseUtils.C:74

◆ setCheckUnusedFlag()

void MooseApp::setCheckUnusedFlag ( bool  warn_is_error = false)
private

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

Definition at line 1308 of file MooseApp.C.

Referenced by setupOptions().

1309 {
1310  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
1311 }
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 1482 of file MooseApp.C.

Referenced by setupOptions().

1483 {
1484  _error_overridden = true;
1485 }
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1208

◆ setExecutioner()

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

Set the Executioner for this App.

Definition at line 327 of file MooseApp.h.

Referenced by CreateExecutionerAction::act().

327 { _executioner = executioner; }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1164

◆ setExecutor()

void MooseApp::setExecutor ( std::shared_ptr< Executor > &&  executor)
inline

Definition at line 328 of file MooseApp.h.

328 { _executor = executor; }
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1167

◆ setExodusFileRestart()

void MooseApp::setExodusFileRestart ( bool  flag)
inline

Set the flag to indicate whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh.

Definition at line 419 of file MooseApp.h.

Referenced by CopyNodalVarsAction::act(), and PhysicsBase::prepareCopyNodalVariables().

419 { _initial_from_file = flag; }
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:1212

◆ setExReaderForRestart()

void MooseApp::setExReaderForRestart ( std::shared_ptr< ExodusII_IO > &&  exreader)
inline

Set the Exodus reader to restart variables from an Exodus mesh file.

Definition at line 430 of file MooseApp.h.

Referenced by FileMesh::buildMesh(), and FileMeshGenerator::generate().

430 { _ex_reader = exreader; }
std::shared_ptr< ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
Definition: MooseApp.h:1215

◆ setGlobalTimeOffset()

void MooseApp::setGlobalTimeOffset ( 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 290 of file MooseApp.h.

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

◆ setOutputFileBase()

void MooseApp::setOutputFileBase ( const std::string &  output_file_base)

Override the selection of the output file base name.

Note: This method is supposed to be called by MultiApp only.

Definition at line 1075 of file MooseApp.C.

1076 {
1077  _output_file_base = output_file_base;
1078 
1079  // Reset the file base in the outputs
1081 
1082  // Reset the file base in multiapps (if they have been constructed yet)
1083  if (getExecutioner())
1084  for (auto & multi_app : feProblem().getMultiAppWarehouse().getObjects())
1085  multi_app->setAppOutputFileBase();
1086 
1087  _file_base_set_by_user = true;
1088 }
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1103
FEProblemBase & feProblem() const
Definition: MooseApp.C:1320
void resetFileBase()
Resets the file base for all FileOutput objects.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:1476
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1137
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1100

◆ setOutputFileNumbers()

void MooseApp::setOutputFileNumbers ( const 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 520 of file MooseApp.h.

521  {
522  _output_file_numbers = numbers;
523  }
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:1242

◆ setOutputPosition()

void MooseApp::setOutputPosition ( const Point &  p)

Tell the app to output in a specific position.

Definition at line 1703 of file MooseApp.C.

1704 {
1705  _output_position_set = true;
1706  _output_position = p;
1708 
1709  if (_executioner.get())
1710  _executioner->parentOutputPositionChanged();
1711 }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1106
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:1164
Point _output_position
The output position.
Definition: MooseApp.h:1109
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1137

◆ setRecover()

void MooseApp::setRecover ( bool  value)

Definition at line 2236 of file MooseApp.C.

2237 {
2238  _recover = value;
2239 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1221

◆ setRestart()

void MooseApp::setRestart ( bool  value)

Sets the restart/recover flags.

Parameters
stateThe state to set the flag to

Definition at line 2230 of file MooseApp.C.

Referenced by FEProblemBase::setRestartFile().

2231 {
2232  _restart = value;
2233 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1224
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ setRestartRecoverFileBase()

void MooseApp::setRestartRecoverFileBase ( const std::string &  file_base)
inline

mutator for recover_base (set by RecoverBaseAction)

Definition at line 498 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act(), and FEProblemBase::setRestartFile().

499  {
500  if (file_base.empty())
502  else
503  _restart_recover_base = file_base;
504  }
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:1746
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236
std::string getLatestCheckpointFilePrefix(const std::list< std::string > &checkpoint_files)
Returns the most recent checkpoint prefix (the four numbers at the begining) If a suitable file isn&#39;t...
Definition: MooseUtils.C:805

◆ setStartTime()

void MooseApp::setStartTime ( 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 1753 of file MooseApp.C.

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

1754 {
1755  _start_time_set = true;
1756  _start_time = time;
1757 }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:1115
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1112

◆ setupOptions()

void MooseApp::setupOptions ( )
virtual

Setup options based on InputParameters.

Definition at line 681 of file MooseApp.C.

Referenced by run().

682 {
683  TIME_SECTION("setupOptions", 5, "Setting Up Options");
684 
685  // Print the header, this is as early as possible
686  auto hdr = header();
687  if (hdr.length() != 0)
688  {
689  if (multiAppLevel() > 0)
691  Moose::out << hdr << std::endl;
692  }
693 
694  if (getParam<bool>("error_unused"))
695  setCheckUnusedFlag(true);
696  else if (getParam<bool>("allow_unused"))
697  setCheckUnusedFlag(false);
698 
699  if (getParam<bool>("error_override"))
701 
702  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
703 
704  _test_checkpoint_half_transient = getParam<bool>("test_checkpoint_half_transient");
705 
706  if (isParamValid("output_wall_time_interval"))
707  {
708  const auto output_wall_time_interval = getParam<Real>("output_wall_time_interval");
709  if (output_wall_time_interval <= 0)
710  mooseError("--output-wall-time-interval must be greater than zero.");
711  }
712 
713  // The no_timing flag takes precedence over the timing flag.
714  if (getParam<bool>("no_timing"))
715  {
716  _pars.set<bool>("timing") = false;
717 
718  _perf_graph.setActive(false);
719  }
720 
721  if (isParamValid("trap_fpe") && isParamValid("no_trap_fpe"))
722  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
723  if (isParamValid("trap_fpe"))
724  _trap_fpe = true;
725  else if (isParamValid("no_trap_fpe"))
726  _trap_fpe = false;
727 
728  // Turn all warnings in MOOSE to errors (almost see next logic block)
729  Moose::_warnings_are_errors = getParam<bool>("error");
730 
731  // Deprecated messages can be toggled to errors independently from everything else.
732  Moose::_deprecated_is_error = getParam<bool>("error_deprecated");
733 
734  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
735  {
736  // Toggle the color console off
737  Moose::setColorConsole(true, true); // set default color condition
738  if (getParam<bool>("no_color"))
739  Moose::setColorConsole(false);
740 
741  char * c_color = std::getenv("MOOSE_COLOR");
742  std::string color = "on";
743  if (c_color)
744  color = c_color;
745  if (getParam<std::string>("color") != "default-on")
746  color = getParam<std::string>("color");
747 
748  if (color == "auto")
750  else if (color == "on")
751  Moose::setColorConsole(true, true);
752  else if (color == "off")
753  Moose::setColorConsole(false);
754  else
755  mooseWarning("ignoring invalid --color arg (want 'auto', 'on', or 'off')");
756  }
757 
758  // this warning goes below --color processing to honor that setting for
759  // the warning. And below settings for warnings/error setup.
760  if (getParam<bool>("no_color"))
761  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
762 
763 // If there's no threading model active, but the user asked for
764 // --n-threads > 1 on the command line, throw a mooseError. This is
765 // intended to prevent situations where the user has potentially
766 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
767 // asking for multiple threads, not knowing that there will never be
768 // any threads launched.
769 #if !LIBMESH_USING_THREADS
770  if (libMesh::command_line_value("--n-threads", 1) > 1)
771  mooseError("You specified --n-threads > 1, but there is no threading model active!");
772 #endif
773 
774  // Build a minimal running application, ignoring the input file.
775  if (getParam<bool>("minimal"))
777 
778  else if (getParam<bool>("display_version"))
779  {
780  Moose::out << getPrintableVersion() << std::endl;
781  _ready_to_exit = true;
782  return;
783  }
784  else if (getParam<bool>("help"))
785  {
786  _command_line->printUsage();
787  _ready_to_exit = true;
788  }
789  else if (isParamValid("dump"))
790  {
791  // Get command line argument following --dump on command line
792  std::string following_arg = getParam<std::string>("dump");
793 
794  // The argument following --dump is a parameter search string,
795  // which can be empty.
796  std::string param_search;
797  if (!following_arg.empty() && (following_arg.find('-') != 0))
798  param_search = following_arg;
799 
800  JsonSyntaxTree tree(param_search);
801 
802  {
803  TIME_SECTION("dump", 1, "Building Syntax Tree");
805  }
806 
807  // Turn off live printing so that it doesn't mess with the dump
809 
810  JsonInputFileFormatter formatter;
811  Moose::out << "\n### START DUMP DATA ###\n"
812  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###" << std::endl;
813  _ready_to_exit = true;
814  }
815  else if (isParamValid("registry"))
816  {
818 
819  Moose::out << "Label\tType\tName\tClass\tFile\n";
820 
821  auto & objmap = Registry::allObjects();
822  for (auto & entry : objmap)
823  for (auto & obj : entry.second)
824  Moose::out << entry.first << "\tobject\t" << obj->name() << "\t" << obj->_classname << "\t"
825  << obj->_file << "\n";
826 
827  auto & actmap = Registry::allActions();
828  for (auto & entry : actmap)
829  {
830  for (auto & act : entry.second)
831  Moose::out << entry.first << "\taction\t" << act->_name << "\t" << act->_classname << "\t"
832  << act->_file << "\n";
833  }
834 
835  _ready_to_exit = true;
836  }
837  else if (isParamValid("registry_hit"))
838  {
840 
841  Moose::out << "### START REGISTRY DATA ###\n";
842 
843  hit::Section root("");
844  auto sec = new hit::Section("registry");
845  root.addChild(sec);
846  auto objsec = new hit::Section("objects");
847  sec->addChild(objsec);
848 
849  auto & objmap = Registry::allObjects();
850  for (auto & entry : objmap)
851  for (auto & obj : entry.second)
852  {
853  auto ent = new hit::Section("entry");
854  objsec->addChild(ent);
855  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
856  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "object"));
857  ent->addChild(new hit::Field("name", hit::Field::Kind::String, obj->name()));
858  ent->addChild(new hit::Field("class", hit::Field::Kind::String, obj->_classname));
859  ent->addChild(new hit::Field("file", hit::Field::Kind::String, obj->_file));
860  }
861 
862  auto actsec = new hit::Section("actions");
863  sec->addChild(actsec);
864  auto & actmap = Registry::allActions();
865  for (auto & entry : actmap)
866  for (auto & act : entry.second)
867  {
868  auto ent = new hit::Section("entry");
869  actsec->addChild(ent);
870  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
871  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "action"));
872  ent->addChild(new hit::Field("task", hit::Field::Kind::String, act->_name));
873  ent->addChild(new hit::Field("class", hit::Field::Kind::String, act->_classname));
874  ent->addChild(new hit::Field("file", hit::Field::Kind::String, act->_file));
875  }
876 
877  Moose::out << root.render();
878 
879  Moose::out << "\n### END REGISTRY DATA ###\n";
880  _ready_to_exit = true;
881  }
882  else if (isParamValid("definition"))
883  {
885 
886  JsonSyntaxTree tree("");
888  SONDefinitionFormatter formatter;
889  Moose::out << "%-START-SON-DEFINITION-%\n"
890  << formatter.toString(tree.getRoot()) << "\n%-END-SON-DEFINITION-%\n";
891  _ready_to_exit = true;
892  }
893  else if (isParamValid("yaml"))
894  {
896 
898 
899  // Get command line argument following --yaml on command line
900  std::string yaml_following_arg = getParam<std::string>("yaml");
901 
902  // If the argument following --yaml is non-existent or begins with
903  // a dash, call buildFullTree() with an empty string, otherwise
904  // pass the argument following --yaml.
905  if (yaml_following_arg.empty() || (yaml_following_arg.find('-') == 0))
907  else
908  _builder.buildFullTree(yaml_following_arg);
909 
910  _ready_to_exit = true;
911  }
912  else if (isParamValid("json"))
913  {
915 
916  // Get command line argument following --json on command line
917  std::string json_following_arg = getParam<std::string>("json");
918 
919  // The argument following --json is a parameter search string,
920  // which can be empty.
921  std::string search;
922  if (!json_following_arg.empty() && (json_following_arg.find('-') != 0))
923  search = json_following_arg;
924 
925  JsonSyntaxTree tree(search);
927 
928  Moose::out << "**START JSON DATA**\n" << tree.getRoot().dump(2) << "\n**END JSON DATA**\n";
929  _ready_to_exit = true;
930  }
931  else if (getParam<bool>("syntax"))
932  {
934 
935  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
936  Moose::out << "**START SYNTAX DATA**\n";
937  for (const auto & it : syntax)
938  Moose::out << it.first << "\n";
939  Moose::out << "**END SYNTAX DATA**\n" << std::endl;
940  _ready_to_exit = true;
941  }
942  else if (getParam<bool>("apptype"))
943  {
945 
946  Moose::out << "MooseApp Type: " << type() << std::endl;
947  _ready_to_exit = true;
948  }
949  else if (getInputFileNames().size())
950  {
951  if (isParamValid("recover"))
952  {
953  // We need to set the flag manually here since the recover parameter is a string type (takes
954  // an optional filename)
955  _recover = true;
956 
957  // Get command line argument following --recover on command line
958  std::string recover_following_arg = getParam<std::string>("recover");
959 
960  // If the argument following --recover is non-existent or begins with
961  // a dash then we are going to eventually find the newest recovery file to use
962  if (!(recover_following_arg.empty() || (recover_following_arg.find('-') == 0)))
963  _restart_recover_base = recover_following_arg;
964  }
965 
966  // In the event that we've parsed once before already in MooseMain, we
967  // won't need to parse again
968  if (!_parser->root())
969  _parser->parse();
970 
971  _builder.build();
972 
973  if (isParamValid("mesh_only"))
974  {
975  _syntax.registerTaskName("mesh_only", true);
976  _syntax.addDependency("mesh_only", "setup_mesh_complete");
977  _syntax.addDependency("determine_system_type", "mesh_only");
978  _action_warehouse.setFinalTask("mesh_only");
979  }
980  else if (isParamValid("split_mesh"))
981  {
982  _split_mesh = true;
983  _syntax.registerTaskName("split_mesh", true);
984  _syntax.addDependency("split_mesh", "setup_mesh_complete");
985  _syntax.addDependency("determine_system_type", "split_mesh");
986  _action_warehouse.setFinalTask("split_mesh");
987  }
989 
990  // Setup the AppFileBase for use by the Outputs or other systems that need output file info
991  {
992  // Extract the CommonOutputAction
993  const auto common_actions = _action_warehouse.getActions<CommonOutputAction>();
994  mooseAssert(common_actions.size() <= 1, "Should not be more than one CommonOutputAction");
995  const Action * common = common_actions.empty() ? nullptr : *common_actions.begin();
996 
997  // If file_base is set in CommonOutputAction through parsing input, obtain the file_base
998  if (common && common->isParamValid("file_base"))
999  {
1000  _output_file_base = common->getParam<std::string>("file_base");
1001  _file_base_set_by_user = true;
1002  }
1003  else if (isUltimateMaster())
1004  {
1005  // if this app is a master, we use the first input file name as the default file base
1006  std::string base = getLastInputFileName();
1007  size_t pos = base.find_last_of('.');
1008  _output_file_base = base.substr(0, pos);
1009  // Note: we did not append "_out" in the file base here because we do not want to
1010  // have it in between the input file name and the object name for Output/*
1011  // syntax.
1012  }
1013  // default file base for multiapps is set by MultiApp
1014  }
1015  }
1016  else if (isParamValid("input_file"))
1017  {
1018  mooseAssert(getInputFileNames().empty(), "Should be empty");
1019  mooseError("No input files specified. Add -i <inputfile> to your command line.");
1020  }
1021  else if (isParamValid("language_server"))
1022  {
1024 
1025  // Reset output to the buffer what was cached before it was turned it off
1026  if (!Moose::out.rdbuf() && _output_buffer_cache)
1027  Moose::out.rdbuf(_output_buffer_cache);
1028 
1029  // Start a language server that communicates using an iostream connection
1030  MooseServer moose_server(*this);
1031 
1032  moose_server.run();
1033 
1034  _ready_to_exit = true;
1035  }
1036 
1037  else /* The catch-all case for bad options or missing options, etc. */
1038  {
1039  if (_check_input)
1040  mooseError("You specified --check-input, but did not provide an input file. Add -i "
1041  "<inputfile> to your command line.");
1042 
1043  _command_line->printUsage();
1044 
1045  _ready_to_exit = true;
1046  }
1047 
1048  Moose::out << std::flush;
1049 }
void build()
Parse an input file (or text string if provided) consisting of hit syntax and setup objects in the MO...
Definition: Builder.C:406
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1155
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:805
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file...
Definition: MooseApp.h:1236
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1140
const std::multimap< std::string, ActionInfo > & getAssociatedActions() const
Return all Syntax to Action associations.
Definition: Syntax.C:368
void buildFullTree(const std::string &search_string)
Use MOOSE Factories to construct a full parse tree for documentation or echoing input.
Definition: Builder.C:678
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1103
void addDependency(const std::string &task, const std::string &pre_req)
Definition: Syntax.C:60
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:1308
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:637
void registerTaskName(const std::string &task, bool should_auto_build=false)
Method to register a new task.
Definition: Syntax.C:20
static const std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > & allActions()
Returns a per-label keyed map of all Actions in the registry.
Definition: Registry.h:209
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:296
void setFinalTask(const std::string &task)
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:794
const std::string _name
The name of this object.
Definition: MooseApp.h:1088
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1245
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1124
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:209
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1233
static const std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > & allObjects()
Returns a per-label keyed map of all MooseObjects in the registry.
Definition: Registry.h:204
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
This class produces a dump of the InputFileParameters in the Standard Object Notation (SON) format fo...
Holds the syntax in a Json::Value tree.
Base class for actions.
Definition: Action.h:38
const std::string & getLastInputFileName() const
Definition: MooseApp.C:1059
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:1482
T command_line_value(const std::string &, T)
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN, bool dont_indent_first_line=true, const std::string &post_prefix=": ")
Indents the supplied message given the prefix and color.
Definition: MooseUtils.C:724
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:638
void setActive(bool active)
Turn on or off timing.
Definition: PerfGraph.h:129
void initSyntaxFormatter(SyntaxFormatterType type, bool dump_mode)
Creates a syntax formatter for printing.
Definition: Builder.C:547
void disableLivePrint()
Completely disables Live Print (cannot be restarted)
Definition: PerfGraph.C:63
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1221
void buildJsonSyntaxTree(JsonSyntaxTree &tree) const
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
Definition: Builder.C:564
std::string toString(const nlohmann::json &root)
returns a string representation of the tree in input file format
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313
This class produces produces a dump of the InputParameters that appears like the normal input file sy...
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1218
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1143
bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1239
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1100
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1431
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:631
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2224
const std::vector< std::string > & getInputFileNames() const
Definition: MooseApp.C:1052
std::string toString(const nlohmann::json &root)
Returns a string representation of the tree in input file format.
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:675
std::vector< const T * > getActions()
Retrieve all actions in a specific type ordered by their names.
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:2242
bool _ready_to_exit
Definition: MooseApp.h:1209
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1227
Meta-action for creating common output object parameters This action serves two purpose, first it adds common output object parameters.

◆ showInputs()

bool MooseApp::showInputs ( ) const
private

Prints a message showing the installable inputs for a given application (if getInstallableInputs has been overridden for an application).

Definition at line 1547 of file MooseApp.C.

Referenced by run().

1548 {
1549  if (isParamValid("show_inputs"))
1550  {
1551  auto copy_syntax = _pars.getCommandLineSyntax("copy_inputs");
1552  std::vector<std::string> dirs;
1553  const auto installable_inputs = getInstallableInputs();
1554 
1555  if (installable_inputs == "")
1556  {
1557  Moose::out
1558  << "Show inputs has not been overriden in this application.\nContact the developers of "
1559  "this appication and request that they override \"MooseApp::getInstallableInputs\".\n";
1560  }
1561  else
1562  {
1563  mooseAssert(!copy_syntax.empty(), "copy_inputs sytnax should not be empty");
1564 
1565  MooseUtils::tokenize(installable_inputs, dirs, 1, " ");
1566  Moose::out << "The following directories are installable into a user-writeable directory:\n\n"
1567  << installable_inputs << '\n'
1568  << "\nTo install one or more directories of inputs, execute the binary with the \""
1569  << copy_syntax[0] << "\" flag. e.g.:\n$ " << _command_line->getExecutableName()
1570  << ' ' << copy_syntax[0] << ' ' << dirs[0] << '\n';
1571  }
1572  return true;
1573  }
1574  return false;
1575 }
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision.h file.
Definition: MooseApp.C:1578
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:779
const std::vector< std::string > & getCommandLineSyntax(const std::string &name) const
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:163
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1121
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:1091

◆ solutionInvalidity()

SolutionInvalidity& MooseApp::solutionInvalidity ( )
inline

◆ syntax()

Syntax& MooseApp::syntax ( )
inline

Returns a writable reference to the syntax object.

Definition at line 209 of file MooseApp.h.

Referenced by dynamicAllRegistration(), and setupOptions().

209 { return _syntax; }
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1124

◆ testCheckpointHalfTransient()

bool MooseApp::testCheckpointHalfTransient ( ) const
inline

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

Definition at line 510 of file MooseApp.h.

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

bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1239

◆ theWarehouse()

TheWarehouse& MooseApp::theWarehouse ( )
inline

Definition at line 102 of file MooseApp.h.

Referenced by MooseVariableDataFV< OutputType >::MooseVariableDataFV(), and FEProblemBase::theWarehouse().

102 { return *_the_warehouse; }
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1402

◆ timedSectionName()

std::string PerfGraphInterface::timedSectionName ( const std::string &  section_name) const
protectedinherited
Returns
The name of the timed section with the name section_name.

Optionally adds a prefix if one is defined.

Definition at line 47 of file PerfGraphInterface.C.

Referenced by PerfGraphInterface::registerTimedSection().

48 {
49  return _prefix.empty() ? "" : (_prefix + "::") + section_name;
50 }
const std::string _prefix
A prefix to use for all sections.

◆ type()

const std::string& MooseBase::type ( ) const
inlineinherited

Get the type of this class.

Returns
the name of the type of this class

Definition at line 51 of file MooseBase.h.

Referenced by CreateProblemDefaultAction::act(), SetupDebugAction::act(), MaterialDerivativeTestAction::act(), MaterialOutputAction::act(), FEProblemBase::addAuxArrayVariable(), FEProblemBase::addAuxScalarVariable(), FEProblemBase::addAuxVariable(), FEProblemBase::addDistribution(), addExecutor(), addExecutorParams(), FEProblemBase::addFunction(), FEProblemBase::addMeshDivision(), addMeshGenerator(), MeshGenerator::addMeshSubgenerator(), FEProblemBase::addObject(), FEProblemBase::addPredictor(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), FEProblemBase::addReporter(), FEProblemBase::addSampler(), FEProblemBase::addTimeIntegrator(), MooseServer::addValuesToList(), DisplacedProblem::addVectorTag(), SubProblem::addVectorTag(), FEProblemBase::advanceMultiApps(), appendMeshGenerator(), PhysicsBase::assertParamDefined(), AuxKernelTempl< Real >::AuxKernelTempl(), FEProblemBase::backupMultiApps(), BoundaryPreservedMarker::BoundaryPreservedMarker(), DistributedRectilinearMeshGenerator::buildCube(), MooseMesh::buildHRefinementAndCoarseningMaps(), MooseMesh::buildPRefinementAndCoarseningMaps(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), PhysicsBase::checkRequiredTasks(), FEProblemBase::computeAuxiliaryKernels(), ADDGKernel::computeElemNeighJacobian(), DGKernel::computeElemNeighJacobian(), ElemElemConstraint::computeElemNeighJacobian(), ArrayDGKernel::computeElemNeighJacobian(), ADDGKernel::computeElemNeighResidual(), DGKernel::computeElemNeighResidual(), ElemElemConstraint::computeElemNeighResidual(), ArrayDGKernel::computeElemNeighResidual(), LowerDIntegratedBC::computeLowerDJacobian(), ArrayLowerDIntegratedBC::computeLowerDJacobian(), DGLowerDKernel::computeLowerDJacobian(), ArrayDGLowerDKernel::computeLowerDJacobian(), LowerDIntegratedBC::computeLowerDOffDiagJacobian(), ArrayLowerDIntegratedBC::computeLowerDOffDiagJacobian(), ArrayHFEMDirichletBC::computeLowerDQpJacobian(), ArrayHFEMDiffusion::computeLowerDQpJacobian(), HFEMDirichletBC::computeLowerDQpJacobian(), HFEMDiffusion::computeLowerDQpJacobian(), ArrayHFEMDirichletBC::computeLowerDQpOffDiagJacobian(), HFEMDirichletBC::computeLowerDQpOffDiagJacobian(), ArrayLowerDIntegratedBC::computeLowerDQpOffDiagJacobian(), ArrayDGLowerDKernel::computeLowerDQpOffDiagJacobian(), FEProblemBase::computeMultiAppsDT(), ADDGKernel::computeOffDiagElemNeighJacobian(), DGKernel::computeOffDiagElemNeighJacobian(), ArrayDGKernel::computeOffDiagElemNeighJacobian(), DGLowerDKernel::computeOffDiagLowerDJacobian(), ArrayDGLowerDKernel::computeOffDiagLowerDJacobian(), DGConvection::computeQpJacobian(), ScalarKernel::computeQpJacobian(), InterfaceDiffusion::computeQpJacobian(), InterfaceReaction::computeQpJacobian(), ArrayDGDiffusion::computeQpJacobian(), CoupledTiedValueConstraint::computeQpJacobian(), TiedValueConstraint::computeQpJacobian(), DGDiffusion::computeQpJacobian(), LinearNodalConstraint::computeQpJacobian(), EqualValueBoundaryConstraint::computeQpJacobian(), EqualValueEmbeddedConstraint::computeQpJacobian(), CoupledTiedValueConstraint::computeQpOffDiagJacobian(), HFEMTestJump::computeQpOffDiagJacobian(), HFEMTrialJump::computeQpOffDiagJacobian(), EqualValueEmbeddedConstraint::computeQpOffDiagJacobian(), ArrayDGKernel::computeQpOffDiagJacobian(), ArrayHFEMDiffusion::computeQpResidual(), DGConvection::computeQpResidual(), HFEMDiffusion::computeQpResidual(), ScalarKernel::computeQpResidual(), InterfaceDiffusion::computeQpResidual(), ArrayDGDiffusion::computeQpResidual(), InterfaceReaction::computeQpResidual(), ADDGAdvection::computeQpResidual(), CoupledTiedValueConstraint::computeQpResidual(), TiedValueConstraint::computeQpResidual(), ADDGDiffusion::computeQpResidual(), LinearNodalConstraint::computeQpResidual(), DGDiffusion::computeQpResidual(), EqualValueBoundaryConstraint::computeQpResidual(), HFEMTestJump::computeQpResidual(), HFEMTrialJump::computeQpResidual(), EqualValueEmbeddedConstraint::computeQpResidual(), FEProblemBase::computeUserObjectByName(), FEProblemBase::computeUserObjects(), FEProblemBase::computeUserObjectsInternal(), BatchMaterial< Tuple, Output, Input >::construct(), DisplacedProblem::createQRules(), FEProblemBase::createQRules(), createRecoverablePerfGraph(), DumpObjectsProblem::deduceNecessaryParameters(), DumpObjectsProblem::dumpObjectHelper(), FEProblemBase::duplicateVariableCheck(), ElementGroupCentroidPositions::ElementGroupCentroidPositions(), MooseBase::errorPrefix(), AB2PredictorCorrector::estimateTimeError(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::execTransfers(), ActionWarehouse::executeActionsWithAction(), FEProblemBase::finishMultiAppStep(), FVScalarLagrangeMultiplierInterface::FVScalarLagrangeMultiplierInterface(), SubdomainPerElementGenerator::generate(), LowerDBlockFromSidesetGenerator::generate(), PatternedMeshGenerator::generate(), MeshGenerator::generateInternal(), MultiAppTransfer::getAppInfo(), TransfiniteMeshGenerator::getEdge(), ElementGenerator::getElemType(), MooseServer::getInputLookupDefinitionNodes(), FEProblemBase::getMaterial(), FEProblemBase::getMaterialData(), MaterialOutputAction::getParams(), ReporterData::getReporterInfo(), Transient::getTimeIntegratorName(), FEProblemBase::getTransfers(), DisplacedProblem::getVectorTags(), SubProblem::getVectorTags(), CommonOutputAction::hasConsole(), FEProblemBase::hasMultiApps(), AdvancedOutput::hasOutput(), FEProblemBase::incrementMultiAppTStep(), AdvancedOutput::initAvailableLists(), FunctorPositions::initialize(), FunctorTimes::initialize(), MultiAppConservativeTransfer::initialSetup(), ArrayDGDiffusion::initQpResidual(), AdvancedOutput::initShowHideLists(), RelationshipManager::isType(), FEProblemBase::logAdd(), MaterialFunctorConverterTempl< T >::MaterialFunctorConverterTempl(), MooseObject::MooseObject(), DisplacedProblem::numVectorTags(), SubProblem::numVectorTags(), Console::output(), AdvancedOutput::output(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), MooseServer::parseDocumentForDiagnostics(), ProjectedStatefulMaterialStorageAction::processProperty(), recursivelyCreateExecutors(), SolutionInvalidInterface::registerInvalidSolutionInternal(), FEProblemBase::restoreMultiApps(), MeshRepairGenerator::separateSubdomainsByElementType(), FEProblemBase::setCoupling(), setupOptions(), MooseBase::typeAndName(), ScalarKernelBase::uOld(), AuxScalarKernel::uOld(), DisplacedProblem::updateGeomSearch(), FEProblemBase::updateGeomSearch(), UserObjectInterface::userObjectType(), and AdvancedOutput::wantOutput().

51 { return _type; }
const std::string _type
The type of this class.
Definition: MooseBase.h:87

◆ typeAndName()

std::string MooseBase::typeAndName ( ) const
inherited

Get the class's combined type and name; useful in error handling.

Returns
The type and name of this class in the form '<type()> "<name()>"'.

Definition at line 27 of file MooseBase.C.

Referenced by MaterialPropertyStorage::addProperty(), MeshGeneratorSystem::dataDrivenError(), ReporterContext< std::vector< T > >::finalize(), and ReporterData::getReporterInfo().

28 {
29  return type() + std::string(" \"") + name() + std::string("\"");
30 }
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51

◆ useEigenvalue()

bool& MooseApp::useEigenvalue ( )
inline

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

Definition at line 391 of file MooseApp.h.

Referenced by CreateProblemDefaultAction::act().

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

◆ useExecutor()

bool MooseApp::useExecutor ( ) const
inline

Definition at line 321 of file MooseApp.h.

321 { return _use_executor; }
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1183

◆ useNonlinear()

bool& MooseApp::useNonlinear ( )
inline

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

Definition at line 386 of file MooseApp.h.

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

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

◆ validParams()

InputParameters MooseApp::validParams ( )
static

Definition at line 96 of file MooseApp.C.

97 {
99 
100  // Parameters that main also expects that we won't use (-i)
102 
103  params.addCommandLineParam<bool>(
104  "display_version", "-v --version", false, "Print application version");
105 
106  params.addCommandLineParam<std::string>(
107  "mesh_only",
108  "--mesh-only [mesh_file_name]",
109  "Setup and Output the input mesh only (Default: \"<input_file_name>_in.e\")");
110 
111  params.addCommandLineParam<bool>("show_input",
112  "--show-input",
113  false,
114  "Shows the parsed input file before running the simulation.");
115  params.addCommandLineParam<bool>(
116  "show_outputs", "--show-outputs", false, "Shows the output execution time information.");
117  params.addCommandLineParam<bool>(
118  "show_controls", "--show-controls", false, "Shows the Control logic available and executed.");
119 
120  params.addCommandLineParam<bool>(
121  "no_color", "--no-color", false, "Disable coloring of all Console outputs.");
122  params.addCommandLineParam<std::string>("color",
123  "--color [auto,on,off]",
124  "default-on",
125  "Whether to use color in console output (default 'on').");
126 
127  params.addCommandLineParam<bool>("help", "-h --help", false, "Displays CLI usage statement.");
128  params.addCommandLineParam<bool>(
129  "minimal",
130  "--minimal",
131  false,
132  "Ignore input file and build a minimal application with Transient executioner.");
133 
134  params.addCommandLineParam<bool>(
135  "language_server",
136  "--language-server",
137  "Starts a process to communicate with development tools using the language server protocol");
138 
139  params.addCommandLineParam<std::string>(
140  "definition", "--definition", "Shows a SON style input definition dump for input validation");
141  params.addCommandLineParam<std::string>(
142  "dump", "--dump [search_string]", "Shows a dump of available input file syntax.");
143  params.addCommandLineParam<bool>(
144  "registry", "--registry", "Lists all known objects and actions.");
145  params.addCommandLineParam<bool>(
146  "registry_hit", "--registry-hit", "Lists all known objects and actions in hit format.");
147  params.addCommandLineParam<bool>(
148  "use_executor", "--executor", false, "Use the new Executor system instead of Executioners");
149 
150  params.addCommandLineParam<bool>(
151  "apptype", "--type", false, "Return the name of the application object.");
152  params.addCommandLineParam<std::string>(
153  "yaml", "--yaml", "Dumps input file syntax in YAML format.");
154  params.addCommandLineParam<std::string>(
155  "json", "--json", "Dumps input file syntax in JSON format.");
156  params.addCommandLineParam<bool>(
157  "syntax", "--syntax", false, "Dumps the associated Action syntax paths ONLY");
158  params.addCommandLineParam<bool>(
159  "show_docs", "--docs", false, "print url/path to the documentation website");
160  params.addCommandLineParam<bool>("check_input",
161  "--check-input",
162  false,
163  "Check the input file (i.e. requires -i <filename>) and quit.");
164  params.addCommandLineParam<std::string>(
165  "show_inputs",
166  "--show-copyable-inputs",
167  "Shows the directories able to be installed (copied) into a user-writable location");
168 
169  params.addCommandLineParam<std::string>("copy_inputs",
170  "--copy-inputs <dir>",
171  "Copies installed inputs (e.g. tests, examples, etc.) to "
172  "an directory named <appname>_<dir>.");
173  params.addCommandLineParam<std::string>("run",
174  "--run",
175  "Runs the inputs in the current directory copied to a "
176  "user-writable location by \"--copy-inputs\"");
177 
178  params.addCommandLineParam<bool>(
179  "list_constructed_objects",
180  "--list-constructed-objects",
181  false,
182  "List all moose object type names constructed by the master app factory.");
183 
184  params.addCommandLineParam<unsigned int>(
185  "n_threads", "--n-threads=<n>", 1, "Runs the specified number of threads per process");
186 
187  params.addCommandLineParam<bool>("allow_unused",
188  "-w --allow-unused",
189  false,
190  "Warn about unused input file options instead of erroring.");
191  params.addCommandLineParam<bool>("error_unused",
192  "-e --error-unused",
193  false,
194  "Error when encountering unused input file options");
195  params.addCommandLineParam<bool>(
196  "error_override",
197  "-o --error-override",
198  false,
199  "Error when encountering overridden or parameters supplied multiple times");
200  params.addCommandLineParam<bool>(
201  "error_deprecated", "--error-deprecated", false, "Turn deprecated code messages into Errors");
202 
203  params.addCommandLineParam<bool>(
204  "distributed_mesh",
205  "--distributed-mesh",
206  false,
207  "The libMesh Mesh underlying MooseMesh should always be a DistributedMesh");
208 
209  params.addCommandLineParam<std::string>(
210  "split_mesh",
211  "--split-mesh [splits]",
212  "comma-separated list of numbers of chunks to split the mesh into");
213 
214  params.addCommandLineParam<std::string>("split_file",
215  "--split-file [filename]",
216  "",
217  "optional name of split mesh file(s) to write/read");
218 
219  params.addCommandLineParam<bool>(
220  "use_split", "--use-split", false, "use split distributed mesh files");
221 
222  params.addCommandLineParam<unsigned int>(
223  "refinements",
224  "-r <n>",
225  0,
226  "Specify additional initial uniform mesh refinements for grid convergence studies");
227 
228  params.addCommandLineParam<std::string>("recover",
229  "--recover [file_base]",
230  "Continue the calculation. If file_base is omitted then "
231  "the most recent recovery file will be utilized");
232 
233  params.addCommandLineParam<bool>("test_checkpoint_half_transient",
234  "--test-checkpoint-half-transient",
235  false,
236  "When true the simulation will only run half of "
237  "its specified transient (ie half the "
238  "timesteps) with checkpoints enabled. "
239  "This is useful for testing recovery and restart "
240  "and should only be used in the test harness.");
241 
242  params.addCommandLineParam<Real>("output_wall_time_interval",
243  "--output-wall-time-interval [interval]",
244  "The target wall time interval (in seconds) at "
245  "which to write to output. "
246  "USE FOR TEST SUITE PROBLEMS ONLY, FOR ALL OTHER USES "
247  "SEE THE wall_time_interval IN DERIVED Output OBJECTS.");
248 
249  // No default on these two options, they must not both be valid
250  params.addCommandLineParam<bool>(
251  "trap_fpe",
252  "--trap-fpe",
253  "Enable Floating Point Exception handling in critical sections of "
254  "code. This is enabled automatically in DEBUG mode");
255  params.addCommandLineParam<bool>("no_trap_fpe",
256  "--no-trap-fpe",
257  "Disable Floating Point Exception handling in critical "
258  "sections of code when using DEBUG mode.");
259 
260  params.addCommandLineParam<bool>("error", "--error", false, "Turn all warnings into errors");
261 
262  params.addCommandLineParam<bool>(
263  "timing",
264  "-t --timing",
265  false,
266  "Enable all performance logging for timing purposes. This will disable all "
267  "screen output of performance logs for all Console objects.");
268  params.addCommandLineParam<bool>("no_timing",
269  "--no-timing",
270  false,
271  "Disabled performance logging. Overrides -t or --timing "
272  "if passed in conjunction with this flag");
273 
274  params.addCommandLineParam<bool>(
275  "allow_test_objects", "--allow-test-objects", false, "Register test objects and syntax.");
276 
277  // Options ignored by MOOSE but picked up by libMesh, these are here so that they are displayed in
278  // the application help
279  params.addCommandLineParam<bool>(
280  "keep_cout",
281  "--keep-cout",
282  false,
283  "Keep standard output from all processors when running in parallel");
284  params.addCommandLineParam<bool>(
285  "redirect_stdout",
286  "--redirect-stdout",
287  false,
288  "Keep standard output from all processors when running in parallel");
289 
290  params.addCommandLineParam<std::string>(
291  "timpi_sync",
292  "--timpi-sync <sync type>",
293  "nbx",
294  "Changes the sync type used in spare parallel communitations within the TIMPI library "
295  "(advanced option).");
296 
297  // Options for debugging
298  params.addCommandLineParam<std::string>("start_in_debugger",
299  "--start-in-debugger <debugger>",
300  "Start the application and attach a debugger. This will "
301  "launch xterm windows using the command you specify for "
302  "'debugger'");
303 
304  params.addCommandLineParam<unsigned int>("stop_for_debugger",
305  "--stop-for-debugger [seconds]",
306  30,
307  "Pauses the application during startup for the "
308  "specified time to allow for connection of debuggers.");
309 
310  params.addCommandLineParam<bool>("perf_graph_live_all",
311  "--perf-graph-live-all",
312  false,
313  "Forces printing of ALL progress messages.");
314 
315  params.addCommandLineParam<bool>("disable_perf_graph_live",
316  "--disable-perf-graph-live",
317  false,
318  "Disables PerfGraph Live Printing.");
319 
320  params.addParam<bool>(
321  "automatic_automatic_scaling", false, "Whether to turn on automatic scaling by default.");
322 
323 #ifdef HAVE_GPERFTOOLS
324  params.addCommandLineParam<std::string>(
325  "gperf_profiler_on",
326  "--gperf-profiler-on [ranks]",
327  "To generate profiling report only on comma-separated list of MPI ranks.");
328 #endif
329 
330  params.addPrivateParam<std::string>("_app_name"); // the name passed to AppFactory::create
331  params.addPrivateParam<std::string>("_type");
332  params.addPrivateParam<int>("_argc");
333  params.addPrivateParam<char **>("_argv");
334  params.addPrivateParam<std::shared_ptr<CommandLine>>("_command_line");
335  params.addPrivateParam<std::shared_ptr<Parallel::Communicator>>("_comm");
336  params.addPrivateParam<unsigned int>("_multiapp_level");
337  params.addPrivateParam<unsigned int>("_multiapp_number");
338  params.addPrivateParam<const MooseMesh *>("_master_mesh");
339  params.addPrivateParam<const MooseMesh *>("_master_displaced_mesh");
340  params.addPrivateParam<std::unique_ptr<Backup> *>("_initial_backup", nullptr);
341  params.addPrivateParam<std::shared_ptr<Parser>>("_parser");
342 
343  params.addParam<bool>(
344  "use_legacy_material_output",
345  true,
346  "Set false to allow material properties to be output on INITIAL, not just TIMESTEP_END.");
347 
348  params.addParam<bool>(
350  false,
351  "Set true to enable data-driven mesh generation, which is an experimental feature");
352 
353  MooseApp::addAppParam(params);
354 
355  return params;
356 }
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()
void addMainCommandLineParams(InputParameters &params)
Adds the command line parameters needed from within main, which will also need to be added to MooseAp...
Definition: MooseMain.C:26
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static void addAppParam(InputParameters &params)
Definition: MooseApp.C:85
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
static const std::string allow_data_driven_param
The name of the boolean parameter on the MooseApp that will enable data driven generation.

◆ writeRestartableMetaData() [1/2]

std::vector< std::filesystem::path > MooseApp::writeRestartableMetaData ( const RestartableDataMapName name,
const std::filesystem::path &  folder_base 
)

Writes the restartable meta data for name with a folder base of folder_base.

Returns
The files that were written

Definition at line 1903 of file MooseApp.C.

Referenced by MeshOnlyAction::act(), SplitMeshAction::act(), Checkpoint::output(), and writeRestartableMetaData().

1905 {
1906  if (processor_id() != 0)
1907  mooseError("MooseApp::writeRestartableMetaData(): Should only run on processor 0");
1908 
1909  const auto & map_name = getRestartableDataMapName(name);
1910  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
1911 
1913  return writer.write(meta_data_folder_base);
1914 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
static std::filesystem::path metaDataFolderBase(const std::filesystem::path &folder_base, const std::string &map_suffix)
The file suffix for meta data (header and data)
Definition: MooseApp.C:2397
Writer for restartable data, to be read by the RestartableDataReader.
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:2775
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
const std::string & getRestartableDataMapName(const RestartableDataMapName &name) const
Definition: MooseApp.C:2802

◆ writeRestartableMetaData() [2/2]

std::vector< std::filesystem::path > MooseApp::writeRestartableMetaData ( const std::filesystem::path &  folder_base)

Writes all available restartable meta data with a file base of file_base.

Returns
The files that were written

Definition at line 1917 of file MooseApp.C.

1918 {
1919  std::vector<std::filesystem::path> paths;
1920 
1921  if (processor_id() == 0)
1922  for (const auto & name_map_pair : _restartable_meta_data)
1923  {
1924  const auto map_paths = writeRestartableMetaData(name_map_pair.first, folder_base);
1925  paths.insert(paths.end(), map_paths.begin(), map_paths.end());
1926  }
1927 
1928  return paths;
1929 }
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1392
std::vector< std::filesystem::path > writeRestartableMetaData(const RestartableDataMapName &name, const std::filesystem::path &folder_base)
Writes the restartable meta data for name with a folder base of folder_base.
Definition: MooseApp.C:1903
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:406

Friends And Related Function Documentation

◆ FEProblemBase

friend class FEProblemBase
friend

Definition at line 1458 of file MooseApp.h.

◆ Restartable

friend class Restartable
friend

Definition at line 1459 of file MooseApp.h.

◆ SubProblem

friend class SubProblem
friend

Definition at line 1460 of file MooseApp.h.

Member Data Documentation

◆ _action_factory

ActionFactory MooseApp::_action_factory
protected

The Factory responsible for building Actions.

Definition at line 1131 of file MooseApp.h.

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

◆ _action_warehouse

ActionWarehouse MooseApp::_action_warehouse
protected

◆ _app

MooseApp& MooseBase::_app
protectedinherited

The MOOSE application this is associated with.

Definition at line 84 of file MooseBase.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), ElementIDOutputAction::act(), AutoCheckpointAction::act(), DeclareLateReportersAction::act(), CheckIntegrityAction::act(), ExecuteMeshGenerators::act(), AddExecutorAction::act(), ReadExecutorParamsAction::act(), SetupMeshCompleteAction::act(), AddMeshGeneratorAction::act(), CopyNodalVarsAction::act(), CreateExecutionerAction::act(), CreateProblemDefaultAction::act(), CreateProblemAction::act(), MeshOnlyAction::act(), SetupMeshAction::act(), SplitMeshAction::act(), AdaptivityAction::act(), AddTimeStepperAction::act(), SetupDebugAction::act(), SetupPredictorAction::act(), SetupTimeStepperAction::act(), ComposeTimeStepperAction::act(), AddRelationshipManager::act(), SetAdaptivityOptionsAction::act(), CouplingFunctorCheckAction::act(), DisplayGhostingAction::act(), CreateAddedMeshGenerators::act(), ResolveOptionalMaterialPropertiesAction::act(), SetupRecoverFileBaseAction::act(), AddPeriodicBCAction::act(), MaterialOutputAction::act(), CommonOutputAction::act(), Action::Action(), FEProblemBase::addAnyRedistributers(), MeshGenerator::addChildMeshGenerator(), FEProblemBase::addMaterialHelper(), MeshGenerator::addMeshSubgenerator(), FEProblemBase::addMultiApp(), FEProblemBase::addOutput(), MeshGenerator::addParentMeshGenerator(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), Action::addRelationshipManager(), FVFluxKernel::adjustRMGhostLayers(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), MooseMesh::buildTypedMesh(), MooseMesh::cacheFaceInfoVariableOwnership(), MooseMesh::cacheFVElementalDoFs(), MooseBase::callMooseError(), CheckOutputAction::checkConsoleOutput(), MeshGenerator::checkGetMesh(), FEProblemBase::checkICRestartError(), CheckOutputAction::checkMaterialOutput(), FEProblemBase::checkNonlinearConvergence(), CheckOutputAction::checkPerfLogOutput(), CheckOutputAction::checkVariableOutput(), SingleRankPartitioner::clone(), RandomPartitioner::clone(), BlockWeightedPartitioner::clone(), GhostEverything::clone(), GhostHigherDLowerDPointNeighbors::clone(), GhostLowerDElems::clone(), LibmeshPartitioner::clone(), PetscExternalPartitioner::clone(), HierarchicalGridPartitioner::clone(), GridPartitioner::clone(), ElementSideNeighborLayers::clone(), ElementPointNeighborLayers::clone(), RedistributeProperties::clone(), ProxyRelationshipManager::clone(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobianTags(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualTags(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), MultiApp::createApps(), MultiApp::createLocalApp(), FEProblemBase::customSetup(), MeshGenerator::declareMeshProperty(), MeshGenerator::declareNullMeshName(), MooseMesh::determineUseDistributedMesh(), DumpObjectsProblem::dumpObjectHelper(), DumpObjectsProblem::dumpVariableHelper(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), NonlinearEigen::execute(), InversePowerMethod::execute(), PseudoTimestep::execute(), IterationInfo::execute(), PIDTransientControl::execute(), Transient::execute(), Steady::execute(), Eigenvalue::execute(), ExtraIDIntegralReporter::ExtraIDIntegralReporter(), FEProblemBase::FEProblemBase(), FileOutput::FileOutput(), ChangeOverFixedPointPostprocessor::finalize(), RadialAverage::finalize(), FixedPointSolve::FixedPointSolve(), FEProblemBase::forceOutput(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), ExtraNodesetGenerator::generate(), SideSetsFromNormalsGenerator::generate(), FileMeshGenerator::generate(), MeshGenerator::generateInternal(), FEProblemBase::getExecutor(), MeshGenerator::getMeshByName(), MooseBase::getMooseApp(), NumRelationshipManagers::getValue(), NumFixedPointIterations::getValue(), GhostingUserObject::GhostingUserObject(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), MooseMesh::init(), FEProblemBase::init(), TimePeriod::initialSetup(), Console::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), EigenProblem::initPetscOutputAndSomeSolverSettings(), FEProblemBase::initPetscOutputAndSomeSolverSettings(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), MeshGenerator::MeshGenerator(), MooseObject::MooseObject(), EigenExecutionerBase::normalizeSolution(), NumFailedTimeSteps::NumFailedTimeSteps(), PerfGraphOutput::output(), Tecplot::output(), Exodus::output(), Nemesis::output(), Checkpoint::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), JSONOutput::outputSystemInformation(), Console::outputSystemInformation(), OverlayMeshGenerator::OverlayMeshGenerator(), MultiApp::parentOutputPositionChanged(), Transient::preExecute(), PhysicsBase::prepareCopyNodalVariables(), Eigenvalue::prepareSolverOptions(), FEProblemBase::projectSolution(), TiledMesh::safeClone(), FileMesh::safeClone(), ImageMesh::safeClone(), ConcentricCircleMesh::safeClone(), GeneratedMesh::safeClone(), AnnularMesh::safeClone(), SpiralAnnularMesh::safeClone(), RinglebMesh::safeClone(), MeshGeneratorMesh::safeClone(), StitchedMesh::safeClone(), PatternedMesh::safeClone(), MultiApp::setAppOutputFileBase(), FileOutput::setFileBaseInternal(), MeshGenerator::setMeshProperty(), MeshGenerator::setMeshPropertyHelper(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), SetupMeshAction::setupMesh(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), Output::setWallTimeIntervalFromCommandLineParam(), SideSetExtruderGenerator::SideSetExtruderGenerator(), SolutionInvalidityReporter::SolutionInvalidityReporter(), EigenProblem::solve(), FEProblemBase::solve(), PetscOutput::solveSetup(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), FEProblemBase::theWarehouse(), TimeExtremeValue::TimeExtremeValue(), TimeIntervalTimes::TimeIntervalTimes(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), FEProblemBase::updateMortarMesh(), Console::write(), and FEProblemBase::~FEProblemBase().

◆ _attached_relationship_managers

std::map<Moose::RelationshipManagerType, std::set<const RelationshipManager *> > MooseApp::_attached_relationship_managers
protected

The relationship managers that have been attached (type -> RMs)

Definition at line 1252 of file MooseApp.h.

Referenced by attachRelationshipManagers().

◆ _automatic_automatic_scaling

const bool MooseApp::_automatic_automatic_scaling
private

Whether to turn on automatic scaling by default.

Definition at line 1434 of file MooseApp.h.

Referenced by defaultAutomaticScaling().

◆ _builder

Moose::Builder MooseApp::_builder
protected

Builder for building app related parser tree.

Definition at line 1143 of file MooseApp.h.

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

◆ _check_input

bool MooseApp::_check_input
protected

true if we want to just check the input file

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

Referenced by errorCheck(), getCommunicator(), MooseApp(), and processor_id().

◆ _command_line

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

Command line object.

Definition at line 1121 of file MooseApp.h.

Referenced by commandLine(), copyInputs(), executeExecutioner(), MooseApp(), runInputs(), setupOptions(), and showInputs().

◆ _console

const ConsoleStream ConsoleStreamInterface::_console
inherited

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

Definition at line 31 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), MeshOnlyAction::act(), SetupDebugAction::act(), MaterialOutputAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualProblem::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), FixedPointSolve::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MessageFromInput::execute(), Steady::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), CoarsenBlockGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseBaseErrorInterface::mooseDeprecated(), MooseBaseErrorInterface::mooseInfo(), MooseBaseErrorInterface::mooseWarning(), MooseBaseErrorInterface::mooseWarningNonPrefixed(), ReferenceResidualProblem::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), FEProblemSolve::solve(), FixedPointSolve::solve(), NonlinearSystem::solve(), EigenProblem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), PerfGraphLivePrint::start(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), Transient::takeStep(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _cpu_profiling

bool MooseApp::_cpu_profiling = false
private

CPU profiling.

Definition at line 1437 of file MooseApp.h.

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

◆ _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 1218 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 1208 of file MooseApp.h.

Referenced by setErrorOverridden().

◆ _ex_reader

std::shared_ptr<ExodusII_IO> MooseApp::_ex_reader
protected

The Exodus reader when _initial_from_file is set to true.

Definition at line 1215 of file MooseApp.h.

Referenced by getExReaderForRestart(), and setExReaderForRestart().

◆ _execute_flags

const ExecFlagEnum MooseApp::_execute_flags
private

Execution flags for this App.

Note: These are copied on purpose instead of maintaining a reference to the ExecFlagRegistry registry. In the Multiapp case, the registry may be augmented, changing the flags "known" to the application in the middle of executing the setup. This causes issues with the application having to process flags that aren't specifically registered.

Definition at line 1428 of file MooseApp.h.

Referenced by getExecuteOnEnum().

◆ _executioner

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

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

Definition at line 1164 of file MooseApp.h.

Referenced by attachRelationshipManagers(), executeExecutioner(), feProblem(), getExecutioner(), removeRelationshipManager(), setExecutioner(), setOutputPosition(), and ~MooseApp().

◆ _executor

std::shared_ptr<Executor> MooseApp::_executor
protected

◆ _executor_params

std::unordered_map<std::string, std::pair<std::string, std::unique_ptr<InputParameters> > > MooseApp::_executor_params
protected

Used in building the Executors Maps the name of the Executor block to the <type, params>

Definition at line 1175 of file MooseApp.h.

Referenced by addExecutorParams(), createExecutors(), and recursivelyCreateExecutors().

◆ _executors

std::map<std::string, std::shared_ptr<Executor> > MooseApp::_executors
protected

Pointers to all of the Executors for this run.

Definition at line 1170 of file MooseApp.h.

Referenced by addExecutor(), createExecutors(), getExecutor(), and recursivelyCreateExecutors().

◆ _factory

Factory MooseApp::_factory
protected

◆ _file_base_set_by_user

bool MooseApp::_file_base_set_by_user
protected

Whether or not file base is set through input or setOutputFileBase by MultiApp.

Definition at line 1103 of file MooseApp.h.

Referenced by getCheckpointDirectories(), getOutputFileBase(), setOutputFileBase(), and setupOptions().

◆ _fixed_point_config

FixedPointConfig MooseApp::_fixed_point_config
protected

Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and used by the executioner/executor system.

Definition at line 1179 of file MooseApp.h.

Referenced by fixedPointConfig().

◆ _global_time_offset

Real MooseApp::_global_time_offset
protected

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

Definition at line 1118 of file MooseApp.h.

Referenced by getGlobalTimeOffset(), and setGlobalTimeOffset().

◆ _heap_profiling

bool MooseApp::_heap_profiling = false
private

Memory profiling.

Definition at line 1440 of file MooseApp.h.

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

◆ _initial_backup

std::unique_ptr<Backup>* const MooseApp::_initial_backup
private

The backup for use in initial setup; this will get set from the _initial_backup input parameter that typically gets set from a MultiApp that has a backup This is a pointer to a pointer because at the time of construction of the app, the backup will not be filled yet.

Definition at line 1455 of file MooseApp.h.

Referenced by hasInitialBackup(), and restoreFromInitialBackup().

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

Referenced by getExodusFileRestart(), and setExodusFileRestart().

◆ _input_parameter_warehouse

std::unique_ptr<InputParameterWarehouse> MooseApp::_input_parameter_warehouse
protected

Input parameter storage structure; unique_ptr so we can control its destruction order.

Definition at line 1128 of file MooseApp.h.

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

◆ _interface_registry

std::map<std::type_index, std::unique_ptr<InterfaceRegistryObjectsBase> > MooseApp::_interface_registry
private

Registration for interface objects.

Definition at line 1449 of file MooseApp.h.

Referenced by getInterfaceObjects(), and registerInterfaceObject().

◆ _lib_handles

std::unordered_map<std::string, DynamicLibraryInfo> MooseApp::_lib_handles
protected

The library archive (name only), registration method and the handle to the method.

Definition at line 1268 of file MooseApp.h.

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

◆ _master_displaced_mesh

const MooseMesh* const MooseApp::_master_displaced_mesh
private

The displaced mesh from master app.

Definition at line 1414 of file MooseApp.h.

Referenced by masterDisplacedMesh(), and MooseApp().

◆ _master_mesh

const MooseMesh* const MooseApp::_master_mesh
private

The mesh from master app.

Definition at line 1411 of file MooseApp.h.

Referenced by masterMesh(), and MooseApp().

◆ _mesh_generator_system

MeshGeneratorSystem MooseApp::_mesh_generator_system
private

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

Referenced by getOutputFileBase(), isUltimateMaster(), MooseApp(), and multiAppLevel().

◆ _multiapp_number

unsigned int MooseApp::_multiapp_number
private

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

Definition at line 1408 of file MooseApp.h.

Referenced by multiAppNumber().

◆ _name

const std::string MooseApp::_name
protected

The name of this object.

Definition at line 1088 of file MooseApp.h.

Referenced by setupOptions().

◆ _null_executor

std::shared_ptr<NullExecutor> MooseApp::_null_executor
protected

Used to return an executor that does nothing.

Definition at line 1186 of file MooseApp.h.

Referenced by createExecutors(), getExecutor(), and getNullExecutor().

◆ _output_buffer_cache

std::streambuf* MooseApp::_output_buffer_cache
private

Cache output buffer so the language server can turn it off then back on.

Definition at line 1431 of file MooseApp.h.

Referenced by MooseApp(), and setupOptions().

◆ _output_file_base

std::string MooseApp::_output_file_base
protected

The output file basename.

Definition at line 1100 of file MooseApp.h.

Referenced by getOutputFileBase(), setOutputFileBase(), and setupOptions().

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

Referenced by getOutputFileNumbers(), and setOutputFileNumbers().

◆ _output_position

Point MooseApp::_output_position
protected

The output position.

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

Referenced by hasOutputPosition(), and setOutputPosition().

◆ _output_warehouse

OutputWarehouse MooseApp::_output_warehouse
protected

OutputWarehouse object for this App.

Definition at line 1137 of file MooseApp.h.

Referenced by getOutputWarehouse(), setOutputFileBase(), and setOutputPosition().

◆ _pars

InputParameters MooseApp::_pars
protected

Parameters of this object.

Definition at line 1091 of file MooseApp.h.

Referenced by copyInputs(), getParam(), getRenamedParam(), isParamSetByUser(), isParamValid(), parameters(), setupOptions(), and showInputs().

◆ _parser

const std::shared_ptr<Parser> MooseApp::_parser
protected

Parser for parsing the input file.

Definition at line 1140 of file MooseApp.h.

Referenced by getInputFileNames(), getLastInputFileName(), parser(), and setupOptions().

◆ _perf_graph

PerfGraph& MooseApp::_perf_graph
protected

The PerfGraph object for this application (recoverable)

Definition at line 1155 of file MooseApp.h.

Referenced by perfGraph(), and setupOptions().

◆ _pg_moose_app

MooseApp& PerfGraphInterface::_pg_moose_app
protectedinherited

The MooseApp that owns the PerfGraph.

Definition at line 124 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::perfGraph().

◆ _prefix

const std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 127 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _rank_map

const RankMap MooseApp::_rank_map
protected

The RankMap is a useful object for determining how the processes are laid out on the physical hardware.

Definition at line 1161 of file MooseApp.h.

Referenced by rankMap().

◆ _rd_reader

RestartableDataReader MooseApp::_rd_reader
private

Definition at line 1419 of file MooseApp.h.

Referenced by finalizeRestore(), and restore().

◆ _ready_to_exit

bool MooseApp::_ready_to_exit
protected

Definition at line 1209 of file MooseApp.h.

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

◆ _recover

bool MooseApp::_recover
protected

Whether or not this is a recovery run.

Definition at line 1221 of file MooseApp.h.

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

◆ _recoverable_data_names

DataNames MooseApp::_recoverable_data_names
protected

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

e.g. these names are excluded during restart.

Definition at line 1152 of file MooseApp.h.

Referenced by getRecoverableData(), and registerRestartableNameWithFilter().

◆ _relationship_managers

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

◆ _restart

bool MooseApp::_restart
protected

Whether or not this is a restart run.

Definition at line 1224 of file MooseApp.h.

Referenced by isRestarting(), and setRestart().

◆ _restart_recover_base

std::string MooseApp::_restart_recover_base
protected

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

Definition at line 1236 of file MooseApp.h.

Referenced by getRecoverFileBase(), getRestartRecoverFileBase(), hasRecoverFileBase(), hasRestartRecoverFileBase(), setRestartRecoverFileBase(), and setupOptions().

◆ _restartable_data

std::vector<RestartableDataMap> MooseApp::_restartable_data
protected

Where the restartable data is held (indexed on tid)

Definition at line 1146 of file MooseApp.h.

Referenced by backup(), getRestartableData(), registerRestartableData(), and ~MooseApp().

◆ _restartable_meta_data

std::unordered_map<RestartableDataMapName, std::pair<RestartableDataMap, std::string> > MooseApp::_restartable_meta_data
private

◆ _solution_invalidity

SolutionInvalidity& MooseApp::_solution_invalidity
protected

The SolutionInvalidity object for this application.

Definition at line 1158 of file MooseApp.h.

Referenced by solutionInvalidity().

◆ _split_mesh

bool MooseApp::_split_mesh
protected

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

Definition at line 1227 of file MooseApp.h.

Referenced by isSplitMesh(), and setupOptions().

◆ _start_time

Real MooseApp::_start_time
protected

The time at which to start the simulation.

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

Referenced by hasStartTime(), and setStartTime().

◆ _syntax

Syntax MooseApp::_syntax
protected

Syntax of the input file.

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

Referenced by getSystemInfo(), and MooseApp().

◆ _template_to_clones

std::map<const RelationshipManager *, std::map<const MeshBase *, std::unique_ptr<RelationshipManager> > > MooseApp::_template_to_clones
private

Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase object and the clone of the template relationship manager, e.g.

the top-level map key

Definition at line 1446 of file MooseApp.h.

Referenced by createRMFromTemplateAndInit(), getRMClone(), and hasRMClone().

◆ _test_checkpoint_half_transient

bool MooseApp::_test_checkpoint_half_transient
protected

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

Definition at line 1239 of file MooseApp.h.

Referenced by setupOptions(), and testCheckpointHalfTransient().

◆ _the_warehouse

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

The combined warehouse for storing any MooseObject based object.

Definition at line 1402 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 1233 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 1094 of file MooseApp.h.

Referenced by MooseApp().

◆ _undisp_to_disp_rms

std::unordered_map<RelationshipManager *, std::shared_ptr<GhostingFunctor> > MooseApp::_undisp_to_disp_rms
protected

A map from undisplaced relationship managers to their displaced clone (stored as the base GhostingFunctor).

Anytime we clone in attachRelationshipManagers we create a map entry from the cloned undisplaced relationship manager to its displaced clone counterpart. We leverage this map when removing relationship managers/ghosting functors

Definition at line 1258 of file MooseApp.h.

◆ _use_eigen_value

bool MooseApp::_use_eigen_value
protected

Boolean to indicate whether to use an eigenvalue executioner.

Definition at line 1192 of file MooseApp.h.

Referenced by useEigenvalue().

◆ _use_executor

const bool MooseApp::_use_executor
protected

Indicates whether we are operating in the new/experimental executor mode instead of using the legacy executioner system.

Definition at line 1183 of file MooseApp.h.

Referenced by executeExecutioner(), and useExecutor().

◆ _use_nonlinear

bool MooseApp::_use_nonlinear
protected

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

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

◆ MESH_META_DATA

const RestartableDataMapName MooseApp::MESH_META_DATA = "MeshMetaData"
static

◆ MESH_META_DATA_SUFFIX

const RestartableDataMapName MooseApp::MESH_META_DATA_SUFFIX = "mesh"
static

Definition at line 96 of file MooseApp.h.

Referenced by MooseApp().


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