12#ifdef MOOSE_LIBTORCH_ENABLED
14#include <torch/types.h>
16#include <torch/cuda.h>
17#include <c10/core/DeviceType.h>
44#include "libmesh/parallel_object.h"
45#include "libmesh/mesh_base.h"
46#include "libmesh/point.h"
52#include <unordered_set>
70#ifdef MOOSE_MFEM_ENABLED
83#ifdef MOOSE_KOKKOS_ENABLED
92#include "gtest/gtest.h"
115#ifdef MOOSE_LIBTORCH_ENABLED
154 if (
name.find_first_of(
"/") != std::string::npos)
155 name =
name.substr(
name.find_first_of(
"/") + 1, std::string::npos);
325 std::string
getFileName(
bool stripLeadingPath =
true)
const;
359 const std::string &
name,
504 "MooseApp::getRestartRecoverFileBase() instead.");
514 if (file_base.empty())
579 std::string library_path,
580 const std::string & library_name);
582 std::string library_path,
583 const std::string & library_name,
635 std::unique_ptr<RestartableDataValue> data,
665 const std::filesystem::path & folder_base);
677 std::vector<std::filesystem::path>
679 const std::filesystem::path & folder_base);
685 std::vector<std::filesystem::path>
734 std::vector<std::filesystem::path>
backup(
const std::filesystem::path & folder_base);
740 std::unique_ptr<Backup>
backup();
783 void restore(
const std::filesystem::path & folder_base,
const bool for_restart);
796 void restore(std::unique_ptr<Backup>
backup,
const bool for_restart);
849 virtual std::string
header()
const;
903 const std::string &
name,
997 static std::filesystem::path
metaDataFolderBase(
const std::filesystem::path & folder_base,
998 const std::string & map_suffix);
1000 std::filesystem::path
restartFolderBase(
const std::filesystem::path & folder_base)
const;
1017 bool attach_geometric_rm_final =
false);
1122#ifdef MOOSE_MFEM_ENABLED
1151#ifdef MOOSE_KOKKOS_ENABLED
1152#ifdef MOOSE_ENABLE_KOKKOS_GPU
1162#ifdef MOOSE_KOKKOS_ENABLED
1188#ifdef MOOSE_UNIT_TEST
1206 bool load_dependencies =
true);
1234 const std::string & start_marker,
1235 const std::string & end_marker,
1236 const std::string & data)
const;
1248 const std::string_view doc);
1259 addIntCapability(
const std::string_view capability,
const int value,
const std::string_view doc);
1270 const std::string_view value,
1271 const std::string_view doc);
1288 const std::string_view doc);
1294 const std::shared_ptr<libMesh::Parallel::Communicator>
_comm;
1374 std::unordered_map<std::string, std::pair<std::string, std::unique_ptr<InputParameters>>>
1457 std::map<Moose::RelationshipManagerType, std::set<const RelationshipManager *>>
1464 std::unordered_map<RelationshipManager *, std::shared_ptr<libMesh::GhostingFunctor>>
1487 std::list<std::string> & possible_roots,
1488 std::list<std::string> & current_branch);
1502#ifdef MOOSE_LIBTORCH_ENABLED
1572 const MeshBase & mesh)
const;
1646 void collectCitations(std::map<std::string, std::string> & citations)
const;
1660 const std::string_view doc);
1663 std::unordered_map<RestartableDataMapName, std::pair<RestartableDataMap, std::string>>
1723 std::map<const MeshBase *, std::unique_ptr<RelationshipManager>>>
1741#ifdef MOOSE_LIBTORCH_ENABLED
1746#ifdef MOOSE_MFEM_ENABLED
1759#ifdef MOOSE_KOKKOS_ENABLED
1781 static_assert(!std::is_base_of<MooseObject, T>::value,
"T is not an interface");
1787 auto new_registry = std::make_unique<InterfaceRegistryObjects<T>>();
1788 registry = new_registry.get();
1794 mooseAssert(std::count(registry->
_objects.begin(), registry->
_objects.end(), &interface) == 0,
1795 "Interface already registered");
1796 registry->
_objects.push_back(&interface);
1800const std::vector<T *> &
1803 static_assert(!std::is_base_of<MooseObject, T>::value,
"T is not an interface");
1808 const static std::vector<T *> empty;
1812#ifdef MOOSE_MFEM_ENABLED
1813inline const std::set<std::string> &
class GTEST_TEST_CLASS_NAME_(CapabilitiesTest, mooseAppAddBoolCapability)
std::string RestartableDataMapName
std::unordered_set< std::string > DataNames
Specialized factory for generic Action System objects.
Storage for action instances.
Generic AppFactory class for building Application objects.
System that manages ChainControls.
This class wraps provides and tracks access to command line parameters.
A MultiMooseEnum object to hold "execute_on" flags.
Executioners are objects that do the actual work of solving your problem.
The Executor class directs the execution flow of simulations.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Generic factory class for build all sorts of objects.
System that manages MeshGenerators.
void addMeshGenerator(const std::string &type, const std::string &name, const InputParameters ¶ms)
Add a mesh generator that will act on the meshes in the system.
std::vector< std::string > getMeshGeneratorNames() const
Get names of all mesh generators Note: This function should be called after all mesh generators are a...
bool hasMeshGenerator(const MeshGeneratorName &name) const
static std::string mainMeshGeneratorName()
The name reserved for the "main" mesh generator which is the one used for the numerical solver downst...
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.
std::unique_ptr< libMesh::MeshBase > getSavedMesh(const std::string &name)
Get the saved mesh by name.
const MeshGenerator & getMeshGenerator(const std::string &name) const
MeshGenerators are objects that can modify or add to an existing mesh.
Base class for MOOSE-based applications.
const bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
bool _heap_profiling
Memory profiling.
void loadRestartableMetaData(const std::filesystem::path &folder_base)
Loads all available restartable meta data if it is available with the folder base folder_base.
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
const std::vector< std::string > & getInputFileNames() const
const RankMap & rankMap()
The RankMap is a useful object for determining how the processes are laid out on the physical nodes o...
const MooseMesh *const _master_mesh
The mesh from master app.
std::shared_ptr< libMesh::ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
bool restoredInitialBackupMesh() const
Whether this app has restored mesh topology from its initial Backup object.
bool isKokkosAvailable() const
Get whether Kokkos is available.
FixedPointConfig _fixed_point_config
Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and u...
const torch::DeviceType _libtorch_device
The libtorch device this app is using (converted from compute_device)
static void addAppParam(InputParameters ¶ms)
FixedPointConfig & fixedPointConfig()
This info is stored here because we need a "globalish" place to put it in order to allow communicatio...
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
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 sup...
bool hasRestartableDataMap(const RestartableDataMapName &name) const
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.
void restoreMeshFromInitialBackup(MooseMesh &mesh)
Restore mesh from this app's initial Backup object and consume the mesh checkpoint entries.
const std::shared_ptr< CommandLine > _command_line
The CommandLine object.
Syntax & syntax()
Returns a writable reference to the syntax object.
bool isSplitMesh() const
Whether or not this is a split mesh operation.
void requestCitations()
Handles the –citations command-line option: registers with PETSc the BibTeX entries that should be ci...
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
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 GhostingFun...
bool unusedFlagIsError() const
Returns whether the flag for unused parameters is set to throw an error.
const std::vector< std::shared_ptr< RelationshipManager > > & getReleationshipManagers()
Retrieve the relationship managers.
void registerRestartableDataMapName(const RestartableDataMapName &name, std::string suffix="")
Reserve a location for storing custom RestartableDataMap objects.
std::set< std::string > getLibrarySearchPaths(const std::string &library_path_from_param) const
Return the paths searched by MOOSE when loading libraries.
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
void restoreFromInitialBackup(const bool for_restart)
Restores from a "initial" backup, that is, one set in _initial_backup.
std::vector< std::string > getMeshGeneratorNames() const
const DataNames & getRecoverableData() const
Return a reference to the recoverable data object.
void queryKokkosGPUs()
Query the Kokkos GPUs in the system and check whether every process has an associated GPU.
bool getFPTrapFlag() const
Returns whether FPE trapping is turned on (either because of debug or user requested)
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
SolutionInvalidity & _solution_invalidity
The SolutionInvalidity object for this application.
void setExReaderForRestart(std::shared_ptr< libMesh::ExodusII_IO > &&exreader)
Set the Exodus reader to restart variables from an Exodus mesh file.
void setStartTime(Real time)
Set the starting time for the simulation.
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
bool hasRelationshipManager(const std::string &name) const
Returns a Boolean indicating whether a RelationshipManater exists with the same name.
void addMeshGenerator(const std::string &type, const std::string &name, const InputParameters ¶ms)
Add a mesh generator that will act on the meshes in the system.
void setMFEMDevice(const std::string &device_string, bool gpu_aware_mpi, Moose::PassKey< MFEMProblemSolve >)
Create/configure the MFEM device with the provided device_string.
void setOutputPosition(const Point &p)
Tell the app to output in a specific position.
Point getOutputPosition() const
Get the output position.
void setOutputFileBase(const std::string &output_file_base)
Override the selection of the output file base name.
bool hasRestartRecoverFileBase() const
Return true if the recovery file base is set.
static void addInputParam(InputParameters ¶ms)
bool forceRestart() const
Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoint...
bool _start_time_set
Whether or not an start time has been set.
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
void setExecutioner(std::shared_ptr< Executioner > &&executioner)
Set the Executioner for this App.
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
void setExodusFileRestart(bool flag)
Set the flag to indicate whether or not we need to use a separate Exodus reader to read the mesh BEFO...
bool restoreDataIfAvailable(RestartableDataValue &value, const THREAD_ID tid, Moose::PassKey< ReporterData >)
Restores value in place from the checkpoint reader if it is present in the checkpoint and has not yet...
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.
void setGlobalTimeOffset(Real offset)
Each App has it's own local time.
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
ActionFactory & getActionFactory()
Retrieve a writable reference to the ActionFactory associated with this App.
bool hasRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname) const
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
UNUSED_CHECK
Indicates whether warnings, errors, or no output is displayed when unused parameters are detected.
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
void setExecutor(std::shared_ptr< Executor > &&executor)
std::string getRecoverFileBase() const
const std::shared_ptr< libMesh::Parallel::Communicator > _comm
The MPI communicator this App is going to use.
bool testReStep() const
Whether or not this simulation should fail a timestep and repeat (for testing).
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
bool hasRecoverFileBase() const
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...
virtual void executeExecutioner()
Execute the Executioner that was built.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
NullExecutor * getNullExecutor() const
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)
const std::vector< RestartableDataMap > & getRestartableData() const
Return reference to the restartable data object.
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
static Moose::Capability & addBoolCapability(const std::string_view capability, const bool value, const std::string_view doc)
Register a boolean capability.
bool hasStartTime() const
bool runInputs()
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
void setRestart(bool value)
Sets the restart/recover flags.
std::string getFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed Note: When stripLeadingPath is false,...
bool isRestarting() const
Whether or not this is a "restart" calculation.
virtual bool constructingMeshGenerators() const
Whether this app is constructing mesh generators.
void loadLibraryAndDependencies(const std::string &library_filename, const libMesh::Parameters ¶ms, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
torch::DeviceType determineLibtorchDeviceType(const MooseEnum &device) const
Function to determine the device which should be used by libtorch on this application.
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
const unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
ActionFactory _action_factory
The Factory responsible for building Actions.
unsigned int multiAppLevel() const
The MultiApp Level.
SolutionInvalidity & createRecoverableSolutionInvalidity()
Creates a recoverable SolutionInvalidity.
unsigned int multiAppNumber() const
The MultiApp number.
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName))
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
void collectCitations(std::map< std::string, std::string > &citations) const
Collects the BibTeX citations for the modules/objects constructed in this app and the finite element ...
torch::DeviceType getLibtorchDevice() const
Get the device torch is supposed to be running on.
virtual void run()
Run the application.
Executor * getExecutor() const
bool _output_position_set
Whether or not an output position has been set for this app.
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
const MooseMesh * masterMesh() const
Returns a pointer to the master mesh.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
The relationship managers that have been attached (type -> RMs)
Real _start_time
The time at which to start the simulation.
Real _global_time_offset
Offset of the local App time to the "global" problem time.
const Parser & parser() const
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo() const
Returns the Relationship managers info suitable for printing.
bool _recover
Whether or not this is a recovery run.
bool hasOutputPosition() const
Whether or not an output position has been set.
std::unique_ptr< Backup > finalizeRestore()
Finalizes (closes) the restoration process done in restore().
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.
void outputMachineReadableData(const std::string ¶m, 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...
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
static bool isRelocated()
virtual bool errorOnJacobianNonzeroReallocation() const
Whether this application should by default error on Jacobian nonzero reallocations.
bool meshChangedForBackup() const
Whether this app requires mesh topology data in its next Backup object.
ActionWarehouse _action_warehouse
Where built actions are stored.
FRIEND_TEST(::CapabilitiesTest, mooseAppAddIntCapability)
static InputParameters validParams()
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.
void removeRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Purge this relationship manager from meshes and DofMaps and finally from us.
static const std::string & checkpointSuffix()
The file suffix for the checkpoint mesh.
bool & useNonlinear()
Returns a writable Boolean indicating whether this app will use a Nonlinear or Eigen System.
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
const std::set< std::string > & getMFEMDevices(Moose::PassKey< MultiApp >) const
Get the configured MFEM devices.
const std::string & getRestartableDataMapName(const RestartableDataMapName &name) const
void addExecutor(const std::string &type, const std::string &name, const InputParameters ¶ms)
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Real getGlobalTimeOffset() const
Each App has it's own local time.
void createExecutors()
After adding all of the Executor Params - this function will actually cause all of them to be built.
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions)
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
enum MooseApp::UNUSED_CHECK _enable_unused_check
const Moose::Kokkos::MemoryPool & getKokkosMemoryPool() const
Get Kokkos memory pool.
const SystemInfo & getSystemInfo() const
Get SystemInfo object.
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Point _output_position
The output position.
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file)
bool _restored_initial_backup_mesh
Whether mesh topology has been restored from the initial Backup object.
ChainControlDataSystem _chain_control_system
The system that manages the ChainControls.
bool hasInitialBackupMesh() const
Whether this app has an initial Backup object with mesh checkpoint entries.
virtual std::string appBinaryName() const
Moose::Builder & builder()
Returns a writable reference to the builder.
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
std::shared_ptr< mfem::Device > getMFEMDevice(Moose::PassKey< MultiApp >)
Get the MFEM device object.
PerfGraph & createRecoverablePerfGraph()
Creates a recoverable PerfGraph.
void deallocateKokkosMemoryPool()
Deallocate Kokkos memory pool.
bool _restart
Whether or not this is a restart run.
void dynamicRegistration(const libMesh::Parameters ¶ms)
Helper method for dynamic loading of objects.
bool _has_kokkos_gpus
Flag whether every process has an associated Kokkos GPU.
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
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>
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibility)...
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
const bool _use_master_mesh
Whether to use the parent app mesh for this app.
std::string _output_file_base
The output file basename.
const unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
void checkMetaDataIntegrity() const
Function to check the integrity of the restartable meta data structure.
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
const std::vector< T * > & getInterfaceObjects() const
Gets the registered interface objects for a given interface.
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 ...
const std::string & getLastInputFileName() const
Moose::Builder _builder
Builder for building app related parser tree.
bool _cpu_profiling
CPU profiling.
std::unique_ptr< MeshBase > getMeshGeneratorMesh()
void dynamicAppRegistration(const std::string &app_name, std::string library_path, const std::string &library_name, bool lib_load_deps)
const std::shared_ptr< libMesh::Parallel::Communicator > getCommunicator() const
FEProblemBase & feProblem() const
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
const MeshGenerator & appendMeshGenerator(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.
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
virtual void preBackup()
Insertion point for other apps that is called before backup()
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
SystemInfo _sys_info
System Information.
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision....
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.
RelationshipManager & getRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Return the relationship manager clone originally created from the provided template relationship mana...
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
void recursivelyCreateExecutors(const std::string ¤t_executor_name, std::list< std::string > &possible_roots, std::list< std::string > ¤t_branch)
Internal function used to recursively create the executor objects.
const bool _test_restep
Whether or not this simulation should fail its middle timestep and repeat (for testing)
const ExecFlagEnum _execute_flags
Execution flags for this App.
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
bool _trap_fpe
Whether or not FPE trapping should be turned on.
auto getRestartableDataMapBegin()
Iterator based access to the extra RestartableDataMap objects; see Checkpoint.C for use case.
void setRecover(bool value)
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected.
std::string getFrameworkVersion() const
Returns the framework version.
const ActionWarehouse & actionWarehouse() const
Return a const reference to the ActionWarehouse associated with this app.
FRIEND_TEST(::CapabilitiesTest, mooseAppAddBoolCapability)
void allocateKokkosMemoryPool(std::size_t size, unsigned int ways) const
Allocate Kokkos memory pool.
bool hasMeshGenerator(const MeshGeneratorName &name) const
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
const bool _check_input
true if we want to just check the input file
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh.
const bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery)
static Moose::Capability & addCapabilityInternal(const std::string_view capability, const Moose::Capability::Value &value, const std::string_view doc)
Internal method for adding a capability.
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers() const
Return the container of relationship managers.
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
RestartableDataValue & getRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname, THREAD_ID tid)
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
bool isRecovering() const
Whether or not this is a "recover" calculation.
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
PerfGraph & perfGraph()
Get the PerfGraph for this app.
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery)
static const std::string MESH_META_DATA_SUFFIX
bool _mesh_changed_for_backup
Whether mesh topology has changed and should be included in Backup objects.
auto getRestartableDataMapEnd()
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
libMesh::ExodusII_IO * getExReaderForRestart() const
Get the Exodus reader to restart variables from an Exodus mesh file.
const MeshGenerator & getMeshGenerator(const std::string &name) const
virtual std::string getPrintableName() const
Get printable name of the application.
const std::shared_ptr< Parser > _parser
Parser for parsing the input file (owns the root hit node)
std::string _restart_recover_base
The base name to restart/recover from. If blank then we will find the newest checkpoint file.
RestartableDataValue & registerRestartableData(const std::string &name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
bool defaultAutomaticScaling() const
Whether to enable automatic scaling by default.
const MooseMesh * masterDisplacedMesh() const
Returns a pointer to the master displaced mesh.
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
std::string appNameToLibName(const std::string &app_name) const
Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof....
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
const SolutionInvalidity & solutionInvalidity() const
int exitCode() const
Get the shell exit code for the application.
virtual void setupOptions()
Setup options based on InputParameters.
static Moose::Capability & addIntCapability(const std::string_view capability, const int value, const std::string_view doc)
Register an integer capability.
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Syntax _syntax
Syntax of the input file.
bool hasInitialBackup() const
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 num...
RestartableDataReader _rd_reader
bool unusedFlagIsWarning() const
Returns whether the flag for unused parameters is set to throw a warning only.
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
const hit::Node * getCurrentActionHitNode() const
const bool _force_restart
Whether or not we are forcefully attempting to load checkpoints (–force-restart)
std::optional< MooseEnum > getComputeDevice() const
Get the device accelerated computations are supposed to be running on.
void disableCheckUnusedFlag()
Removes warnings and error checks for unrecognized variables in the input file.
Real getStartTime() const
std::string libNameToAppName(const std::string &library_name) const
Converts a library name to an application name:
std::set< std::string > getLoadedLibraryPaths() const
Return the paths of loaded libraries.
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 ...
FRIEND_TEST(::CapabilitiesTest, mooseAppAddStringCapability)
bool checkInput() const
Returns whether the Application is running in check input mode.
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
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...
std::filesystem::path restartFolderBase(const std::filesystem::path &folder_base) const
The file suffix for restartable data.
bool useMasterMesh() const
Returns whether to use the parent app mesh as the mesh for this app.
FRIEND_TEST(::CapabilitiesTest, mooseAppAddCapability)
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 ...
void addExecutorParams(const std::string &type, const std::string &name, const InputParameters ¶ms)
Adds the parameters for an Executor to the list of parameters.
bool copyInputs()
Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a ...
static Moose::Capability & addStringCapability(const std::string_view capability, const std::string_view value, const std::string_view doc)
Register a string capability.
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
static const RestartableDataMapName MESH_META_DATA
virtual void runInputFile()
Actually build everything in the input file.
std::vector< RestartableDataMap > & getRestartableData()
TheWarehouse & theWarehouse()
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit.
void markMeshChangedForBackup()
Mark this app as requiring mesh topology data in its next Backup object.
static Moose::Capability & addCapability(const std::string_view capability, const Moose::Capability::Value &value, const std::string_view doc)
Deprecated method for adding a capability.
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
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 num...
bool & useEigenvalue()
Returns a writable Boolean indicating whether this app will use an eigenvalue executioner.
int _exit_code
The exit code.
const RankMap _rank_map
The RankMap is a useful object for determining how the processes are laid out on the physical hardwar...
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Base class for everything in MOOSE with a name and a type.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & type() const
Get the type of this class.
void mooseDeprecated(Args &&... args) const
Emits a deprecation warning prefixed with the object name and type, and a stack trace.
const std::string & name() const
Get the name of the class.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Parses MOOSE input using HIT/WASP.
An entry for a single capability.
std::variant< bool, int, std::string > Value
A capability can have a bool, int, or string value.
The Kokkos class that manages memory pool for dynamically-sized temporary arrays in Kokkos parallel f...
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Class for storing and utilizing output objects.
Class for parsing input files.
Interface for objects interacting with the PerfGraph.
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode.
Builds lists and maps that help in knowing which physical hardware nodes each rank is on.
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
This is a helper class for managing the storage of declared Reporter object values.
Storage for restartable data that is ordered based on insertion order.
Reader for restartable data written by the RestartableDataWriter.
bool restoreDataIfAvailable(RestartableDataValue &value, const THREAD_ID tid, Moose::PassKey< MooseApp >)
Restores value in place from the open reader if it is present in the checkpoint and has not yet been ...
Abstract definition of a RestartableData value.
A class for creating restricted objects.
The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidit...
Generic class for solving transient nonlinear problems.
Holding syntax for parsing input files.
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
std::string getLatestCheckpointFilePrefix(const std::list< std::string > &checkpoint_files)
std::string getExecutableName()
Gets the name of the running executable on Mac OS X and linux.
RelationshipManagerType
Main types of Relationship Managers.
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::unordered_set< std::string > entry_symbols
Stores configuration options relating to the fixed-point solving capability.
std::vector< std::string > sub_transformed_vars
The names of variables to transform for fixed point solve algorithms (e.g. secant,...
std::vector< PostprocessorName > sub_transformed_pps
The names of postprocessors to transform for fixed point solve algorithms (e.g. secant,...
Real sub_relaxation_factor
relaxation factor to be used for a MultiApp's subapps.
virtual ~InterfaceRegistryObjectsBase()
std::vector< T * > _objects