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

639 {
640 #ifdef HAVE_GPERFTOOLS
641  // CPU profiling stop
642  if (_cpu_profiling)
643  ProfilerStop();
644  // Heap profiling stop
645  if (_heap_profiling)
646  HeapProfilerStop();
647 #endif
649  _executioner.reset();
650  _the_warehouse.reset();
651 
652  // Don't wait for implicit destruction of input parameter storage
654 
655  // This is dirty, but I don't know what else to do. Obviously, others
656  // have had similar problems if you look above. In specific, the
657  // dlclose below on macs is destructing some data that does not
658  // belong to it in garbage collection. So... don't even give
659  // dlclose an option
660  _restartable_data.clear();
661 
662 #ifdef LIBMESH_HAVE_DLOPEN
663  // Close any open dynamic libraries
664  for (const auto & lib_pair : _lib_handles)
665  dlclose(lib_pair.second.library_handle);
666 #endif
667 }
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 365 of file MooseApp.C.

366  : ConsoleStreamInterface(*this),
367  PerfGraphInterface(*this, "MooseApp"),
368  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
369  "_comm")), // Can't call getParam() before pars is set
370  MooseBase(parameters.get<std::string>("_type"),
371  parameters.get<std::string>("_app_name"),
372  *this,
373  _pars),
374  _pars(parameters),
375  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
376  _file_base_set_by_user(false),
377  _output_position_set(false),
378  _start_time_set(false),
379  _start_time(0.0),
380  _global_time_offset(0.0),
381  _input_parameter_warehouse(std::make_unique<InputParameterWarehouse>()),
382  _action_factory(*this),
384  _output_warehouse(*this),
385  _parser(parameters.get<std::shared_ptr<Parser>>("_parser")),
391  _use_executor(parameters.get<bool>("use_executor")),
392  _null_executor(NULL),
393  _use_nonlinear(true),
394  _use_eigen_value(false),
396  _factory(*this),
397  _error_overridden(false),
398  _ready_to_exit(false),
399  _initial_from_file(false),
401  _recover(false),
402  _restart(false),
403  _split_mesh(false),
404  _use_split(parameters.get<bool>("use_split")),
405 #ifdef DEBUG
406  _trap_fpe(true),
407 #else
408  _trap_fpe(false),
409 #endif
411  _check_input(getParam<bool>("check_input")),
413  isParamValid("_multiapp_level") ? parameters.get<unsigned int>("_multiapp_level") : 0),
415  isParamValid("_multiapp_number") ? parameters.get<unsigned int>("_multiapp_number") : 0),
416  _master_mesh(isParamValid("_master_mesh") ? parameters.get<const MooseMesh *>("_master_mesh")
417  : nullptr),
418  _master_displaced_mesh(isParamValid("_master_displaced_mesh")
419  ? parameters.get<const MooseMesh *>("_master_displaced_mesh")
420  : nullptr),
421  _mesh_generator_system(*this),
424  _output_buffer_cache(nullptr),
425  _automatic_automatic_scaling(getParam<bool>("automatic_automatic_scaling")),
426  _initial_backup(getParam<std::unique_ptr<Backup> *>("_initial_backup"))
427 {
428  // Set the TIMPI sync type via --timpi-sync
429  const auto & timpi_sync = parameters.get<std::string>("timpi_sync");
430  const_cast<Parallel::Communicator &>(comm()).sync_type(timpi_sync);
431 
432 #ifdef HAVE_GPERFTOOLS
433  if (isUltimateMaster())
434  {
435  bool has_cpu_profiling = false;
436  bool has_heap_profiling = false;
437  static std::string cpu_profile_file;
438  static std::string heap_profile_file;
439 
440  // For CPU profiling, users need to have environment 'MOOSE_PROFILE_BASE'
441  if (std::getenv("MOOSE_PROFILE_BASE"))
442  {
443  has_cpu_profiling = true;
444  cpu_profile_file =
445  std::getenv("MOOSE_PROFILE_BASE") + std::to_string(_comm->rank()) + ".prof";
446  // create directory if needed
447  auto name = MooseUtils::splitFileName(cpu_profile_file);
448  if (!name.first.empty())
449  {
450  if (processor_id() == 0)
451  MooseUtils::makedirs(name.first.c_str());
452  _comm->barrier();
453  }
454  }
455 
456  // For Heap profiling, users need to have 'MOOSE_HEAP_BASE'
457  if (std::getenv("MOOSE_HEAP_BASE"))
458  {
459  has_heap_profiling = true;
460  heap_profile_file = std::getenv("MOOSE_HEAP_BASE") + std::to_string(_comm->rank());
461  // create directory if needed
462  auto name = MooseUtils::splitFileName(heap_profile_file);
463  if (!name.first.empty())
464  {
465  if (processor_id() == 0)
466  MooseUtils::makedirs(name.first.c_str());
467  _comm->barrier();
468  }
469  }
470 
471  // turn on profiling only on selected ranks
472  if (isParamValid("gperf_profiler_on"))
473  {
474  auto rankstr = getParam<std::string>("gperf_profiler_on");
475  std::vector<processor_id_type> ranks;
476  bool success = MooseUtils::tokenizeAndConvert(rankstr, ranks, ", ");
477  if (!success)
478  mooseError("Invalid argument for --gperf-profiler-on: '", rankstr, "'");
479  for (auto & rank : ranks)
480  {
481  if (rank >= _comm->size())
482  mooseError("Invalid argument for --gperf-profiler-on: ",
483  rank,
484  " is greater than or equal to ",
485  _comm->size());
486  if (rank == _comm->rank())
487  {
488  _cpu_profiling = has_cpu_profiling;
489  _heap_profiling = has_heap_profiling;
490  }
491  }
492  }
493  else
494  {
495  _cpu_profiling = has_cpu_profiling;
496  _heap_profiling = has_heap_profiling;
497  }
498 
499  if (_cpu_profiling)
500  if (!ProfilerStart(cpu_profile_file.c_str()))
501  mooseError("CPU profiler is not started properly");
502 
503  if (_heap_profiling)
504  {
505  HeapProfilerStart(heap_profile_file.c_str());
506  if (!IsHeapProfilerRunning())
507  mooseError("Heap profiler is not started properly");
508  }
509  }
510 #else
511  if (std::getenv("MOOSE_PROFILE_BASE") || std::getenv("MOOSE_HEAP_BASE"))
512  mooseError("gperftool is not available for CPU or heap profiling");
513 #endif
514 
515  // If this will be a language server then turn off output until that starts
516  if (isParamValid("language_server"))
517  _output_buffer_cache = Moose::out.rdbuf(nullptr);
518 
521 
522  _the_warehouse = std::make_unique<TheWarehouse>();
523  _the_warehouse->registerAttribute<AttribMatrixTags>("matrix_tags", 0);
524  _the_warehouse->registerAttribute<AttribVectorTags>("vector_tags", 0);
525  _the_warehouse->registerAttribute<AttribExecOns>("exec_ons", 0);
526  _the_warehouse->registerAttribute<AttribSubdomains>("subdomains", 0);
527  _the_warehouse->registerAttribute<AttribBoundaries>("boundaries", 0);
528  _the_warehouse->registerAttribute<AttribThread>("thread", 0);
529  _the_warehouse->registerAttribute<AttribExecutionOrderGroup>("execution_order_group", 0);
530  _the_warehouse->registerAttribute<AttribPreIC>("pre_ic", 0);
531  _the_warehouse->registerAttribute<AttribPreAux>("pre_aux");
532  _the_warehouse->registerAttribute<AttribPostAux>("post_aux");
533  _the_warehouse->registerAttribute<AttribName>("name", "dummy");
534  _the_warehouse->registerAttribute<AttribSystem>("system", "dummy");
535  _the_warehouse->registerAttribute<AttribVar>("variable", -1);
536  _the_warehouse->registerAttribute<AttribInterfaces>("interfaces", 0);
537  _the_warehouse->registerAttribute<AttribSysNum>("sys_num", libMesh::invalid_uint);
538  _the_warehouse->registerAttribute<AttribResidualObject>("residual_object");
539  _the_warehouse->registerAttribute<AttribSorted>("sorted");
540  _the_warehouse->registerAttribute<AttribDisplaced>("displaced", -1);
541 
542  if (isParamValid("_argc") && isParamValid("_argv"))
543  {
544  int argc = getParam<int>("_argc");
545  char ** argv = getParam<char **>("_argv");
546 
547  _sys_info = std::make_unique<SystemInfo>(argc, argv);
548  }
549  if (isParamValid("_command_line"))
550  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
551  else
552  mooseError("Valid CommandLine object required");
553 
554  if (_check_input && isParamValid("recover"))
555  mooseError("Cannot run --check-input with --recover. Recover files might not exist");
556 
557  if (isParamValid("start_in_debugger") && _multiapp_level == 0)
558  {
559  auto command = getParam<std::string>("start_in_debugger");
560 
561  Moose::out << "Starting in debugger using: " << command << std::endl;
562 
564 
565  std::stringstream command_stream;
566 
567  // This will start XTerm and print out some info first... then run the debugger
568  command_stream << "xterm -e \"echo 'Rank: " << processor_id() << " Hostname: " << hostname
569  << " PID: " << getpid() << "'; echo ''; ";
570 
571  // Figure out how to run the debugger
572  if (command.find("lldb") != std::string::npos || command.find("gdb") != std::string::npos)
573  command_stream << command << " -p " << getpid();
574  else
575  mooseError("Unknown debugger: ",
576  command,
577  "\nIf this is truly what you meant then contact moose-users to have a discussion "
578  "about adding your debugger.");
579 
580  // Finish up the command
581  command_stream << "\""
582  << " & ";
583 
584  std::string command_string = command_stream.str();
585  Moose::out << "Running: " << command_string << std::endl;
586 
587  int ret = std::system(command_string.c_str());
588  libmesh_ignore(ret);
589 
590  // Sleep to allow time for the debugger to attach
591  std::this_thread::sleep_for(std::chrono::seconds(10));
592  }
593 
594  if (!parameters.isParamSetByAddParam("stop_for_debugger"))
595  {
596  Moose::out << "\nStopping for " << getParam<unsigned int>("stop_for_debugger")
597  << " seconds to allow attachment from a debugger.\n";
598 
599  Moose::out << "\nAll of the processes you can connect to:\n";
600  Moose::out << "rank - hostname - pid\n";
601 
603 
604  {
605  // The 'false' turns off the serialization warning
606  SerializerGuard sg(_communicator, false); // Guarantees that the processors print in order
607  Moose::err << processor_id() << " - " << hostname << " - " << getpid() << "\n";
608  }
609 
610  Moose::out << "\nWaiting...\n" << std::endl;
611 
612  // Sleep to allow time for the debugger to attach
613  std::this_thread::sleep_for(std::chrono::seconds(getParam<unsigned int>("stop_for_debugger")));
614  }
615 
616  if (_master_mesh && _multiapp_level == 0)
617  mooseError("Mesh can be passed in only for sub-apps");
618 
620  mooseError("_master_mesh should have been set when _master_displaced_mesh is set");
621 
622  // Data specifically associated with the mesh (meta-data) that will read from the restart
623  // file early during the simulation setup so that they are available to Actions and other objects
624  // that need them during the setup process. Most of the restartable data isn't made available
625  // until all objects have been created and all Actions have been executed (i.e. initialSetup).
627 
628  if (parameters.have_parameter<bool>("use_legacy_dirichlet_bc"))
629  mooseDeprecated("The parameter 'use_legacy_dirichlet_bc' is no longer valid.\n\n",
630  "All Dirichlet boundary conditions are preset by default.\n\n",
631  "Remove said parameter in ",
632  name(),
633  " to remove this deprecation warning.");
634 
635  Moose::out << std::flush;
636 }
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:2818
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:299
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:350
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:2836
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:2799
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 1333 of file MooseApp.C.

Referenced by recursivelyCreateExecutors().

1336 {
1337  std::shared_ptr<Executor> executor = _factory.create<Executor>(type, name, params);
1338 
1339  if (_executors.count(executor->name()) > 0)
1340  mooseError("an executor with name '", executor->name(), "' already exists");
1341  _executors[executor->name()] = executor;
1342 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 1345 of file MooseApp.C.

Referenced by ReadExecutorParamsAction::act().

1348 {
1349  _executor_params[name] = std::make_pair(type, std::make_unique<InputParameters>(params));
1350 }
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 2349 of file MooseApp.C.

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

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

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

1780 {
1781  std::string library_name(app_name);
1782 
1783  // Strip off the App part (should always be the last 3 letters of the name)
1784  size_t pos = library_name.find("App");
1785  if (pos != library_name.length() - 3)
1786  mooseError("Invalid application name: ", library_name);
1787  library_name.erase(pos);
1788 
1789  // Now get rid of the camel case, prepend lib, and append the method and suffix
1790  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
1791  QUOTE(METHOD) + ".la";
1792 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2559 of file MooseApp.C.

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

2561 {
2562  for (auto & rm : _relationship_managers)
2563  {
2564  if (!rm->isType(rm_type))
2565  continue;
2566 
2567  // RM is already attached (this also handles the geometric early case)
2568  if (_attached_relationship_managers[rm_type].count(rm.get()))
2569  continue;
2570 
2572  {
2573  // The problem is not built yet - so the ActionWarehouse currently owns the mesh
2574  MooseMesh * const mesh = _action_warehouse.mesh().get();
2575 
2576  // "attach_geometric_rm_final = true" inidicate that it is the last chance to attach
2577  // geometric RMs. Therefore, we need to attach them.
2578  if (!rm->attachGeometricEarly() && !attach_geometric_rm_final)
2579  // Will attach them later (during algebraic). But also, we need to tell the mesh that we
2580  // shouldn't be deleting remote elements yet
2581  mesh->allowRemoteElementRemoval(false);
2582  else
2583  {
2584  MeshBase & undisp_mesh_base = mesh->getMesh();
2585  const DofMap * const undisp_sys_dof_map =
2586  _executioner ? &feProblem().getSolverSystem(0).dofMap() : nullptr;
2587  undisp_mesh_base.add_ghosting_functor(
2588  createRMFromTemplateAndInit(*rm, *mesh, undisp_mesh_base, undisp_sys_dof_map));
2589 
2590  // In the final stage, if there is a displaced mesh, we need to
2591  // clone ghosting functors for displacedMesh
2592  if (auto & disp_moose_mesh = _action_warehouse.displacedMesh();
2593  attach_geometric_rm_final && disp_moose_mesh)
2594  {
2595  MeshBase & disp_mesh_base = _action_warehouse.displacedMesh()->getMesh();
2596  const DofMap * disp_sys_dof_map = nullptr;
2597  if (_executioner && feProblem().getDisplacedProblem())
2598  disp_sys_dof_map = &feProblem().getDisplacedProblem()->solverSys(0).dofMap();
2599  disp_mesh_base.add_ghosting_functor(
2600  createRMFromTemplateAndInit(*rm, *disp_moose_mesh, disp_mesh_base, disp_sys_dof_map));
2601  }
2602  else if (_action_warehouse.displacedMesh())
2603  mooseError("The displaced mesh should not yet exist at the time that we are attaching "
2604  "early geometric relationship managers.");
2605 
2606  // Mark this RM as attached
2607  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
2608  _attached_relationship_managers[rm_type].insert(rm.get());
2609  }
2610  }
2611  else // rm_type is algebraic or coupling
2612  {
2613  if (!_executioner && !_executor)
2614  mooseError("We must have an executioner by now or else we do not have to data to add "
2615  "algebraic or coupling functors to in MooseApp::attachRelationshipManagers");
2616 
2617  // Now we've built the problem, so we can use it
2618  auto & problem = feProblem();
2619  auto & undisp_moose_mesh = problem.mesh();
2620  auto & undisp_sys = feProblem().getSolverSystem(0);
2621  auto & undisp_sys_dof_map = undisp_sys.dofMap();
2622  auto & undisp_mesh = undisp_moose_mesh.getMesh();
2623 
2624  if (rm->useDisplacedMesh() && problem.getDisplacedProblem())
2625  {
2627  // We actually need to add this to the FEProblemBase NonlinearSystemBase's DofMap
2628  // because the DisplacedProblem "nonlinear" DisplacedSystem doesn't have any matrices
2629  // for which to do coupling. It's actually horrifying to me that we are adding a
2630  // coupling functor, that is going to determine its couplings based on a displaced
2631  // MeshBase object, to a System associated with the undisplaced MeshBase object (there
2632  // is only ever one EquationSystems object per MeshBase object and visa versa). So here
2633  // I'm left with the choice of whether to pass in a MeshBase object that is *not* the
2634  // MeshBase object that will actually determine the couplings or to pass in the MeshBase
2635  // object that is inconsistent with the System DofMap that we are adding the coupling
2636  // functor for! Let's err on the side of *libMesh* consistency and pass properly paired
2637  // MeshBase-DofMap
2638  problem.addCouplingGhostingFunctor(
2639  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
2640  /*to_mesh = */ false);
2641 
2642  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
2643  {
2644  auto & displaced_problem = *problem.getDisplacedProblem();
2645  auto & disp_moose_mesh = displaced_problem.mesh();
2646  auto & disp_mesh = disp_moose_mesh.getMesh();
2647  const DofMap * const disp_nl_dof_map = &displaced_problem.solverSys(0).dofMap();
2648  displaced_problem.addAlgebraicGhostingFunctor(
2649  createRMFromTemplateAndInit(*rm, disp_moose_mesh, disp_mesh, disp_nl_dof_map),
2650  /*to_mesh = */ false);
2651  }
2652  }
2653  else // undisplaced
2654  {
2656  problem.addCouplingGhostingFunctor(
2657  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
2658  /*to_mesh = */ false);
2659 
2660  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
2661  problem.addAlgebraicGhostingFunctor(
2662  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
2663  /*to_mesh = */ false);
2664  }
2665 
2666  // Mark this RM as attached
2667  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
2668  _attached_relationship_managers[rm_type].insert(rm.get());
2669  }
2670  }
2671 }
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:2493
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:299
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:1327
std::shared_ptr< MooseMesh > & mesh()
virtual DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1138
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 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
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
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 2529 of file MooseApp.C.

2530 {
2531  for (auto & rm : _relationship_managers)
2532  {
2534  {
2535  if (rm->attachGeometricEarly())
2536  mesh.add_ghosting_functor(createRMFromTemplateAndInit(*rm, moose_mesh, mesh));
2537  else
2538  {
2539  // If we have a geometric ghosting functor that can't be attached early, then we have to
2540  // prevent the mesh from deleting remote elements
2541  moose_mesh.allowRemoteElementRemoval(false);
2542 
2543  if (const MeshBase * const moose_mesh_base = moose_mesh.getMeshPtr())
2544  {
2545  if (moose_mesh_base != &mesh)
2546  mooseError("The MooseMesh MeshBase and the MeshBase we're trying to attach "
2547  "relationship managers to are different");
2548  }
2549  else
2550  // The MeshBase isn't attached to the MooseMesh yet, so have to tell it not to remove
2551  // remote elements independently
2552  mesh.allow_remote_element_removal(false);
2553  }
2554  }
2555  }
2556 }
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:2493
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MeshBase & mesh
void allowRemoteElementRemoval(bool allow_removal)
Set whether to allow remote element removal.
Definition: MooseMesh.C:3662
const MeshBase * getMeshPtr() const
Definition: MooseMesh.C:3193
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 1215 of file MooseApp.C.

Referenced by Checkpoint::output().

1216 {
1217  TIME_SECTION("backup", 2, "Backing Up Application to File");
1218 
1219  preBackup();
1220 
1222  return writer.write(folder_base);
1223 }
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 1226 of file MooseApp.C.

Referenced by finalizeRestore(), and restore().

1227 {
1228  TIME_SECTION("backup", 2, "Backing Up Application");
1229 
1231 
1232  preBackup();
1233 
1234  auto backup = std::make_unique<Backup>();
1235  writer.write(*backup->header, *backup->data);
1236 
1237  return backup;
1238 }
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:1226

◆ 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::mooseDocumentedError(), 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:51
void mooseConsole()
Send current output buffer to Console output objects.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1773

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

Referenced by SetupRecoverFileBaseAction::act().

2751 {
2752  for (auto map_iter = _restartable_meta_data.begin(); map_iter != _restartable_meta_data.end();
2753  ++map_iter)
2754  {
2755  const RestartableDataMapName & name = map_iter->first;
2756  const RestartableDataMap & meta_data = map_iter->second.first;
2757 
2758  std::vector<std::string> not_declared;
2759 
2760  for (const auto & data : meta_data)
2761  if (!data.declared())
2762  not_declared.push_back(data.name());
2763 
2764  if (!not_declared.empty())
2765  {
2766  std::ostringstream oss;
2767  std::copy(
2768  not_declared.begin(), not_declared.end(), infix_ostream_iterator<std::string>(oss, ", "));
2769 
2770  mooseError("The following '",
2771  name,
2772  "' meta-data properties were retrieved but never declared: ",
2773  oss.str());
2774  }
2775  }
2776 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2397 of file MooseApp.C.

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

2398 {
2399  static const std::string suffix = "-mesh.cpr";
2400  return suffix;
2401 }

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

2850 {
2851  return _action_warehouse.getCurrentTaskName() == "create_added_mesh_generators" ||
2853 }
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 1591 of file MooseApp.C.

Referenced by run().

1592 {
1593  if (isParamValid("copy_inputs"))
1594  {
1595  // Get command line argument following --copy-inputs on command line
1596  auto dir_to_copy = getParam<std::string>("copy_inputs");
1597 
1598  if (dir_to_copy.empty())
1599  mooseError("Error retrieving directory to copy");
1600  if (dir_to_copy.back() != '/')
1601  dir_to_copy += '/';
1602 
1603  // This binary name is the actual binary. That is, if we called a symlink it'll
1604  // be the name of what the symlink points to
1605  auto binname = appBinaryName();
1606  if (binname == "")
1607  mooseError("could not locate installed tests to run (unresolved binary/app name)");
1608 
1609  auto src_dir = MooseUtils::installedInputsDir(binname,
1610  dir_to_copy,
1611  "Rerun binary with " +
1612  _pars.getCommandLineSyntax("show_inputs")[0] +
1613  " to get a list of installable directories.");
1614 
1615  // Use the command line here because if we have a symlink to another binary,
1616  // we want to dump into a directory that is named after the symlink not the true binary
1617  auto dst_dir = _command_line->getExecutableNameBase() + "/" + dir_to_copy;
1618  auto cmdname = _command_line->getExecutableName();
1619  if (cmdname.find_first_of("/") != std::string::npos)
1620  cmdname = cmdname.substr(cmdname.find_first_of("/") + 1, std::string::npos);
1621 
1622  if (MooseUtils::pathExists(dst_dir))
1623  mooseError(
1624  "The directory \"./",
1625  dst_dir,
1626  "\" already exists.\nTo update/recopy the contents of this directory, rename (\"mv ",
1627  dst_dir,
1628  " new_dir_name\") or remove (\"rm -r ",
1629  dst_dir,
1630  "\") the existing directory.\nThen re-run \"",
1631  cmdname,
1632  " --copy-inputs ",
1633  dir_to_copy,
1634  "\".");
1635 
1636  std::string cmd = "mkdir -p " + dst_dir + "; rsync -av " + src_dir + " " + dst_dir;
1637 
1638  TIME_SECTION("copy_inputs", 2, "Copying Inputs");
1639 
1640  // Only perform the copy on the root processor
1641  int return_value = 0;
1642  if (processor_id() == 0)
1643  return_value = system(cmd.c_str());
1644  _communicator.broadcast(return_value);
1645 
1646  if (WIFEXITED(return_value) && WEXITSTATUS(return_value) != 0)
1647  mooseError("Failed to copy the requested directory.");
1648  Moose::out << "Directory successfully copied into ./" << dst_dir << '\n';
1649  return true;
1650  }
1651  return false;
1652 }
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:299
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 1412 of file MooseApp.C.

Referenced by AddExecutorAction::act().

1413 {
1414  // Do we have any?
1415  if (_executor_params.empty())
1416  return;
1417 
1418  // Holds the names of Executors that may be the root executor
1419  std::list<std::string> possibly_root;
1420 
1421  // What is already built
1422  std::map<std::string, bool> already_built;
1423 
1424  // The Executors that are currently candidates for being roots
1425  std::list<std::string> possible_roots;
1426 
1427  // The current line of dependencies - used for finding cycles
1428  std::list<std::string> current_branch;
1429 
1430  // Build the NullExecutor
1431  {
1432  auto params = _factory.getValidParams("NullExecutor");
1433  _null_executor = _factory.create<NullExecutor>("NullExecutor", "_null_executor", params);
1434  }
1435 
1436  for (const auto & params_entry : _executor_params)
1437  {
1438  const auto & name = params_entry.first;
1439 
1440  // Did we already make this one?
1441  if (_executors.find(name) != _executors.end())
1442  continue;
1443 
1444  possible_roots.emplace_back(name);
1445 
1446  recursivelyCreateExecutors(name, possible_roots, current_branch);
1447  }
1448 
1449  // If there is more than one possible root - error
1450  if (possible_roots.size() > 1)
1451  {
1452  auto root_string_it = possible_roots.begin();
1453 
1454  std::stringstream roots_string;
1455 
1456  roots_string << *root_string_it++;
1457 
1458  for (; root_string_it != possible_roots.end(); ++root_string_it)
1459  roots_string << ", " << *root_string_it;
1460 
1461  mooseError("Multiple Executor roots found: ", roots_string.str());
1462  }
1463 
1464  // Set the root executor
1465  _executor = _executors[possible_roots.front()];
1466 }
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:299
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:1360
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 2249 of file MooseApp.C.

Referenced by setupOptions().

2250 {
2251  TIME_SECTION("createMinimalApp", 3, "Creating Minimal App");
2252 
2253  // SetupMeshAction
2254  {
2255  // Build the Action parameters
2256  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
2257  action_params.set<std::string>("type") = "GeneratedMesh";
2258 
2259  // Create The Action
2260  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2261  _action_factory.create("SetupMeshAction", "Mesh", action_params));
2262 
2263  // Set the object parameters
2264  InputParameters & params = action->getObjectParams();
2265  params.set<MooseEnum>("dim") = "1";
2266  params.set<unsigned int>("nx") = 1;
2267 
2268  // Add Action to the warehouse
2270  }
2271 
2272  // Executioner
2273  {
2274  // Build the Action parameters
2275  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
2276  action_params.set<std::string>("type") = "Transient";
2277 
2278  // Create the action
2279  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2280  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
2281 
2282  // Set the object parameters
2283  InputParameters & params = action->getObjectParams();
2284  params.set<unsigned int>("num_steps") = 1;
2285  params.set<Real>("dt") = 1;
2286 
2287  // Add Action to the warehouse
2289  }
2290 
2291  // Problem
2292  {
2293  // Build the Action parameters
2294  InputParameters action_params = _action_factory.getValidParams("CreateProblemDefaultAction");
2295  action_params.set<bool>("_solve") = false;
2296 
2297  // Create the action
2298  std::shared_ptr<Action> action = std::static_pointer_cast<Action>(
2299  _action_factory.create("CreateProblemDefaultAction", "Problem", action_params));
2300 
2301  // Add Action to the warehouse
2303  }
2304 
2305  // Outputs
2306  {
2307  // Build the Action parameters
2308  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
2309  action_params.set<bool>("console") = false;
2310 
2311  // Create action
2312  std::shared_ptr<Action> action =
2313  _action_factory.create("CommonOutputAction", "Outputs", action_params);
2314 
2315  // Add Action to the warehouse
2317  }
2318 
2320 }
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 2818 of file MooseApp.C.

2819 {
2821 
2822  auto perf_graph =
2823  std::make_unique<RestartableData<PerfGraph>>("perf_graph",
2824  this,
2825  type() + " (" + name() + ')',
2826  *this,
2827  getParam<bool>("perf_graph_live_all"),
2828  !getParam<bool>("disable_perf_graph_live"));
2829 
2830  return dynamic_cast<RestartableData<PerfGraph> &>(
2831  registerRestartableData(std::move(perf_graph), 0, false))
2832  .set();
2833 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1200
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:1807
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 2836 of file MooseApp.C.

2837 {
2839 
2840  auto solution_invalidity =
2841  std::make_unique<RestartableData<SolutionInvalidity>>("solution_invalidity", nullptr, *this);
2842 
2843  return dynamic_cast<RestartableData<SolutionInvalidity> &>(
2844  registerRestartableData(std::move(solution_invalidity), 0, false))
2845  .set();
2846 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1200
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:1807
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 2493 of file MooseApp.C.

Referenced by attachRelationshipManagers().

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

1322 {
1324 }
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 1996 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction().

2002 {
2003 #ifdef LIBMESH_HAVE_DLOPEN
2004  Parameters params;
2005  params.set<std::string>("app_name") = app_name;
2006  params.set<RegistrationType>("reg_type") = REGALL;
2007  params.set<std::string>("registration_method") = app_name + "__registerAll";
2008  params.set<std::string>("library_path") = library_path;
2009  params.set<std::string>("library_name") =
2010  library_name.empty() ? appNameToLibName(app_name) : library_name;
2011 
2012  params.set<Factory *>("factory") = factory;
2013  params.set<Syntax *>("syntax") = syntax;
2014  params.set<ActionFactory *>("action_factory") = action_factory;
2015  params.set<bool>("library_load_dependencies") = false;
2016 
2017  dynamicRegistration(params);
2018 #else
2019  libmesh_ignore(app_name, factory, action_factory, syntax, library_path, library_name);
2020  mooseError("Dynamic Loading is either not supported or was not detected by libMesh configure.");
2021 #endif
2022 }
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:299
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2025
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:1779

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

Referenced by MultiApp::createApps().

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

◆ dynamicRegistration()

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

Helper method for dynamic loading of objects.

Definition at line 2025 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

2026 {
2027  const auto paths = getLibrarySearchPaths(params.get<std::string>("library_path"));
2028  const auto library_name = params.get<std::string>("library_name");
2029 
2030  // Attempt to dynamically load the library
2031  for (const auto & path : paths)
2032  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
2034  path + '/' + library_name, params, params.get<bool>("library_load_dependencies"));
2035 }
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:2199
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:2038

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

Referenced by executeExecutioner(), and run().

1124 {
1125  bool warn = _enable_unused_check == WARN_UNUSED;
1127 
1128  _builder.errorCheck(*_comm, warn, err);
1129 
1130  auto apps = feProblem().getMultiAppWarehouse().getObjects();
1131  for (auto app : apps)
1132  for (unsigned int i = 0; i < app->numLocalApps(); i++)
1133  app->localApp(i)->errorCheck();
1134 }
OStreamProxy err
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
FEProblemBase & feProblem() const
Definition: MooseApp.C:1327
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 1137 of file MooseApp.C.

Referenced by run().

1138 {
1139  TIME_SECTION("executeExecutioner", 3);
1140 
1141  // If ready to exit has been set, then just return
1142  if (_ready_to_exit)
1143  return;
1144 
1145  // run the simulation
1146  if (_use_executor && _executor)
1147  {
1149 
1150  _executor->init();
1151  errorCheck();
1152  auto result = _executor->exec();
1153  if (!result.convergedAll())
1154  mooseError(result.str());
1155  }
1156  else if (_executioner)
1157  {
1159  _executioner->init();
1160  errorCheck();
1161  _executioner->execute();
1162  }
1163  else
1164  mooseError("No executioner was specified (go fix your input file)");
1165 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:261
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:1123

◆ feProblem()

FEProblemBase & MooseApp::feProblem ( ) const

Definition at line 1327 of file MooseApp.C.

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

1328 {
1329  return _executor.get() ? _executor->feProblem() : _executioner->feProblem();
1330 }
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 1283 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1284 {
1285  if (!_rd_reader.isRestoring())
1286  mooseError("MooseApp::finalizeRestore(): Not currently restoring");
1287 
1288  // This gives us access to the underlying streams so that we can return it if needed
1289  auto input_streams = _rd_reader.clear();
1290 
1291  std::unique_ptr<Backup> backup;
1292 
1293  // Give them back a backup if this restore started from a Backup, in which case
1294  // the two streams in the Backup are formed into StringInputStreams
1295  if (auto header_string_input = dynamic_cast<StringInputStream *>(input_streams.header.get()))
1296  {
1297  auto data_string_input = dynamic_cast<StringInputStream *>(input_streams.data.get());
1298  mooseAssert(data_string_input, "Should also be a string input");
1299 
1300  auto header_sstream = header_string_input->release();
1301  mooseAssert(header_sstream, "Header not available");
1302 
1303  auto data_sstream = data_string_input->release();
1304  mooseAssert(data_sstream, "Data not available");
1305 
1306  backup = std::make_unique<Backup>();
1307  backup->header = std::move(header_sstream);
1308  backup->data = std::move(data_sstream);
1309  }
1310 
1311  return backup;
1312 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
RestartableDataReader _rd_reader
Definition: MooseApp.h:1419
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1226
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 1721 of file MooseApp.C.

Referenced by getCheckpointFiles().

1722 {
1723  // Storage for the directory names
1724  std::list<std::string> checkpoint_dirs;
1725 
1726  // Add the directories added with Outputs/checkpoint=true input syntax
1727  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
1728 
1729  // Add the directories from any existing checkpoint output objects
1730  const auto & actions = _action_warehouse.getActionListByName("add_output");
1731  for (const auto & action : actions)
1732  {
1733  // Get the parameters from the MooseObjectAction
1734  MooseObjectAction * moose_object_action = dynamic_cast<MooseObjectAction *>(action);
1735  if (!moose_object_action)
1736  continue;
1737 
1738  const InputParameters & params = moose_object_action->getObjectParams();
1739  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
1740  {
1741  // Unless file_base was explicitly set by user, we cannot rely on it, as it will be changed
1742  // later
1743  const std::string cp_dir =
1744  _file_base_set_by_user ? params.get<std::string>("file_base")
1745  : (getOutputFileBase(true) + "_" + moose_object_action->name());
1746  checkpoint_dirs.push_back(cp_dir + "_cp");
1747  }
1748  }
1749  return checkpoint_dirs;
1750 }
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:1073
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 1753 of file MooseApp.C.

Referenced by setRestartRecoverFileBase().

1754 {
1755  auto checkpoint_dirs = getCheckpointDirectories();
1756  return MooseUtils::getFilesInDirs(checkpoint_dirs, false);
1757 }
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:1721
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 2420 of file MooseApp.C.

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

2421 {
2422  if (const auto action = _action_warehouse.getCurrentAction())
2423  return action->parameters().getHitNode();
2424  return nullptr;
2425 }
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 1469 of file MooseApp.C.

1470 {
1471  auto it = _executors.find(name);
1472 
1473  if (it != _executors.end())
1474  return *it->second;
1475 
1476  if (fail_if_not_found)
1477  mooseError("Executor not found: ", name);
1478 
1479  return *_null_executor;
1480 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 1767 of file MooseApp.C.

Referenced by ProgressOutput::output().

1768 {
1769  return _builder.getPrimaryFileName(stripLeadingPath);
1770 }
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 670 of file MooseApp.C.

671 {
672  return MOOSE_VERSION;
673 }

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

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

1060 {
1061  mooseAssert(_parser, "Parser is not set");
1062  return _parser->getInputFileNames();
1063 }
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 2225 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().

2226 {
2228 }
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 1585 of file MooseApp.C.

Referenced by showInputs().

1586 {
1587  return "tests";
1588 }

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

Referenced by setupOptions().

1067 {
1068  mooseAssert(_parser, "Parser is not set");
1069  return _parser->getLastInputFileName();
1070 }
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 2199 of file MooseApp.C.

Referenced by dynamicAppRegistration(), and dynamicRegistration().

2200 {
2201  std::set<std::string> paths;
2202 
2203  if (!library_path.empty())
2204  {
2205  std::vector<std::string> tmp_paths;
2206  MooseUtils::tokenize(library_path, tmp_paths, 1, ":");
2207 
2208  paths.insert(tmp_paths.begin(), tmp_paths.end());
2209  }
2210 
2211  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
2212  if (moose_lib_path_env)
2213  {
2214  std::string moose_lib_path(moose_lib_path_env);
2215  std::vector<std::string> tmp_paths;
2216  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
2217 
2218  paths.insert(tmp_paths.begin(), tmp_paths.end());
2219  }
2220 
2221  return paths;
2222 }
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 2188 of file MooseApp.C.

Referenced by Factory::reportUnregisteredError().

2189 {
2190  // Return the paths but not the open file handles
2191  std::set<std::string> paths;
2192  for (const auto & it : _lib_handles)
2193  paths.insert(it.first);
2194 
2195  return paths;
2196 }
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 1073 of file MooseApp.C.

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

1074 {
1075  if (_file_base_set_by_user || for_non_moose_build_output || _multiapp_level)
1076  return _output_file_base;
1077  else
1078  return _output_file_base + "_out";
1079 }
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 682 of file MooseApp.C.

Referenced by setupOptions().

683 {
684  return getPrintableName() + " Version: " + getVersion();
685 }
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:676

◆ 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:350

◆ getRelationshipManagerInfo()

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

Returns the Relationship managers info suitable for printing.

Definition at line 2674 of file MooseApp.C.

Referenced by ConsoleUtils::outputRelationshipManagerInformation().

2675 {
2676  std::vector<std::pair<std::string, std::string>> info_strings;
2677  info_strings.reserve(_relationship_managers.size());
2678 
2679  for (const auto & rm : _relationship_managers)
2680  {
2681  std::stringstream oss;
2682  oss << rm->getInfo();
2683 
2684  auto & for_whom = rm->forWhom();
2685 
2686  if (!for_whom.empty())
2687  {
2688  oss << " for ";
2689 
2690  std::copy(for_whom.begin(), for_whom.end(), infix_ostream_iterator<std::string>(oss, ", "));
2691  }
2692 
2693  info_strings.emplace_back(std::make_pair(Moose::stringify(rm->getType()), oss.str()));
2694  }
2695 
2696  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
2697  // Ghosting Functors are also attached to the mesh. This should catch them all.
2698  const auto & mesh = _action_warehouse.getMesh();
2699  if (mesh)
2700  {
2701  // Let us use an ordered map to avoid stochastic console behaviors.
2702  // I believe we won't have many RMs, and there is no performance issue.
2703  // Deterministic behaviors are good for setting up regression tests
2704  std::map<std::string, unsigned int> counts;
2705 
2706  for (auto & gf : as_range(mesh->getMesh().ghosting_functors_begin(),
2707  mesh->getMesh().ghosting_functors_end()))
2708  {
2709  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
2710  if (!gf_ptr)
2711  // Count how many occurences of the same Ghosting Functor types we are encountering
2712  counts[demangle(typeid(*gf).name())]++;
2713  }
2714 
2715  for (const auto & pair : counts)
2716  info_strings.emplace_back(std::make_pair(
2717  "Default", pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "")));
2718  }
2719 
2720  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
2721  // Ghosting Functors are also attached to the mesh. This should catch them all.
2722  const auto & d_mesh = _action_warehouse.getDisplacedMesh();
2723  if (d_mesh)
2724  {
2725  // Let us use an ordered map to avoid stochastic console behaviors.
2726  // I believe we won't have many RMs, and there is no performance issue.
2727  // Deterministic behaviors are good for setting up regression tests
2728  std::map<std::string, unsigned int> counts;
2729 
2730  for (auto & gf : as_range(d_mesh->getMesh().ghosting_functors_begin(),
2731  d_mesh->getMesh().ghosting_functors_end()))
2732  {
2733  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
2734  if (!gf_ptr)
2735  // Count how many occurences of the same Ghosting Functor types we are encountering
2736  counts[demangle(typeid(*gf).name())]++;
2737  }
2738 
2739  for (const auto & pair : counts)
2740  info_strings.emplace_back(
2741  std::make_pair("Default",
2742  pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "") +
2743  " for DisplacedMesh"));
2744  }
2745 
2746  return info_strings;
2747 }
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:299
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 2782 of file MooseApp.C.

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

2783 {
2784  auto iter = _restartable_meta_data.find(name);
2785  if (iter == _restartable_meta_data.end())
2786  mooseError("Unable to find RestartableDataMap object for the supplied name '",
2787  name,
2788  "', did you call registerRestartableDataMapName in the application constructor?");
2789  return iter->second.first;
2790 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2809 of file MooseApp.C.

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

2810 {
2811  const auto it = _restartable_meta_data.find(name);
2812  if (it == _restartable_meta_data.end())
2813  mooseError("MooseApp::getRestartableDataMapName: The name '", name, "' is not registered");
2814  return it->second.second;
2815 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 1869 of file MooseApp.C.

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

1872 {
1873  if (tid != 0)
1874  mooseError(
1875  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
1876 
1877  // Get metadata reference from RestartableDataMap and return a (non-const) reference to its value
1878  auto & restartable_data_map = getRestartableDataMap(metaname);
1879  RestartableDataValue * const data = restartable_data_map.findData(name);
1880  if (!data)
1881  mooseError("Unable to find RestartableDataValue object with name " + name +
1882  " in RestartableDataMap");
1883 
1884  return *data;
1885 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:2782
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 2436 of file MooseApp.C.

Referenced by removeRelationshipManager().

2437 {
2438  auto outer_it = _template_to_clones.find(&template_rm);
2439  if (outer_it == _template_to_clones.end())
2440  mooseError("The template rm does not exist in our _template_to_clones map");
2441 
2442  auto & mesh_to_clone_map = outer_it->second;
2443  auto inner_it = mesh_to_clone_map.find(&mesh);
2444  if (inner_it == mesh_to_clone_map.end())
2445  mooseError("We should have the mesh key in our mesh");
2446 
2447  return *inner_it->second;
2448 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 676 of file MooseApp.C.

Referenced by getPrintableVersion().

677 {
678  return MOOSE_VERSION;
679 }

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

1193 {
1194  mooseDeprecated("MooseApp::hasRecoverFileBase is deprecated, use "
1195  "MooseApp::hasRestartRecoverFileBase() instead.");
1196  return !_restart_recover_base.empty();
1197 }
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:350

◆ hasRelationshipManager()

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

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

Definition at line 2323 of file MooseApp.C.

2324 {
2325  return std::find_if(_relationship_managers.begin(),
2326  _relationship_managers.end(),
2327  [&name](const std::shared_ptr<RelationshipManager> & rm)
2328  { return rm->name() == name; }) != _relationship_managers.end();
2329 }
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 2793 of file MooseApp.C.

2794 {
2795  return _restartable_meta_data.count(name);
2796 }
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 1859 of file MooseApp.C.

Referenced by MeshMetaDataInterface::hasMeshProperty().

1861 {
1862  auto it = _restartable_meta_data.find(metaname);
1863  if (it == _restartable_meta_data.end())
1864  return false;
1865  return it->second.first.hasData(name);
1866 }
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 1186 of file MooseApp.C.

1187 {
1188  return !_restart_recover_base.empty();
1189 }
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 2428 of file MooseApp.C.

Referenced by removeRelationshipManager().

2429 {
2430  auto it = _template_to_clones.find(&template_rm);
2431  // C++ does short circuiting so we're safe here
2432  return (it != _template_to_clones.end()) && (it->second.find(&mesh) != it->second.end());
2433 }
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 2231 of file MooseApp.C.

Referenced by restore(), and setupOptions().

2232 {
2233  return std::string("");
2234 }

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

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

1175 {
1176  return _restart;
1177 }
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 1180 of file MooseApp.C.

Referenced by MooseMesh::init().

1181 {
1182  return _split_mesh;
1183 }
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 1795 of file MooseApp.C.

1796 {
1797  std::string app_name(library_name);
1798 
1799  // Strip off the leading "lib" and trailing ".la"
1800  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
1801  mooseError("Invalid library name: ", app_name);
1802 
1803  return MooseUtils::underscoreToCamelCase(app_name, true);
1804 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2038 of file MooseApp.C.

Referenced by dynamicRegistration().

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

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

Referenced by SetupRecoverFileBaseAction::act().

1904 {
1905  for (const auto & name_map_pair : _restartable_meta_data)
1906  possiblyLoadRestartableMetaData(name_map_pair.first, folder_base);
1907 }
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:1888

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

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

2406 {
2407  return RestartableDataIO::restartableDataFolder(folder_base /
2408  std::filesystem::path("meta_data" + map_suffix));
2409 }
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::addLinearFVBC(), FEProblemBase::addLinearFVKernel(), 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(), 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(), EigenKernel::enabled(), MooseMesh::errorIfDistributedMesh(), MooseBase::errorPrefix(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), RestartableDataReporter::execute(), PointValue::execute(), MultiAppNearestNodeTransfer::execute(), WebServerControl::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(), 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(), Control::hasControllableParameterByName(), 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(), WebServerControl::startServer(), 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(), MooseServer::parseDocumentForDiagnostics(), and NonlinearSystemBase::shouldEvaluatePreSMOResidual().

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

◆ parser()

Parser & MooseApp::parser ( )
Returns
The Parser

Definition at line 1353 of file MooseApp.C.

Referenced by ActionFactory::create().

1354 {
1355  mooseAssert(_parser, "Not set");
1356  return *_parser;
1357 }
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 1888 of file MooseApp.C.

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

1890 {
1891  const auto & map_name = getRestartableDataMapName(name);
1892  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
1893  if (RestartableDataReader::isAvailable(meta_data_folder_base))
1894  {
1896  reader.setErrorOnLoadWithDifferentNumberOfProcessors(false);
1897  reader.setInput(meta_data_folder_base);
1898  reader.restore();
1899  }
1900 }
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:2404
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:2782
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:2809
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 1360 of file MooseApp.C.

Referenced by createExecutors().

1363 {
1364  // Did we already make this one?
1365  if (_executors.find(current_executor_name) != _executors.end())
1366  return;
1367 
1368  // Is this one already on the current branch (i.e. there is a cycle)
1369  if (std::find(current_branch.begin(), current_branch.end(), current_executor_name) !=
1370  current_branch.end())
1371  {
1372  std::stringstream exec_names_string;
1373 
1374  auto branch_it = current_branch.begin();
1375 
1376  exec_names_string << *branch_it++;
1377 
1378  for (; branch_it != current_branch.end(); ++branch_it)
1379  exec_names_string << ", " << *branch_it;
1380 
1381  exec_names_string << ", " << current_executor_name;
1382 
1383  mooseError("Executor cycle detected: ", exec_names_string.str());
1384  }
1385 
1386  current_branch.push_back(current_executor_name);
1387 
1388  // Build the dependencies first
1389  const auto & params = *_executor_params[current_executor_name].second;
1390 
1391  for (const auto & param : params)
1392  {
1393  if (params.have_parameter<ExecutorName>(param.first))
1394  {
1395  const auto & dependency_name = params.get<ExecutorName>(param.first);
1396 
1397  possible_roots.remove(dependency_name);
1398 
1399  if (!dependency_name.empty())
1400  recursivelyCreateExecutors(dependency_name, possible_roots, current_branch);
1401  }
1402  }
1403 
1404  // Add this Executor
1405  const auto & type = _executor_params[current_executor_name].first;
1406  addExecutor(type, current_executor_name, params);
1407 
1408  current_branch.pop_back();
1409 }
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:299
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:1360
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:1333

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

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

1811 {
1812  if (!metaname.empty() && tid != 0)
1813  mooseError(
1814  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
1815 
1816  mooseAssert(metaname.empty() ||
1817  _restartable_meta_data.find(metaname) != _restartable_meta_data.end(),
1818  "The desired meta data name does not exist: " + metaname);
1819 
1820  // Select the data store for saving this piece of restartable data (mesh or everything else)
1821  auto & data_map =
1822  metaname.empty() ? _restartable_data[tid] : _restartable_meta_data[metaname].first;
1823 
1824  RestartableDataValue * stored_data = data_map.findData(data->name());
1825  if (stored_data)
1826  {
1827  if (data->typeId() != stored_data->typeId())
1828  mooseError("Type mismatch found in RestartableData registration of '",
1829  data->name(),
1830  "'\n\n Stored type: ",
1831  stored_data->type(),
1832  "\n New type: ",
1833  data->type());
1834  }
1835  else
1836  stored_data = &data_map.addData(std::move(data));
1837 
1838  if (!read_only)
1839  stored_data->setDeclared({});
1840 
1841  return *stored_data;
1842 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2799 of file MooseApp.C.

Referenced by MooseApp().

2800 {
2801  if (!suffix.empty())
2802  std::transform(suffix.begin(), suffix.end(), suffix.begin(), ::tolower);
2803  suffix.insert(0, "_");
2804  _restartable_meta_data.emplace(
2805  std::make_pair(name, std::make_pair(RestartableDataMap(), suffix)));
2806 }
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 1200 of file MooseApp.C.

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

1202 {
1204  switch (filter)
1205  {
1206  case RESTARTABLE_FILTER::RECOVERABLE:
1207  _recoverable_data_names.insert(name);
1208  break;
1209  default:
1210  mooseError("Unknown filter");
1211  }
1212 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 2451 of file MooseApp.C.

Referenced by addRelationshipManager().

2452 {
2453  auto * const mesh = _action_warehouse.mesh().get();
2454  if (!mesh)
2455  mooseError("The MooseMesh should exist");
2456 
2457  const MeshBase * const undisp_lm_mesh = mesh->getMeshPtr();
2458  RelationshipManager * undisp_clone = nullptr;
2459  if (undisp_lm_mesh && hasRMClone(*rm, *undisp_lm_mesh))
2460  {
2461  undisp_clone = &getRMClone(*rm, *undisp_lm_mesh);
2462  const_cast<MeshBase *>(undisp_lm_mesh)->remove_ghosting_functor(*undisp_clone);
2463  }
2464 
2465  auto & displaced_mesh = _action_warehouse.displacedMesh();
2466  MeshBase * const disp_lm_mesh = displaced_mesh ? &displaced_mesh->getMesh() : nullptr;
2467  RelationshipManager * disp_clone = nullptr;
2468  if (disp_lm_mesh && hasRMClone(*rm, *disp_lm_mesh))
2469  {
2470  disp_clone = &getRMClone(*rm, *disp_lm_mesh);
2471  disp_lm_mesh->remove_ghosting_functor(*disp_clone);
2472  }
2473 
2474  if (_executioner)
2475  {
2476  auto & problem = feProblem();
2477  if (undisp_clone)
2478  {
2479  problem.removeAlgebraicGhostingFunctor(*undisp_clone);
2480  problem.removeCouplingGhostingFunctor(*undisp_clone);
2481  }
2482 
2483  auto * dp = problem.getDisplacedProblem().get();
2484  if (dp && disp_clone)
2485  dp->removeAlgebraicGhostingFunctor(*disp_clone);
2486  }
2487 
2489  _relationship_managers.erase(rm);
2490 }
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Definition: MooseApp.C:2428
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:2436
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1134
FEProblemBase & feProblem() const
Definition: MooseApp.C:1327
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 2412 of file MooseApp.C.

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

2413 {
2414  auto folder = folder_base;
2415  folder += "-restart-" + std::to_string(processor_id());
2417 }
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 1241 of file MooseApp.C.

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

1242 {
1243  TIME_SECTION("restore", 2, "Restoring Application from File");
1244 
1245  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1246 
1247  _rd_reader.setInput(folder_base);
1248  _rd_reader.restore(filter_names);
1249 
1250  postRestore(for_restart);
1251 }
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 1254 of file MooseApp.C.

1255 {
1256  TIME_SECTION("restore", 2, "Restoring Application");
1257 
1258  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1259 
1260  if (!backup)
1261  mooseError("MooseApp::resore(): Provided backup is not initialized");
1262 
1263  auto header = std::move(backup->header);
1264  mooseAssert(header, "Header not available");
1265 
1266  auto data = std::move(backup->data);
1267  mooseAssert(data, "Data not available");
1268 
1269  _rd_reader.setInput(std::move(header), std::move(data));
1270  _rd_reader.restore(filter_names);
1271 
1272  postRestore(for_restart);
1273 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1226
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2231
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 1276 of file MooseApp.C.

Referenced by FEProblemBase::initialSetup().

1277 {
1278  mooseAssert(hasInitialBackup(), "Missing initial backup");
1279  restore(std::move(*_initial_backup), for_restart);
1280 }
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:1241
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 1495 of file MooseApp.C.

1496 {
1497  TIME_SECTION("run", 3);
1498  if (isParamValid("show_docs") && getParam<bool>("show_docs"))
1499  {
1500  auto binname = appBinaryName();
1501  if (binname == "")
1502  mooseError("could not locate installed tests to run (unresolved binary/app name)");
1503  auto docspath = MooseUtils::docsDir(binname);
1504  if (docspath == "")
1505  mooseError("no installed documentation found");
1506 
1507  auto docmsgfile = MooseUtils::pathjoin(docspath, "docmsg.txt");
1508  std::string docmsg = "file://" + MooseUtils::realpath(docspath) + "/index.html";
1509  if (MooseUtils::pathExists(docmsgfile) && MooseUtils::checkFileReadable(docmsgfile))
1510  {
1511  std::ifstream ifs(docmsgfile);
1512  std::string content((std::istreambuf_iterator<char>(ifs)),
1513  (std::istreambuf_iterator<char>()));
1514  content.replace(content.find("$LOCAL_SITE_HOME"), content.length(), docmsg);
1515  docmsg = content;
1516  }
1517 
1518  Moose::out << docmsg << "\n";
1519  _ready_to_exit = true;
1520  return;
1521  }
1522 
1523  if (showInputs() || copyInputs() || runInputs())
1524  {
1525  _ready_to_exit = true;
1526  return;
1527  }
1528 
1529  try
1530  {
1531  TIME_SECTION("setup", 2, "Setting Up");
1532  setupOptions();
1533  runInputFile();
1534  }
1535  catch (std::exception & err)
1536  {
1537  mooseError(err.what());
1538  }
1539 
1540  if (!_check_input)
1541  {
1542  TIME_SECTION("execute", 2, "Executing");
1544  }
1545  else
1546  {
1547  errorCheck();
1548  // Output to stderr, so it is easier for peacock to get the result
1549  Moose::err << "Syntax OK" << std::endl;
1550  }
1551 }
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:688
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1591
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
Definition: MooseApp.C:1554
bool runInputs() const
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
Definition: MooseApp.C:1655
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:1137
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:1098
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:1123

◆ runInputFile()

void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 1098 of file MooseApp.C.

Referenced by run().

1099 {
1100  TIME_SECTION("runInputFile", 3);
1101 
1102  // If ready to exit has been set, then just return
1103  if (_ready_to_exit)
1104  return;
1105 
1107 
1108  if (isParamValid("mesh_only") || isParamValid("split_mesh"))
1109  _ready_to_exit = true;
1110  else if (getParam<bool>("list_constructed_objects"))
1111  {
1112  // TODO: ask multiapps for their constructed objects
1113  _ready_to_exit = true;
1114  std::vector<std::string> obj_list = _factory.getConstructedObjects();
1115  Moose::out << "**START OBJECT DATA**\n";
1116  for (const auto & name : obj_list)
1117  Moose::out << name << "\n";
1118  Moose::out << "**END OBJECT DATA**\n" << std::endl;
1119  }
1120 }
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 1655 of file MooseApp.C.

Referenced by run().

1656 {
1657  if (isParamValid("run"))
1658  {
1659  // Here we are going to pass everything after --run on the cli to the TestHarness. That means
1660  // cannot validate these CLIs.
1661  auto it = _command_line->find("run");
1662 
1663  std::string test_args;
1664  if (it != _command_line->end())
1665  {
1666  // Preincrement here to skip over --run
1667  while (++it != _command_line->end())
1668  test_args += " " + *it;
1669  }
1670 
1671  auto cmd = MooseUtils::runTestsExecutable() + test_args;
1672  auto working_dir = MooseUtils::getCurrentWorkingDir();
1673 
1674  if (MooseUtils::findTestRoot() == "")
1675  {
1676  auto bin_name = appBinaryName();
1677  if (bin_name == "")
1678  mooseError("Could not locate binary name relative to installed location");
1679 
1680  auto cmd_name = Moose::getExecutableName();
1681  mooseError(
1682  "Could not locate installed tests from the current working directory:",
1683  working_dir,
1684  ".\nMake sure you are executing this command from within a writable installed inputs ",
1685  "directory.\nRun \"",
1686  cmd_name,
1687  " --copy-inputs <dir>\" to copy the contents of <dir> to a \"./",
1688  bin_name,
1689  "_<dir>\" directory.\nChange into that directory and try \"",
1690  cmd_name,
1691  " --run <dir>\" again.");
1692  }
1693 
1694  // Only launch the tests on the root processor
1695  Moose::out << "Working Directory: " << working_dir << "\nRunning Command: " << cmd << std::endl;
1696  int return_value = 0;
1697  if (processor_id() == 0)
1698  return_value = system(cmd.c_str());
1699  _communicator.broadcast(return_value);
1700 
1701  if (WIFEXITED(return_value) && WEXITSTATUS(return_value) != 0)
1702  mooseError("Run failed");
1703  return true;
1704  }
1705 
1706  return false;
1707 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 1315 of file MooseApp.C.

Referenced by setupOptions().

1316 {
1317  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
1318 }
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 1489 of file MooseApp.C.

Referenced by setupOptions().

1490 {
1491  _error_overridden = true;
1492 }
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 1082 of file MooseApp.C.

1083 {
1084  _output_file_base = output_file_base;
1085 
1086  // Reset the file base in the outputs
1088 
1089  // Reset the file base in multiapps (if they have been constructed yet)
1090  if (getExecutioner())
1091  for (auto & multi_app : feProblem().getMultiAppWarehouse().getObjects())
1092  multi_app->setAppOutputFileBase();
1093 
1094  _file_base_set_by_user = true;
1095 }
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:1327
void resetFileBase()
Resets the file base for all FileOutput objects.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:1483
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 1710 of file MooseApp.C.

1711 {
1712  _output_position_set = true;
1713  _output_position = p;
1715 
1716  if (_executioner.get())
1717  _executioner->parentOutputPositionChanged();
1718 }
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 2243 of file MooseApp.C.

2244 {
2245  _recover = value;
2246 }
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 2237 of file MooseApp.C.

Referenced by FEProblemBase::setRestartFile().

2238 {
2239  _restart = value;
2240 }
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:1753
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 1760 of file MooseApp.C.

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

1761 {
1762  _start_time_set = true;
1763  _start_time = time;
1764 }
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 688 of file MooseApp.C.

Referenced by run().

689 {
690  TIME_SECTION("setupOptions", 5, "Setting Up Options");
691 
692  // Print the header, this is as early as possible
693  auto hdr = header();
694  if (hdr.length() != 0)
695  {
696  if (multiAppLevel() > 0)
698  Moose::out << hdr << std::endl;
699  }
700 
701  if (getParam<bool>("error_unused"))
702  setCheckUnusedFlag(true);
703  else if (getParam<bool>("allow_unused"))
704  setCheckUnusedFlag(false);
705 
706  if (getParam<bool>("error_override"))
708 
709  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
710 
711  _test_checkpoint_half_transient = getParam<bool>("test_checkpoint_half_transient");
712 
713  if (isParamValid("output_wall_time_interval"))
714  {
715  const auto output_wall_time_interval = getParam<Real>("output_wall_time_interval");
716  if (output_wall_time_interval <= 0)
717  mooseError("--output-wall-time-interval must be greater than zero.");
718  }
719 
720  // The no_timing flag takes precedence over the timing flag.
721  if (getParam<bool>("no_timing"))
722  {
723  _pars.set<bool>("timing") = false;
724 
725  _perf_graph.setActive(false);
726  }
727 
728  if (isParamValid("trap_fpe") && isParamValid("no_trap_fpe"))
729  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
730  if (isParamValid("trap_fpe"))
731  _trap_fpe = true;
732  else if (isParamValid("no_trap_fpe"))
733  _trap_fpe = false;
734 
735  // Turn all warnings in MOOSE to errors (almost see next logic block)
736  Moose::_warnings_are_errors = getParam<bool>("error");
737 
738  // Deprecated messages can be toggled to errors independently from everything else.
739  Moose::_deprecated_is_error = getParam<bool>("error_deprecated");
740 
741  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
742  {
743  // Toggle the color console off
744  Moose::setColorConsole(true, true); // set default color condition
745  if (getParam<bool>("no_color"))
746  Moose::setColorConsole(false);
747 
748  char * c_color = std::getenv("MOOSE_COLOR");
749  std::string color = "on";
750  if (c_color)
751  color = c_color;
752  if (getParam<std::string>("color") != "default-on")
753  color = getParam<std::string>("color");
754 
755  if (color == "auto")
757  else if (color == "on")
758  Moose::setColorConsole(true, true);
759  else if (color == "off")
760  Moose::setColorConsole(false);
761  else
762  mooseWarning("ignoring invalid --color arg (want 'auto', 'on', or 'off')");
763  }
764 
765  // this warning goes below --color processing to honor that setting for
766  // the warning. And below settings for warnings/error setup.
767  if (getParam<bool>("no_color"))
768  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
769 
770 // If there's no threading model active, but the user asked for
771 // --n-threads > 1 on the command line, throw a mooseError. This is
772 // intended to prevent situations where the user has potentially
773 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
774 // asking for multiple threads, not knowing that there will never be
775 // any threads launched.
776 #if !LIBMESH_USING_THREADS
777  if (libMesh::command_line_value("--n-threads", 1) > 1)
778  mooseError("You specified --n-threads > 1, but there is no threading model active!");
779 #endif
780 
781  // Build a minimal running application, ignoring the input file.
782  if (getParam<bool>("minimal"))
784 
785  else if (getParam<bool>("display_version"))
786  {
787  Moose::out << getPrintableVersion() << std::endl;
788  _ready_to_exit = true;
789  return;
790  }
791  else if (getParam<bool>("help"))
792  {
793  _command_line->printUsage();
794  _ready_to_exit = true;
795  }
796  else if (isParamValid("dump"))
797  {
798  // Get command line argument following --dump on command line
799  std::string following_arg = getParam<std::string>("dump");
800 
801  // The argument following --dump is a parameter search string,
802  // which can be empty.
803  std::string param_search;
804  if (!following_arg.empty() && (following_arg.find('-') != 0))
805  param_search = following_arg;
806 
807  JsonSyntaxTree tree(param_search);
808 
809  {
810  TIME_SECTION("dump", 1, "Building Syntax Tree");
812  }
813 
814  // Turn off live printing so that it doesn't mess with the dump
816 
817  JsonInputFileFormatter formatter;
818  Moose::out << "\n### START DUMP DATA ###\n"
819  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###" << std::endl;
820  _ready_to_exit = true;
821  }
822  else if (isParamValid("registry"))
823  {
825 
826  Moose::out << "Label\tType\tName\tClass\tFile\n";
827 
828  auto & objmap = Registry::allObjects();
829  for (auto & entry : objmap)
830  for (auto & obj : entry.second)
831  Moose::out << entry.first << "\tobject\t" << obj->name() << "\t" << obj->_classname << "\t"
832  << obj->_file << "\n";
833 
834  auto & actmap = Registry::allActions();
835  for (auto & entry : actmap)
836  {
837  for (auto & act : entry.second)
838  Moose::out << entry.first << "\taction\t" << act->_name << "\t" << act->_classname << "\t"
839  << act->_file << "\n";
840  }
841 
842  _ready_to_exit = true;
843  }
844  else if (isParamValid("registry_hit"))
845  {
847 
848  Moose::out << "### START REGISTRY DATA ###\n";
849 
850  hit::Section root("");
851  auto sec = new hit::Section("registry");
852  root.addChild(sec);
853  auto objsec = new hit::Section("objects");
854  sec->addChild(objsec);
855 
856  auto & objmap = Registry::allObjects();
857  for (auto & entry : objmap)
858  for (auto & obj : entry.second)
859  {
860  auto ent = new hit::Section("entry");
861  objsec->addChild(ent);
862  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
863  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "object"));
864  ent->addChild(new hit::Field("name", hit::Field::Kind::String, obj->name()));
865  ent->addChild(new hit::Field("class", hit::Field::Kind::String, obj->_classname));
866  ent->addChild(new hit::Field("file", hit::Field::Kind::String, obj->_file));
867  }
868 
869  auto actsec = new hit::Section("actions");
870  sec->addChild(actsec);
871  auto & actmap = Registry::allActions();
872  for (auto & entry : actmap)
873  for (auto & act : entry.second)
874  {
875  auto ent = new hit::Section("entry");
876  actsec->addChild(ent);
877  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
878  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "action"));
879  ent->addChild(new hit::Field("task", hit::Field::Kind::String, act->_name));
880  ent->addChild(new hit::Field("class", hit::Field::Kind::String, act->_classname));
881  ent->addChild(new hit::Field("file", hit::Field::Kind::String, act->_file));
882  }
883 
884  Moose::out << root.render();
885 
886  Moose::out << "\n### END REGISTRY DATA ###\n";
887  _ready_to_exit = true;
888  }
889  else if (isParamValid("definition"))
890  {
892 
893  JsonSyntaxTree tree("");
895  SONDefinitionFormatter formatter;
896  Moose::out << "%-START-SON-DEFINITION-%\n"
897  << formatter.toString(tree.getRoot()) << "\n%-END-SON-DEFINITION-%\n";
898  _ready_to_exit = true;
899  }
900  else if (isParamValid("yaml"))
901  {
903 
905 
906  // Get command line argument following --yaml on command line
907  std::string yaml_following_arg = getParam<std::string>("yaml");
908 
909  // If the argument following --yaml is non-existent or begins with
910  // a dash, call buildFullTree() with an empty string, otherwise
911  // pass the argument following --yaml.
912  if (yaml_following_arg.empty() || (yaml_following_arg.find('-') == 0))
914  else
915  _builder.buildFullTree(yaml_following_arg);
916 
917  _ready_to_exit = true;
918  }
919  else if (isParamValid("json"))
920  {
922 
923  // Get command line argument following --json on command line
924  std::string json_following_arg = getParam<std::string>("json");
925 
926  // The argument following --json is a parameter search string,
927  // which can be empty.
928  std::string search;
929  if (!json_following_arg.empty() && (json_following_arg.find('-') != 0))
930  search = json_following_arg;
931 
932  JsonSyntaxTree tree(search);
934 
935  Moose::out << "**START JSON DATA**\n" << tree.getRoot().dump(2) << "\n**END JSON DATA**\n";
936  _ready_to_exit = true;
937  }
938  else if (getParam<bool>("syntax"))
939  {
941 
942  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
943  Moose::out << "**START SYNTAX DATA**\n";
944  for (const auto & it : syntax)
945  Moose::out << it.first << "\n";
946  Moose::out << "**END SYNTAX DATA**\n" << std::endl;
947  _ready_to_exit = true;
948  }
949  else if (getParam<bool>("apptype"))
950  {
952 
953  Moose::out << "MooseApp Type: " << type() << std::endl;
954  _ready_to_exit = true;
955  }
956  else if (getInputFileNames().size())
957  {
958  if (isParamValid("recover"))
959  {
960  // We need to set the flag manually here since the recover parameter is a string type (takes
961  // an optional filename)
962  _recover = true;
963 
964  // Get command line argument following --recover on command line
965  std::string recover_following_arg = getParam<std::string>("recover");
966 
967  // If the argument following --recover is non-existent or begins with
968  // a dash then we are going to eventually find the newest recovery file to use
969  if (!(recover_following_arg.empty() || (recover_following_arg.find('-') == 0)))
970  _restart_recover_base = recover_following_arg;
971  }
972 
973  // In the event that we've parsed once before already in MooseMain, we
974  // won't need to parse again
975  if (!_parser->root())
976  _parser->parse();
977 
978  _builder.build();
979 
980  if (isParamValid("mesh_only"))
981  {
982  _syntax.registerTaskName("mesh_only", true);
983  _syntax.addDependency("mesh_only", "setup_mesh_complete");
984  _syntax.addDependency("determine_system_type", "mesh_only");
985  _action_warehouse.setFinalTask("mesh_only");
986  }
987  else if (isParamValid("split_mesh"))
988  {
989  _split_mesh = true;
990  _syntax.registerTaskName("split_mesh", true);
991  _syntax.addDependency("split_mesh", "setup_mesh_complete");
992  _syntax.addDependency("determine_system_type", "split_mesh");
993  _action_warehouse.setFinalTask("split_mesh");
994  }
996 
997  // Setup the AppFileBase for use by the Outputs or other systems that need output file info
998  {
999  // Extract the CommonOutputAction
1000  const auto common_actions = _action_warehouse.getActions<CommonOutputAction>();
1001  mooseAssert(common_actions.size() <= 1, "Should not be more than one CommonOutputAction");
1002  const Action * common = common_actions.empty() ? nullptr : *common_actions.begin();
1003 
1004  // If file_base is set in CommonOutputAction through parsing input, obtain the file_base
1005  if (common && common->isParamValid("file_base"))
1006  {
1007  _output_file_base = common->getParam<std::string>("file_base");
1008  _file_base_set_by_user = true;
1009  }
1010  else if (isUltimateMaster())
1011  {
1012  // if this app is a master, we use the first input file name as the default file base
1013  std::string base = getLastInputFileName();
1014  size_t pos = base.find_last_of('.');
1015  _output_file_base = base.substr(0, pos);
1016  // Note: we did not append "_out" in the file base here because we do not want to
1017  // have it in between the input file name and the object name for Output/*
1018  // syntax.
1019  }
1020  // default file base for multiapps is set by MultiApp
1021  }
1022  }
1023  else if (isParamValid("input_file"))
1024  {
1025  mooseAssert(getInputFileNames().empty(), "Should be empty");
1026  mooseError("No input files specified. Add -i <inputfile> to your command line.");
1027  }
1028  else if (isParamValid("language_server"))
1029  {
1031 
1032  // Reset output to the buffer what was cached before it was turned it off
1033  if (!Moose::out.rdbuf() && _output_buffer_cache)
1034  Moose::out.rdbuf(_output_buffer_cache);
1035 
1036  // Start a language server that communicates using an iostream connection
1037  MooseServer moose_server(*this);
1038 
1039  moose_server.run();
1040 
1041  _ready_to_exit = true;
1042  }
1043 
1044  else /* The catch-all case for bad options or missing options, etc. */
1045  {
1046  if (_check_input)
1047  mooseError("You specified --check-input, but did not provide an input file. Add -i "
1048  "<inputfile> to your command line.");
1049 
1050  _command_line->printUsage();
1051 
1052  _ready_to_exit = true;
1053  }
1054 
1055  Moose::out << std::flush;
1056 }
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:1315
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:644
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:214
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:333
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:209
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:1066
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:1489
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:645
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:350
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:638
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2231
const std::vector< std::string > & getInputFileNames() const
Definition: MooseApp.C:1059
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:682
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:2249
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 1554 of file MooseApp.C.

Referenced by run().

1555 {
1556  if (isParamValid("show_inputs"))
1557  {
1558  auto copy_syntax = _pars.getCommandLineSyntax("copy_inputs");
1559  std::vector<std::string> dirs;
1560  const auto installable_inputs = getInstallableInputs();
1561 
1562  if (installable_inputs == "")
1563  {
1564  Moose::out
1565  << "Show inputs has not been overriden in this application.\nContact the developers of "
1566  "this appication and request that they override \"MooseApp::getInstallableInputs\".\n";
1567  }
1568  else
1569  {
1570  mooseAssert(!copy_syntax.empty(), "copy_inputs sytnax should not be empty");
1571 
1572  MooseUtils::tokenize(installable_inputs, dirs, 1, " ");
1573  Moose::out << "The following directories are installable into a user-writeable directory:\n\n"
1574  << installable_inputs << '\n'
1575  << "\nTo install one or more directories of inputs, execute the binary with the \""
1576  << copy_syntax[0] << "\" flag. e.g.:\n$ " << _command_line->getExecutableName()
1577  << ' ' << copy_syntax[0] << ' ' << dirs[0] << '\n';
1578  }
1579  return true;
1580  }
1581  return false;
1582 }
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision.h file.
Definition: MooseApp.C:1585
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(), 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(), ArrayDGDiffusion::computeQpJacobian(), InterfaceReaction::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(), InterfaceReaction::computeQpResidual(), ADDGAdvection::computeQpResidual(), ArrayDGDiffusion::computeQpResidual(), CoupledTiedValueConstraint::computeQpResidual(), TiedValueConstraint::computeQpResidual(), ADDGDiffusion::computeQpResidual(), DGDiffusion::computeQpResidual(), LinearNodalConstraint::computeQpResidual(), HFEMTestJump::computeQpResidual(), HFEMTrialJump::computeQpResidual(), EqualValueBoundaryConstraint::computeQpResidual(), EqualValueEmbeddedConstraint::computeQpResidual(), FEProblemBase::computeSystems(), FEProblemBase::computeUserObjectByName(), FEProblemBase::computeUserObjects(), FEProblemBase::computeUserObjectsInternal(), DisplacedProblem::createQRules(), FEProblemBase::createQRules(), createRecoverablePerfGraph(), DumpObjectsProblem::deduceNecessaryParameters(), DumpObjectsProblem::dumpObjectHelper(), FEProblemBase::duplicateVariableCheck(), ElementGroupCentroidPositions::ElementGroupCentroidPositions(), MooseBase::errorPrefix(), AB2PredictorCorrector::estimateTimeError(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::execTransfers(), WebServerControl::execute(), 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(), LinearFVDiffusion::initialSetup(), LinearFVAdvection::initialSetup(), ArrayDGDiffusion::initQpResidual(), AdvancedOutput::initShowHideLists(), RelationshipManager::isType(), FEProblemBase::logAdd(), MaterialFunctorConverterTempl< T >::MaterialFunctorConverterTempl(), MooseObject::MooseObject(), DisplacedProblem::numVectorTags(), SubProblem::numVectorTags(), Console::output(), AdvancedOutput::output(), ConsoleUtils::outputExecutionInformation(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), MooseServer::parseDocumentForDiagnostics(), ProjectedStatefulMaterialStorageAction::processProperty(), recursivelyCreateExecutors(), SolutionInvalidInterface::registerInvalidSolutionInternal(), FEProblemBase::restoreMultiApps(), MeshRepairGenerator::separateSubdomainsByElementType(), FEProblemBase::setCoupling(), setupOptions(), WebServerControl::startServer(), 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  params.addParam<bool>(
348  "use_legacy_initial_residual_evaluation_bahavior",
349  true,
350  "The legacy behavior performs an often times redundant residual evaluation before the "
351  "solution modifying objects are executed prior to the initial (0th nonlinear iteration) "
352  "residual evaluation. The new behavior skips that redundant residual evaluation unless the "
353  "parameter Executioner/use_pre_SMO_residual is set to true.");
354 
355  params.addParam<bool>(
357  false,
358  "Set true to enable data-driven mesh generation, which is an experimental feature");
359 
360  MooseApp::addAppParam(params);
361 
362  return params;
363 }
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 1910 of file MooseApp.C.

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

1912 {
1913  if (processor_id() != 0)
1914  mooseError("MooseApp::writeRestartableMetaData(): Should only run on processor 0");
1915 
1916  const auto & map_name = getRestartableDataMapName(name);
1917  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
1918 
1920  return writer.write(meta_data_folder_base);
1921 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:2404
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:2782
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:2809

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

1925 {
1926  std::vector<std::filesystem::path> paths;
1927 
1928  if (processor_id() == 0)
1929  for (const auto & name_map_pair : _restartable_meta_data)
1930  {
1931  const auto map_paths = writeRestartableMetaData(name_map_pair.first, folder_base);
1932  paths.insert(paths.end(), map_paths.begin(), map_paths.end());
1933  }
1934 
1935  return paths;
1936 }
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:1910
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(), GhostHigherDLowerDPointNeighbors::clone(), GhostEverything::clone(), GhostLowerDElems::clone(), LibmeshPartitioner::clone(), PetscExternalPartitioner::clone(), HierarchicalGridPartitioner::clone(), GridPartitioner::clone(), ElementSideNeighborLayers::clone(), ElementPointNeighborLayers::clone(), RedistributeProperties::clone(), ProxyRelationshipManager::clone(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobianTags(), FEProblemBase::computeLinearSystemTags(), 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(), FileMeshGenerator::generate(), SideSetsFromNormalsGenerator::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(), SpiralAnnularMesh::safeClone(), ConcentricCircleMesh::safeClone(), RinglebMesh::safeClone(), AnnularMesh::safeClone(), GeneratedMesh::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(), FEProblemBase::solveLinearSystem(), 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(), SolverSystem::checkInvalidSolution(), 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(), FEProblemBase::computeLinearSystemTags(), 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(), NonlinearSystemBase::setInitialSolution(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), FEProblemSolve::solve(), FixedPointSolve::solve(), NonlinearSystem::solve(), EigenProblem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::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: