https://mooseframework.inl.gov
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

torch::DeviceType getLibtorchDevice () const
 Get the device torch is supposed to be running on. More...
 
virtual ~MooseApp ()
 
TheWarehousetheWarehouse ()
 
virtual std::string getPrintableName () const
 Get printable name of the application. More...
 
virtual std::string appBinaryName () const
 
int exitCode () const
 Get the shell exit code for the application. More...
 
void setExitCode (const int exit_code)
 Sets the exit code that the application will exit with. More...
 
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...
 
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< libMesh::ExodusII_IO > &&exreader)
 Set the Exodus reader to restart variables from an Exodus mesh file. More...
 
libMesh::ExodusII_IOgetExReaderForRestart () 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 OutputWarehousegetOutputWarehouse () const
 
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...
 
bool useMasterMesh () const
 Returns whether to use the parent app mesh as the mesh for this 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...
 
ChainControlDataSystemgetChainControlDataSystem ()
 Gets the system that manages the ChainControls. 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< libMesh::Parallel::CommunicatorgetCommunicator () 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...
 
bool forceRestart () const
 Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoints); used within RestartableDataReader. More...
 
bool unusedFlagIsWarning () const
 Returns whether the flag for unused parameters is set to throw a warning only. More...
 
bool unusedFlagIsError () const
 Returns whether the flag for unused parameters is set to throw an error. More...
 
void setMFEMDevice (const std::string &device_string, Moose::PassKey< MFEMExecutioner >)
 Create/configure the MFEM device with the provided device_string. More...
 
std::shared_ptr< mfem::Device > getMFEMDevice (Moose::PassKey< MultiApp >)
 Get the MFEM device object. More...
 
const std::set< std::string > & getMFEMDevices (Moose::PassKey< MultiApp >) const
 Get the configured MFEM devices. More...
 
const Parallel::Communicatorcomm () 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...
 
SolutionInvaliditysolutionInvalidity ()
 Get the SolutionInvalidity for this app. More...
 
const SolutionInvaliditysolutionInvalidity () const
 
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)
 
static void addInputParam (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 libMesh::Parameters &params)
 Helper method for dynamic loading of objects. More...
 
void loadLibraryAndDependencies (const std::string &library_filename, const libMesh::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 (const 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...
 
void outputMachineReadableData (const std::string &param, const std::string &start_marker, const std::string &end_marker, const std::string &data) const
 Outputs machine readable data (JSON, YAML, etc.) either to the screen (if no filename was provided as an argument to the parameter param) or to a file (if a filename was provided). 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
 

Static Protected Member Functions

static void addCapability (const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
 register a new capability More...
 
static void addCapability (const std::string &capability, const char *value, const std::string &doc)
 

Protected Attributes

const 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< libMesh::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...
 
std::string _early_exit_param
 Indicates if simulation is ready to exit, and keeps track of which param caused it to exit. More...
 
bool _ready_to_exit
 
int _exit_code
 The exit code. More...
 
bool _initial_from_file
 This variable indicates when a request has been made to restart from an Exodus file. More...
 
std::shared_ptr< libMesh::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...
 
const bool _force_restart
 Whether or not we are forcefully attempting to load checkpoints (–force-restart) 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< libMesh::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...
 
const std::string _name
 The name of this class. 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 registerCapabilities ()
 Register all base MooseApp capabilities to the Moose::Capabilities registry. More...
 
void removeRelationshipManager (std::shared_ptr< RelationshipManager > relationship_manager)
 Purge this relationship manager from meshes and DofMaps and finally from us. More...
 
torch::DeviceType determineLibtorchDeviceType (const MooseEnum &device) const
 Function to determine the device which should be used by libtorch on this application. 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 libMesh::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 ()
 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 ()
 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 bool _use_master_mesh
 Whether to use the parent app mesh for this app. 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...
 
ChainControlDataSystem _chain_control_system
 The system that manages the ChainControls. 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...
 
const torch::DeviceType _libtorch_device
 The libtorch device this app is using. More...
 
std::shared_ptr< mfem::Device > _mfem_device
 The MFEM Device object. More...
 
std::set< std::string > _mfem_devices
 MFEM supported devices based on user-provided config. 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 96 of file MooseApp.h.

Member Enumeration Documentation

◆ RegistrationType

Enumeration for holding the valid types of dynamic registrations allowed.

Enumerator
APPLICATION 
REGALL 

Definition at line 1516 of file MooseApp.h.

1517  {
1518  APPLICATION,
1519  REGALL
1520  };

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

1271  {
1272  OFF,
1273  WARN_UNUSED,
1274  ERROR_UNUSED
enum MooseApp::UNUSED_CHECK _enable_unused_check

Constructor & Destructor Documentation

◆ ~MooseApp()

MooseApp::~MooseApp ( )
virtual

Definition at line 1169 of file MooseApp.C.

1170 {
1171 #ifdef HAVE_GPERFTOOLS
1172  // CPU profiling stop
1173  if (_cpu_profiling)
1174  ProfilerStop();
1175  // Heap profiling stop
1176  if (_heap_profiling)
1177  HeapProfilerStop();
1178 #endif
1180  _the_warehouse.reset();
1181  _executioner.reset();
1182 
1183  // Don't wait for implicit destruction of input parameter storage
1185 
1186  // This is dirty, but I don't know what else to do. Obviously, others
1187  // have had similar problems if you look above. In specific, the
1188  // dlclose below on macs is destructing some data that does not
1189  // belong to it in garbage collection. So... don't even give
1190  // dlclose an option
1191  _restartable_data.clear();
1192 
1193  // Remove this app's parameters from the AppFactory
1195 
1196 #ifdef LIBMESH_HAVE_DLOPEN
1197  // Close any open dynamic libraries
1198  for (const auto & lib_pair : _lib_handles)
1199  dlclose(lib_pair.second.library_handle);
1200 #endif
1201 }
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1523
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
const InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:161
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1218
void clearAppParams(const InputParameters &params, const ClearAppParamsKey)
Clears the stored parameters for the given application parameteres.
Definition: AppFactory.C:49
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1567
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1348
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:18
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1564
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1200
void clear()
This method deletes all of the Actions in the warehouse.

◆ MooseApp()

MooseApp::MooseApp ( const InputParameters parameters)
protected

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

Definition at line 435 of file MooseApp.C.

436  : ConsoleStreamInterface(*this),
437  PerfGraphInterface(*this, "MooseApp"),
438  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
439  "_comm")), // Can't call getParam() before pars is set
440  // The use of AppFactory::getAppParams() is atrocious. However, a long time ago
441  // we decided to copy construct parameters in each derived application...
442  // which means that the "parameters" we get if someone derives from MooseApp are
443  // actually a copy of the ones built by the factory. Because we have unique
444  // application names, this allows us to reference (using _pars and MooseBase)
445  // the actual const parameters that the AppFactory made for this application
446  MooseBase(AppFactory::instance().getAppParams(parameters).get<std::string>("_type"),
447  AppFactory::instance().getAppParams(parameters).get<std::string>("_app_name"),
448  *this,
449  AppFactory::instance().getAppParams(parameters)),
450  _pars(AppFactory::instance().getAppParams(parameters)),
451  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
452  _file_base_set_by_user(false),
453  _output_position_set(false),
454  _start_time_set(false),
455  _start_time(0.0),
456  _global_time_offset(0.0),
457  _input_parameter_warehouse(std::make_unique<InputParameterWarehouse>()),
458  _action_factory(*this),
460  _output_warehouse(*this),
461  _parser(_pars.get<std::shared_ptr<Parser>>("_parser")),
467  _use_executor(_pars.get<bool>("use_executor")),
468  _null_executor(NULL),
469  _use_nonlinear(true),
470  _use_eigen_value(false),
472  _factory(*this),
473  _error_overridden(false),
474  _early_exit_param(""),
475  _ready_to_exit(false),
476  _exit_code(0),
477  _initial_from_file(false),
479  _recover(false),
480  _restart(false),
481  _split_mesh(false),
482  _use_split(_pars.get<bool>("use_split")),
483  _force_restart(_pars.get<bool>("force_restart")),
484 #ifdef DEBUG
485  _trap_fpe(true),
486 #else
487  _trap_fpe(false),
488 #endif
490  _check_input(getParam<bool>("check_input")),
491  _multiapp_level(isParamValid("_multiapp_level") ? _pars.get<unsigned int>("_multiapp_level")
492  : 0),
493  _multiapp_number(isParamValid("_multiapp_number") ? _pars.get<unsigned int>("_multiapp_number")
494  : 0),
495  _use_master_mesh(_pars.get<bool>("_use_master_mesh")),
496  _master_mesh(isParamValid("_master_mesh") ? _pars.get<const MooseMesh *>("_master_mesh")
497  : nullptr),
498  _master_displaced_mesh(isParamValid("_master_displaced_mesh")
499  ? _pars.get<const MooseMesh *>("_master_displaced_mesh")
500  : nullptr),
501  _mesh_generator_system(*this),
502  _chain_control_system(*this),
505  _output_buffer_cache(nullptr),
506  _automatic_automatic_scaling(getParam<bool>("automatic_automatic_scaling")),
507  _initial_backup(getParam<std::unique_ptr<Backup> *>("_initial_backup"))
508 #ifdef MOOSE_LIBTORCH_ENABLED
509  ,
510  _libtorch_device(determineLibtorchDeviceType(getParam<MooseEnum>("libtorch_device")))
511 #endif
512 #ifdef MOOSE_MFEM_ENABLED
513  ,
514  _mfem_device(isParamValid("_mfem_device")
515  ? getParam<std::shared_ptr<mfem::Device>>("_mfem_device")
516  : nullptr),
518  isParamValid("_mfem_devices")
519  ? std::set<std::string>(getParam<std::vector<std::string>>("_mfem_devices").begin(),
520  getParam<std::vector<std::string>>("_mfem_devices").end())
521  : std::set<std::string>{})
522 #endif
523 {
524  if (&parameters != &_pars)
525  {
526  const auto show_trace = Moose::show_trace;
527  Moose::show_trace = false;
528  const std::string bad_params = "(InputParameters parameters)";
529  const std::string good_params = "(const InputParameters & parameters)";
530  const std::string source_constructor = type() + "::" + type();
531  mooseDoOnce(mooseDeprecated(type(),
532  " copy-constructs its input parameters.\n\n",
533  "This is deprecated and will not be allowed in the future.\n\n",
534  "In ",
535  type(),
536  ".C, change:\n ",
537  source_constructor,
538  bad_params,
539  " -> ",
540  source_constructor,
541  good_params,
542  "\n\n",
543  "In ",
544  type(),
545  ".h, change:\n ",
546  type(),
547  bad_params,
548  "; -> ",
549  type(),
550  good_params,
551  ";"));
553  }
554 
555  // Set the TIMPI sync type via --timpi-sync
556  const auto & timpi_sync = _pars.get<std::string>("timpi_sync");
557  const_cast<Parallel::Communicator &>(comm()).sync_type(timpi_sync);
558 
559 #ifdef HAVE_GPERFTOOLS
560  if (isUltimateMaster())
561  {
562  bool has_cpu_profiling = false;
563  bool has_heap_profiling = false;
564  static std::string cpu_profile_file;
565  static std::string heap_profile_file;
566 
567  // For CPU profiling, users need to have environment 'MOOSE_PROFILE_BASE'
568  if (std::getenv("MOOSE_PROFILE_BASE"))
569  {
570  has_cpu_profiling = true;
571  cpu_profile_file =
572  std::getenv("MOOSE_PROFILE_BASE") + std::to_string(_comm->rank()) + ".prof";
573  // create directory if needed
574  auto name = MooseUtils::splitFileName(cpu_profile_file);
575  if (!name.first.empty())
576  {
577  if (processor_id() == 0)
578  MooseUtils::makedirs(name.first.c_str());
579  _comm->barrier();
580  }
581  }
582 
583  // For Heap profiling, users need to have 'MOOSE_HEAP_BASE'
584  if (std::getenv("MOOSE_HEAP_BASE"))
585  {
586  has_heap_profiling = true;
587  heap_profile_file = std::getenv("MOOSE_HEAP_BASE") + std::to_string(_comm->rank());
588  // create directory if needed
589  auto name = MooseUtils::splitFileName(heap_profile_file);
590  if (!name.first.empty())
591  {
592  if (processor_id() == 0)
593  MooseUtils::makedirs(name.first.c_str());
594  _comm->barrier();
595  }
596  }
597 
598  // turn on profiling only on selected ranks
599  if (isParamSetByUser("gperf_profiler_on"))
600  {
601  auto rankstr = getParam<std::string>("gperf_profiler_on");
602  std::vector<processor_id_type> ranks;
603  bool success = MooseUtils::tokenizeAndConvert(rankstr, ranks, ", ");
604  if (!success)
605  mooseError("Invalid argument for --gperf-profiler-on: '", rankstr, "'");
606  for (auto & rank : ranks)
607  {
608  if (rank >= _comm->size())
609  mooseError("Invalid argument for --gperf-profiler-on: ",
610  rank,
611  " is greater than or equal to ",
612  _comm->size());
613  if (rank == _comm->rank())
614  {
615  _cpu_profiling = has_cpu_profiling;
616  _heap_profiling = has_heap_profiling;
617  }
618  }
619  }
620  else
621  {
622  _cpu_profiling = has_cpu_profiling;
623  _heap_profiling = has_heap_profiling;
624  }
625 
626  if (_cpu_profiling)
627  if (!ProfilerStart(cpu_profile_file.c_str()))
628  mooseError("CPU profiler is not started properly");
629 
630  if (_heap_profiling)
631  {
632  HeapProfilerStart(heap_profile_file.c_str());
633  if (!IsHeapProfilerRunning())
634  mooseError("Heap profiler is not started properly");
635  }
636  }
637 #else
638  if (std::getenv("MOOSE_PROFILE_BASE") || std::getenv("MOOSE_HEAP_BASE"))
639  mooseError("gperftool is not available for CPU or heap profiling");
640 #endif
641 
642  // If this will be a language server then turn off output until that starts
643  if (isParamValid("language_server") && getParam<bool>("language_server"))
644  _output_buffer_cache = Moose::out.rdbuf(nullptr);
645 
648 
649  _the_warehouse = std::make_unique<TheWarehouse>();
650  _the_warehouse->registerAttribute<AttribMatrixTags>("matrix_tags", 0);
651  _the_warehouse->registerAttribute<AttribVectorTags>("vector_tags", 0);
652  _the_warehouse->registerAttribute<AttribExecOns>("exec_ons", 0);
653  _the_warehouse->registerAttribute<AttribSubdomains>("subdomains", 0);
654  _the_warehouse->registerAttribute<AttribBoundaries>("boundaries", 0);
655  _the_warehouse->registerAttribute<AttribThread>("thread", 0);
656  _the_warehouse->registerAttribute<AttribExecutionOrderGroup>("execution_order_group", 0);
657  _the_warehouse->registerAttribute<AttribPreIC>("pre_ic", 0);
658  _the_warehouse->registerAttribute<AttribPreAux>("pre_aux");
659  _the_warehouse->registerAttribute<AttribPostAux>("post_aux");
660  _the_warehouse->registerAttribute<AttribName>("name", "dummy");
661  _the_warehouse->registerAttribute<AttribSystem>("system", "dummy");
662  _the_warehouse->registerAttribute<AttribVar>("variable", -1);
663  _the_warehouse->registerAttribute<AttribInterfaces>("interfaces", 0);
664  _the_warehouse->registerAttribute<AttribSysNum>("sys_num", libMesh::invalid_uint);
665  _the_warehouse->registerAttribute<AttribResidualObject>("residual_object");
666  _the_warehouse->registerAttribute<AttribSorted>("sorted");
667  _the_warehouse->registerAttribute<AttribDisplaced>("displaced", -1);
668 
670 
671  if (isParamValid("_argc") && isParamValid("_argv"))
672  {
673  int argc = getParam<int>("_argc");
674  char ** argv = getParam<char **>("_argv");
675 
676  _sys_info = std::make_unique<SystemInfo>(argc, argv);
677  }
678  if (isParamValid("_command_line"))
679  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
680  else
681  mooseError("Valid CommandLine object required");
682 
683  if (_check_input && isParamSetByUser("recover"))
684  mooseError("Cannot run --check-input with --recover. Recover files might not exist");
685 
686  if (isParamSetByUser("start_in_debugger") && isUltimateMaster())
687  {
688  auto command = getParam<std::string>("start_in_debugger");
689 
690  Moose::out << "Starting in debugger using: " << command << std::endl;
691 
693 
694  std::stringstream command_stream;
695 
696  // This will start XTerm and print out some info first... then run the debugger
697  command_stream << "xterm -e \"echo 'Rank: " << processor_id() << " Hostname: " << hostname
698  << " PID: " << getpid() << "'; echo ''; ";
699 
700  // Figure out how to run the debugger
701  if (command.find("lldb") != std::string::npos || command.find("gdb") != std::string::npos)
702  command_stream << command << " -p " << getpid();
703  else
704  mooseError("Unknown debugger: ",
705  command,
706  "\nIf this is truly what you meant then contact moose-users to have a discussion "
707  "about adding your debugger.");
708 
709  // Finish up the command
710  command_stream << "\""
711  << " & ";
712  std::string command_string = command_stream.str();
713  Moose::out << "Running: " << command_string << std::endl;
714 
715  int ret = std::system(command_string.c_str());
716  libmesh_ignore(ret);
717 
718  // Sleep to allow time for the debugger to attach
719  std::this_thread::sleep_for(std::chrono::seconds(10));
720  }
721 
722  if (isParamSetByUser("stop_for_debugger") && isUltimateMaster())
723  {
724  Moose::out << "\nStopping for " << getParam<unsigned int>("stop_for_debugger")
725  << " seconds to allow attachment from a debugger.\n";
726 
727  Moose::out << "\nAll of the processes you can connect to:\n";
728  Moose::out << "rank - hostname - pid\n";
729 
731 
732  {
733  // The 'false' turns off the serialization warning
734  SerializerGuard sg(_communicator, false); // Guarantees that the processors print in order
735  Moose::err << processor_id() << " - " << hostname << " - " << getpid() << "\n";
736  }
737 
738  Moose::out << "\nWaiting...\n" << std::endl;
739 
740  // Sleep to allow time for the debugger to attach
741  std::this_thread::sleep_for(std::chrono::seconds(getParam<unsigned int>("stop_for_debugger")));
742  }
743 
745  mooseError("Mesh can be passed in only for sub-apps");
746 
748  mooseError("_master_mesh should have been set when _master_displaced_mesh is set");
749 
750 #ifdef MOOSE_MFEM_ENABLED
751  if (_mfem_device)
752  {
753  mooseAssert(!isUltimateMaster(),
754  "The MFEM device should only be auto-set for sub-applications");
755  mooseAssert(!_mfem_devices.empty(),
756  "If we are a sub-application and we have an MFEM device object, then we must know "
757  "its configuration string");
758  }
759 #endif
760 
761  // Data specifically associated with the mesh (meta-data) that will read from the restart
762  // file early during the simulation setup so that they are available to Actions and other objects
763  // that need them during the setup process. Most of the restartable data isn't made available
764  // until all objects have been created and all Actions have been executed (i.e. initialSetup).
766 
767  if (_pars.have_parameter<bool>("use_legacy_dirichlet_bc"))
768  mooseDeprecated("The parameter 'use_legacy_dirichlet_bc' is no longer valid.\n\n",
769  "All Dirichlet boundary conditions are preset by default.\n\n",
770  "Remove said parameter in ",
771  name(),
772  " to remove this deprecation warning.");
773 
775  Moose::out << std::flush;
776 }
777 
778 void
780 {
781  // helper lambdas
782  auto haveCapability = [](const std::string & capability, const std::string & doc)
783  { addCapability(capability, true, doc + " is available."); };
784 
785  auto missingCapability =
786  [](const std::string & capability, const std::string & doc, const std::string & help = "")
787  { addCapability(capability, false, doc + " is not available. " + help); };
788 
789  auto haveCapabilityVersion =
790  [](const std::string & capability, const std::string & doc, const std::string & version)
791  { addCapability(capability, version, doc + " version " + version + " is available."); };
792 
793  auto petscMissingCapability = [](const std::string & capability, const std::string & doc)
794  {
796  capability, false, doc + " is not available. Check your PETSc configure options.");
797  };
798 
799  auto libmeshMissingCapability =
800  [](const std::string & capability, const std::string & doc, const std::string & config_option)
801  {
802  addCapability(capability,
803  false,
804  doc + " is not available. It is controlled by the `" + config_option +
805  "` libMesh configure option.");
806  };
807 
808  // register capabilities
809  if (_trap_fpe)
810  addCapability("trap_fpe",
811  true,
812  "Trapping floating point exceptions is enabled (in debug mode this "
813  "can be disabled using the --no-trap-fpe option).");
814  else
815  addCapability("trap_fpe",
816  false,
817  "Trapping floating point exceptions is not enabled (enable them using "
818  "the --trap-fpe option or by running a debug mode executable).");
819 
820  {
821  const auto doc = "LibTorch machine learning and parallel tensor algebra library";
822 #ifdef MOOSE_LIBTORCH_ENABLED
823  addCapability("libtorch", TORCH_VERSION, doc);
824 #else
825  missingCapability("libtorch",
826  doc,
827  "Check "
828  "https://mooseframework.inl.gov/moose/getting_started/installation/"
829  "install_libtorch.html for "
830  "instructions on how to configure and build moose with libTorch.");
831 #endif
832  }
833 
834  {
835  const auto doc = "MFEM finite element library";
836 #ifdef MOOSE_MFEM_ENABLED
837  haveCapability("mfem", doc);
838 #else
839  missingCapability("mfem",
840  doc,
841  "Install mfem using the scripts/update_and_rebuild_mfem.sh script after "
842  "first running scripts/update_and_rebuild_conduit.sh. Finally, configure "
843  "moose with ./configure --with-mfem");
844 #endif
845  }
846 
847  {
848  const auto doc = "New Engineering Material model Library, version 2";
849 #ifdef NEML2_ENABLED
850  haveCapability("neml2", doc);
851 #else
852  missingCapability("neml2",
853  doc,
854  "Install neml2 using the scripts/update_and_rebuild_neml2.sh script, then "
855  "configure moose with ./configure --with-neml2 --with-libtorch");
856 #endif
857  }
858 
859  {
860  const auto doc = "gperftools code performance analysis and profiling library";
861 #ifdef HAVE_GPERFTOOLS
862  haveCapability("gperftools", doc);
863 #else
864  missingCapability("gperftools",
865  doc,
866  "Check https://mooseframework.inl.gov/application_development/profiling.html "
867  "for instructions on profiling MOOSE based applications.");
868 #endif
869  }
870 
871  {
872  const auto doc = "libPNG portable network graphics format library";
873 #ifdef MOOSE_HAVE_LIBPNG
874  haveCapability("libpng", doc);
875 #else
876  missingCapability("libpng",
877  doc,
878  "Install libpng through conda or your distribution and check that it gets "
879  "detected through pkg-config, then reconfigure and rebuild MOOSE.");
880 #endif
881  }
882 
883  {
884  const auto doc = "NVIDIA GPU parallel computing platform";
885 #ifdef PETSC_HAVE_CUDA
886  haveCapability("cuda", doc);
887 #else
888  missingCapability("cuda", doc, "Add the CUDA bin directory to your path and rebuild PETSc.");
889 #endif
890  }
891 
893  "ad_size",
894  MOOSE_AD_MAX_DOFS_PER_ELEM,
895  "MOOSE was configured and built with a dual number backing store size of " +
896  Moose::stringify(MOOSE_AD_MAX_DOFS_PER_ELEM) +
897  ". Complex simulations with many variables or contact problems may require larger "
898  "values. Reconfigure MOOSE with the --with-derivative-size=<n> option in the root of the "
899  "repository.");
900  {
901  const std::string method = QUOTE(METHOD);
902  addCapability("method", method, "The executable was built with METHOD=\"" + method + "\"");
903  }
904 
905  {
906  const std::string version = QUOTE(LIBMESH_DETECTED_PETSC_VERSION_MAJOR) "." QUOTE(
907  LIBMESH_DETECTED_PETSC_VERSION_MINOR) "." QUOTE(LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR);
908  addCapability("petsc", version, "Using PETSc version " + version + ".");
909  }
910 
911 #ifdef LIBMESH_PETSC_USE_DEBUG
912  addCapability("petsc_debug", true, "PETSc was built with debugging options.");
913 #else
914  addCapability("petsc_debug", false, "PETSc was built without debugging options.");
915 #endif
916 
917  {
918  const auto doc = "SuperLU direct solver";
919 #ifdef LIBMESH_PETSC_HAVE_SUPERLU_DIST
920  haveCapability("superlu", doc);
921 #else
922  petscMissingCapability("superlu", doc);
923 #endif
924  }
925 
926  {
927  const auto doc = "MUltifrontal Massively Parallel sparse direct Solver (MUMPS)";
928 #ifdef LIBMESH_PETSC_HAVE_MUMPS
929  haveCapability("mumps", doc);
930 #else
931  petscMissingCapability("mumps", doc);
932 #endif
933  }
934 
935  {
936  const auto doc = "STRUMPACK - STRUctured Matrix PACKage solver library";
937 #ifdef LIBMESH_PETSC_HAVE_STRUMPACK
938  haveCapability("strumpack", doc);
939 #else
940  petscMissingCapability("strumpack", doc);
941 #endif
942  }
943 
944  {
945  const auto doc = "Parmetis partitioning library";
946 #if defined(LIBMESH_PETSC_HAVE_PARMETIS) || defined(LIBMESH_HAVE_PARMETIS)
947  haveCapability("parmetis", doc);
948 #else
949  petscMissingCapability("parmetis", doc);
950 #endif
951  }
952 
953  {
954  const auto doc = "Chaco graph partitioning library";
955 #ifdef LIBMESH_PETSC_HAVE_CHACO
956  haveCapability("chaco", doc);
957 #else
958  petscMissingCapability("chaco", doc);
959 #endif
960  }
961 
962  {
963  const auto doc = "Party matrix or graph partitioning library";
964 #ifdef LIBMESH_PETSC_HAVE_PARTY
965  haveCapability("party", doc);
966 #else
967  petscMissingCapability("party", doc);
968 #endif
969  }
970 
971  {
972  const auto doc = "PT-Scotch graph partitioning library";
973 #ifdef LIBMESH_PETSC_HAVE_PTSCOTCH
974  haveCapability("ptscotch", doc);
975 #else
976  petscMissingCapability("ptscotch", doc);
977 #endif
978  }
979 
980  {
981  const auto doc = "Scalable Library for Eigenvalue Problem Computations (SLEPc)";
982 #ifdef LIBMESH_HAVE_SLEPC
983  const auto version = QUOTE(LIBMESH_DETECTED_SLEPC_VERSION_MAJOR) "." QUOTE(
984  LIBMESH_DETECTED_SLEPC_VERSION_MINOR) "." QUOTE(LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR);
985  haveCapabilityVersion("slepc", doc, version);
986 #else
987  petscMissingCapability("slepc", doc);
988 #endif
989  }
990 
991  {
992  const auto doc = "Exodus mesh file format library";
993 #ifdef LIBMESH_HAVE_EXODUS_API
994  const std::string version = QUOTE(LIBMESH_DETECTED_EXODUS_VERSION_MAJOR) "." QUOTE(
995  LIBMESH_DETECTED_EXODUS_VERSION_MINOR);
996  haveCapabilityVersion("exodus", doc, version);
997 #else
998  libmeshMissingCapability("exodus", doc, "--enable-exodus");
999 #endif
1000  }
1001 
1002  {
1003  const auto doc = "Netgen meshing library";
1004 #ifdef LIBMESH_HAVE_NETGEN
1005  haveCapability("netgen", doc);
1006 #else
1007  libmeshMissingCapability("netgen", doc, "--enable-netgen");
1008 #endif
1009  }
1010 
1011  {
1012  const auto doc = "Visualization Toolkit (VTK)";
1013 #ifdef LIBMESH_HAVE_VTK
1014  const std::string version = QUOTE(LIBMESH_DETECTED_VTK_VERSION_MAJOR) "." QUOTE(
1015  LIBMESH_DETECTED_VTK_VERSION_MINOR) "." QUOTE(LIBMESH_DETECTED_VTK_VERSION_SUBMINOR);
1016  haveCapabilityVersion("vtk", doc, version);
1017 #else
1018  libmeshMissingCapability("vtk", doc, "--disable-vtk and --enable-vtk-required");
1019 #endif
1020  }
1021 
1022  {
1023  const auto doc = "libcurl - the multiprotocol file transfer library";
1024 #ifdef LIBMESH_HAVE_CURL
1025  haveCapability("curl", doc);
1026 #else
1027  libmeshMissingCapability("curl", doc, "--enable-curl");
1028 #endif
1029  }
1030 
1031  {
1032  const auto doc = "Tecplot post-processing tools API";
1033 #ifdef LIBMESH_HAVE_TECPLOT_API
1034  haveCapability("tecplot", doc);
1035 #else
1036  libmeshMissingCapability("tecplot", doc, "--enable-tecplot");
1037 #endif
1038  }
1039 
1040  {
1041  const auto doc = "Boost C++ library";
1042 #ifdef LIBMESH_HAVE_EXTERNAL_BOOST
1043  haveCapability("boost", doc);
1044 #else
1045  libmeshMissingCapability("boost", doc, "--with-boost");
1046 #endif
1047  }
1048 
1049  // libmesh stuff
1050  {
1051  const auto doc = "Adaptive mesh refinement";
1052 #ifdef LIBMESH_ENABLE_AMR
1053  haveCapability("amr", doc);
1054 #else
1055  libmeshMissingCapability("amr", doc, "--disable-amr");
1056 #endif
1057  }
1058 
1059  {
1060  const auto doc = "nanoflann library for Nearest Neighbor (NN) search with KD-trees";
1061 #ifdef LIBMESH_HAVE_NANOFLANN
1062  haveCapability("nanoflann", doc);
1063 #else
1064  libmeshMissingCapability("nanoflann", doc, "--disable-nanoflann");
1065 #endif
1066  }
1067 
1068 #ifdef LIBMESH_HAVE_FPARSER
1069 #ifdef LIBMESH_HAVE_FPARSER_JIT
1070  addCapability("fparser", "jit", "FParser enabled with just in time compilation support.");
1071 #else
1072  addCapability("fparser", "byte_code", "FParser enabled.");
1073 #endif
1074 #else
1075  addCapability("fparser",
1076  false,
1077  "FParser is disabled, libMesh was likely configured with --disable-fparser.");
1078 #endif
1079 
1080 #ifdef LIBMESH_HAVE_DLOPEN
1081  addCapability(
1082  "dlopen", true, "The dlopen() system call is available to dynamically load libraries.");
1083 #else
1084  addCapability("dlopen",
1085  false,
1086  "The dlopen() system call is not available. Dynamic library loading is "
1087  "not supported on this system.");
1088 #endif
1089 
1090  {
1091  const auto doc = "LibMesh support for threaded execution";
1092 #ifdef LIBMESH_USING_THREADS
1093  haveCapability("threads", doc);
1094 #else
1095  libmeshMissingCapability("threads", doc, "--with-thread-model=tbb,pthread,openmp,auto,none");
1096 #endif
1097  }
1098 
1099  {
1100  const auto doc = "OpenMP multi-platform shared-memory parallel programming API";
1101 #ifdef LIBMESH_HAVE_OPENMP
1102  haveCapability("openmp", doc);
1103 #else
1104  libmeshMissingCapability("openmp", doc, "--with-thread-model=tbb,pthread,openmp,auto,none");
1105 #endif
1106  }
1107  {
1108  const auto doc = "oneAPI Threading Building Blocks (TBB) API";
1109 #ifdef LIBMESH_HAVE_TBB_API
1110  haveCapability("tbb", doc);
1111 #else
1112  libmeshMissingCapability("tbb", doc, "--with-thread-model=tbb,pthread,openmp,auto,none");
1113 #endif
1114  }
1115 
1116  {
1117  const auto doc = "libMesh unique ID support";
1118 #ifdef LIBMESH_ENABLE_UNIQUE_ID
1119  haveCapability("unique_id", doc);
1120 #else
1121  libmeshMissingCapability("unique_id", doc, "--enable-unique-id");
1122 #endif
1123  }
1124 
1125  {
1126  const auto doc = "libMesh default mesh mode";
1127 #ifdef LIBMESH_ENABLE_PARMESH
1128  addCapability("mesh_mode", "distributed", doc);
1129 #else
1130  addCapability("mesh_mode", "replicated", doc);
1131 #endif
1132  }
1133 
1134  addCapability("dof_id_bytes",
1135  static_cast<int>(sizeof(dof_id_type)),
1136  "Degree of freedom (DOF) identifiers use " + Moose::stringify(sizeof(dof_id_type)) +
1137  " bytes for storage. This is controlled by the "
1138  "--with-dof-id-bytes=<1|2|4|8> libMesh configure option.");
1139 
1140  // compiler
1141  {
1142  const auto doc = "Compiler used to build the MOOSE framework.";
1143 #if defined(__clang__)
1144  addCapability("compiler", "clang", doc);
1145 #elif defined(__GNUC__) || defined(__GNUG__)
1146  addCapability("compiler", "gcc", doc);
1147 #elif defined(_MSC_VER)
1148  addCapability("compiler", "msvc", doc);
1149 #else
1150  addCapability("compiler", false, "Unknown compiler");
1151 #endif
1152  }
1153 
1154  // OS related
1155  {
1156  const auto doc = "Operating system this executable is running on.";
1157 #ifdef __APPLE__
1158  addCapability("platform", "darwin", doc);
1159 #elif __WIN32__
1160  addCapability("platform", "win32", doc);
1161 #elif __linux__
1162  addCapability("platform", "linux", doc);
1163 #elif __unix__ // all unices not caught above
1164  addCapability("platform", "unix", doc);
1165 #endif
1166  }
1167 }
ParallelObject(const Parallel::Communicator &comm_in)
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:1264
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1526
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1227
bool show_trace
Set to true (the default) to print the stack trace with error and warning messages - false to omit it...
Definition: Moose.C:765
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:1166
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:837
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:1288
unsigned int n_threads()
PerfGraph & createRecoverablePerfGraph()
Creates a recoverable PerfGraph.
Definition: MooseApp.C:3461
const unsigned int invalid_uint
void registerCapabilities()
Register all base MooseApp capabilities to the Moose::Capabilities registry.
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:1190
torch::DeviceType determineLibtorchDeviceType(const MooseEnum &device) const
Function to determine the device which should be used by libtorch on this application.
Definition: MooseApp.C:3500
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1178
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1523
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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.
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:1261
static const RestartableDataMapName MESH_META_DATA
Definition: MooseApp.h:123
const bool _use_master_mesh
Whether to use the parent app mesh for this app.
Definition: MooseApp.h:1532
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:1187
This attribute describes sorting state.
Definition: TheWarehouse.h:112
bool forceRestart() const
Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoint...
Definition: MooseApp.h:1085
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:1306
std::pair< std::filesystem::path, std::filesystem::path > splitFileName(const T &full_file)
Function for splitting path and filename.
Definition: MooseUtils.h:261
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1324
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:313
const Parallel::Communicator & comm() const
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:205
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
Definition: MooseApp.h:1594
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1196
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1312
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:434
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
RestartableDataReader _rd_reader
Definition: MooseApp.h:1546
static ExecFlagRegistry & getExecFlagRegistry()
Return Singleton instance.
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:1267
const InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:161
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:1230
std::string hostname()
Get the hostname the current process is running on.
Definition: MooseUtils.C:620
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1218
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:1233
int _exit_code
The exit code.
Definition: MooseApp.h:1285
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:1541
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1184
void libmesh_ignore(const Args &...)
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1258
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:1193
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1300
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:1203
ConsoleStreamInterface(MooseApp &app)
A class for providing a helper stream object for writting message to all the Output objects...
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1297
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1280
SolutionInvalidity & createRecoverableSolutionInvalidity()
Creates a recoverable SolutionInvalidity.
Definition: MooseApp.C:3479
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1567
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
Definition: MooseApp.h:1538
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:344
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
const bool _force_restart
Whether or not we are forcefully attempting to load checkpoints (–force-restart) ...
Definition: MooseApp.h:1309
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:18
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:1555
std::string help
void registerRestartableDataMapName(const RestartableDataMapName &name, std::string suffix="")
Reserve a location for storing custom RestartableDataMap objects.
Definition: MooseApp.C:3442
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:1605
ChainControlDataSystem _chain_control_system
The system that manages the ChainControls.
Definition: MooseApp.h:1544
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1294
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1215
const torch::DeviceType _libtorch_device
The libtorch device this app is using.
Definition: MooseApp.h:1586
bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1318
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1209
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1558
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1564
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
Definition: Moose.C:65
static const std::string MESH_META_DATA_SUFFIX
Definition: MooseApp.h:124
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1561
Factory _factory
Definition: MooseApp.h:1277
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1200
Tracks whether the object is on the displaced mesh.
Definition: Attributes.h:481
static void addCapability(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
Definition: MooseApp.C:3556
void makedirs(const std::string &dir_name, bool throw_on_failure=false)
Recursively make directories.
Definition: MooseUtils.C:445
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:1529
const std::shared_ptr< libMesh::Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1169
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
Definition: MooseApp.h:1591
bool _ready_to_exit
Definition: MooseApp.h:1283
const MooseMesh *const _master_mesh
The mesh from master app.
Definition: MooseApp.h:1535
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:1303
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1255
void enableLivePrint()
Enables Live Print.
Definition: PerfGraph.C:57
static char addKnownLabel(const std::string &label)
addKnownLabel whitelists a label as valid for purposes of the checkLabels function.
Definition: Registry.C:84
uint8_t dof_id_type
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282
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:1582
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

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

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

◆ addAppParam()

void MooseApp::addAppParam ( InputParameters params)
static

Definition at line 94 of file MooseApp.C.

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

95 {
96  params.addCommandLineParam<std::string>(
97  "app_to_run", "--app <type>", "Specify the application type to run (case-sensitive)");
98 }
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)

◆ addCapability() [1/2]

void MooseApp::addCapability ( const std::string &  capability,
CapabilityUtils::Type  value,
const std::string &  doc 
)
staticprotected

register a new capability

Definition at line 3556 of file MooseApp.C.

3559 {
3560  Moose::Capabilities::getCapabilityRegistry().add(capability, value, doc);
3561 }
static Capabilities & getCapabilityRegistry()
Definition: Capabilities.C:22
void add(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
Definition: Capabilities.C:33

◆ addCapability() [2/2]

void MooseApp::addCapability ( const std::string &  capability,
const char *  value,
const std::string &  doc 
)
staticprotected

Definition at line 3564 of file MooseApp.C.

3565 {
3566  Moose::Capabilities::getCapabilityRegistry().add(capability, std::string(value), doc);
3567 }
static Capabilities & getCapabilityRegistry()
Definition: Capabilities.C:22
void add(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
Definition: Capabilities.C:33

◆ addExecutor()

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

Definition at line 1961 of file MooseApp.C.

Referenced by recursivelyCreateExecutors().

1964 {
1965  std::shared_ptr<Executor> executor = _factory.create<Executor>(type, name, params);
1966 
1967  if (_executors.count(executor->name()) > 0)
1968  mooseError("an executor with name '", executor->name(), "' already exists");
1969  _executors[executor->name()] = executor;
1970 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1242
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
virtual std::unique_ptr< Base > create()=0
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
Factory _factory
Definition: MooseApp.h:1277
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 1973 of file MooseApp.C.

Referenced by ReadExecutorParamsAction::act().

1976 {
1977  _executor_params[name] = std::make_pair(type, std::make_unique<InputParameters>(params));
1978 }
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:1247
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

◆ addInputParam()

void MooseApp::addInputParam ( InputParameters params)
static

Definition at line 101 of file MooseApp.C.

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

102 {
103  params.addCommandLineParam<std::vector<std::string>>(
104  "input_file", "-i <input file(s)>", "Specify input file(s); multiple files are merged");
105 }
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)

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

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

876  {
878  }
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:1541
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 2989 of file MooseApp.C.

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

2990 {
2991  // We prefer to always add geometric RMs. There is no hurt to add RMs for replicated mesh
2992  // since MeshBase::delete_remote_elements{} is a no-op (empty) for replicated mesh.
2993  // The motivation here is that MooseMesh::_use_distributed_mesh may not be properly set
2994  // at the time we are adding geometric relationship managers. We deleted the following
2995  // old logic to add all geometric RMs regardless of there is a distributed mesh or not.
2996  // Otherwise, all geometric RMs will be improperly ignored for a distributed mesh generator.
2997 
2998  // if (!_action_warehouse.mesh()->isDistributedMesh() && !_split_mesh &&
2999  // (relationship_manager->isType(Moose::RelationshipManagerType::GEOMETRIC) &&
3000  // !(relationship_manager->isType(Moose::RelationshipManagerType::ALGEBRAIC) ||
3001  // relationship_manager->isType(Moose::RelationshipManagerType::COUPLING))))
3002  // return false;
3003 
3004  bool add = true;
3005 
3006  std::set<std::shared_ptr<RelationshipManager>> rms_to_erase;
3007 
3008  for (const auto & existing_rm : _relationship_managers)
3009  {
3010  if (*existing_rm >= *new_rm)
3011  {
3012  add = false;
3013  donateForWhom(*new_rm, *existing_rm);
3014  break;
3015  }
3016  // The new rm did not provide less or the same amount/type of ghosting as the existing rm, but
3017  // what about the other way around?
3018  else if (*new_rm >= *existing_rm)
3019  rms_to_erase.emplace(existing_rm);
3020  }
3021 
3022  if (add)
3023  {
3024  _relationship_managers.emplace(new_rm);
3025  for (const auto & rm_to_erase : rms_to_erase)
3026  {
3027  donateForWhom(*rm_to_erase, *new_rm);
3028  removeRelationshipManager(rm_to_erase);
3029  }
3030  }
3031 
3032  // Inform the caller whether the object was added or not
3033  return add;
3034 }
void removeRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Purge this relationship manager from meshes and DofMaps and finally from us.
Definition: MooseApp.C:3091
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1327

◆ appBinaryName()

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

Definition at line 137 of file MooseApp.h.

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

138  {
140  name = name.substr(0, name.find_last_of("-"));
141  if (name.find_first_of("/") != std::string::npos)
142  name = name.substr(name.find_first_of("/") + 1, std::string::npos);
143  return name;
144  }
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 924 of file MooseApp.h.

925  {
927  }
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:1541
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 2419 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

2420 {
2421  std::string library_name(app_name);
2422 
2423  // Strip off the App part (should always be the last 3 letters of the name)
2424  size_t pos = library_name.find("App");
2425  if (pos != library_name.length() - 3)
2426  mooseError("Invalid application name: ", library_name);
2427  library_name.erase(pos);
2428 
2429  // Now get rid of the camel case, prepend lib, and append the method and suffix
2430  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
2431  QUOTE(METHOD) + ".la";
2432 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::string camelCaseToUnderscore(const std::string &camel_case_name)
Function for converting a camel case name to a name containing underscores.
Definition: MooseUtils.C:564

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

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

3204 {
3205  for (auto & rm : _relationship_managers)
3206  {
3207  if (!rm->isType(rm_type))
3208  continue;
3209 
3210  // RM is already attached (this also handles the geometric early case)
3211  if (_attached_relationship_managers[rm_type].count(rm.get()))
3212  continue;
3213 
3215  {
3216  // The problem is not built yet - so the ActionWarehouse currently owns the mesh
3217  MooseMesh * const mesh = _action_warehouse.mesh().get();
3218 
3219  // "attach_geometric_rm_final = true" inidicate that it is the last chance to attach
3220  // geometric RMs. Therefore, we need to attach them.
3221  if (!rm->attachGeometricEarly() && !attach_geometric_rm_final)
3222  // Will attach them later (during algebraic). But also, we need to tell the mesh that we
3223  // shouldn't be deleting remote elements yet
3224  mesh->allowRemoteElementRemoval(false);
3225  else
3226  {
3227  MeshBase & undisp_mesh_base = mesh->getMesh();
3228  const DofMap * const undisp_sys_dof_map =
3229  _executioner ? &feProblem().getSolverSystem(0).dofMap() : nullptr;
3230  undisp_mesh_base.add_ghosting_functor(
3231  createRMFromTemplateAndInit(*rm, *mesh, undisp_mesh_base, undisp_sys_dof_map));
3232 
3233  // In the final stage, if there is a displaced mesh, we need to
3234  // clone ghosting functors for displacedMesh
3235  if (auto & disp_moose_mesh = _action_warehouse.displacedMesh();
3236  attach_geometric_rm_final && disp_moose_mesh)
3237  {
3238  MeshBase & disp_mesh_base = _action_warehouse.displacedMesh()->getMesh();
3239  const DofMap * disp_sys_dof_map = nullptr;
3240  if (_executioner && feProblem().getDisplacedProblem())
3241  disp_sys_dof_map = &feProblem().getDisplacedProblem()->solverSys(0).dofMap();
3242  disp_mesh_base.add_ghosting_functor(
3243  createRMFromTemplateAndInit(*rm, *disp_moose_mesh, disp_mesh_base, disp_sys_dof_map));
3244  }
3245  else if (_action_warehouse.displacedMesh())
3246  mooseError("The displaced mesh should not yet exist at the time that we are attaching "
3247  "early geometric relationship managers.");
3248 
3249  // Mark this RM as attached
3250  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
3251  _attached_relationship_managers[rm_type].insert(rm.get());
3252  }
3253  }
3254  else // rm_type is algebraic or coupling
3255  {
3256  if (!_executioner && !_executor)
3257  mooseError("We must have an executioner by now or else we do not have to data to add "
3258  "algebraic or coupling functors to in MooseApp::attachRelationshipManagers");
3259 
3260  // Now we've built the problem, so we can use it
3261  auto & problem = feProblem();
3262  auto & undisp_moose_mesh = problem.mesh();
3263  auto & undisp_sys = feProblem().getSolverSystem(0);
3264  auto & undisp_sys_dof_map = undisp_sys.dofMap();
3265  auto & undisp_mesh = undisp_moose_mesh.getMesh();
3266 
3267  if (rm->useDisplacedMesh() && problem.getDisplacedProblem())
3268  {
3270  // We actually need to add this to the FEProblemBase NonlinearSystemBase's DofMap
3271  // because the DisplacedProblem "nonlinear" DisplacedSystem doesn't have any matrices
3272  // for which to do coupling. It's actually horrifying to me that we are adding a
3273  // coupling functor, that is going to determine its couplings based on a displaced
3274  // MeshBase object, to a System associated with the undisplaced MeshBase object (there
3275  // is only ever one EquationSystems object per MeshBase object and visa versa). So here
3276  // I'm left with the choice of whether to pass in a MeshBase object that is *not* the
3277  // MeshBase object that will actually determine the couplings or to pass in the MeshBase
3278  // object that is inconsistent with the System DofMap that we are adding the coupling
3279  // functor for! Let's err on the side of *libMesh* consistency and pass properly paired
3280  // MeshBase-DofMap
3281  problem.addCouplingGhostingFunctor(
3282  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
3283  /*to_mesh = */ false);
3284 
3285  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
3286  {
3287  auto & displaced_problem = *problem.getDisplacedProblem();
3288  auto & disp_moose_mesh = displaced_problem.mesh();
3289  auto & disp_mesh = disp_moose_mesh.getMesh();
3290  const DofMap * const disp_nl_dof_map = &displaced_problem.solverSys(0).dofMap();
3291  displaced_problem.addAlgebraicGhostingFunctor(
3292  createRMFromTemplateAndInit(*rm, disp_moose_mesh, disp_mesh, disp_nl_dof_map),
3293  /*to_mesh = */ false);
3294  }
3295  }
3296  else // undisplaced
3297  {
3299  problem.addCouplingGhostingFunctor(
3300  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
3301  /*to_mesh = */ false);
3302 
3303  else if (rm_type == Moose::RelationshipManagerType::ALGEBRAIC)
3304  problem.addAlgebraicGhostingFunctor(
3305  createRMFromTemplateAndInit(*rm, undisp_moose_mesh, undisp_mesh, &undisp_sys_dof_map),
3306  /*to_mesh = */ false);
3307  }
3308 
3309  // Mark this RM as attached
3310  mooseAssert(!_attached_relationship_managers[rm_type].count(rm.get()), "Already attached");
3311  _attached_relationship_managers[rm_type].insert(rm.get());
3312  }
3313  }
3314 }
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
The relationship managers that have been attached (type -> RMs)
Definition: MooseApp.h:1331
std::shared_ptr< DisplacedProblem > displaced_problem
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::shared_ptr< MooseMesh > & displacedMesh()
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
FEProblemBase & feProblem() const
Definition: MooseApp.C:1954
RelationshipManager & createRMFromTemplateAndInit(const RelationshipManager &template_rm, MooseMesh &moose_mesh, MeshBase &mesh, const libMesh::DofMap *dof_map=nullptr)
Take an input relationship manager, clone it, and then initialize it with provided mesh and optional ...
Definition: MooseApp.C:3133
std::shared_ptr< MooseMesh > & mesh()
virtual libMesh::DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1165
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
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:1327
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:1239
void add_ghosting_functor(GhostingFunctor &ghosting_functor)

◆ 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.

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

Referenced by Checkpoint::output().

1843 {
1844  TIME_SECTION("backup", 2, "Backing Up Application to File");
1845 
1846  preBackup();
1847 
1849  return writer.write(folder_base);
1850 }
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:1218
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:756

◆ backup() [2/2]

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

Backs up the application memory in a Backup.

Returns
The backup

Definition at line 1853 of file MooseApp.C.

Referenced by finalizeRestore(), and restore().

1854 {
1855  TIME_SECTION("backup", 2, "Backing Up Application");
1856 
1858 
1859  preBackup();
1860 
1861  auto backup = std::make_unique<Backup>();
1862  writer.write(*backup->header, *backup->data);
1863 
1864  return backup;
1865 }
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:1218
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:756
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1853

◆ builder()

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

Returns a writable reference to the builder.

Definition at line 246 of file MooseApp.h.

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

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

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

◆ checkInput()

bool MooseApp::checkInput ( ) const
inline

Returns whether the Application is running in check input mode.

Definition at line 947 of file MooseApp.h.

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

◆ checkMetaDataIntegrity()

void MooseApp::checkMetaDataIntegrity ( ) const

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

Definition at line 3393 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act().

3394 {
3395  for (auto map_iter = _restartable_meta_data.begin(); map_iter != _restartable_meta_data.end();
3396  ++map_iter)
3397  {
3398  const RestartableDataMapName & name = map_iter->first;
3399  const RestartableDataMap & meta_data = map_iter->second.first;
3400 
3401  std::vector<std::string> not_declared;
3402 
3403  for (const auto & data : meta_data)
3404  if (!data.declared())
3405  not_declared.push_back(data.name());
3406 
3407  if (!not_declared.empty())
3408  {
3409  std::ostringstream oss;
3410  std::copy(
3411  not_declared.begin(), not_declared.end(), infix_ostream_iterator<std::string>(oss, ", "));
3412 
3413  mooseError("The following '",
3414  name,
3415  "' meta-data properties were retrieved but never declared: ",
3416  oss.str());
3417  }
3418  }
3419 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1513
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:214

◆ checkpointSuffix()

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

The file suffix for the checkpoint mesh.

Definition at line 3037 of file MooseApp.C.

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

3038 {
3039  static const std::string suffix = "-mesh.cpa.gz";
3040  return suffix;
3041 }

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

Referenced by FEProblemBase::addMultiApp(), Moose::Builder::build(), MultiApp::createApp(), Moose::Builder::errorCheck(), ConsoleUtils::outputExecutionInformation(), ConsoleUtils::outputFrameworkInformation(), and MooseServer::parseDocumentForDiagnostics().

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

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

3493 {
3494  return _action_warehouse.getCurrentTaskName() == "create_added_mesh_generators" ||
3496 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1541
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 ( )
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 2222 of file MooseApp.C.

Referenced by run().

2223 {
2224  if (isParamSetByUser("copy_inputs"))
2225  {
2226  if (comm().size() > 1)
2227  mooseError("The --copy-inputs option should not be ran in parallel");
2228 
2229  // Get command line argument following --copy-inputs on command line
2230  auto dir_to_copy = getParam<std::string>("copy_inputs");
2231 
2232  if (dir_to_copy.empty())
2233  mooseError("Error retrieving directory to copy");
2234  if (dir_to_copy.back() != '/')
2235  dir_to_copy += '/';
2236 
2237  // This binary name is the actual binary. That is, if we called a symlink it'll
2238  // be the name of what the symlink points to
2239  auto binname = appBinaryName();
2240  if (binname == "")
2241  mooseError("could not locate installed tests to run (unresolved binary/app name)");
2242 
2243  auto src_dir = MooseUtils::installedInputsDir(
2244  binname,
2245  dir_to_copy,
2246  "Rerun binary with " + _pars.getCommandLineMetadata("show_inputs").switches[0] +
2247  " to get a list of installable directories.");
2248 
2249  // Use the command line here because if we have a symlink to another binary,
2250  // we want to dump into a directory that is named after the symlink not the true binary
2251  auto dst_dir = _command_line->getExecutableNameBase() + "/" + dir_to_copy;
2252  auto cmdname = _command_line->getExecutableName();
2253  if (cmdname.find_first_of("/") != std::string::npos)
2254  cmdname = cmdname.substr(cmdname.find_first_of("/") + 1, std::string::npos);
2255 
2256  if (MooseUtils::pathExists(dst_dir))
2257  mooseError(
2258  "The directory \"./",
2259  dst_dir,
2260  "\" already exists.\nTo update/recopy the contents of this directory, rename (\"mv ",
2261  dst_dir,
2262  " new_dir_name\") or remove (\"rm -r ",
2263  dst_dir,
2264  "\") the existing directory.\nThen re-run \"",
2265  cmdname,
2266  " --copy-inputs ",
2267  dir_to_copy,
2268  "\".");
2269 
2270  std::string cmd = "mkdir -p " + dst_dir + "; rsync -av " + src_dir + " " + dst_dir;
2271 
2272  TIME_SECTION("copy_inputs", 2, "Copying Inputs");
2273 
2274  mooseAssert(comm().size() == 1, "Should be run in serial");
2275  const auto return_value = system(cmd.c_str());
2276  if (!WIFEXITED(return_value))
2277  mooseError("Process exited unexpectedly");
2278  setExitCode(WEXITSTATUS(return_value));
2279  if (exitCode() == 0)
2280  Moose::out << "Directory successfully copied into ./" << dst_dir << '\n';
2281  return true;
2282  }
2283  return false;
2284 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:99
virtual std::string appBinaryName() const
Definition: MooseApp.h:137
const Parallel::Communicator & comm() const
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
int exitCode() const
Get the shell exit code for the application.
Definition: MooseApp.h:150
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1193
const InputParameters::CommandLineMetadata & getCommandLineMetadata(const std::string &name) const
std::vector< std::string > switches
The switches for the parameter (i.e., [-t, –timing])
bool pathExists(const std::string &path)
Definition: MooseUtils.C:243
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
Definition: MooseApp.h:155
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

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

Referenced by AddExecutorAction::act().

2041 {
2042  // Do we have any?
2043  if (_executor_params.empty())
2044  return;
2045 
2046  // Holds the names of Executors that may be the root executor
2047  std::list<std::string> possibly_root;
2048 
2049  // What is already built
2050  std::map<std::string, bool> already_built;
2051 
2052  // The Executors that are currently candidates for being roots
2053  std::list<std::string> possible_roots;
2054 
2055  // The current line of dependencies - used for finding cycles
2056  std::list<std::string> current_branch;
2057 
2058  // Build the NullExecutor
2059  {
2060  auto params = _factory.getValidParams("NullExecutor");
2061  _null_executor = _factory.create<NullExecutor>("NullExecutor", "_null_executor", params);
2062  }
2063 
2064  for (const auto & params_entry : _executor_params)
2065  {
2066  const auto & name = params_entry.first;
2067 
2068  // Did we already make this one?
2069  if (_executors.find(name) != _executors.end())
2070  continue;
2071 
2072  possible_roots.emplace_back(name);
2073 
2074  recursivelyCreateExecutors(name, possible_roots, current_branch);
2075  }
2076 
2077  // If there is more than one possible root - error
2078  if (possible_roots.size() > 1)
2079  {
2080  auto root_string_it = possible_roots.begin();
2081 
2082  std::stringstream roots_string;
2083 
2084  roots_string << *root_string_it++;
2085 
2086  for (; root_string_it != possible_roots.end(); ++root_string_it)
2087  roots_string << ", " << *root_string_it;
2088 
2089  mooseError("Multiple Executor roots found: ", roots_string.str());
2090  }
2091 
2092  // Set the root executor
2093  _executor = _executors[possible_roots.front()];
2094 }
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:1247
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1988
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1242
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:1258
virtual std::unique_ptr< Base > create()=0
Factory _factory
Definition: MooseApp.h:1277
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239

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

Referenced by setupOptions().

2890 {
2891  TIME_SECTION("createMinimalApp", 3, "Creating Minimal App");
2892 
2893  // SetupMeshAction
2894  {
2895  // Build the Action parameters
2896  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
2897  action_params.set<std::string>("type") = "GeneratedMesh";
2898 
2899  // Create The Action
2900  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2901  _action_factory.create("SetupMeshAction", "Mesh", action_params));
2902 
2903  // Set the object parameters
2904  InputParameters & params = action->getObjectParams();
2905  params.set<MooseEnum>("dim") = "1";
2906  params.set<unsigned int>("nx") = 1;
2907 
2908  // Add Action to the warehouse
2910  }
2911 
2912  // Executioner
2913  {
2914  // Build the Action parameters
2915  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
2916  action_params.set<std::string>("type") = "Transient";
2917 
2918  // Create the action
2919  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
2920  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
2921 
2922  // Set the object parameters
2923  InputParameters & params = action->getObjectParams();
2924  params.set<unsigned int>("num_steps") = 1;
2925  params.set<Real>("dt") = 1;
2926 
2927  // Add Action to the warehouse
2929  }
2930 
2931  // Problem
2932  {
2933  // Build the Action parameters
2934  InputParameters action_params = _action_factory.getValidParams("CreateProblemDefaultAction");
2935  action_params.set<bool>("_solve") = false;
2936 
2937  // Create the action
2938  std::shared_ptr<Action> action = std::static_pointer_cast<Action>(
2939  _action_factory.create("CreateProblemDefaultAction", "Problem", action_params));
2940 
2941  // Add Action to the warehouse
2943  }
2944 
2945  // Outputs
2946  {
2947  // Build the Action parameters
2948  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
2949  action_params.set<bool>("console") = false;
2950 
2951  // Create action
2952  std::shared_ptr<Action> action =
2953  _action_factory.create("CommonOutputAction", "Outputs", action_params);
2954 
2955  // Add Action to the warehouse
2957  }
2958 
2960 }
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:1206
Base class for actions.
Definition: Action.h:33
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:1203
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
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 3461 of file MooseApp.C.

3462 {
3464 
3465  auto perf_graph =
3466  std::make_unique<RestartableData<PerfGraph>>("perf_graph",
3467  this,
3468  type() + " (" + name() + ')',
3469  *this,
3470  getParam<bool>("perf_graph_live_all"),
3471  !getParam<bool>("disable_perf_graph_live"));
3472 
3473  return dynamic_cast<RestartableData<PerfGraph> &>(
3474  registerRestartableData(std::move(perf_graph), 0, false))
3475  .set();
3476 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1827
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:2447
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 3479 of file MooseApp.C.

3480 {
3482 
3483  auto solution_invalidity =
3484  std::make_unique<RestartableData<SolutionInvalidity>>("solution_invalidity", nullptr, *this);
3485 
3486  return dynamic_cast<RestartableData<SolutionInvalidity> &>(
3487  registerRestartableData(std::move(solution_invalidity), 0, false))
3488  .set();
3489 }
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1827
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:2447
Concrete definition of a parameter value for a specified type.

◆ createRMFromTemplateAndInit()

RelationshipManager & MooseApp::createRMFromTemplateAndInit ( const RelationshipManager template_rm,
MooseMesh moose_mesh,
MeshBase mesh,
const libMesh::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 3133 of file MooseApp.C.

Referenced by attachRelationshipManagers().

3137 {
3138  auto & mesh_to_clone = _template_to_clones[&template_rm];
3139  auto it = mesh_to_clone.find(&mesh);
3140  if (it != mesh_to_clone.end())
3141  {
3142  // We've already created a clone for this mesh
3143  auto & clone_rm = *it->second;
3144  if (!clone_rm.dofMap() && dof_map)
3145  // We didn't have a DofMap before, but now we do, so we should re-init
3146  clone_rm.init(moose_mesh, mesh, dof_map);
3147  else if (clone_rm.dofMap() && dof_map && (clone_rm.dofMap() != dof_map))
3148  mooseError("Attempting to create and initialize an existing clone with a different DofMap. "
3149  "This should not happen.");
3150 
3151  return clone_rm;
3152  }
3153 
3154  // It's possible that this method is going to get called for multiple different MeshBase
3155  // objects. If that happens, then we *cannot* risk having a MeshBase object with a ghosting
3156  // functor that is init'd with another MeshBase object. So the safe thing to do is to make a
3157  // different RM for every MeshBase object that gets called here. Then the
3158  // RelationshipManagers stored here in MooseApp are serving as a template only
3159  auto pr = mesh_to_clone.emplace(
3160  std::make_pair(&const_cast<const MeshBase &>(mesh),
3161  dynamic_pointer_cast<RelationshipManager>(template_rm.clone())));
3162  mooseAssert(pr.second, "An insertion should have happened");
3163  auto & clone_rm = *pr.first->second;
3164  clone_rm.init(moose_mesh, mesh, dof_map);
3165  return clone_rm;
3166 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1573
virtual std::unique_ptr< GhostingFunctor > clone() const

◆ defaultAutomaticScaling()

bool MooseApp::defaultAutomaticScaling ( ) const
inline

Whether to enable automatic scaling by default.

Definition at line 1026 of file MooseApp.h.

1026 { return _automatic_automatic_scaling; }
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1561

◆ determineLibtorchDeviceType()

torch::DeviceType MooseApp::determineLibtorchDeviceType ( const MooseEnum device) const
private

Function to determine the device which should be used by libtorch on this application.

We use this function to decide what is available on different builds.

Parameters
deviceEnum to describe if a cpu or a gpu should be used.

Definition at line 3500 of file MooseApp.C.

3501 {
3502  if (device_enum == "cuda")
3503  {
3504 #ifdef __linux__
3505  if (!torch::cuda::is_available())
3506  mooseError("--libtorch-device=cuda: CUDA is not available");
3507  return torch::kCUDA;
3508 #else
3509  mooseError("--libtorch-device=cuda: CUDA is not supported on your platform");
3510 #endif
3511  }
3512  else if (device_enum == "mps")
3513  {
3514 #ifdef __APPLE__
3515  if (!torch::mps::is_available())
3516  mooseError("--libtorch-device=mps: MPS is not available");
3517  return torch::kMPS;
3518 #else
3519  mooseError("--libtorch-device=mps: MPS is not supported on your platform");
3520 #endif
3521  }
3522 
3523  mooseAssert(device_enum == "cpu", "Should be cpu");
3524  return torch::kCPU;
3525 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ disableCheckUnusedFlag()

void MooseApp::disableCheckUnusedFlag ( )

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

Definition at line 1948 of file MooseApp.C.

1949 {
1951 }
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 2636 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction().

2642 {
2643 #ifdef LIBMESH_HAVE_DLOPEN
2644  Parameters params;
2645  params.set<std::string>("app_name") = app_name;
2646  params.set<RegistrationType>("reg_type") = REGALL;
2647  params.set<std::string>("registration_method") = app_name + "__registerAll";
2648  params.set<std::string>("library_path") = library_path;
2649  params.set<std::string>("library_name") =
2650  library_name.empty() ? appNameToLibName(app_name) : library_name;
2651 
2652  params.set<Factory *>("factory") = factory;
2653  params.set<Syntax *>("syntax") = syntax;
2654  params.set<ActionFactory *>("action_factory") = action_factory;
2655  params.set<bool>("library_load_dependencies") = false;
2656 
2657  dynamicRegistration(params);
2658 #else
2659  libmesh_ignore(app_name, factory, action_factory, syntax, library_path, library_name);
2660  mooseError("Dynamic Loading is either not supported or was not detected by libMesh configure.");
2661 #endif
2662 }
void dynamicRegistration(const libMesh::Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2665
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:251
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:1516
T & set(const std::string &)
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:2419

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

Referenced by MultiApp::createApps().

2583 {
2584 #ifdef LIBMESH_HAVE_DLOPEN
2585  Parameters params;
2586  params.set<std::string>("app_name") = app_name;
2587  params.set<RegistrationType>("reg_type") = APPLICATION;
2588  params.set<std::string>("registration_method") = app_name + "__registerApps";
2589  params.set<std::string>("library_path") = library_path;
2590 
2591  const auto effective_library_name =
2592  library_name.empty() ? appNameToLibName(app_name) : library_name;
2593  params.set<std::string>("library_name") = effective_library_name;
2594  params.set<bool>("library_load_dependencies") = lib_load_deps;
2595 
2596  const auto paths = getLibrarySearchPaths(library_path);
2597  std::ostringstream oss;
2598 
2599  auto successfully_loaded = false;
2600  if (paths.empty())
2601  oss << '"' << app_name << "\" is not a registered application name.\n"
2602  << "No search paths were set. We made no attempts to locate the corresponding library "
2603  "file.\n";
2604  else
2605  {
2606  dynamicRegistration(params);
2607 
2608  // At this point the application should be registered so check it
2609  if (!AppFactory::instance().isRegistered(app_name))
2610  {
2611  oss << '"' << app_name << "\" is not a registered application name.\n"
2612  << "Unable to locate library archive for \"" << app_name
2613  << "\".\nWe attempted to locate the library archive \"" << effective_library_name
2614  << "\" in the following paths:\n\t";
2615  std::copy(paths.begin(), paths.end(), infix_ostream_iterator<std::string>(oss, "\n\t"));
2616  }
2617  else
2618  successfully_loaded = true;
2619  }
2620 
2621  if (!successfully_loaded)
2622  {
2623  oss << "\nMake sure you have compiled the library and either set the \"library_path\" "
2624  "variable in your input file or exported \"MOOSE_LIBRARY_PATH\".\n";
2625 
2626  mooseError(oss.str());
2627  }
2628 
2629 #else
2630  libmesh_ignore(app_name, library_path, library_name, lib_load_deps);
2631  mooseError("Dynamic Loading is either not supported or was not detected by libMesh configure.");
2632 #endif
2633 }
void dynamicRegistration(const libMesh::Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2665
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void libmesh_ignore(const Args &...)
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1516
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:2839
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:18
T & set(const std::string &)
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:2419

◆ dynamicRegistration()

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

Helper method for dynamic loading of objects.

Definition at line 2665 of file MooseApp.C.

Referenced by dynamicAllRegistration(), and dynamicAppRegistration().

2666 {
2667  const auto paths = getLibrarySearchPaths(params.get<std::string>("library_path"));
2668  const auto library_name = params.get<std::string>("library_name");
2669 
2670  // Attempt to dynamically load the library
2671  for (const auto & path : paths)
2672  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
2674  path + '/' + library_name, params, params.get<bool>("library_load_dependencies"));
2675 }
const T & get(std::string_view) const
void loadLibraryAndDependencies(const std::string &library_filename, const libMesh::Parameters &params, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:2678
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:250
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:2839

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

Referenced by executeExecutioner(), and run().

1728 {
1729  bool warn = _enable_unused_check == WARN_UNUSED;
1731 
1732  _builder.errorCheck(*_comm, warn, err);
1733 
1734  // Return early for mesh only mode, since we want error checking to run even though
1735  // an executor is not created for this case
1736  if (isParamSetByUser("mesh_only"))
1737  return;
1738 
1739  if (!_executor.get() && !_executioner.get())
1740  {
1741  if (!_early_exit_param.empty())
1742  {
1743  mooseAssert(_check_input,
1744  "Something went wrong, we should only get here if _check_input is true.");
1745  mooseError(
1746  "Incompatible command line arguments provided. --check-input cannot be called with ",
1748  ".");
1749  }
1750  // We should never get here
1751  mooseError("The Executor is being called without being initialized. This is likely "
1752  "caused by "
1753  "incompatible command line arguments");
1754  }
1755 
1756  auto apps = feProblem().getMultiAppWarehouse().getObjects();
1757  for (auto app : apps)
1758  for (unsigned int i = 0; i < app->numLocalApps(); i++)
1759  app->localApp(i)->errorCheck();
1760 }
OStreamProxy err
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1324
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
FEProblemBase & feProblem() const
Definition: MooseApp.C:1954
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...
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
enum MooseApp::UNUSED_CHECK _enable_unused_check
void errorCheck(const libMesh::Parallel::Communicator &comm, bool warn_unused, bool err_unused)
Definition: Builder.C:419
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1215
const std::shared_ptr< libMesh::Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1169
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

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

1060 { 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::mooseDeprecated(), MooseBaseErrorInterface::mooseInfo(), 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 1763 of file MooseApp.C.

Referenced by run().

1764 {
1765  TIME_SECTION("executeExecutioner", 3);
1766 
1767  // If ready to exit has been set, then just return
1768  if (_ready_to_exit)
1769  return;
1770 
1771  // run the simulation
1772  if (_use_executor && _executor)
1773  {
1774  LibmeshPetscCall(Moose::PetscSupport::petscSetupOutput(_command_line.get()));
1775  _executor->init();
1776  errorCheck();
1777  auto result = _executor->exec();
1778  if (!result.convergedAll())
1779  mooseError(result.str());
1780  }
1781  else if (_executioner)
1782  {
1783  LibmeshPetscCall(Moose::PetscSupport::petscSetupOutput(_command_line.get()));
1784  _executioner->init();
1785  errorCheck();
1786  _executioner->execute();
1787  if (!_executioner->lastSolveConverged())
1788  setExitCode(1);
1789  }
1790  else
1791  mooseError("No executioner was specified (go fix your input file)");
1792 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1193
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
PetscErrorCode petscSetupOutput(CommandLine *cmd_line)
Definition: PetscSupport.C:293
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
Definition: MooseApp.h:155
bool _ready_to_exit
Definition: MooseApp.h:1283
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1255
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:1727

◆ exitCode()

int MooseApp::exitCode ( ) const
inline

Get the shell exit code for the application.

Returns
The shell exit code

Definition at line 150 of file MooseApp.h.

Referenced by copyInputs().

150 { return _exit_code; }
int _exit_code
The exit code.
Definition: MooseApp.h:1285

◆ feProblem()

FEProblemBase & MooseApp::feProblem ( ) const

Definition at line 1954 of file MooseApp.C.

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

1955 {
1956  mooseAssert(_executor.get() || _executioner.get(), "No executioner yet, calling too early!");
1957  return _executor.get() ? _executor->feProblem() : _executioner->feProblem();
1958 }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239

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

Referenced by FEProblemBase::initialSetup().

1911 {
1912  if (!_rd_reader.isRestoring())
1913  mooseError("MooseApp::finalizeRestore(): Not currently restoring");
1914 
1915  // This gives us access to the underlying streams so that we can return it if needed
1916  auto input_streams = _rd_reader.clear();
1917 
1918  std::unique_ptr<Backup> backup;
1919 
1920  // Give them back a backup if this restore started from a Backup, in which case
1921  // the two streams in the Backup are formed into StringInputStreams
1922  if (auto header_string_input = dynamic_cast<StringInputStream *>(input_streams.header.get()))
1923  {
1924  auto data_string_input = dynamic_cast<StringInputStream *>(input_streams.data.get());
1925  mooseAssert(data_string_input, "Should also be a string input");
1926 
1927  auto header_sstream = header_string_input->release();
1928  mooseAssert(header_sstream, "Header not available");
1929 
1930  auto data_sstream = data_string_input->release();
1931  mooseAssert(data_sstream, "Data not available");
1932 
1933  backup = std::make_unique<Backup>();
1934  backup->header = std::move(header_sstream);
1935  backup->data = std::move(data_sstream);
1936  }
1937 
1938  return backup;
1939 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
RestartableDataReader _rd_reader
Definition: MooseApp.h:1546
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1853
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 409 of file MooseApp.h.

Referenced by FixedPointSolve::FixedPointSolve().

409 { 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:1251

◆ forceRestart()

bool MooseApp::forceRestart ( ) const
inline

Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoints); used within RestartableDataReader.

Definition at line 1085 of file MooseApp.h.

Referenced by possiblyLoadRestartableMetaData().

1085 { return _force_restart; }
const bool _force_restart
Whether or not we are forcefully attempting to load checkpoints (–force-restart) ...
Definition: MooseApp.h:1309

◆ getActionFactory()

ActionFactory& MooseApp::getActionFactory ( )
inline

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

Definition at line 429 of file MooseApp.h.

Referenced by Action::Action(), and DumpObjectsProblem::DumpObjectsProblem().

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

◆ getChainControlDataSystem()

ChainControlDataSystem& MooseApp::getChainControlDataSystem ( )
inline

Gets the system that manages the ChainControls.

Definition at line 862 of file MooseApp.h.

Referenced by ChainControlSetupAction::act(), FEProblemBase::advanceState(), ChainControl::getChainControlDataSystem(), and ChainControlDataPostprocessor::initialSetup().

862 { return _chain_control_system; }
ChainControlDataSystem _chain_control_system
The system that manages the ChainControls.
Definition: MooseApp.h:1544

◆ getCheckpointDirectories()

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

Get all checkpoint directories.

Returns
A Set of checkpoint directories

Definition at line 2355 of file MooseApp.C.

Referenced by getCheckpointFiles().

2356 {
2357  // Storage for the directory names
2358  std::list<std::string> checkpoint_dirs;
2359 
2360  // Add the directories added with Outputs/checkpoint=true input syntax
2361  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
2362 
2363  // Add the directories from any existing checkpoint output objects
2364  const auto & actions = _action_warehouse.getActionListByName("add_output");
2365  for (const auto & action : actions)
2366  {
2367  // Get the parameters from the MooseObjectAction
2368  MooseObjectAction * moose_object_action = dynamic_cast<MooseObjectAction *>(action);
2369  if (!moose_object_action)
2370  continue;
2371 
2372  const InputParameters & params = moose_object_action->getObjectParams();
2373  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
2374  {
2375  // Unless file_base was explicitly set by user, we cannot rely on it, as it will be changed
2376  // later
2377  const std::string cp_dir =
2378  _file_base_set_by_user ? params.get<std::string>("file_base")
2379  : (getOutputFileBase(true) + "_" + moose_object_action->name());
2380  checkpoint_dirs.push_back(cp_dir + "_cp");
2381  }
2382  }
2383  return checkpoint_dirs;
2384 }
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
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:1663
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:1206
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()
Retrieve 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 2387 of file MooseApp.C.

Referenced by setRestartRecoverFileBase().

2388 {
2389  auto checkpoint_dirs = getCheckpointDirectories();
2390  return MooseUtils::getFilesInDirs(checkpoint_dirs, false);
2391 }
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:2355
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:804

◆ getCommunicator()

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

Definition at line 1029 of file MooseApp.h.

Referenced by MooseServer::parseDocumentForDiagnostics().

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

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

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

3061 {
3062  if (const auto action = _action_warehouse.getCurrentAction())
3063  return action->parameters().getHitNode();
3064  return nullptr;
3065 }
const Action * getCurrentAction() const
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206

◆ 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 483 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:1294

◆ getExecuteOnEnum()

const ExecFlagEnum& MooseApp::getExecuteOnEnum ( ) const
inline

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

Definition at line 1011 of file MooseApp.h.

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

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

◆ getExecutioner()

Executioner * MooseApp::getExecutioner ( ) const

Retrieve the Executioner for this App.

Definition at line 2111 of file MooseApp.C.

Referenced by CheckIntegrityAction::act(), SetupPredictorAction::act(), SetupTimeStepperAction::act(), AddTimeStepperAction::act(), ComposeTimeStepperAction::act(), AddDefaultConvergenceAction::checkUnusedMultiAppFixedPointConvergenceParameters(), AddDefaultConvergenceAction::checkUnusedNonlinearConvergenceParameters(), AddDefaultConvergenceAction::checkUnusedSteadyStateConvergenceParameters(), LazyCoupleable::coupled(), EigenProblem::doFreeNonlinearPowerIterations(), EigenKernel::EigenKernel(), PseudoTimestep::execute(), IterationInfo::execute(), PIDTransientControl::execute(), Terminator::execute(), ChangeOverFixedPointPostprocessor::finalize(), FVAdvection::FVAdvection(), DefaultConvergenceBase::getSharedExecutionerParam(), NumFixedPointIterations::getValue(), FEProblemBase::init(), Console::initialSetup(), MFEMProblem::initProblemOperator(), NumFailedTimeSteps::NumFailedTimeSteps(), ConsoleUtils::outputExecutionInformation(), MultiApp::preTransfer(), setOutputFileBase(), TimeIntervalTimes::TimeIntervalTimes(), and TimePeriod::TimePeriod().

2112 {
2113  return _executioner.get() ? _executioner.get() : _executor.get();
2114 }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239

◆ getExecutor() [1/2]

Executor* MooseApp::getExecutor ( ) const
inline

Definition at line 361 of file MooseApp.h.

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

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

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

2098 {
2099  auto it = _executors.find(name);
2100 
2101  if (it != _executors.end())
2102  return *it->second;
2103 
2104  if (fail_if_not_found)
2105  mooseError("Executor not found: ", name);
2106 
2107  return *_null_executor;
2108 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1242
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:1258
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD

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

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

453 { 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:1288

◆ getExReaderForRestart()

libMesh::ExodusII_IO* MooseApp::getExReaderForRestart ( ) const
inline

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

Definition at line 466 of file MooseApp.h.

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

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

◆ getFactory()

Factory& MooseApp::getFactory ( )
inline

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

Definition at line 424 of file MooseApp.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), BatchMeshGeneratorAction::addMeshGenerators(), MeshGenerator::addMeshSubgenerator(), AStableDirk4::AStableDirk4(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), SingleRankPartitioner::clone(), CopyMeshPartitioner::clone(), RandomPartitioner::clone(), BlockWeightedPartitioner::clone(), GhostEverything::clone(), GhostHigherDLowerDPointNeighbors::clone(), GhostLowerDElems::clone(), LibmeshPartitioner::clone(), PetscExternalPartitioner::clone(), HierarchicalGridPartitioner::clone(), GridPartitioner::clone(), ElementSideNeighborLayers::clone(), ElementPointNeighborLayers::clone(), GhostBoundary::clone(), RedistributeProperties::clone(), ProxyRelationshipManager::clone(), SampledOutput::cloneMesh(), MeshGeneratorSystem::createMeshGenerator(), ExtraIDIntegralReporter::ExtraIDIntegralReporter(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), MooseObject::MooseObject(), MultiAppGeneralFieldTransfer::MultiAppGeneralFieldTransfer(), OverlayMeshGenerator::OverlayMeshGenerator(), TiledMesh::safeClone(), FileMesh::safeClone(), ImageMesh::safeClone(), GeneratedMesh::safeClone(), SpiralAnnularMesh::safeClone(), ConcentricCircleMesh::safeClone(), AnnularMesh::safeClone(), RinglebMesh::safeClone(), MeshGeneratorMesh::safeClone(), StitchedMesh::safeClone(), PatternedMesh::safeClone(), MFEMMesh::safeClone(), TransientBase::setupTimeIntegrator(), and SideSetExtruderGenerator::SideSetExtruderGenerator().

424 { return _factory; }
Factory _factory
Definition: MooseApp.h:1277

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

Referenced by ProgressOutput::output().

2402 {
2403  return _builder.getPrimaryFileName(stripLeadingPath);
2404 }
std::string getPrimaryFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed.
Definition: Builder.C:199
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1215

◆ getFPTrapFlag()

bool MooseApp::getFPTrapFlag ( ) const
inline

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

Definition at line 950 of file MooseApp.h.

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

◆ getFrameworkVersion()

std::string MooseApp::getFrameworkVersion ( ) const

Returns the framework version.

Definition at line 1204 of file MooseApp.C.

1205 {
1206  return MOOSE_VERSION;
1207 }

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

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

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

◆ getInputFileNames()

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

Definition at line 1649 of file MooseApp.C.

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

1650 {
1651  mooseAssert(_parser, "Parser is not set");
1652  return _parser->getInputFileNames();
1653 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212

◆ getInputParameterWarehouse()

InputParameterWarehouse & MooseApp::getInputParameterWarehouse ( )

◆ getInstallableInputs()

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

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

Definition at line 2216 of file MooseApp.C.

Referenced by showInputs().

2217 {
2218  return "tests";
2219 }

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

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

1667 {
1668  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1669 
1670  const auto it = _interface_registry.find(typeid(T));
1671  if (it != _interface_registry.end())
1672  return static_cast<InterfaceRegistryObjects<T> *>(it->second.get())->_objects;
1673  const static std::vector<T *> empty;
1674  return empty;
1675 }
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1576

◆ getLastInputFileName()

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

Definition at line 1656 of file MooseApp.C.

Referenced by setupOptions().

1657 {
1658  mooseAssert(_parser, "Parser is not set");
1659  return _parser->getLastInputFileName();
1660 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212

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

Referenced by dynamicAppRegistration(), and dynamicRegistration().

2840 {
2841  std::set<std::string> paths;
2842 
2843  if (!library_path.empty())
2844  {
2845  std::vector<std::string> tmp_paths;
2846  MooseUtils::tokenize(library_path, tmp_paths, 1, ":");
2847 
2848  paths.insert(tmp_paths.begin(), tmp_paths.end());
2849  }
2850 
2851  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
2852  if (moose_lib_path_env)
2853  {
2854  std::string moose_lib_path(moose_lib_path_env);
2855  std::vector<std::string> tmp_paths;
2856  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
2857 
2858  paths.insert(tmp_paths.begin(), tmp_paths.end());
2859  }
2860 
2861  return paths;
2862 }
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 ...

◆ getLibtorchDevice()

torch::DeviceType MooseApp::getLibtorchDevice ( ) const
inline

Get the device torch is supposed to be running on.

Definition at line 104 of file MooseApp.h.

104 { return _libtorch_device; }
const torch::DeviceType _libtorch_device
The libtorch device this app is using.
Definition: MooseApp.h:1586

◆ getLoadedLibraryPaths()

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

Return the paths of loaded libraries.

Definition at line 2828 of file MooseApp.C.

Referenced by Factory::reportUnregisteredError().

2829 {
2830  // Return the paths but not the open file handles
2831  std::set<std::string> paths;
2832  for (const auto & it : _lib_handles)
2833  paths.insert(it.first);
2834 
2835  return paths;
2836 }
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1348

◆ getMeshGenerator()

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

Definition at line 891 of file MooseApp.h.

Referenced by MeshGenerator::generateInternal().

892  {
894  }
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:1541
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 899 of file MooseApp.h.

900  {
902  }
std::unique_ptr< libMesh::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:1541
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 909 of file MooseApp.h.

Referenced by SetupMeshAction::act().

910  {
912  }
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:1541

◆ getMeshGeneratorSystem()

MeshGeneratorSystem& MooseApp::getMeshGeneratorSystem ( )
inline

◆ getMFEMDevice()

std::shared_ptr<mfem::Device> MooseApp::getMFEMDevice ( Moose::PassKey< MultiApp )
inline

Get the MFEM device object.

Definition at line 1103 of file MooseApp.h.

Referenced by MultiApp::createApp().

1103 { return _mfem_device; }
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
Definition: MooseApp.h:1591

◆ getMFEMDevices()

const std::set< std::string > & MooseApp::getMFEMDevices ( Moose::PassKey< MultiApp ) const
inline

Get the configured MFEM devices.

Definition at line 1679 of file MooseApp.h.

Referenced by MultiApp::createApp().

1680 {
1681  return _mfem_devices;
1682 }
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
Definition: MooseApp.h:1594

◆ getMooseApp()

MooseApp& MooseBase::getMooseApp ( ) const
inlineinherited

Get the MooseApp this class is associated with.

Definition at line 45 of file MooseBase.h.

Referenced by ChainControlSetupAction::act(), AddDefaultConvergenceAction::addDefaultMultiAppFixedPointConvergence(), AddDefaultConvergenceAction::addDefaultNonlinearConvergence(), AddDefaultConvergenceAction::addDefaultSteadyStateConvergence(), FEProblemBase::advanceState(), ParsedChainControl::buildFunction(), ReporterTransferInterface::checkHasReporterValue(), AddDefaultConvergenceAction::checkUnusedMultiAppFixedPointConvergenceParameters(), AddDefaultConvergenceAction::checkUnusedNonlinearConvergenceParameters(), AddDefaultConvergenceAction::checkUnusedSteadyStateConvergenceParameters(), Coupleable::checkWritableVar(), ComponentPhysicsInterface::ComponentPhysicsInterface(), MooseBaseParameterInterface::connectControllableParams(), Coupleable::Coupleable(), MortarData::createMortarInterface(), EigenProblem::doFreeNonlinearPowerIterations(), Terminator::execute(), FEProblemSolve::FEProblemSolve(), SolutionInvalidInterface::flagInvalidSolutionInternal(), ChainControl::getChainControlDataSystem(), DefaultConvergenceBase::getSharedExecutionerParam(), ChainControlDataPostprocessor::initialSetup(), MaterialPropertyInterface::MaterialPropertyInterface(), MooseVariableDataFV< OutputType >::MooseVariableDataFV(), ProgressOutput::output(), PetscOutputInterface::petscLinearOutput(), PetscOutputInterface::petscNonlinearOutput(), PetscOutputInterface::PetscOutputInterface(), PostprocessorInterface::postprocessorsAdded(), MultiApp::preTransfer(), Reporter::Reporter(), ReporterInterface::reportersAdded(), and VectorPostprocessorInterface::vectorPostprocessorsAdded().

45 { return _app; }
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84

◆ getNullExecutor()

NullExecutor* MooseApp::getNullExecutor ( ) const
inline

Definition at line 362 of file MooseApp.h.

Referenced by ExecutorInterface::getExecutor().

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

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

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

1664 {
1665  if (_file_base_set_by_user || for_non_moose_build_output || _multiapp_level)
1666  return _output_file_base;
1667  else
1668  return _output_file_base + "_out";
1669 }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1526
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1172

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

Referenced by TransientMultiApp::setupApp().

564  {
565  return _output_file_numbers;
566  }
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:1321

◆ getOutputPosition()

Point MooseApp::getOutputPosition ( ) const
inline

Get the output position.

Returns
The position offset for the output.

Definition at line 308 of file MooseApp.h.

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

308 { return _output_position; }
Point _output_position
The output position.
Definition: MooseApp.h:1181

◆ getOutputWarehouse() [1/2]

OutputWarehouse & MooseApp::getOutputWarehouse ( )

◆ getOutputWarehouse() [2/2]

const OutputWarehouse & MooseApp::getOutputWarehouse ( ) const

Definition at line 2413 of file MooseApp.C.

2414 {
2415  return _output_warehouse;
2416 }
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1209

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

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

1606 {
1607  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
1608 }
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
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 1612 of file MooseApp.h.

1613 {
1614  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0), this);
1615 }
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
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 135 of file MooseApp.h.

Referenced by getPrintableVersion().

135 { return "Application"; }

◆ getPrintableVersion()

std::string MooseApp::getPrintableVersion ( ) const

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

Definition at line 1216 of file MooseApp.C.

Referenced by setupOptions().

1217 {
1218  return getPrintableName() + " Version: " + getVersion();
1219 }
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:135
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:1210

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

Referenced by restore().

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

◆ getRecoverFileBase()

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

Definition at line 518 of file MooseApp.h.

519  {
520  mooseDeprecated("MooseApp::getRecoverFileBase is deprecated, use "
521  "MooseApp::getRestartRecoverFileBase() instead.");
522  return _restart_recover_base;
523  }
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:1315
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353

◆ getRelationshipManagerInfo()

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

Returns the Relationship managers info suitable for printing.

Definition at line 3317 of file MooseApp.C.

Referenced by ConsoleUtils::outputRelationshipManagerInformation().

3318 {
3319  std::vector<std::pair<std::string, std::string>> info_strings;
3320  info_strings.reserve(_relationship_managers.size());
3321 
3322  for (const auto & rm : _relationship_managers)
3323  {
3324  std::stringstream oss;
3325  oss << rm->getInfo();
3326 
3327  auto & for_whom = rm->forWhom();
3328 
3329  if (!for_whom.empty())
3330  {
3331  oss << " for ";
3332 
3333  std::copy(for_whom.begin(), for_whom.end(), infix_ostream_iterator<std::string>(oss, ", "));
3334  }
3335 
3336  info_strings.emplace_back(std::make_pair(Moose::stringify(rm->getType()), oss.str()));
3337  }
3338 
3339  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
3340  // Ghosting Functors are also attached to the mesh. This should catch them all.
3341  const auto & mesh = _action_warehouse.getMesh();
3342  if (mesh)
3343  {
3344  // Let us use an ordered map to avoid stochastic console behaviors.
3345  // I believe we won't have many RMs, and there is no performance issue.
3346  // Deterministic behaviors are good for setting up regression tests
3347  std::map<std::string, unsigned int> counts;
3348 
3349  for (auto & gf : as_range(mesh->getMesh().ghosting_functors_begin(),
3350  mesh->getMesh().ghosting_functors_end()))
3351  {
3352  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
3353  if (!gf_ptr)
3354  // Count how many occurences of the same Ghosting Functor types we are encountering
3355  counts[demangle(typeid(*gf).name())]++;
3356  }
3357 
3358  for (const auto & pair : counts)
3359  info_strings.emplace_back(std::make_pair(
3360  "Default", pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "")));
3361  }
3362 
3363  // List the libMesh GhostingFunctors - Not that in libMesh all of the algebraic and coupling
3364  // Ghosting Functors are also attached to the mesh. This should catch them all.
3365  const auto & d_mesh = _action_warehouse.getDisplacedMesh();
3366  if (d_mesh)
3367  {
3368  // Let us use an ordered map to avoid stochastic console behaviors.
3369  // I believe we won't have many RMs, and there is no performance issue.
3370  // Deterministic behaviors are good for setting up regression tests
3371  std::map<std::string, unsigned int> counts;
3372 
3373  for (auto & gf : as_range(d_mesh->getMesh().ghosting_functors_begin(),
3374  d_mesh->getMesh().ghosting_functors_end()))
3375  {
3376  const auto * gf_ptr = dynamic_cast<const RelationshipManager *>(gf);
3377  if (!gf_ptr)
3378  // Count how many occurences of the same Ghosting Functor types we are encountering
3379  counts[demangle(typeid(*gf).name())]++;
3380  }
3381 
3382  for (const auto & pair : counts)
3383  info_strings.emplace_back(
3384  std::make_pair("Default",
3385  pair.first + (pair.second > 1 ? " x " + std::to_string(pair.second) : "") +
3386  " for DisplacedMesh"));
3387  }
3388 
3389  return info_strings;
3390 }
const std::shared_ptr< MooseMesh > & getMesh() const
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
std::string demangle(const char *name)
std::set< GhostingFunctor *>::const_iterator ghosting_functors_begin() const
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:1327
std::set< GhostingFunctor *>::const_iterator ghosting_functors_end() const

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

1620 {
1621  // this enables having a default on the new parameter but bypassing it with the old one
1622  // Most important: accept new parameter
1623  if (isParamSetByUser(new_name) && !isParamValid(old_name))
1624  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1625  // Second most: accept old parameter
1626  else if (isParamValid(old_name) && !isParamSetByUser(new_name))
1627  return InputParameters::getParamHelper(old_name, _pars, static_cast<T *>(0), this);
1628  // Third most: accept default for new parameter
1629  else if (isParamValid(new_name) && !isParamValid(old_name))
1630  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1631  // Refuse: no default, no value passed
1632  else if (!isParamValid(old_name) && !isParamValid(new_name))
1633  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1634  "' is being retrieved without being set.\n"
1635  "Did you mispell it?");
1636  // Refuse: both old and new parameters set by user
1637  else
1638  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1639  "' may not be provided alongside former parameter '" + old_name + "'");
1640 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:205
std::string blockFullpath() const
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207
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 704 of file MooseApp.h.

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

◆ getRestartableData() [2/2]

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

Definition at line 705 of file MooseApp.h.

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

◆ getRestartableDataMap()

RestartableDataMap & MooseApp::getRestartableDataMap ( const RestartableDataMapName name)

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

Definition at line 3425 of file MooseApp.C.

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

3426 {
3427  auto iter = _restartable_meta_data.find(name);
3428  if (iter == _restartable_meta_data.end())
3429  mooseError("Unable to find RestartableDataMap object for the supplied name '",
3430  name,
3431  "', did you call registerRestartableDataMapName in the application constructor?");
3432  return iter->second.first;
3433 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1513
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 1050 of file MooseApp.h.

Referenced by SetupDebugAction::act().

1050 { 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:1513

◆ getRestartableDataMapEnd()

auto MooseApp::getRestartableDataMapEnd ( )
inline

Definition at line 1052 of file MooseApp.h.

Referenced by SetupDebugAction::act().

1052 { 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:1513

◆ getRestartableDataMapName()

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

Definition at line 3452 of file MooseApp.C.

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

3453 {
3454  const auto it = _restartable_meta_data.find(name);
3455  if (it == _restartable_meta_data.end())
3456  mooseError("MooseApp::getRestartableDataMapName: The name '", name, "' is not registered");
3457  return it->second.second;
3458 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1513
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 2509 of file MooseApp.C.

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

2512 {
2513  if (tid != 0)
2514  mooseError(
2515  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
2516 
2517  // Get metadata reference from RestartableDataMap and return a (non-const) reference to its value
2518  auto & restartable_data_map = getRestartableDataMap(metaname);
2519  RestartableDataValue * const data = restartable_data_map.findData(name);
2520  if (!data)
2521  mooseError("Unable to find RestartableDataValue object with name " + name +
2522  " in RestartableDataMap");
2523 
2524  return *data;
2525 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:3425
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 517 of file MooseApp.h.

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

517 { 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:1315

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

Referenced by removeRelationshipManager().

3077 {
3078  auto outer_it = _template_to_clones.find(&template_rm);
3079  if (outer_it == _template_to_clones.end())
3080  mooseError("The template rm does not exist in our _template_to_clones map");
3081 
3082  auto & mesh_to_clone_map = outer_it->second;
3083  auto inner_it = mesh_to_clone_map.find(&mesh);
3084  if (inner_it == mesh_to_clone_map.end())
3085  mooseError("We should have the mesh key in our mesh");
3086 
3087  return *inner_it->second;
3088 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1573

◆ getStartTime()

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

Definition at line 326 of file MooseApp.h.

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

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

◆ getSystemInfo()

const SystemInfo* MooseApp::getSystemInfo ( ) const
inline

Get SystemInfo object.

Returns
A pointer to the SystemInformation object

Definition at line 578 of file MooseApp.h.

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

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

◆ getVersion()

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

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

Definition at line 1210 of file MooseApp.C.

Referenced by getPrintableVersion().

1211 {
1212  return MOOSE_VERSION;
1213 }

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

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

1019  {
1020  return _initial_backup != nullptr && *_initial_backup != nullptr;
1021  }
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:1582

◆ hasMeshGenerator()

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

Definition at line 883 of file MooseApp.h.

884  {
886  }
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:1541
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 302 of file MooseApp.h.

Referenced by Exodus::output().

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

◆ hasRecoverFileBase()

bool MooseApp::hasRecoverFileBase ( ) const

Definition at line 1819 of file MooseApp.C.

1820 {
1821  mooseDeprecated("MooseApp::hasRecoverFileBase is deprecated, use "
1822  "MooseApp::hasRestartRecoverFileBase() instead.");
1823  return !_restart_recover_base.empty();
1824 }
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:1315
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353

◆ hasRelationshipManager()

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

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

Definition at line 2963 of file MooseApp.C.

2964 {
2965  return std::find_if(_relationship_managers.begin(),
2966  _relationship_managers.end(),
2967  [&name](const std::shared_ptr<RelationshipManager> & rm)
2968  { return rm->name() == name; }) != _relationship_managers.end();
2969 }
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:1327

◆ hasRestartableDataMap()

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

Definition at line 3436 of file MooseApp.C.

3437 {
3438  return _restartable_meta_data.count(name);
3439 }
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:1513
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 2499 of file MooseApp.C.

Referenced by MeshMetaDataInterface::hasMeshProperty().

2501 {
2502  auto it = _restartable_meta_data.find(metaname);
2503  if (it == _restartable_meta_data.end())
2504  return false;
2505  return it->second.first.hasData(name);
2506 }
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:1513
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 1813 of file MooseApp.C.

1814 {
1815  return !_restart_recover_base.empty();
1816 }
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:1315

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

Referenced by removeRelationshipManager().

3069 {
3070  auto it = _template_to_clones.find(&template_rm);
3071  // C++ does short circuiting so we're safe here
3072  return (it != _template_to_clones.end()) && (it->second.find(&mesh) != it->second.end());
3073 }
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:1573

◆ hasStartTime()

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

Definition at line 321 of file MooseApp.h.

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

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

◆ header()

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

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

Definition at line 2871 of file MooseApp.C.

Referenced by restore(), and setupOptions().

2872 {
2873  return std::string("");
2874 }

◆ isParamSetByUser()

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

Definition at line 207 of file MooseApp.h.

Referenced by copyInputs(), errorCheck(), getRenamedParam(), runInputFile(), runInputs(), SetupMeshAction::setupMesh(), and setupOptions().

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

◆ isParamValid()

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

Definition at line 205 of file MooseApp.h.

Referenced by getRenamedParam(), setupOptions(), and Output::setWallTimeIntervalFromCommandLineParam().

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

Referenced by SetupMeshAction::act(), FEProblemBase::checkICRestartError(), MultiApp::createApp(), EigenProblem::execute(), FileOutput::FileOutput(), FullSolveMultiApp::FullSolveMultiApp(), Eigenvalue::init(), FEProblemBase::initialSetup(), TransientBase::preExecute(), TimeSequenceStepperBase::setupSequence(), PhysicsBase::shouldCreateIC(), and TransientMultiApp::solveStep().

1802 {
1803  return _restart;
1804 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1300

◆ isSplitMesh()

bool MooseApp::isSplitMesh ( ) const

Whether or not this is a split mesh operation.

Definition at line 1807 of file MooseApp.C.

Referenced by MooseMesh::init().

1808 {
1809  return _split_mesh;
1810 }
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1303

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

2436 {
2437  std::string app_name(library_name);
2438 
2439  // Strip off the leading "lib" and trailing ".la"
2440  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
2441  mooseError("Invalid library name: ", app_name);
2442 
2443  return MooseUtils::underscoreToCamelCase(app_name, true);
2444 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:576

◆ loadLibraryAndDependencies()

void MooseApp::loadLibraryAndDependencies ( const std::string &  library_filename,
const libMesh::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 2678 of file MooseApp.C.

Referenced by dynamicRegistration().

2681 {
2682  std::string line;
2683  std::string dl_lib_filename;
2684 
2685  // This RE looks for absolute path libtool filenames (i.e. begins with a slash and ends with a
2686  // .la)
2687  pcrecpp::RE re_deps("(/\\S*\\.la)");
2688 
2689  std::ifstream la_handle(library_filename.c_str());
2690  if (la_handle.is_open())
2691  {
2692  while (std::getline(la_handle, line))
2693  {
2694  // Look for the system dependent dynamic library filename to open
2695  if (line.find("dlname=") != std::string::npos)
2696  // Magic numbers are computed from length of this string "dlname=' and line minus that
2697  // string plus quotes"
2698  dl_lib_filename = line.substr(8, line.size() - 9);
2699 
2700  if (line.find("dependency_libs=") != std::string::npos)
2701  {
2702  if (load_dependencies)
2703  {
2704  pcrecpp::StringPiece input(line);
2705  pcrecpp::StringPiece depend_library;
2706  while (re_deps.FindAndConsume(&input, &depend_library))
2707  // Recurse here to load dependent libraries in depth-first order
2708  loadLibraryAndDependencies(depend_library.as_string(), params, load_dependencies);
2709  }
2710 
2711  // There's only one line in the .la file containing the dependency libs so break after
2712  // finding it
2713  break;
2714  }
2715  }
2716  la_handle.close();
2717  }
2718 
2719  // This should only occur if we have static linkage.
2720  if (dl_lib_filename.empty())
2721  return;
2722 
2723  const auto & [dir, file_name] = MooseUtils::splitFileName(library_filename);
2724 
2725  // Time to load the library, First see if we've already loaded this particular dynamic library
2726  // 1) make sure we haven't already loaded this library
2727  // AND 2) make sure we have a library name (we won't for static linkage)
2728  // Note: Here was are going to assume uniqueness based on the filename alone. This has significant
2729  // implications for applications that have "diamond" inheritance of libraries (usually
2730  // modules). We will only load one of those libraries, versions be damned.
2731  auto dyn_lib_it = _lib_handles.find(file_name);
2732  if (dyn_lib_it == _lib_handles.end())
2733  {
2734  // Assemble the actual filename using the base path of the *.la file and the dl_lib_filename
2735  const auto dl_lib_full_path = MooseUtils::pathjoin(dir, dl_lib_filename);
2736 
2737  MooseUtils::checkFileReadable(dl_lib_full_path, false, /*throw_on_unreadable=*/true);
2738 
2739 #ifdef LIBMESH_HAVE_DLOPEN
2740  void * const lib_handle = dlopen(dl_lib_full_path.c_str(), RTLD_LAZY);
2741 #else
2742  void * const lib_handle = nullptr;
2743 #endif
2744 
2745  if (!lib_handle)
2746  mooseError("The library file \"",
2747  dl_lib_full_path,
2748  "\" exists and has proper permissions, but cannot by dynamically loaded.\nThis "
2749  "generally means that the loader was unable to load one or more of the "
2750  "dependencies listed in the supplied library (see otool or ldd).\n",
2751  dlerror());
2752 
2753  DynamicLibraryInfo lib_info;
2754  lib_info.library_handle = lib_handle;
2755  lib_info.full_path = library_filename;
2756 
2757  auto insert_ret = _lib_handles.insert(std::make_pair(file_name, lib_info));
2758  mooseAssert(insert_ret.second == true, "Error inserting into lib_handles map");
2759 
2760  dyn_lib_it = insert_ret.first;
2761  }
2762 
2763  // Library has been loaded, check to see if we've called the requested registration method
2764  const auto registration_method = params.get<std::string>("registration_method");
2765  auto & entry_sym_from_curr_lib = dyn_lib_it->second.entry_symbols;
2766 
2767  if (entry_sym_from_curr_lib.find(registration_method) == entry_sym_from_curr_lib.end())
2768  {
2769  // get the pointer to the method in the library. The dlsym()
2770  // function returns a null pointer if the symbol cannot be found,
2771  // we also explicitly set the pointer to NULL if dlsym is not
2772  // available.
2773 #ifdef LIBMESH_HAVE_DLOPEN
2774  void * registration_handle =
2775  dlsym(dyn_lib_it->second.library_handle, registration_method.c_str());
2776 #else
2777  void * registration_handle = nullptr;
2778 #endif
2779 
2780  if (registration_handle)
2781  {
2782  switch (params.get<RegistrationType>("reg_type"))
2783  {
2784  case APPLICATION:
2785  {
2786  using register_app_t = void (*)();
2787  register_app_t * const reg_ptr = reinterpret_cast<register_app_t *>(&registration_handle);
2788  (*reg_ptr)();
2789  break;
2790  }
2791  case REGALL:
2792  {
2793  using register_app_t = void (*)(Factory *, ActionFactory *, Syntax *);
2794  register_app_t * const reg_ptr = reinterpret_cast<register_app_t *>(&registration_handle);
2795  (*reg_ptr)(params.get<Factory *>("factory"),
2796  params.get<ActionFactory *>("action_factory"),
2797  params.get<Syntax *>("syntax"));
2798  break;
2799  }
2800  default:
2801  mooseError("Unhandled RegistrationType");
2802  }
2803 
2804  entry_sym_from_curr_lib.insert(registration_method);
2805  }
2806  else
2807  {
2808 
2809 #if defined(DEBUG) && defined(LIBMESH_HAVE_DLOPEN)
2810  // We found a dynamic library that doesn't have a dynamic
2811  // registration method in it. This shouldn't be an error, so
2812  // we'll just move on.
2813  if (!registration_handle)
2814  mooseWarning("Unable to find extern \"C\" method \"",
2815  registration_method,
2816  "\" in library: ",
2817  dyn_lib_it->first,
2818  ".\n",
2819  "This doesn't necessarily indicate an error condition unless you believe that "
2820  "the method should exist in that library.\n",
2821  dlerror());
2822 #endif
2823  }
2824  }
2825 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:336
std::pair< std::filesystem::path, std::filesystem::path > splitFileName(const T &full_file)
Function for splitting path and filename.
Definition: MooseUtils.h:261
const T & get(std::string_view) const
void loadLibraryAndDependencies(const std::string &library_filename, const libMesh::Parameters &params, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:2678
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:250
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1516
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1348
std::filesystem::path pathjoin(const std::filesystem::path &p)
Definition: MooseUtils.C:59
Holding syntax for parsing input files.
Definition: Syntax.h:21
class infix_ostream_iterator if void
Definition: InfixIterator.h:26

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

Referenced by SetupRecoverFileBaseAction::act().

2544 {
2545  for (const auto & name_map_pair : _restartable_meta_data)
2546  possiblyLoadRestartableMetaData(name_map_pair.first, folder_base);
2547 }
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:1513
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:2528

◆ masterDisplacedMesh()

const MooseMesh* MooseApp::masterDisplacedMesh ( ) const
inline

Returns a pointer to the master displaced mesh.

Definition at line 852 of file MooseApp.h.

Referenced by SetupMeshAction::act().

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

◆ masterMesh()

const MooseMesh* MooseApp::masterMesh ( ) const
inline

Returns a pointer to the master mesh.

Definition at line 847 of file MooseApp.h.

Referenced by SetupMeshAction::act(), and CopyMeshPartitioner::CopyMeshPartitioner().

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

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

Referenced by possiblyLoadRestartableMetaData(), and writeRestartableMetaData().

3046 {
3047  return RestartableDataIO::restartableDataFolder(folder_base /
3048  std::filesystem::path("meta_data" + map_suffix));
3049 }
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 826 of file MooseApp.h.

Referenced by DefaultNonlinearConvergence::checkConvergence(), MultiApp::createApp(), OutputWarehouse::mooseConsole(), ConsoleUtils::outputFrameworkInformation(), and Console::write().

826 { 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:1526

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

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

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

◆ 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 AddElementalFieldAction::act(), CopyNodalVarsAction::act(), AdaptivityAction::act(), AddTimeStepperAction::act(), DeprecatedBlockAction::act(), SetupTimeIntegratorAction::act(), AddActionComponentAction::act(), DisplayGhostingAction::act(), MaterialOutputAction::act(), AddPeriodicBCAction::act(), FEProblemBase::addAnyRedistributers(), Executioner::addAttributeReporter(), MFEMProblem::addAuxKernel(), FEProblemBase::addAuxKernel(), FEProblemBase::addAuxScalarKernel(), DisplacedProblem::addAuxVariable(), MFEMProblem::addBoundaryCondition(), FEProblemBase::addBoundaryCondition(), PhysicsComponentInterface::addComponent(), FEProblemBase::addConstraint(), FEProblemBase::addConvergence(), FEProblemBase::addDamper(), Registry::addDataFilePath(), FEProblemBase::addDGKernel(), FEProblemBase::addDiracKernel(), FEProblemBase::addDistribution(), addExecutor(), addExecutorParams(), MFEMProblem::addFESpace(), MFEMProblem::addFunction(), FEProblemBase::addFunction(), SubProblem::addFunctor(), MFEMProblem::addFunctorMaterial(), FEProblemBase::addFunctorMaterial(), FunctorMaterial::addFunctorProperty(), FunctorMaterial::addFunctorPropertyByBlocks(), FEProblemBase::addFVBC(), FEProblemBase::addFVInitialCondition(), FEProblemBase::addFVInterfaceKernel(), FEProblemBase::addFVKernel(), ADDGKernel::ADDGKernel(), FEProblemBase::addHDGKernel(), FEProblemBase::addIndicator(), MFEMProblem::addInitialCondition(), FEProblemBase::addInitialCondition(), FEProblemBase::addInterfaceKernel(), FEProblemBase::addInterfaceMaterial(), MFEMProblem::addKernel(), FEProblemBase::addKernel(), FEProblemBase::addLinearFVBC(), FEProblemBase::addLinearFVKernel(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), FEProblemBase::addMaterialHelper(), ComponentMaterialPropertyInterface::addMaterials(), FEProblemBase::addMeshDivision(), addMeshGenerator(), ComponentMeshTransformHelper::addMeshGenerators(), CylinderComponent::addMeshGenerators(), MeshGenerator::addMeshSubgenerator(), MFEMProblem::addMFEMPreconditioner(), MFEMProblem::addMFEMSolver(), FEProblemBase::addMultiApp(), FEProblemBase::addNodalKernel(), FEProblemBase::addObject(), ComponentPhysicsInterface::addPhysics(), SubProblem::addPiecewiseByBlockLambdaFunctor(), MFEMProblem::addPostprocessor(), FEProblemBase::addPostprocessor(), InitialConditionBase::addPostprocessorDependencyHelper(), UserObject::addPostprocessorDependencyHelper(), FEProblemBase::addPredictor(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), Action::addRelationshipManager(), FEProblemBase::addReporter(), FEProblemBase::addSampler(), FEProblemBase::addScalarKernel(), FEProblemBase::addTimeIntegrator(), MFEMProblem::addTransfer(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), InitialConditionBase::addUserObjectDependencyHelper(), UserObject::addUserObjectDependencyHelper(), AuxKernelTempl< Real >::addUserObjectDependencyHelper(), DisplacedProblem::addVariable(), FEProblemBase::addVectorPostprocessor(), UserObject::addVectorPostprocessorDependencyHelper(), Output::advancedExecuteOn(), AdvancedExtruderGenerator::AdvancedExtruderGenerator(), appBinaryName(), appendMeshGenerator(), Registry::appNameFromAppPath(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), ArrayDGKernel::ArrayDGKernel(), PhysicsBase::assignBlocks(), AStableDirk4::AStableDirk4(), AuxKernelTempl< Real >::AuxKernelTempl(), Function::average(), MultiApp::backup(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), MFEMFESpace::buildFEC(), PiecewiseTabularBase::buildFromFile(), MultiAppVariableValueSamplePostprocessorTransfer::cacheElemToPostprocessorData(), MooseBase::callMooseError(), ChangeOverFixedPointPostprocessor::ChangeOverFixedPointPostprocessor(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), PhysicsBase::checkBlockRestrictionIdentical(), PhysicsBase::checkComponentType(), ParsedConvergence::checkConvergence(), DefaultNonlinearConvergence::checkConvergence(), FEProblemBase::checkDependMaterialsHelper(), ReporterTransferInterface::checkHasReporterValue(), FEProblemBase::checkICRestartError(), Material::checkMaterialProperty(), checkMetaDataIntegrity(), Damper::checkMinDamping(), Checkpoint::checkpointInfo(), Coupleable::checkWritableVar(), CompositeFunction::CompositeFunction(), MaterialBase::computeProperties(), FEProblemBase::computeUserObjectByName(), VectorPostprocessorVisualizationAux::computeValue(), MooseBaseParameterInterface::connectControllableParams(), ConstantPostprocessor::ConstantPostprocessor(), CommonOutputAction::create(), MultiApp::createApp(), createExecutors(), MeshGeneratorSystem::createMeshGeneratorOrder(), createRecoverablePerfGraph(), CutMeshByPlaneGenerator::CutMeshByPlaneGenerator(), MaterialBase::declareADProperty(), MeshGenerator::declareMeshesForSubByName(), MeshGenerator::declareNullMeshName(), MaterialBase::declareProperty(), DOFMapOutput::demangle(), DerivativeSumMaterialTempl< is_ad >::DerivativeSumMaterialTempl(), Registry::determineDataFilePath(), DGKernel::DGKernel(), DGKernelBase::DGKernelBase(), DomainUserObject::DomainUserObject(), DumpObjectsProblem::dumpObjectHelper(), ElementGroupCentroidPositions::ElementGroupCentroidPositions(), ElementMaterialSampler::ElementMaterialSampler(), ElementValueSampler::ElementValueSampler(), EigenKernel::enabled(), MooseMesh::errorIfDistributedMesh(), MooseBase::errorPrefix(), SolutionUserObjectBase::evalMeshFunction(), SolutionUserObjectBase::evalMeshFunctionGradient(), SolutionUserObjectBase::evalMultiValuedMeshFunction(), SolutionUserObjectBase::evalMultiValuedMeshFunctionGradient(), SideValueSampler::execute(), RestartableDataReporter::execute(), PointValue::execute(), MultiAppNearestNodeTransfer::execute(), WebServerControl::execute(), MultiAppGeneralFieldTransfer::execute(), ActionWarehouse::executeActionsWithAction(), Exodus::Exodus(), ExtraIDIntegralVectorPostprocessor::ExtraIDIntegralVectorPostprocessor(), FEProblemBase::FEProblemBase(), MultiApp::fillPositions(), PointSamplerBase::finalize(), ChainControl::fullControlDataName(), FunctionDT::FunctionDT(), FunctionIC::functionName(), FVFunctionIC::functionName(), FunctorPositions::FunctorPositions(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), FVOneVarDiffusionInterface::FVOneVarDiffusionInterface(), MooseServer::gatherDocumentSymbols(), BoundaryDeletionGenerator::generate(), UniqueExtraIDMeshGenerator::generate(), RenameBlockGenerator::generate(), RenameBoundaryGenerator::generate(), GeneratedMeshGenerator::generate(), BreakMeshByBlockGenerator::generate(), ParsedSubdomainGeneratorBase::generate(), ParsedExtraElementIDGenerator::generate(), StitchedMeshGenerator::generate(), XYDelaunayGenerator::generate(), SubdomainBoundingBoxGenerator::generate(), MeshGenerator::generateInternal(), InterfaceMaterial::getADMaterialProperty(), Material::getADMaterialProperty(), MultiAppTransfer::getAppInfo(), MultiApp::getBoundingBox(), getCheckpointDirectories(), Control::getControllableParameterByName(), Control::getControllableValue(), Control::getControllableValueByName(), FEProblemBase::getConvergence(), Registry::getDataFilePath(), 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(), MFEMProblem::getGridFunction(), SolutionUserObjectBase::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(), MFEMGeneralUserObject::getMatrixCoefficient(), MFEMGeneralUserObject::getMatrixCoefficientByName(), 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(), ComponentMaterialPropertyInterface::getPropertyValue(), ReporterData::getReporterInfo(), getRestartableDataMap(), getRestartableDataMapName(), getRestartableMetaData(), FEProblemBase::getSampler(), MFEMGeneralUserObject::getScalarCoefficient(), MFEMGeneralUserObject::getScalarCoefficientByName(), TransientBase::getTimeStepperName(), ProjectedStatefulMaterialStorageAction::getTypeEnum(), FEProblemBase::getUserObject(), FEProblemBase::getUserObjectBase(), MFEMGeneralUserObject::getVectorCoefficient(), MFEMGeneralUserObject::getVectorCoefficientByName(), Terminator::handleMessage(), Control::hasControllableParameterByName(), FEProblemBase::hasConvergence(), FEProblemBase::hasFunction(), SubProblem::hasFunctor(), SubProblem::hasFunctorWithType(), hasMeshGenerator(), AdvancedOutput::hasOutputHelper(), FEProblemBase::hasPostprocessor(), FEProblemBase::hasPostprocessorValueByName(), hasRelationshipManager(), hasRestartableDataMap(), hasRestartableMetaData(), FEProblemBase::hasUserObject(), IterationAdaptiveDT::init(), AddVariableAction::init(), AdvancedOutput::init(), AdvancedOutput::initExecutionTypes(), AttribName::initFrom(), NestedDivision::initialize(), TransformedPositions::initialize(), JSONOutput::initialSetup(), SideFVFluxBCIntegral::initialSetup(), SolutionScalarAux::initialSetup(), MultiAppProjectionTransfer::initialSetup(), NodalVariableValue::initialSetup(), Console::initialSetup(), SolutionUserObjectBase::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(), MaterialBase::markMatPropRequested(), MatDiffusionBase< Real >::MatDiffusionBase(), Material::Material(), MaterialDerivativeTestKernelBase< Real >::MaterialDerivativeTestKernelBase(), Distribution::median(), MemoryUsageReporter::MemoryUsageReporter(), MeshGenerator::meshPropertyPrefix(), OutputWarehouse::mooseConsole(), MooseVariableInterface< Real >::MooseVariableInterface(), MultiAppGeneralFieldTransfer::MultiAppGeneralFieldTransfer(), MultiAppUserObjectTransfer::MultiAppUserObjectTransfer(), NodalPatchRecoveryAuxBase::NodalPatchRecoveryAuxBase(), NodalValueSampler::NodalValueSampler(), Registry::objData(), MeshGenerator::Comparator::operator()(), ProgressOutput::output(), DOFMapOutput::output(), Output::Output(), AdvancedOutput::outputElementalVariables(), ConsoleUtils::outputExecutionInformation(), MaterialOutputAction::outputHelper(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), TableOutput::outputReporter(), AdvancedOutput::outputReporters(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), ParsedCurveGenerator::ParsedCurveGenerator(), MooseServer::parseDocumentForDiagnostics(), ParsedODEKernel::ParsedODEKernel(), ComponentPhysicsInterface::physicsExists(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseByBlockFunctorMaterialTempl< T >::PiecewiseByBlockFunctorMaterialTempl(), possiblyLoadRestartableMetaData(), PhysicsBase::prefix(), MooseMesh::prepare(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), PerfGraphLivePrint::printStats(), MultiApp::readCommandLineArguments(), Receiver::Receiver(), Executor::Result::record(), AppFactory::reg(), Registry::registerObjectsTo(), FEProblemBase::registerRandomInterface(), registerRestartableDataMapName(), registerRestartableNameWithFilter(), GlobalParamsAction::remove(), MaterialBase::resetQpProperties(), MultiApp::restore(), ScalarComponentIC::ScalarComponentIC(), MultiApp::setAppOutputFileBase(), MooseMesh::setBoundaryName(), Control::setControllableValue(), Control::setControllableValueByName(), GlobalParamsAction::setDoubleIndexParam(), OutputWarehouse::setFileNumbers(), GlobalParamsAction::setParam(), FEProblemBase::setPostprocessorValueByName(), FEProblemBase::setResidualObjectParamsAndLog(), GlobalParamsAction::setScalarParam(), MooseMesh::setSubdomainName(), GlobalParamsAction::setTripleIndexParam(), NodeSetsGeneratorBase::setup(), Split::setup(), SideSetsGeneratorBase::setup(), TransientMultiApp::setupApp(), GlobalParamsAction::setVectorParam(), FullSolveMultiApp::showStatusMessage(), SideSetExtruderGenerator::SideSetExtruderGenerator(), TransientMultiApp::solveStep(), UserObject::spatialValue(), WebServerControl::startServer(), StitchedMesh::StitchedMesh(), SubProblem::storeBoundaryDelayedCheckMatProp(), SubProblem::storeBoundaryMatPropName(), MaterialBase::storeBoundaryZeroMatProp(), SubProblem::storeBoundaryZeroMatProp(), SubProblem::storeSubdomainDelayedCheckMatProp(), SubProblem::storeSubdomainMatPropName(), MaterialBase::storeSubdomainZeroMatProp(), 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(), ParsedAux::validateGenericVectorNames(), PhysicsBase::variableExists(), MultiAppTransfer::variableIntegrityCheck(), VectorMagnitudeFunctorMaterialTempl< is_ad >::VectorMagnitudeFunctorMaterialTempl(), Convergence::verboseOutput(), 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

◆ outputMachineReadableData()

void MooseApp::outputMachineReadableData ( const std::string &  param,
const std::string &  start_marker,
const std::string &  end_marker,
const std::string &  data 
) const
protected

Outputs machine readable data (JSON, YAML, etc.) either to the screen (if no filename was provided as an argument to the parameter param) or to a file (if a filename was provided).

Definition at line 3529 of file MooseApp.C.

Referenced by runInputFile(), and setupOptions().

3533 {
3534  // Bool parameter, just to screen
3535  if (_pars.have_parameter<bool>(param))
3536  {
3537  Moose::out << start_marker << data << end_marker << std::endl;
3538  return;
3539  }
3540 
3541  // String parameter, to file
3542  const auto & filename = getParam<std::string>(param);
3543  // write to file
3544  std::ofstream out(filename.c_str());
3545  if (out.is_open())
3546  {
3547  std::ofstream out(filename.c_str());
3548  out << data << std::flush;
3549  out.close();
3550  }
3551  else
3552  mooseError("Unable to open file `", filename, "` for writing ", param, " data to it.");
3553 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
OStreamProxy out

◆ parameters()

const InputParameters& MooseApp::parameters ( )
inline

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 161 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), SplitMeshAction::act(), CommonOutputAction::act(), MeshGeneratorSystem::hasDataDrivenAllowed(), ConsoleUtils::outputLegacyInformation(), MooseServer::parseDocumentForDiagnostics(), NEML2Action::printSummary(), NonlinearSystemBase::shouldEvaluatePreSMOResidual(), and ~MooseApp().

161 { return _pars; }
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163

◆ parser()

Parser & MooseApp::parser ( )
Returns
The Parser

Definition at line 1981 of file MooseApp.C.

Referenced by ActionFactory::create().

1982 {
1983  mooseAssert(_parser, "Not set");
1984  return *_parser;
1985 }
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212

◆ perfGraph()

PerfGraph& MooseApp::perfGraph ( )
inline

Get the PerfGraph for this app.

Definition at line 172 of file MooseApp.h.

Referenced by PerfGraphInterface::perfGraph().

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

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

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

2530 {
2531  const auto & map_name = getRestartableDataMapName(name);
2532  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
2533  if (RestartableDataReader::isAvailable(meta_data_folder_base))
2534  {
2536  reader.setErrorOnLoadWithDifferentNumberOfProcessors(false);
2537  reader.setInput(meta_data_folder_base);
2538  reader.restore();
2539  }
2540 }
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:3044
bool forceRestart() const
Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoint...
Definition: MooseApp.h:1085
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:3425
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:3452
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 790 of file MooseApp.h.

Referenced by restore().

790 {}

◆ preBackup()

virtual void MooseApp::preBackup ( )
inlinevirtual

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

Definition at line 756 of file MooseApp.h.

Referenced by backup().

756 {}

◆ processor_id()

processor_id_type MooseApp::processor_id ( ) const
inline

Returns the MPI processor ID of the current processor.

Definition at line 434 of file MooseApp.h.

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

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

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

167 { 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:1233

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

Referenced by createExecutors().

1991 {
1992  // Did we already make this one?
1993  if (_executors.find(current_executor_name) != _executors.end())
1994  return;
1995 
1996  // Is this one already on the current branch (i.e. there is a cycle)
1997  if (std::find(current_branch.begin(), current_branch.end(), current_executor_name) !=
1998  current_branch.end())
1999  {
2000  std::stringstream exec_names_string;
2001 
2002  auto branch_it = current_branch.begin();
2003 
2004  exec_names_string << *branch_it++;
2005 
2006  for (; branch_it != current_branch.end(); ++branch_it)
2007  exec_names_string << ", " << *branch_it;
2008 
2009  exec_names_string << ", " << current_executor_name;
2010 
2011  mooseError("Executor cycle detected: ", exec_names_string.str());
2012  }
2013 
2014  current_branch.push_back(current_executor_name);
2015 
2016  // Build the dependencies first
2017  const auto & params = *_executor_params[current_executor_name].second;
2018 
2019  for (const auto & param : params)
2020  {
2021  if (params.have_parameter<ExecutorName>(param.first))
2022  {
2023  const auto & dependency_name = params.get<ExecutorName>(param.first);
2024 
2025  possible_roots.remove(dependency_name);
2026 
2027  if (!dependency_name.empty())
2028  recursivelyCreateExecutors(dependency_name, possible_roots, current_branch);
2029  }
2030  }
2031 
2032  // Add this Executor
2033  const auto & type = _executor_params[current_executor_name].first;
2034  addExecutor(type, current_executor_name, params);
2035 
2036  current_branch.pop_back();
2037 }
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:1247
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1988
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1242
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:1961

◆ registerCapabilities()

void MooseApp::registerCapabilities ( )
private

Register all base MooseApp capabilities to the Moose::Capabilities registry.

Apps and Modules may register additional capabilities in their registerAll function.

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

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

1645 {
1646  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1647 
1648  InterfaceRegistryObjects<T> * registry = nullptr;
1649  auto it = _interface_registry.find(typeid(T));
1650  if (it == _interface_registry.end())
1651  {
1652  auto new_registry = std::make_unique<InterfaceRegistryObjects<T>>();
1653  registry = new_registry.get();
1654  _interface_registry.emplace(typeid(T), std::move(new_registry));
1655  }
1656  else
1657  registry = static_cast<InterfaceRegistryObjects<T> *>(it->second.get());
1658 
1659  mooseAssert(std::count(registry->_objects.begin(), registry->_objects.end(), &interface) == 0,
1660  "Interface already registered");
1661  registry->_objects.push_back(&interface);
1662 }
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1576

◆ registerRestartableData() [1/2]

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

Definition at line 2447 of file MooseApp.C.

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

2451 {
2452  if (!metaname.empty() && tid != 0)
2453  mooseError(
2454  "The meta data storage for '", metaname, "' is not threaded, so the tid must be zero.");
2455 
2456  mooseAssert(metaname.empty() ||
2457  _restartable_meta_data.find(metaname) != _restartable_meta_data.end(),
2458  "The desired meta data name does not exist: " + metaname);
2459 
2460  // Select the data store for saving this piece of restartable data (mesh or everything else)
2461  auto & data_map =
2462  metaname.empty() ? _restartable_data[tid] : _restartable_meta_data[metaname].first;
2463 
2464  RestartableDataValue * stored_data = data_map.findData(data->name());
2465  if (stored_data)
2466  {
2467  if (data->typeId() != stored_data->typeId())
2468  mooseError("Type mismatch found in RestartableData registration of '",
2469  data->name(),
2470  "'\n\n Stored type: ",
2471  stored_data->type(),
2472  "\n New type: ",
2473  data->type());
2474  }
2475  else
2476  stored_data = &data_map.addData(std::move(data));
2477 
2478  if (!read_only)
2479  stored_data->setDeclared({});
2480 
2481  return *stored_data;
2482 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1513
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:1218
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 3442 of file MooseApp.C.

3443 {
3444  if (!suffix.empty())
3445  std::transform(suffix.begin(), suffix.end(), suffix.begin(), ::tolower);
3446  suffix.insert(0, "_");
3447  _restartable_meta_data.emplace(
3448  std::make_pair(name, std::make_pair(RestartableDataMap(), suffix)));
3449 }
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:1513
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 1827 of file MooseApp.C.

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

1829 {
1831  switch (filter)
1832  {
1833  case RESTARTABLE_FILTER::RECOVERABLE:
1834  _recoverable_data_names.insert(name);
1835  break;
1836  default:
1837  mooseError("Unknown filter");
1838  }
1839 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:791
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:1224

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

Referenced by NumRelationshipManagers::getValue().

1035  {
1036  return _relationship_managers;
1037  }
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1327

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

Referenced by addRelationshipManager().

3092 {
3093  auto * const mesh = _action_warehouse.mesh().get();
3094  if (!mesh)
3095  mooseError("The MooseMesh should exist");
3096 
3097  const MeshBase * const undisp_lm_mesh = mesh->getMeshPtr();
3098  RelationshipManager * undisp_clone = nullptr;
3099  if (undisp_lm_mesh && hasRMClone(*rm, *undisp_lm_mesh))
3100  {
3101  undisp_clone = &getRMClone(*rm, *undisp_lm_mesh);
3102  const_cast<MeshBase *>(undisp_lm_mesh)->remove_ghosting_functor(*undisp_clone);
3103  }
3104 
3105  auto & displaced_mesh = _action_warehouse.displacedMesh();
3106  MeshBase * const disp_lm_mesh = displaced_mesh ? &displaced_mesh->getMesh() : nullptr;
3107  RelationshipManager * disp_clone = nullptr;
3108  if (disp_lm_mesh && hasRMClone(*rm, *disp_lm_mesh))
3109  {
3110  disp_clone = &getRMClone(*rm, *disp_lm_mesh);
3111  disp_lm_mesh->remove_ghosting_functor(*disp_clone);
3112  }
3113 
3114  if (_executioner)
3115  {
3116  auto & problem = feProblem();
3117  if (undisp_clone)
3118  {
3119  problem.removeAlgebraicGhostingFunctor(*undisp_clone);
3120  problem.removeCouplingGhostingFunctor(*undisp_clone);
3121  }
3122 
3123  auto * dp = problem.getDisplacedProblem().get();
3124  if (dp && disp_clone)
3125  dp->removeAlgebraicGhostingFunctor(*disp_clone);
3126  }
3127 
3128  _factory.releaseSharedObjects(*rm);
3129  _relationship_managers.erase(rm);
3130 }
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Definition: MooseApp.C:3068
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:3076
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
MeshBase & mesh
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
FEProblemBase & feProblem() const
Definition: MooseApp.C:1954
std::shared_ptr< MooseMesh > & mesh()
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1236
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:1327
Factory _factory
Definition: MooseApp.h:1277

◆ restartFolderBase()

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

The file suffix for restartable data.

Definition at line 3052 of file MooseApp.C.

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

3053 {
3054  auto folder = folder_base;
3055  folder += "-restart-" + std::to_string(processor_id());
3057 }
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:434
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 1868 of file MooseApp.C.

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

1869 {
1870  TIME_SECTION("restore", 2, "Restoring Application from File");
1871 
1872  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1873 
1874  _rd_reader.setInput(folder_base);
1875  _rd_reader.restore(filter_names);
1876 
1877  postRestore(for_restart);
1878 }
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:1546
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:790
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:738

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

1882 {
1883  TIME_SECTION("restore", 2, "Restoring Application");
1884 
1885  const DataNames filter_names = for_restart ? getRecoverableData() : DataNames{};
1886 
1887  if (!backup)
1888  mooseError("MooseApp::restore(): Provided backup is not initialized");
1889 
1890  auto header = std::move(backup->header);
1891  mooseAssert(header, "Header not available");
1892 
1893  auto data = std::move(backup->data);
1894  mooseAssert(data, "Data not available");
1895 
1896  _rd_reader.setInput(std::move(header), std::move(data));
1897  _rd_reader.restore(filter_names);
1898 
1899  postRestore(for_restart);
1900 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:1546
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:790
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1853
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2871
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:738

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

Referenced by FEProblemBase::initialSetup().

1904 {
1905  mooseAssert(hasInitialBackup(), "Missing initial backup");
1906  restore(std::move(*_initial_backup), for_restart);
1907 }
bool hasInitialBackup() const
Definition: MooseApp.h:1018
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
Definition: MooseApp.C:1868
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:1582

◆ run()

void MooseApp::run ( )
virtual

Run the application.

Definition at line 2123 of file MooseApp.C.

2124 {
2125  TIME_SECTION("run", 3);
2126  if (getParam<bool>("show_docs"))
2127  {
2128  auto binname = appBinaryName();
2129  if (binname == "")
2130  mooseError("could not locate installed tests to run (unresolved binary/app name)");
2131  auto docspath = MooseUtils::docsDir(binname);
2132  if (docspath == "")
2133  mooseError("no installed documentation found");
2134 
2135  auto docmsgfile = MooseUtils::pathjoin(docspath, "docmsg.txt");
2136  std::string docmsg = "file://" + MooseUtils::realpath(docspath) + "/index.html";
2137  if (MooseUtils::pathExists(docmsgfile) && MooseUtils::checkFileReadable(docmsgfile))
2138  {
2139  std::ifstream ifs(docmsgfile);
2140  std::string content((std::istreambuf_iterator<char>(ifs)),
2141  (std::istreambuf_iterator<char>()));
2142  content.replace(content.find("$LOCAL_SITE_HOME"), content.length(), docmsg);
2143  docmsg = content;
2144  }
2145 
2146  Moose::out << docmsg << "\n";
2147  _early_exit_param = "--docs";
2148  _ready_to_exit = true;
2149  return;
2150  }
2151 
2152  if (showInputs() || copyInputs() || runInputs())
2153  {
2154  _early_exit_param = "--show-input, --copy-inputs, or --run";
2155  _ready_to_exit = true;
2156  return;
2157  }
2158 
2159  try
2160  {
2161  TIME_SECTION("setup", 2, "Setting Up");
2162  setupOptions();
2163  runInputFile();
2164  }
2165  catch (std::exception & err)
2166  {
2167  mooseError(err.what());
2168  }
2169 
2170  if (!_check_input)
2171  {
2172  TIME_SECTION("execute", 2, "Executing");
2174  }
2175  else
2176  {
2177  errorCheck();
2178  // Output to stderr, so it is easier for peacock to get the result
2179  Moose::err << "Syntax OK" << std::endl;
2180  }
2181 }
OStreamProxy err
std::string docsDir(const std::string &app_name)
Returns the directory of any installed docs/site.
Definition: MooseUtils.C:121
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:1222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual std::string appBinaryName() const
Definition: MooseApp.h:137
bool runInputs()
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
Definition: MooseApp.C:2287
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1324
std::string realpath(const std::string &path)
Wrapper around PetscGetRealPath, which is a cross-platform replacement for realpath.
Definition: MooseUtils.C:1231
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
Definition: MooseApp.C:2184
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:250
std::filesystem::path pathjoin(const std::filesystem::path &p)
Definition: MooseUtils.C:59
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:1763
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:1688
bool pathExists(const std::string &path)
Definition: MooseUtils.C:243
bool _ready_to_exit
Definition: MooseApp.h:1283
bool copyInputs()
Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a ...
Definition: MooseApp.C:2222
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:1727
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282

◆ runInputFile()

void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 1688 of file MooseApp.C.

Referenced by run().

1689 {
1690  TIME_SECTION("runInputFile", 3);
1691 
1692  // If early exit param has been set, then just return
1693  if (_ready_to_exit)
1694  return;
1695 
1697 
1698  if (isParamSetByUser("mesh_only"))
1699  {
1700  _early_exit_param = "--mesh-only";
1701  _ready_to_exit = true;
1702  }
1703  else if (isParamSetByUser("split_mesh"))
1704  {
1705  _early_exit_param = "--split-mesh";
1706  _ready_to_exit = true;
1707  }
1708  else if (isParamSetByUser("parse_neml2_only"))
1709  {
1710  _early_exit_param = "--parse-neml2-only";
1711  _ready_to_exit = true;
1712  }
1713  else if (getParam<bool>("list_constructed_objects"))
1714  {
1715  // TODO: ask multiapps for their constructed objects
1716  _early_exit_param = "--list-constructed-objects";
1717  _ready_to_exit = true;
1718  std::stringstream ss;
1719  for (const auto & obj : _factory.getConstructedObjects())
1720  ss << obj << '\n';
1722  "list_constructed_objects", "**START OBJECT DATA**\n", "\n**END OBJECT DATA**", ss.str());
1723  }
1724 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
void outputMachineReadableData(const std::string &param, const std::string &start_marker, const std::string &end_marker, const std::string &data) const
Outputs machine readable data (JSON, YAML, etc.) either to the screen (if no filename was provided as...
Definition: MooseApp.C:3529
Factory _factory
Definition: MooseApp.h:1277
void executeAllActions()
This method loops over all actions in the warehouse and executes them.
bool _ready_to_exit
Definition: MooseApp.h:1283
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

◆ runInputs()

bool MooseApp::runInputs ( )
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 2287 of file MooseApp.C.

Referenced by run().

2288 {
2289  if (isParamSetByUser("run"))
2290  {
2291  if (comm().size() > 1)
2292  mooseError("The --run option should not be ran in parallel");
2293 
2294  // Pass everything after --run on the cli to the TestHarness
2295  const auto find_run_it = std::as_const(*_command_line).findCommandLineParam("run");
2296  const auto & cl_entries = std::as_const(*_command_line).getEntries();
2297  mooseAssert(find_run_it != cl_entries.end(), "Didn't find the option");
2298  std::string test_args;
2299  for (auto it = std::next(find_run_it); it != cl_entries.end(); ++it)
2300  for (const auto & arg : it->raw_args)
2301  {
2302  test_args += " " + arg;
2304  }
2305 
2306  auto working_dir = MooseUtils::getCurrentWorkingDir();
2307  if (MooseUtils::findTestRoot() == "")
2308  {
2309  auto bin_name = appBinaryName();
2310  if (bin_name == "")
2311  mooseError("Could not locate binary name relative to installed location");
2312 
2313  auto cmd_name = Moose::getExecutableName();
2314  mooseError(
2315  "Could not locate installed tests from the current working directory:",
2316  working_dir,
2317  ".\nMake sure you are executing this command from within a writable installed inputs ",
2318  "directory.\nRun \"",
2319  cmd_name,
2320  " --copy-inputs <dir>\" to copy the contents of <dir> to a \"./",
2321  bin_name,
2322  "_<dir>\" directory.\nChange into that directory and try \"",
2323  cmd_name,
2324  " --run <dir>\" again.");
2325  }
2326 
2327  // Set this application as the app name for the moose_test_runner script that we're running
2328  setenv("MOOSE_TEST_RUNNER_APP_NAME", appBinaryName().c_str(), true);
2329 
2330  const std::string cmd = MooseUtils::runTestsExecutable() + test_args;
2331  Moose::out << "Working Directory: " << working_dir << "\nRunning Command: " << cmd << std::endl;
2332  mooseAssert(comm().size() == 1, "Should be run in serial");
2333  const auto return_value = system(cmd.c_str());
2334  if (!WIFEXITED(return_value))
2335  mooseError("Process exited unexpectedly");
2336  setExitCode(WEXITSTATUS(return_value));
2337  return true;
2338  }
2339 
2340  return false;
2341 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual std::string appBinaryName() const
Definition: MooseApp.h:137
const Parallel::Communicator & comm() const
std::string runTestsExecutable()
Returns the location of either a local repo run_tests script - or an installed test executor script i...
Definition: MooseUtils.C:65
void add_command_line_name(const std::string &name)
std::string getCurrentWorkingDir()
Returns the current working directory as a string.
Definition: MooseUtils.C:432
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
Definition: MooseApp.h:155
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:75
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

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

Referenced by setupOptions().

1943 {
1944  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
1945 }
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 2117 of file MooseApp.C.

Referenced by setupOptions().

2118 {
2119  _error_overridden = true;
2120 }
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1280

◆ setExecutioner()

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

Set the Executioner for this App.

Definition at line 369 of file MooseApp.h.

Referenced by CreateExecutionerAction::act().

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

◆ setExecutor()

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

Definition at line 370 of file MooseApp.h.

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

◆ setExitCode()

void MooseApp::setExitCode ( const int  exit_code)
inline

Sets the exit code that the application will exit with.

Definition at line 155 of file MooseApp.h.

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

155 { _exit_code = exit_code; }
int _exit_code
The exit code.
Definition: MooseApp.h:1285

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

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

447 { _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:1288

◆ setExReaderForRestart()

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

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

Definition at line 458 of file MooseApp.h.

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

459  {
460  _ex_reader = exreader;
461  }
std::shared_ptr< libMesh::ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
Definition: MooseApp.h:1291

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

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

◆ setMFEMDevice()

void MooseApp::setMFEMDevice ( const std::string &  device_string,
Moose::PassKey< MFEMExecutioner  
)

Create/configure the MFEM device with the provided device_string.

More than one device can be configured. If supplying multiple devices, they should be comma separated

Definition at line 3571 of file MooseApp.C.

Referenced by MFEMExecutioner::MFEMExecutioner().

3572 {
3573  const auto string_vec = MooseUtils::split(device_string, ",");
3574  auto string_set = std::set<std::string>(string_vec.begin(), string_vec.end());
3575  if (!_mfem_device)
3576  {
3577  _mfem_device = std::make_shared<mfem::Device>(device_string);
3578  _mfem_devices = std::move(string_set);
3579  _mfem_device->Print(Moose::out);
3580  }
3581  else if (string_set != _mfem_devices)
3582  mooseError("Attempted to configure with MFEM devices '",
3583  MooseUtils::join(string_set, " "),
3584  "', but we have already configured the MFEM device object with the devices '",
3586  "'");
3587 }
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
Definition: MooseApp.h:1594
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
Python like split functions for strings.
Definition: MooseUtils.C:1126
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
Definition: MooseApp.h:1591

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

1673 {
1674  _output_file_base = output_file_base;
1675 
1676  // Reset the file base in the outputs
1678 
1679  // Reset the file base in multiapps (if they have been constructed yet)
1680  if (getExecutioner())
1681  for (auto & multi_app : feProblem().getMultiAppWarehouse().getObjects())
1682  multi_app->setAppOutputFileBase();
1683 
1684  _file_base_set_by_user = true;
1685 }
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
FEProblemBase & feProblem() const
Definition: MooseApp.C:1954
void resetFileBase()
Resets the file base for all FileOutput objects.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:2111
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1209
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1172

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

552  {
553  _output_file_numbers = numbers;
554  }
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:1321

◆ setOutputPosition()

void MooseApp::setOutputPosition ( const Point p)

Tell the app to output in a specific position.

Definition at line 2344 of file MooseApp.C.

2345 {
2346  _output_position_set = true;
2347  _output_position = p;
2349 
2350  if (_executioner.get())
2351  _executioner->parentOutputPositionChanged();
2352 }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1178
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:1236
Point _output_position
The output position.
Definition: MooseApp.h:1181
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1209

◆ setRecover()

void MooseApp::setRecover ( bool  value)

Definition at line 2883 of file MooseApp.C.

2884 {
2885  _recover = value;
2886 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1297

◆ setRestart()

void MooseApp::setRestart ( bool  value)

Sets the restart/recover flags.

Parameters
stateThe state to set the flag to

Definition at line 2877 of file MooseApp.C.

Referenced by FEProblemBase::setRestartFile().

2878 {
2879  _restart = value;
2880 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1300
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 529 of file MooseApp.h.

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

530  {
531  if (file_base.empty())
533  else
534  _restart_recover_base = file_base;
535  }
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:2387
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:1315
std::string getLatestCheckpointFilePrefix(const std::list< std::string > &checkpoint_files)
Returns the most recent checkpoint prefix (the four numbers at the beginning) If a suitable file isn&#39;...
Definition: MooseUtils.C:815

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

Referenced by EigenExecutionerBase::EigenExecutionerBase(), MFEMTransient::MFEMTransient(), and TransientBase::TransientBase().

2395 {
2396  _start_time_set = true;
2397  _start_time = time;
2398 }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:1187
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1184

◆ setupOptions()

void MooseApp::setupOptions ( )
virtual

Setup options based on InputParameters.

Definition at line 1222 of file MooseApp.C.

Referenced by run().

1223 {
1224  TIME_SECTION("setupOptions", 5, "Setting Up Options");
1225 
1226  // Print the header, this is as early as possible
1227  if (header().length() && !getParam<bool>("suppress_header"))
1228  _console << header() << std::endl;
1229 
1230  if (getParam<bool>("error_unused"))
1231  setCheckUnusedFlag(true);
1232  else if (getParam<bool>("allow_unused"))
1233  setCheckUnusedFlag(false);
1234 
1235  if (getParam<bool>("error_override"))
1237 
1238  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
1239 
1240  _test_checkpoint_half_transient = getParam<bool>("test_checkpoint_half_transient");
1241 
1242  if (getParam<bool>("trap_fpe"))
1243  {
1244  _trap_fpe = true;
1245  _perf_graph.setActive(false);
1246  if (getParam<bool>("no_trap_fpe"))
1247  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
1248  }
1249  else if (getParam<bool>("no_trap_fpe"))
1250  _trap_fpe = false;
1251 
1252  // Turn all warnings in MOOSE to errors (almost see next logic block)
1253  Moose::_warnings_are_errors = getParam<bool>("error");
1254 
1255  // Deprecated messages can be toggled to errors independently from everything else.
1256  Moose::_deprecated_is_error = getParam<bool>("error_deprecated");
1257 
1258  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
1259  {
1260  // Set from command line
1261  auto color = getParam<MooseEnum>("color");
1262  if (!isParamSetByUser("color"))
1263  {
1264  // Set from deprecated --no-color
1265  if (getParam<bool>("no_color"))
1266  color = "off";
1267  // Set from environment
1268  else
1269  {
1270  char * c_color = std::getenv("MOOSE_COLOR");
1271  if (c_color)
1272  color.assign(std::string(c_color), "While assigning environment variable MOOSE_COLOR");
1273  }
1274  }
1275 
1276  if (color == "auto")
1277  Moose::setColorConsole(true);
1278  else if (color == "on")
1279  Moose::setColorConsole(true, true);
1280  else if (color == "off")
1281  Moose::setColorConsole(false);
1282  else
1283  mooseAssert(false, "Should not hit");
1284 
1285  // After setting color so that non-yellow deprecated is honored
1286  if (getParam<bool>("no_color"))
1287  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
1288  }
1289 
1290 // If there's no threading model active, but the user asked for
1291 // --n-threads > 1 on the command line, throw a mooseError. This is
1292 // intended to prevent situations where the user has potentially
1293 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
1294 // asking for multiple threads, not knowing that there will never be
1295 // any threads launched.
1296 #if !LIBMESH_USING_THREADS
1297  if (libMesh::command_line_value("--n-threads", 1) > 1)
1298  mooseError("You specified --n-threads > 1, but there is no threading model active!");
1299 #endif
1300 
1301  // Build a minimal running application, ignoring the input file.
1302  if (getParam<bool>("minimal"))
1303  createMinimalApp();
1304 
1305  else if (getParam<bool>("display_version"))
1306  {
1307  Moose::out << getPrintableVersion() << std::endl;
1308  _early_exit_param = "--version";
1309  _ready_to_exit = true;
1310  return;
1311  }
1312  else if (getParam<bool>("help"))
1313  {
1314  _command_line->printUsage();
1315  _early_exit_param = "--help";
1316  _ready_to_exit = true;
1317  }
1318  else if (getParam<bool>("dump") || isParamSetByUser("dump_search"))
1319  {
1320  const std::string search =
1321  isParamSetByUser("dump_search") ? getParam<std::string>("dump_search") : "";
1322 
1323  JsonSyntaxTree tree(search);
1324 
1325  {
1326  TIME_SECTION("dump", 1, "Building Syntax Tree");
1328  }
1329 
1330  // Check if second arg is valid or not
1331  if ((tree.getRoot()).is_object())
1332  {
1333  // Turn off live printing so that it doesn't mess with the dump
1335 
1336  JsonInputFileFormatter formatter;
1337  Moose::out << "\n### START DUMP DATA ###\n"
1338  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###" << std::endl;
1339  _early_exit_param = "--dump";
1340  _ready_to_exit = true;
1341  }
1342  else
1343  mooseError("Search parameter '", search, "' was not found in the registered syntax.");
1344  }
1345  else if (getParam<bool>("registry"))
1346  {
1348 
1349  Moose::out << "Label\tType\tName\tClass\tFile\n";
1350 
1351  auto & objmap = Registry::allObjects();
1352  for (auto & entry : objmap)
1353  for (auto & obj : entry.second)
1354  Moose::out << entry.first << "\tobject\t" << obj->name() << "\t" << obj->_classname << "\t"
1355  << obj->_file << "\n";
1356 
1357  auto & actmap = Registry::allActions();
1358  for (auto & entry : actmap)
1359  {
1360  for (auto & act : entry.second)
1361  Moose::out << entry.first << "\taction\t" << act->_name << "\t" << act->_classname << "\t"
1362  << act->_file << "\n";
1363  }
1364  _early_exit_param = "--registry";
1365  _ready_to_exit = true;
1366  }
1367  else if (getParam<bool>("registry_hit"))
1368  {
1370 
1371  Moose::out << "### START REGISTRY DATA ###\n";
1372 
1373  hit::Section root("");
1374  auto sec = new hit::Section("registry");
1375  root.addChild(sec);
1376  auto objsec = new hit::Section("objects");
1377  sec->addChild(objsec);
1378 
1379  auto & objmap = Registry::allObjects();
1380  for (auto & entry : objmap)
1381  for (auto & obj : entry.second)
1382  {
1383  auto ent = new hit::Section("entry");
1384  objsec->addChild(ent);
1385  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
1386  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "object"));
1387  ent->addChild(new hit::Field("name", hit::Field::Kind::String, obj->name()));
1388  ent->addChild(new hit::Field("class", hit::Field::Kind::String, obj->_classname));
1389  ent->addChild(new hit::Field("file", hit::Field::Kind::String, obj->_file));
1390  }
1391 
1392  auto actsec = new hit::Section("actions");
1393  sec->addChild(actsec);
1394  auto & actmap = Registry::allActions();
1395  for (auto & entry : actmap)
1396  for (auto & act : entry.second)
1397  {
1398  auto ent = new hit::Section("entry");
1399  actsec->addChild(ent);
1400  ent->addChild(new hit::Field("label", hit::Field::Kind::String, entry.first));
1401  ent->addChild(new hit::Field("type", hit::Field::Kind::String, "action"));
1402  ent->addChild(new hit::Field("task", hit::Field::Kind::String, act->_name));
1403  ent->addChild(new hit::Field("class", hit::Field::Kind::String, act->_classname));
1404  ent->addChild(new hit::Field("file", hit::Field::Kind::String, act->_file));
1405  }
1406 
1407  Moose::out << root.render();
1408 
1409  Moose::out << "\n### END REGISTRY DATA ###\n";
1410  _early_exit_param = "--registry_hit";
1411  _ready_to_exit = true;
1412  }
1413  else if (getParam<bool>("definition"))
1414  {
1416 
1417  JsonSyntaxTree tree("");
1419  SONDefinitionFormatter formatter;
1420  Moose::out << "%-START-SON-DEFINITION-%\n"
1421  << formatter.toString(tree.getRoot()) << "\n%-END-SON-DEFINITION-%\n";
1422  _early_exit_param = "--definition";
1423  _ready_to_exit = true;
1424  }
1425  else if (getParam<bool>("yaml") || isParamSetByUser("yaml_search"))
1426  {
1427  const std::string search =
1428  isParamSetByUser("yaml_search") ? getParam<std::string>("yaml_search") : "";
1430 
1432  _builder.buildFullTree(search);
1433 
1434  _early_exit_param = "--yaml";
1435  _ready_to_exit = true;
1436  }
1437  else if (getParam<bool>("json") || isParamSetByUser("json_search"))
1438  {
1439  const std::string search =
1440  isParamSetByUser("json_search") ? getParam<std::string>("json_search") : "";
1442 
1443  JsonSyntaxTree tree(search);
1445 
1447  "json", "**START JSON DATA**\n", "\n**END JSON DATA**", tree.getRoot().dump(2));
1448  _early_exit_param = "--json";
1449  _ready_to_exit = true;
1450  }
1451  else if (getParam<bool>("syntax"))
1452  {
1454 
1455  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
1456  std::stringstream ss;
1457  for (const auto & it : syntax)
1458  ss << it.first << "\n";
1459  outputMachineReadableData("syntax", "**START SYNTAX DATA**\n", "**END SYNTAX DATA**", ss.str());
1460  _early_exit_param = "--syntax";
1461  _ready_to_exit = true;
1462  }
1463  else if (getParam<bool>("show_type"))
1464  {
1466 
1467  Moose::out << "MooseApp Type: " << type() << std::endl;
1468  _early_exit_param = "--show-type";
1469  _ready_to_exit = true;
1470  }
1471  else if (getParam<bool>("show_capabilities"))
1472  {
1474  outputMachineReadableData("show_capabilities",
1475  "**START JSON DATA**\n",
1476  "\n**END JSON DATA**",
1478  _ready_to_exit = true;
1479  }
1480  else if (isParamValid("check_capabilities"))
1481  {
1483  const auto & capabilities = getParam<std::string>("check_capabilities");
1484  auto [status, reason, doc] = Moose::Capabilities::getCapabilityRegistry().check(capabilities);
1485  const bool pass = status == CapabilityUtils::CERTAIN_PASS;
1486  _console << "Capabilities '" << capabilities << "' are " << (pass ? "" : "not ") << "fulfilled."
1487  << std::endl;
1488  _ready_to_exit = true;
1489  if (!pass)
1490  _exit_code = 77;
1491  return;
1492  }
1493  else if (!getInputFileNames().empty())
1494  {
1495  if (isParamSetByUser("recover"))
1496  {
1497  // We need to set the flag manually here since the recover parameter is a string type (takes
1498  // an optional filename)
1499  _recover = true;
1500  const auto & recover = getParam<std::string>("recover");
1501  if (recover.size())
1502  _restart_recover_base = recover;
1503  }
1504 
1505  // In the event that we've parsed once before already in MooseMain, we
1506  // won't need to parse again
1507  if (!_parser->root())
1508  _parser->parse();
1509 
1510  _builder.build();
1511 
1512  if (isParamValid("required_capabilities"))
1513  {
1515 
1516  const auto required_capabilities = getParam<std::string>("required_capabilities");
1517  auto [status, reason, doc] =
1518  Moose::Capabilities::getCapabilityRegistry().check(required_capabilities);
1520  {
1521  mooseInfo("Required capabilities '", required_capabilities, "' not fulfilled.");
1522  _ready_to_exit = true;
1523  // we use code 77 as "skip" in the Testharness
1524  _exit_code = 77;
1525  return;
1526  }
1528  mooseError("Required capabilities '",
1529  required_capabilities,
1530  "' are not specific enough. A comparison test is performed on an undefined "
1531  "capability. Disambiguate this requirement by adding an existence/non-existence "
1532  "requirement. Example: 'unknown<1.2.3' should become 'unknown & unknown<1.2.3' "
1533  "or '!unknown | unknown<1.2.3'");
1534  }
1535 
1536  // Lambda to check for mutually exclusive parameters
1537  auto isExclusiveParamSetByUser =
1538  [this](const std::vector<std::string> & group, const std::string & param)
1539  {
1540  auto is_set = isParamSetByUser(param);
1541  if (is_set)
1542  for (const auto & p : group)
1543  if (p != param && isParamSetByUser(p))
1544  mooseError("Parameters '" + p + "' and '" + param +
1545  "' are mutually exclusive. Please choose only one of them.");
1546  return is_set;
1547  };
1548 
1549  // The following parameters set the final task and so are mutually exclusive.
1550  const std::vector<std::string> final_task_params = {
1551  "mesh_only", "split_mesh", "parse_neml2_only"};
1552  if (isExclusiveParamSetByUser(final_task_params, "mesh_only"))
1553  {
1554  // If we are looking to just check the input, there is no need to
1555  // call MeshOnlyAction and generate a mesh
1556  if (_check_input)
1557  _action_warehouse.setFinalTask("setup_mesh_complete");
1558  else
1559  {
1560  _syntax.registerTaskName("mesh_only", true);
1561  _syntax.addDependency("mesh_only", "setup_mesh_complete");
1562  _syntax.addDependency("determine_system_type", "mesh_only");
1563  _action_warehouse.setFinalTask("mesh_only");
1564  }
1565  }
1566  else if (isExclusiveParamSetByUser(final_task_params, "split_mesh"))
1567  {
1568  _split_mesh = true;
1569  _syntax.registerTaskName("split_mesh", true);
1570  _syntax.addDependency("split_mesh", "setup_mesh_complete");
1571  _syntax.addDependency("determine_system_type", "split_mesh");
1572  _action_warehouse.setFinalTask("split_mesh");
1573  }
1574  else if (isExclusiveParamSetByUser(final_task_params, "parse_neml2_only"))
1575  {
1576  _syntax.registerTaskName("parse_neml2");
1577  _syntax.addDependency("determine_system_type", "parse_neml2");
1578  _action_warehouse.setFinalTask("parse_neml2");
1579  }
1581 
1582  // Setup the AppFileBase for use by the Outputs or other systems that need output file info
1583  {
1584  // Extract the CommonOutputAction
1585  const auto common_actions = _action_warehouse.getActions<CommonOutputAction>();
1586  mooseAssert(common_actions.size() <= 1, "Should not be more than one CommonOutputAction");
1587  const Action * common = common_actions.empty() ? nullptr : *common_actions.begin();
1588 
1589  // If file_base is set in CommonOutputAction through parsing input, obtain the file_base
1590  if (common && common->isParamValid("file_base"))
1591  {
1592  _output_file_base = common->getParam<std::string>("file_base");
1593  _file_base_set_by_user = true;
1594  }
1595  else if (isUltimateMaster())
1596  {
1597  // if this app is a master, we use the first input file name as the default file base.
1598  // use proximate here because the input file is an absolute path
1599  const auto & base = getLastInputFileName();
1600  size_t pos = base.find_last_of('.');
1601  _output_file_base = base.substr(0, pos);
1602  // Note: we did not append "_out" in the file base here because we do not want to
1603  // have it in between the input file name and the object name for Output/*
1604  // syntax.
1605  }
1606  // default file base for multiapps is set by MultiApp
1607  }
1608  }
1609  // No input file provided but we have other arguments (so don't just show print usage)
1610  else if (!isParamSetByUser("input_file") && _command_line->getArguments().size() > 2)
1611  {
1612  mooseAssert(getInputFileNames().empty(), "Should be empty");
1613 
1614  if (_check_input)
1615  mooseError("You specified --check-input, but did not provide an input file. Add -i "
1616  "<inputfile> to your command line.");
1617 
1618  mooseError("No input files specified. Add -i <inputfile> to your command line.");
1619  }
1620  else if (isParamValid("language_server") && getParam<bool>("language_server"))
1621  {
1623 
1624  // Reset output to the buffer what was cached before it was turned it off
1625  if (!Moose::out.rdbuf() && _output_buffer_cache)
1626  Moose::out.rdbuf(_output_buffer_cache);
1627 
1628  // Start a language server that communicates using an iostream connection
1629  MooseServer moose_server(*this);
1630 
1631  moose_server.run();
1632 
1633  _early_exit_param = "--language-server";
1634  _ready_to_exit = true;
1635  }
1636 
1637  else /* The catch-all case for bad options or missing options, etc. */
1638  {
1639  _command_line->printUsage();
1640  _early_exit_param = "bad or missing";
1641  _ready_to_exit = true;
1642  _exit_code = 1;
1643  }
1644 
1645  Moose::out << std::flush;
1646 }
void build()
Parse an input file (or text string if provided) consisting of hit syntax and setup objects in the MO...
Definition: Builder.C:328
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1227
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:837
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:1315
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212
const std::multimap< std::string, ActionInfo > & getAssociatedActions() const
Return all Syntax to Action associations.
Definition: Syntax.C:374
void buildFullTree(const std::string &search_string)
Use MOOSE Factories to construct a full parse tree for documentation or echoing input.
Definition: Builder.C:640
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
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:1942
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:760
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:227
void setFinalTask(const std::string &task)
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1324
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:205
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1196
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:251
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1312
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:222
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
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:33
int _exit_code
The exit code.
Definition: MooseApp.h:1285
CapabilityUtils::Result check(const std::string &requested_capabilities) const
check if the given required capabilities are fulfilled, returns a bool, a reason, and a verbose docum...
Definition: Capabilities.C:82
MPI_Status status
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
Definition: MooseError.h:369
const std::string & getLastInputFileName() const
Definition: MooseApp.C:1656
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:2117
T command_line_value(const std::string &, T)
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1193
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:761
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:463
void disableLivePrint()
Completely disables Live Print (cannot be restarted)
Definition: PerfGraph.C:67
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:1297
void buildJsonSyntaxTree(JsonSyntaxTree &tree) const
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
Definition: Builder.C:480
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:353
void outputMachineReadableData(const std::string &param, const std::string &start_marker, const std::string &end_marker, const std::string &data) const
Outputs machine readable data (JSON, YAML, etc.) either to the screen (if no filename was provided as...
Definition: MooseApp.C:3529
This class produces produces a dump of the InputParameters that appears like the normal input file sy...
static Capabilities & getCapabilityRegistry()
Definition: Capabilities.C:22
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1294
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1215
bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1318
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1172
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1558
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:754
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2871
const std::vector< std::string > & getInputFileNames() const
Definition: MooseApp.C:1649
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
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:1216
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:2889
bool _ready_to_exit
Definition: MooseApp.h:1283
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1303
Meta-action for creating common output object parameters This action serves two purpose, first it adds common output object parameters.
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207

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

Referenced by run().

2185 {
2186  if (getParam<bool>("show_inputs"))
2187  {
2188  const auto show_inputs_syntax = _pars.getCommandLineMetadata("show_inputs").switches;
2189  std::vector<std::string> dirs;
2190  const auto installable_inputs = getInstallableInputs();
2191 
2192  if (installable_inputs == "")
2193  {
2194  Moose::out
2195  << "Show inputs has not been overriden in this application.\nContact the developers of "
2196  "this appication and request that they override \"MooseApp::getInstallableInputs\".\n";
2197  }
2198  else
2199  {
2200  mooseAssert(!show_inputs_syntax.empty(), "show_inputs sytnax should not be empty");
2201 
2202  MooseUtils::tokenize(installable_inputs, dirs, 1, " ");
2203  Moose::out << "The following directories are installable into a user-writeable directory:\n\n"
2204  << installable_inputs << '\n'
2205  << "\nTo install one or more directories of inputs, execute the binary with the \""
2206  << show_inputs_syntax[0] << "\" flag. e.g.:\n$ "
2207  << _command_line->getExecutableName() << ' ' << show_inputs_syntax[0] << ' '
2208  << dirs[0] << '\n';
2209  }
2210  return true;
2211  }
2212  return false;
2213 }
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision.h file.
Definition: MooseApp.C:2216
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 ...
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1193
const InputParameters::CommandLineMetadata & getCommandLineMetadata(const std::string &name) const
std::vector< std::string > switches
The switches for the parameter (i.e., [-t, –timing])

◆ solutionInvalidity() [1/2]

SolutionInvalidity& MooseApp::solutionInvalidity ( )
inline

◆ solutionInvalidity() [2/2]

const SolutionInvalidity& MooseApp::solutionInvalidity ( ) const
inline

Definition at line 179 of file MooseApp.h.

179 { return _solution_invalidity; }
SolutionInvalidity & _solution_invalidity
The SolutionInvalidity object for this application.
Definition: MooseApp.h:1230

◆ syntax()

Syntax& MooseApp::syntax ( )
inline

Returns a writable reference to the syntax object.

Definition at line 251 of file MooseApp.h.

Referenced by dynamicAllRegistration(), and setupOptions().

251 { return _syntax; }
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1196

◆ testCheckpointHalfTransient()

bool MooseApp::testCheckpointHalfTransient ( ) const
inline

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

Definition at line 541 of file MooseApp.h.

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

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

◆ theWarehouse()

TheWarehouse& MooseApp::theWarehouse ( )
inline

Definition at line 130 of file MooseApp.h.

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

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

◆ 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::addConvergence(), FEProblemBase::addDistribution(), addExecutor(), addExecutorParams(), MFEMProblem::addFunction(), FEProblemBase::addFunction(), FEProblemBase::addMeshDivision(), addMeshGenerator(), MeshGenerator::addMeshSubgenerator(), FEProblemBase::addObject(), MFEMProblem::addPostprocessor(), FEProblemBase::addPredictor(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), FEProblemBase::addReporter(), FEProblemBase::addSampler(), FEProblemBase::addTimeIntegrator(), MooseServer::addValuesToList(), DisplacedProblem::addVectorTag(), SubProblem::addVectorTag(), FEProblemBase::advanceMultiApps(), appendMeshGenerator(), AuxKernelTempl< Real >::AuxKernelTempl(), FEProblemBase::backupMultiApps(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), BoundaryPreservedMarker::BoundaryPreservedMarker(), DistributedRectilinearMeshGenerator::buildCube(), MooseMesh::buildHRefinementAndCoarseningMaps(), MooseMesh::buildLowerDMesh(), MooseMesh::buildPRefinementAndCoarseningMaps(), PhysicsBase::checkComponentType(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), ActionComponent::checkRequiredTasks(), 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(), CoupledTiedValueConstraint::computeQpOffDiagJacobian(), HFEMTestJump::computeQpOffDiagJacobian(), HFEMTrialJump::computeQpOffDiagJacobian(), ArrayDGKernel::computeQpOffDiagJacobian(), HFEMDiffusion::computeQpResidual(), ArrayHFEMDiffusion::computeQpResidual(), DGConvection::computeQpResidual(), ScalarKernel::computeQpResidual(), InterfaceDiffusion::computeQpResidual(), ADMatInterfaceReaction::computeQpResidual(), InterfaceReaction::computeQpResidual(), ADDGAdvection::computeQpResidual(), ArrayDGDiffusion::computeQpResidual(), CoupledTiedValueConstraint::computeQpResidual(), TiedValueConstraint::computeQpResidual(), LinearNodalConstraint::computeQpResidual(), DGDiffusion::computeQpResidual(), ADDGDiffusion::computeQpResidual(), HFEMTrialJump::computeQpResidual(), EqualValueBoundaryConstraint::computeQpResidual(), HFEMTestJump::computeQpResidual(), FEProblemBase::computeSystems(), FEProblemBase::computeUserObjectByName(), FEProblemBase::computeUserObjects(), FEProblemBase::computeUserObjectsInternal(), DisplacedProblem::createQRules(), FEProblemBase::createQRules(), createRecoverablePerfGraph(), DumpObjectsProblem::deduceNecessaryParameters(), DumpObjectsProblem::dumpObjectHelper(), FEProblemBase::duplicateVariableCheck(), MooseBase::errorPrefix(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::execTransfers(), WebServerControl::execute(), SteadyBase::execute(), ActionWarehouse::executeActionsWithAction(), FEProblemBase::finishMultiAppStep(), FVScalarLagrangeMultiplierInterface::FVScalarLagrangeMultiplierInterface(), MooseServer::gatherDocumentReferencesLocations(), LowerDBlockFromSidesetGenerator::generate(), SubdomainPerElementGenerator::generate(), PatternedMeshGenerator::generate(), MeshGenerator::generateInternal(), MultiAppTransfer::getAppInfo(), TransfiniteMeshGenerator::getEdge(), ElementGenerator::getElemType(), MooseServer::getInputLookupDefinitionNodes(), FEProblemBase::getMaterial(), FEProblemBase::getMaterialData(), MaterialOutputAction::getParams(), ReporterData::getReporterInfo(), FEProblemBase::getTransfers(), DisplacedProblem::getVectorTags(), SubProblem::getVectorTags(), CommonOutputAction::hasConsole(), FEProblemBase::hasMultiApps(), AdvancedOutput::hasOutput(), FEProblemBase::incrementMultiAppTStep(), AdvancedOutput::initAvailableLists(), FunctorPositions::initialize(), FunctorTimes::initialize(), MultiAppConservativeTransfer::initialSetup(), LinearFVDiffusion::initialSetup(), LinearFVAnisotropicDiffusion::initialSetup(), LinearFVAdvection::initialSetup(), ArrayDGDiffusion::initQpResidual(), AdvancedOutput::initShowHideLists(), RelationshipManager::isType(), FEProblemBase::logAdd(), MaterialFunctorConverterTempl< T >::MaterialFunctorConverterTempl(), MFEMProblem::mesh(), MooseObject::MooseObject(), MultiAppMFEMCopyTransfer::MultiAppMFEMCopyTransfer(), DisplacedProblem::numVectorTags(), SubProblem::numVectorTags(), Console::output(), AdvancedOutput::output(), ConsoleUtils::outputExecutionInformation(), SampledOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), MooseServer::parseDocumentForDiagnostics(), MooseMesh::prepare(), 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

◆ unusedFlagIsError()

bool MooseApp::unusedFlagIsError ( ) const
inline

Returns whether the flag for unused parameters is set to throw an error.

Definition at line 1091 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), and PhysicsBase::reportPotentiallyMissedParameters().

1091 { return _enable_unused_check == ERROR_UNUSED; }
enum MooseApp::UNUSED_CHECK _enable_unused_check

◆ unusedFlagIsWarning()

bool MooseApp::unusedFlagIsWarning ( ) const
inline

Returns whether the flag for unused parameters is set to throw a warning only.

Definition at line 1088 of file MooseApp.h.

Referenced by MeshOnlyAction::act(), and PhysicsBase::reportPotentiallyMissedParameters().

1088 { return _enable_unused_check == WARN_UNUSED; }
enum MooseApp::UNUSED_CHECK _enable_unused_check

◆ useEigenvalue()

bool& MooseApp::useEigenvalue ( )
inline

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

Definition at line 419 of file MooseApp.h.

Referenced by CreateProblemDefaultAction::act().

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

◆ useExecutor()

bool MooseApp::useExecutor ( ) const
inline

Definition at line 363 of file MooseApp.h.

363 { 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:1255

◆ useMasterMesh()

bool MooseApp::useMasterMesh ( ) const
inline

Returns whether to use the parent app mesh as the mesh for this app.

Definition at line 842 of file MooseApp.h.

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

842 { return _use_master_mesh; }
const bool _use_master_mesh
Whether to use the parent app mesh for this app.
Definition: MooseApp.h:1532

◆ useNonlinear()

bool& MooseApp::useNonlinear ( )
inline

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

Definition at line 414 of file MooseApp.h.

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

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

◆ validParams()

InputParameters MooseApp::validParams ( )
static

Definition at line 108 of file MooseApp.C.

109 {
111 
112  MooseApp::addAppParam(params);
113  MooseApp::addInputParam(params);
114 
115  params.addCommandLineParam<bool>("display_version", "-v --version", "Print application version");
116 
117  params.addOptionalValuedCommandLineParam<std::string>(
118  "mesh_only",
119  "--mesh-only <optional path>",
120  "",
121  "Build and output the mesh only (Default: \"<input_file_name>_in.e\")");
122 
123  params.addCommandLineParam<bool>(
124  "show_input", "--show-input", "Shows the parsed input file before running the simulation");
125  params.setGlobalCommandLineParam("show_input");
126  params.addCommandLineParam<bool>(
127  "show_outputs", "--show-outputs", "Shows the output execution time information");
128  params.setGlobalCommandLineParam("show_outputs");
129  params.addCommandLineParam<bool>(
130  "show_controls", "--show-controls", "Shows the Control logic available and executed");
131  params.setGlobalCommandLineParam("show_controls");
132 
133  params.addCommandLineParam<bool>(
134  "no_color", "--no-color", "Disable coloring of all Console outputs");
135  params.setGlobalCommandLineParam("no_color");
136 
137  MooseEnum colors("auto on off", "on");
139  "color", "--color <auto,on,off=on>", colors, "Whether to use color in console output");
140  params.setGlobalCommandLineParam("color");
141 
142  params.addCommandLineParam<bool>("help", "-h --help", "Displays CLI usage statement");
143  params.addCommandLineParam<bool>(
144  "minimal",
145  "--minimal",
146  "Ignore input file and build a minimal application with Transient executioner");
147 
148  params.addCommandLineParam<bool>(
149  "language_server",
150  "--language-server",
151  "Starts a process to communicate with development tools using the language server protocol");
152 
153  params.addCommandLineParam<bool>(
154  "definition", "--definition", "Shows a SON style input definition dump for input validation");
155  params.addCommandLineParam<bool>("dump", "--dump", "Shows a dump of available input file syntax");
156  params.addCommandLineParam<std::string>(
157  "dump_search",
158  "--dump-search <search>",
159  "Shows a dump of available input syntax matching a search");
160  params.addCommandLineParam<bool>("registry", "--registry", "Lists all known objects and actions");
161  params.addCommandLineParam<bool>(
162  "registry_hit", "--registry-hit", "Lists all known objects and actions in hit format");
163  params.addCommandLineParam<bool>(
164  "use_executor", "--executor", "Use the new Executor system instead of Executioners");
165 
166  params.addCommandLineParam<bool>(
167  "show_type", "--show-type", "Return the name of the application object");
168  params.addCommandLineParam<bool>("yaml", "--yaml", "Dumps all input file syntax in YAML format");
169  params.addCommandLineParam<std::string>(
170  "yaml_search", "--yaml-search", "Dumps input file syntax matching a search in YAML format");
171  params.addCommandLineParam<bool>("json", "--json", "Dumps all input file syntax in JSON format");
172  params.addCommandLineParam<std::string>(
173  "json_search", "--json-search", "Dumps input file syntax matching a search in JSON format");
174  params.addCommandLineParam<bool>(
175  "syntax", "--syntax", "Dumps the associated Action syntax paths ONLY");
176  params.addCommandLineParam<bool>(
177  "show_docs", "--docs", "Print url/path to the documentation website");
178  params.addCommandLineParam<bool>(
179  "show_capabilities", "--show-capabilities", "Dumps the capability registry in JSON format.");
180  params.addCommandLineParam<std::string>(
181  "required_capabilities",
182  "--required-capabilities",
183  "A list of conditions that is checked against the registered capabilities (see "
184  "--show-capabilities). The executable will terminate early if the conditions are not met.");
185  params.addCommandLineParam<std::string>(
186  "check_capabilities",
187  "--check-capabilities",
188  "A list of conditions that is checked against the registered capabilities. Will exit based "
189  "on whether or not the capaiblities are fulfilled. Does not check dynamically loaded apps.");
190  params.addCommandLineParam<bool>("check_input",
191  "--check-input",
192  "Check the input file (i.e. requires -i <filename>) and quit");
193  params.setGlobalCommandLineParam("check_input");
194  params.addCommandLineParam<bool>(
195  "show_inputs",
196  "--show-copyable-inputs",
197  "Shows the directories able to be copied into a user-writable location");
198 
199  params.addCommandLineParam<std::string>(
200  "copy_inputs",
201  "--copy-inputs <dir>",
202  "Copies installed inputs (e.g. tests, examples, etc.) to a directory <appname>_<dir>");
203  // TODO: Should this remain a bool? It can't be a regular argument because it contains
204  // values that have dashes in it, so it'll get treated as another arg
205  params.addOptionalValuedCommandLineParam<std::string>(
206  "run",
207  "--run <test harness args>",
208  "",
209  "Runs the inputs in the current directory copied to a "
210  "user-writable location by \"--copy-inputs\"");
211 
212  params.addCommandLineParam<bool>(
213  "list_constructed_objects",
214  "--list-constructed-objects",
215  "List all moose object type names constructed by the master app factory");
216 
217  params.addCommandLineParam<unsigned int>(
218  "n_threads", "--n-threads=<n>", "Runs the specified number of threads per process");
219  // This probably shouldn't be global, but the implications of removing this are currently
220  // unknown and we need to manage it with libmesh better
221  params.setGlobalCommandLineParam("n_threads");
222 
223  params.addCommandLineParam<bool>("allow_unused",
224  "-w --allow-unused",
225  "Warn about unused input file options instead of erroring");
226  params.setGlobalCommandLineParam("allow_unused");
227  params.addCommandLineParam<bool>(
228  "error_unused", "-e --error-unused", "Error when encountering unused input file options");
229  params.setGlobalCommandLineParam("error_unused");
230  params.addCommandLineParam<bool>(
231  "error_override",
232  "-o --error-override",
233  "Error when encountering overridden or parameters supplied multiple times");
234  params.setGlobalCommandLineParam("error_override");
235  params.addCommandLineParam<bool>(
236  "error_deprecated", "--error-deprecated", "Turn deprecated code messages into Errors");
237  params.setGlobalCommandLineParam("error_deprecated");
238 
239  params.addCommandLineParam<bool>("distributed_mesh",
240  "--distributed-mesh",
241  "Forces the use of a distributed finite element mesh");
242  // Would prefer that this parameter isn't global, but we rely on it too much
243  // in tests to be able to go back on that decision now
244  params.setGlobalCommandLineParam("distributed_mesh");
245 
246  params.addCommandLineParam<std::string>(
247  "split_mesh",
248  "--split-mesh <splits>",
249  "Comma-separated list of numbers of chunks to split the mesh into");
250 
251  // TODO: remove the logic now that this is global
252  params.addCommandLineParam<std::string>(
253  "split_file", "--split-file <filename>", "Name of split mesh file(s) to write/read");
254 
255  params.addCommandLineParam<bool>("use_split", "--use-split", "Use split distributed mesh files");
256 
257  params.addCommandLineParam<unsigned int>(
258  "refinements", "-r <num refinements>", "Specify additional initial uniform mesh refinements");
259 
260  params.addOptionalValuedCommandLineParam<std::string>(
261  "recover",
262  "--recover <optional file base>",
263  "",
264  "Continue the calculation. Without <file base>, the most recent recovery file will be used");
265  params.setGlobalCommandLineParam("recover");
266  params.addCommandLineParam<bool>(
267  "force_restart",
268  "--force-restart",
269  "Forcefully load checkpoints despite possible incompatibilities");
270  params.setGlobalCommandLineParam("force_restart");
271 
272  params.addCommandLineParam<bool>("suppress_header",
273  "--suppress-header",
274  false,
275  "Disables the output of the application header.");
276  params.setGlobalCommandLineParam("suppress_header");
277 
278  params.addCommandLineParam<bool>(
279  "test_checkpoint_half_transient",
280  "--test-checkpoint-half-transient",
281  "Run half of a transient with checkpoints enabled; used by the TestHarness");
282  params.setGlobalCommandLineParam("test_checkpoint_half_transient");
283 
284  params.addCommandLineParam<bool>(
285  "trap_fpe",
286  "--trap-fpe",
287  "Enable floating point exception handling in critical sections of code"
288 #ifdef DEBUG
289  " (automatic due to debug build)"
290 #endif
291  );
292  params.setGlobalCommandLineParam("trap_fpe");
293 
294  params.addCommandLineParam<bool>(
295  "no_trap_fpe",
296  "--no-trap-fpe",
297  "Disable floating point exception handling in critical sections of code"
298 #ifndef DEBUG
299  " (unused due to non-debug build)"
300 #endif
301  );
302 
303  params.setGlobalCommandLineParam("no_trap_fpe");
304 
305  params.addCommandLineParam<bool>(
306  "no_gdb_backtrace", "--no-gdb-backtrace", "Disables gdb backtraces.");
307  params.setGlobalCommandLineParam("no_gdb_backtrace");
308 
309  params.addCommandLineParam<bool>("error", "--error", "Turn all warnings into errors");
310  params.setGlobalCommandLineParam("error");
311 
312  params.addCommandLineParam<bool>("timing",
313  "-t --timing",
314  "Enable all performance logging for timing; disables screen "
315  "output of performance logs for all Console objects");
316  params.setGlobalCommandLineParam("timing");
317  params.addCommandLineParam<bool>(
318  "no_timing", "--no-timing", "Disabled performance logging; overrides -t or --timing");
319  params.setGlobalCommandLineParam("no_timing");
320 
321  params.addCommandLineParam<bool>(
322  "allow_test_objects", "--allow-test-objects", "Register test objects and syntax");
323  params.setGlobalCommandLineParam("allow_test_objects");
324 
325  // Options ignored by MOOSE but picked up by libMesh, these are here so that they are displayed in
326  // the application help
327  params.addCommandLineParam<bool>(
328  "keep_cout",
329  "--keep-cout",
330  "Keep standard output from all processors when running in parallel");
331  params.setGlobalCommandLineParam("keep_cout");
332  params.addCommandLineParam<bool>(
333  "redirect_stdout",
334  "--redirect-stdout",
335  "Keep standard output from all processors when running in parallel");
336  params.setGlobalCommandLineParam("redirect_stdout");
337 
338  params.addCommandLineParam<std::string>(
339  "timpi_sync",
340  "--timpi-sync <type=nbx>",
341  "nbx",
342  "Changes the sync type used in spare parallel communitations within TIMPI");
343  params.setGlobalCommandLineParam("timpi_sync");
344 
345  // Options for debugging
346  params.addCommandLineParam<std::string>("start_in_debugger",
347  "--start-in-debugger <debugger>",
348  "Start the application and attach a debugger; this will "
349  "launch xterm windows using <debugger>");
350 
351  params.addCommandLineParam<unsigned int>(
352  "stop_for_debugger",
353  "--stop-for-debugger <seconds>",
354  "Pauses the application during startup for <seconds> to allow for connection of debuggers");
355 
356  params.addCommandLineParam<bool>(
357  "perf_graph_live_all", "--perf-graph-live-all", "Forces printing of ALL progress messages");
358  params.setGlobalCommandLineParam("perf_graph_live_all");
359 
360  params.addCommandLineParam<bool>(
361  "disable_perf_graph_live", "--disable-perf-graph-live", "Disables PerfGraph live printing");
362  params.setGlobalCommandLineParam("disable_perf_graph_live");
363 
364  params.addParam<bool>(
365  "automatic_automatic_scaling", false, "Whether to turn on automatic scaling by default");
366 
367  MooseEnum libtorch_device_type("cpu cuda mps", "cpu");
368  params.addCommandLineParam<MooseEnum>("libtorch_device",
369  "--libtorch-device",
370  libtorch_device_type,
371  "The device type we want to run libtorch on.");
372 
373 #ifdef HAVE_GPERFTOOLS
374  params.addCommandLineParam<std::string>(
375  "gperf_profiler_on",
376  "--gperf-profiler-on <ranks>",
377  "To generate profiling report only on comma-separated list of MPI ranks");
378 #endif
379 
380  params.addCommandLineParam<bool>(
381  "show_data_params",
382  "--show-data-params",
383  false,
384  "Show found paths for all DataFileName parameters in the header");
385  params.addCommandLineParam<bool>("show_data_paths",
386  "--show-data-paths",
387  false,
388  "Show registered data paths for searching in the header");
389 
390  params.addPrivateParam<std::string>("_app_name"); // the name passed to AppFactory::create
391  params.addPrivateParam<std::string>("_type");
392  params.addPrivateParam<int>("_argc");
393  params.addPrivateParam<char **>("_argv");
394  params.addPrivateParam<std::shared_ptr<CommandLine>>("_command_line");
395  params.addPrivateParam<std::shared_ptr<Parallel::Communicator>>("_comm");
396  params.addPrivateParam<unsigned int>("_multiapp_level");
397  params.addPrivateParam<unsigned int>("_multiapp_number");
398  params.addPrivateParam<bool>("_use_master_mesh", false);
399  params.addPrivateParam<const MooseMesh *>("_master_mesh");
400  params.addPrivateParam<const MooseMesh *>("_master_displaced_mesh");
401  params.addPrivateParam<std::unique_ptr<Backup> *>("_initial_backup", nullptr);
402  params.addPrivateParam<std::shared_ptr<Parser>>("_parser");
403 #ifdef MOOSE_MFEM_ENABLED
404  params.addPrivateParam<std::shared_ptr<mfem::Device>>("_mfem_device");
405  params.addPrivateParam<std::vector<std::string>>("_mfem_devices");
406 #endif
407 
408  params.addParam<bool>(
409  "use_legacy_material_output",
410  true,
411  "Set false to allow material properties to be output on INITIAL, not just TIMESTEP_END.");
412  params.addParam<bool>(
413  "use_legacy_initial_residual_evaluation_behavior",
414  true,
415  "The legacy behavior performs an often times redundant residual evaluation before the "
416  "solution modifying objects are executed prior to the initial (0th nonlinear iteration) "
417  "residual evaluation. The new behavior skips that redundant residual evaluation unless the "
418  "parameter Executioner/use_pre_SMO_residual is set to true.");
419 
420  params.addParam<bool>(
422  false,
423  "Set true to enable data-driven mesh generation, which is an experimental feature");
424 
425  params.addCommandLineParam<bool>(
426  "parse_neml2_only",
427  "--parse-neml2-only",
428  "Executes the [NEML2] block to parse the input file and terminate.");
429 
430  MooseApp::addAppParam(params);
431 
432  return params;
433 }
void setGlobalCommandLineParam(const std::string &name)
Sets the command line parameter with name as global.
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...
static void addInputParam(InputParameters &params)
Definition: MooseApp.C:101
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)
static void addAppParam(InputParameters &params)
Definition: MooseApp.C:94
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional 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.
void addOptionalValuedCommandLineParam(const std::string &name, const std::string &syntax, const T &value, const std::string &doc_string)
Add a command line parameter with an optional value.

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

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

2552 {
2553  if (processor_id() != 0)
2554  mooseError("MooseApp::writeRestartableMetaData(): Should only run on processor 0");
2555 
2556  const auto & map_name = getRestartableDataMapName(name);
2557  const auto meta_data_folder_base = metaDataFolderBase(folder_base, map_name);
2558 
2560  return writer.write(meta_data_folder_base);
2561 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:3044
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:434
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:3425
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:3452

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

2565 {
2566  std::vector<std::filesystem::path> paths;
2567 
2568  if (processor_id() == 0)
2569  for (const auto & name_map_pair : _restartable_meta_data)
2570  {
2571  const auto map_paths = writeRestartableMetaData(name_map_pair.first, folder_base);
2572  paths.insert(paths.end(), map_paths.begin(), map_paths.end());
2573  }
2574 
2575  return paths;
2576 }
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:1513
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:2550
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:434

Friends And Related Function Documentation

◆ FEProblemBase

friend class FEProblemBase
friend

Definition at line 1598 of file MooseApp.h.

◆ Restartable

friend class Restartable
friend

Definition at line 1599 of file MooseApp.h.

◆ SubProblem

friend class SubProblem
friend

Definition at line 1600 of file MooseApp.h.

Member Data Documentation

◆ _action_factory

ActionFactory MooseApp::_action_factory
protected

The Factory responsible for building Actions.

Definition at line 1203 of file MooseApp.h.

Referenced by createMinimalApp(), and getActionFactory().

◆ _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(), FEProblemBase::acceptInvalidSolution(), ElementIDOutputAction::act(), CopyNodalVarsAction::act(), CreateExecutionerAction::act(), DeclareLateReportersAction::act(), AddExecutorAction::act(), AutoCheckpointAction::act(), ExecuteMeshGenerators::act(), AddMeshGeneratorAction::act(), ReadExecutorParamsAction::act(), CheckIntegrityAction::act(), SetupMeshCompleteAction::act(), CreateProblemAction::act(), CreateProblemDefaultAction::act(), AdaptivityAction::act(), MeshOnlyAction::act(), SetupMeshAction::act(), CombineComponentsMeshes::act(), SplitMeshAction::act(), AddTimeStepperAction::act(), SetupDebugAction::act(), SetupPredictorAction::act(), SetupTimeStepperAction::act(), ComposeTimeStepperAction::act(), SetupRecoverFileBaseAction::act(), CouplingFunctorCheckAction::act(), AddRelationshipManager::act(), SetAdaptivityOptionsAction::act(), CreateAddedMeshGenerators::act(), DisplayGhostingAction::act(), MaterialOutputAction::act(), ResolveOptionalMaterialPropertiesAction::act(), AddPeriodicBCAction::act(), CommonOutputAction::act(), Action::Action(), FEProblemBase::addAnyRedistributers(), MeshGenerator::addChildMeshGenerator(), FEProblemBase::addMaterialHelper(), ComponentMeshTransformHelper::addMeshGenerators(), CylinderComponent::addMeshGenerators(), BatchMeshGeneratorAction::addMeshGenerators(), MeshGenerator::addMeshSubgenerator(), FEProblemBase::addMultiApp(), FEProblemBase::addOutput(), MeshGenerator::addParentMeshGenerator(), CreateDisplacedProblemAction::addProxyRelationshipManagers(), Action::addRelationshipManager(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), FileMesh::buildMesh(), MooseMesh::buildTypedMesh(), MooseMesh::cacheFaceInfoVariableOwnership(), MooseMesh::cacheFVElementalDoFs(), MooseBase::callMooseError(), CheckOutputAction::checkConsoleOutput(), DefaultNonlinearConvergence::checkConvergence(), MeshGenerator::checkGetMesh(), FEProblemBase::checkICRestartError(), CheckOutputAction::checkMaterialOutput(), CheckOutputAction::checkPerfLogOutput(), FEProblemBase::checkProblemIntegrity(), CheckOutputAction::checkVariableOutput(), SingleRankPartitioner::clone(), CopyMeshPartitioner::clone(), RandomPartitioner::clone(), BlockWeightedPartitioner::clone(), GhostEverything::clone(), GhostHigherDLowerDPointNeighbors::clone(), GhostLowerDElems::clone(), LibmeshPartitioner::clone(), PetscExternalPartitioner::clone(), HierarchicalGridPartitioner::clone(), GridPartitioner::clone(), ElementSideNeighborLayers::clone(), ElementPointNeighborLayers::clone(), GhostBoundary::clone(), RedistributeProperties::clone(), ProxyRelationshipManager::clone(), SampledOutput::cloneMesh(), FEProblemBase::computeJacobianTags(), FEProblemBase::computeLinearSystemTags(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualTags(), Console::Console(), TimeStepper::constrainStep(), CopyMeshPartitioner::CopyMeshPartitioner(), MultiApp::createApp(), MultiApp::createApps(), FEProblemBase::customSetup(), MeshGenerator::declareMeshProperty(), MeshGenerator::declareNullMeshName(), MooseMesh::determineUseDistributedMesh(), DumpObjectsProblem::dumpObjectHelper(), DumpObjectsProblem::DumpObjectsProblem(), DumpObjectsProblem::dumpVariableHelper(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), PseudoTimestep::execute(), IterationInfo::execute(), MFEMSteady::execute(), PIDTransientControl::execute(), TransientBase::execute(), SteadyBase::execute(), Eigenvalue::execute(), EigenProblem::execute(), ExtraIDIntegralReporter::ExtraIDIntegralReporter(), FEProblemBase::FEProblemBase(), FileOutput::FileOutput(), ChangeOverFixedPointPostprocessor::finalize(), RadialAverage::finalize(), FixedPointSolve::FixedPointSolve(), FEProblemBase::forceOutput(), FullSolveMultiApp::FullSolveMultiApp(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), FVAdvection::FVAdvection(), FileMeshGenerator::generate(), ExtraNodesetGenerator::generate(), SideSetsFromNormalsGenerator::generate(), MeshGenerator::generateInternal(), FEProblemBase::getExecutor(), MeshGenerator::getMeshByName(), MooseBase::getMooseApp(), NumRelationshipManagers::getValue(), NumFixedPointIterations::getValue(), GhostingUserObject::GhostingUserObject(), InversePowerMethod::init(), NonlinearEigen::init(), TransientBase::init(), Eigenvalue::init(), MooseMesh::init(), FEProblemBase::init(), TimePeriod::initialSetup(), Console::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), EigenProblem::initPetscOutputAndSomeSolverSettings(), FEProblemBase::initPetscOutputAndSomeSolverSettings(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), MFEMProblem::initProblemOperator(), MeshGenerator::MeshGenerator(), MFEMExecutioner::MFEMExecutioner(), MFEMTransient::MFEMTransient(), MooseObject::MooseObject(), MultiAppGeneralFieldTransfer::MultiAppGeneralFieldTransfer(), NEML2Action::NEML2Action(), EigenExecutionerBase::normalizeSolution(), NumFailedTimeSteps::NumFailedTimeSteps(), PerfGraphOutput::output(), Tecplot::output(), Exodus::output(), Checkpoint::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), JSONOutput::outputReporters(), SampledOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), JSONOutput::outputSystemInformation(), Console::outputSystemInformation(), OverlayMeshGenerator::OverlayMeshGenerator(), MultiApp::parentOutputPositionChanged(), TransientBase::preExecute(), PhysicsBase::prepareCopyVariablesFromMesh(), Eigenvalue::prepareSolverOptions(), NEML2Action::printSummary(), FEProblemBase::projectSolution(), PhysicsBase::reportPotentiallyMissedParameters(), TiledMesh::safeClone(), FileMesh::safeClone(), ImageMesh::safeClone(), GeneratedMesh::safeClone(), ConcentricCircleMesh::safeClone(), AnnularMesh::safeClone(), SpiralAnnularMesh::safeClone(), RinglebMesh::safeClone(), MeshGeneratorMesh::safeClone(), StitchedMesh::safeClone(), PatternedMesh::safeClone(), MFEMMesh::safeClone(), MultiApp::setAppOutputFileBase(), FileOutput::setFileBaseInternal(), MeshGenerator::setMeshProperty(), MeshGenerator::setMeshPropertyHelper(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), MeshGeneratorComponent::setupComponent(), SetupMeshAction::setupMesh(), TimeSequenceStepperBase::setupSequence(), TransientBase::setupTimeIntegrator(), Output::setWallTimeIntervalFromCommandLineParam(), PhysicsBase::shouldCreateIC(), 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(), TransientBase::TransientBase(), 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 1331 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 1561 of file MooseApp.h.

Referenced by defaultAutomaticScaling().

◆ _builder

Moose::Builder MooseApp::_builder
protected

Builder for building app related parser tree.

Definition at line 1215 of file MooseApp.h.

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

◆ _chain_control_system

ChainControlDataSystem MooseApp::_chain_control_system
private

The system that manages the ChainControls.

Definition at line 1544 of file MooseApp.h.

Referenced by getChainControlDataSystem().

◆ _check_input

bool MooseApp::_check_input
protected

true if we want to just check the input file

Definition at line 1324 of file MooseApp.h.

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

◆ _comm

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

The MPI communicator this App is going to use.

Definition at line 1169 of file MooseApp.h.

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

◆ _command_line

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

Command line object.

Definition at line 1193 of file MooseApp.h.

Referenced by commandLine(), copyInputs(), executeExecutioner(), 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(), DefaultSteadyStateConvergence::checkConvergence(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), SolverSystem::checkInvalidSolution(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), IterationAdaptiveDT::computeAdaptiveDT(), TransientBase::computeConstrainedDT(), DefaultMultiAppFixedPointConvergence::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), FixedPointIterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), LinearSystem::computeLinearSystemTags(), FEProblemBase::computeLinearSystemTags(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MFEMSteady::execute(), MessageFromInput::execute(), SteadyBase::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MeshGeneratorSystem::executeMeshGenerators(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), CoarsenBlockGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), DefaultMultiAppFixedPointConvergence::initialize(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), TransientBase::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseBaseErrorInterface::mooseDeprecated(), MooseBaseErrorInterface::mooseInfo(), MooseBaseErrorInterface::mooseWarning(), MooseBaseErrorInterface::mooseWarningNonPrefixed(), ReferenceResidualConvergence::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), SolutionInvalidityOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), DefaultMultiAppFixedPointConvergence::outputResidualNorm(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), NEML2Action::printSummary(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), FEProblemBase::restoreSolutions(), NonlinearSystemBase::setInitialSolution(), setupOptions(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), EigenProblem::solve(), FEProblemSolve::solve(), FixedPointSolve::solve(), NonlinearSystem::solve(), LinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), PerfGraphLivePrint::start(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), TransientBase::takeStep(), TerminateChainControl::terminate(), Convergence::verboseOutput(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _cpu_profiling

bool MooseApp::_cpu_profiling = false
private

CPU profiling.

Definition at line 1564 of file MooseApp.h.

Referenced by ~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 1294 of file MooseApp.h.

Referenced by getDistributedMeshOnCommandLine(), and setupOptions().

◆ _early_exit_param

std::string MooseApp::_early_exit_param
protected

Indicates if simulation is ready to exit, and keeps track of which param caused it to exit.

Definition at line 1282 of file MooseApp.h.

Referenced by errorCheck(), run(), runInputFile(), 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 1280 of file MooseApp.h.

Referenced by setErrorOverridden().

◆ _ex_reader

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

The Exodus reader when _initial_from_file is set to true.

Definition at line 1291 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 1555 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 1236 of file MooseApp.h.

Referenced by attachRelationshipManagers(), errorCheck(), 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 1247 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 1242 of file MooseApp.h.

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

◆ _exit_code

int MooseApp::_exit_code
protected

The exit code.

Definition at line 1285 of file MooseApp.h.

Referenced by exitCode(), setExitCode(), and setupOptions().

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

Referenced by fixedPointConfig().

◆ _force_restart

const bool MooseApp::_force_restart
protected

Whether or not we are forcefully attempting to load checkpoints (–force-restart)

Definition at line 1309 of file MooseApp.h.

Referenced by forceRestart().

◆ _global_time_offset

Real MooseApp::_global_time_offset
protected

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

Definition at line 1190 of file MooseApp.h.

Referenced by getGlobalTimeOffset(), and setGlobalTimeOffset().

◆ _heap_profiling

bool MooseApp::_heap_profiling = false
private

Memory profiling.

Definition at line 1567 of file MooseApp.h.

Referenced by ~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 1582 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 1288 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 1200 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 1576 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 1348 of file MooseApp.h.

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

◆ _libtorch_device

const torch::DeviceType MooseApp::_libtorch_device
private

The libtorch device this app is using.

Definition at line 1586 of file MooseApp.h.

◆ _master_displaced_mesh

const MooseMesh* const MooseApp::_master_displaced_mesh
private

The displaced mesh from master app.

Definition at line 1538 of file MooseApp.h.

Referenced by masterDisplacedMesh().

◆ _master_mesh

const MooseMesh* const MooseApp::_master_mesh
private

The mesh from master app.

Definition at line 1535 of file MooseApp.h.

Referenced by masterMesh().

◆ _mesh_generator_system

MeshGeneratorSystem MooseApp::_mesh_generator_system
private

◆ _mfem_device

std::shared_ptr<mfem::Device> MooseApp::_mfem_device
private

The MFEM Device object.

Definition at line 1591 of file MooseApp.h.

Referenced by getMFEMDevice(), and setMFEMDevice().

◆ _mfem_devices

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

MFEM supported devices based on user-provided config.

Definition at line 1594 of file MooseApp.h.

Referenced by getMFEMDevices(), and setMFEMDevice().

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

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

◆ _multiapp_number

unsigned int MooseApp::_multiapp_number
private

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

Definition at line 1529 of file MooseApp.h.

Referenced by multiAppNumber().

◆ _name

const std::string MooseBase::_name
protectedinherited

The name of this class.

Definition at line 90 of file MooseBase.h.

Referenced by AddBCAction::act(), AddConstraintAction::act(), AddFVInitialConditionAction::act(), AddPostprocessorAction::act(), AddVectorPostprocessorAction::act(), AddKernelAction::act(), AddMultiAppAction::act(), PartitionerAction::act(), AddInterfaceKernelAction::act(), AddNodalKernelAction::act(), AddDiracKernelAction::act(), AddDGKernelAction::act(), AddMarkerAction::act(), AddIndicatorAction::act(), AddInitialConditionAction::act(), AddMeshGeneratorAction::act(), AddDamperAction::act(), AddFVInterfaceKernelAction::act(), AddMaterialAction::act(), AddScalarKernelAction::act(), AddTransferAction::act(), AddFunctorMaterialAction::act(), AddUserObjectAction::act(), ReadExecutorParamsAction::act(), AddPositionsAction::act(), AddReporterAction::act(), AddTimesAction::act(), AddFieldSplitAction::act(), AddFVKernelAction::act(), AddFVBCAction::act(), AddFunctionAction::act(), AddConvergenceAction::act(), AddMeshDivisionAction::act(), AddHDGKernelAction::act(), AddTimeStepperAction::act(), AddDistributionAction::act(), SetupPreconditionerAction::act(), SetupTimeIntegratorAction::act(), AddOutputAction::act(), AddLinearFVBCAction::act(), AddLinearFVKernelAction::act(), AddCorrectorAction::act(), AddMeshModifiersAction::act(), AddSamplerAction::act(), AddControlAction::act(), AddMFEMSolverAction::act(), AddMFEMPreconditionerAction::act(), AddMFEMSubMeshAction::act(), AddMFEMFESpaceAction::act(), AddPeriodicBCAction::act(), ADPiecewiseLinearInterpolationMaterial::ADPiecewiseLinearInterpolationMaterial(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), PiecewiseTabularBase::buildFromFile(), PiecewiseTabularBase::buildFromXY(), PiecewiseLinearBase::buildInterpolation(), CombinerGenerator::CombinerGenerator(), Executor::Executor(), ExtraIDIntegralReporter::ExtraIDIntegralReporter(), QuadraturePointMultiApp::fillPositions(), CentroidMultiApp::fillPositions(), MultiApp::fillPositions(), FunctionDT::FunctionDT(), FillBetweenCurvesGenerator::generate(), FillBetweenPointVectorsGenerator::generate(), FillBetweenSidesetsGenerator::generate(), NearestPointBase< LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject >::name(), ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseBase::setData(), and AddVariableAction::varName().

◆ _null_executor

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

Used to return an executor that does nothing.

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

Referenced by setupOptions().

◆ _output_file_base

std::string MooseApp::_output_file_base
protected

The output file basename.

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

Referenced by getOutputFileNumbers(), and setOutputFileNumbers().

◆ _output_position

Point MooseApp::_output_position
protected

The output position.

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

Referenced by hasOutputPosition(), and setOutputPosition().

◆ _output_warehouse

OutputWarehouse MooseApp::_output_warehouse
protected

OutputWarehouse object for this App.

Definition at line 1209 of file MooseApp.h.

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

◆ _pars

const InputParameters& MooseApp::_pars
protected

Parameters of this object.

Definition at line 1163 of file MooseApp.h.

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

◆ _parser

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

Parser for parsing the input file.

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

Referenced by rankMap().

◆ _rd_reader

RestartableDataReader MooseApp::_rd_reader
private

Definition at line 1546 of file MooseApp.h.

Referenced by finalizeRestore(), and restore().

◆ _ready_to_exit

bool MooseApp::_ready_to_exit
protected

Definition at line 1283 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 1297 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 1224 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 1300 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 1315 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 1218 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 1230 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 1303 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 1187 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 1184 of file MooseApp.h.

Referenced by hasStartTime(), and setStartTime().

◆ _syntax

Syntax MooseApp::_syntax
protected

Syntax of the input file.

Definition at line 1196 of file MooseApp.h.

Referenced by setupOptions(), and syntax().

◆ _sys_info

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

System Information.

Definition at line 1267 of file MooseApp.h.

Referenced by getSystemInfo().

◆ _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 1573 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 1318 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 1523 of file MooseApp.h.

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

◆ _trap_fpe

bool MooseApp::_trap_fpe
protected

Whether or not FPE trapping should be turned on.

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

◆ _undisp_to_disp_rms

std::unordered_map<RelationshipManager *, std::shared_ptr<libMesh::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 1338 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 1264 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 1255 of file MooseApp.h.

Referenced by executeExecutioner(), and useExecutor().

◆ _use_master_mesh

const bool MooseApp::_use_master_mesh
private

Whether to use the parent app mesh for this app.

Definition at line 1532 of file MooseApp.h.

Referenced by useMasterMesh().

◆ _use_nonlinear

bool MooseApp::_use_nonlinear
protected

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

Definition at line 1261 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 1306 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 124 of file MooseApp.h.


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