https://mooseframework.inl.gov
MooseApp.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #ifdef MOOSE_LIBTORCH_ENABLED
13 // Libtorch includes
14 #include <torch/types.h>
15 #include <torch/mps.h>
16 #include <torch/cuda.h>
17 #include <c10/core/DeviceType.h>
18 #endif
19 
20 #ifdef MOOSE_MFEM_ENABLED
21 #include "libmesh/ignore_warnings.h"
22 #include <mfem.hpp>
23 #include "libmesh/restore_warnings.h"
24 #endif
25 
26 // MOOSE includes
27 #include "Moose.h"
28 #include "Builder.h"
29 #include "ActionWarehouse.h"
30 #include "Factory.h"
31 #include "ActionFactory.h"
32 #include "OutputWarehouse.h"
33 #include "RestartableData.h"
34 #include "RestartableDataMap.h"
35 #include "ConsoleStreamInterface.h"
36 #include "PerfGraph.h"
37 #include "PerfGraphInterface.h"
38 #include "TheWarehouse.h"
39 #include "RankMap.h"
40 #include "MeshGeneratorSystem.h"
41 #include "ChainControlDataSystem.h"
42 #include "RestartableDataReader.h"
43 #include "Backup.h"
44 #include "MooseBase.h"
45 #include "Capabilities.h"
46 #include "MoosePassKey.h"
47 #include "SystemInfo.h"
48 #include "Syntax.h"
49 
50 #include "libmesh/parallel_object.h"
51 #include "libmesh/mesh_base.h"
52 #include "libmesh/point.h"
53 
54 // C++ includes
55 #include <list>
56 #include <map>
57 #include <set>
58 #include <unordered_set>
59 #include <typeindex>
60 #include <filesystem>
61 #include <variant>
62 
63 // Forward declarations
64 class Executioner;
65 class Executor;
66 class NullExecutor;
67 class FEProblemBase;
69 class CommandLine;
71 class SolutionInvalidity;
72 class MultiApp;
73 #ifdef MOOSE_MFEM_ENABLED
74 class MFEMProblemSolve;
75 #endif
76 
77 namespace libMesh
78 {
79 class ExodusII_IO;
80 }
81 namespace hit
82 {
83 class Node;
84 }
85 
86 #ifdef MOOSE_KOKKOS_ENABLED
87 namespace Moose::Kokkos
88 {
89 class MemoryPool;
90 }
91 #endif
92 
104 {
105 public:
107  std::optional<MooseEnum> getComputeDevice() const;
108 
109 #ifdef MOOSE_LIBTORCH_ENABLED
110  torch::DeviceType getLibtorchDevice() const { return _libtorch_device; }
112 #endif
113 
120  {
125  std::vector<std::string> sub_transformed_vars;
127  std::vector<PostprocessorName> sub_transformed_pps;
128  };
129 
131  static const std::string MESH_META_DATA_SUFFIX;
132 
133  static InputParameters validParams();
134 
135  virtual ~MooseApp();
136 
138 
142  virtual std::string getPrintableName() const { return "Application"; }
143 
144  virtual std::string appBinaryName() const
145  {
147  name = name.substr(0, name.find_last_of("-"));
148  if (name.find_first_of("/") != std::string::npos)
149  name = name.substr(name.find_first_of("/") + 1, std::string::npos);
150  return name;
151  }
152 
157  int exitCode() const { return _exit_code; }
158 
162  void setExitCode(const int exit_code) { _exit_code = exit_code; }
163 
168  const RankMap & rankMap() { return _rank_map; }
169 
174 
182 
186  virtual void run();
187 
191  std::string getFrameworkVersion() const;
192 
196  virtual std::string getVersion() const;
197 
201  std::string getPrintableVersion() const;
202 
206  virtual void setupOptions();
207 
216 
221 
225  Syntax & syntax() { return _syntax; }
226 
230  const std::vector<std::string> & getInputFileNames() const;
231 
235  const std::string & getLastInputFileName() const;
236 
241  void setOutputFileBase(const std::string & output_file_base);
242 
253  std::string getOutputFileBase(bool for_non_moose_build_output = false) const;
254 
258  void setOutputPosition(const Point & p);
259 
264  std::list<std::string> getCheckpointDirectories() const;
265 
270  std::list<std::string> getCheckpointFiles() const;
271 
276  bool hasOutputPosition() const { return _output_position_set; }
277 
282  Point getOutputPosition() const { return _output_position; }
283 
290  void setStartTime(Real time);
291 
295  bool hasStartTime() const { return _start_time_set; }
296 
300  Real getStartTime() const { return _start_time; }
301 
306  void setGlobalTimeOffset(Real offset) { _global_time_offset = offset; }
307 
313 
319  std::string getFileName(bool stripLeadingPath = true) const;
320 
324  void setErrorOverridden();
325 
329  void disableCheckUnusedFlag();
330 
334  Executioner * getExecutioner() const;
335  Executor * getExecutor() const { return _executor.get(); }
336  NullExecutor * getNullExecutor() const { return _null_executor.get(); }
337  bool useExecutor() const { return _use_executor; }
338  FEProblemBase & feProblem() const;
339 
343  void setExecutioner(std::shared_ptr<Executioner> && executioner) { _executioner = executioner; }
344  void setExecutor(std::shared_ptr<Executor> && executor) { _executor = executor; }
345  void
346  addExecutor(const std::string & type, const std::string & name, const InputParameters & params);
347 
352  void addExecutorParams(const std::string & type,
353  const std::string & name,
354  const InputParameters & params);
355 
359  const Parser & parser() const;
361  Parser & parser();
363 
368  void createExecutors();
369 
377  Executor & getExecutor(const std::string & name, bool fail_if_not_found = true);
378 
387 
391  bool & useNonlinear() { return _use_nonlinear; }
392 
396  bool & useEigenvalue() { return _use_eigen_value; }
397 
401  Factory & getFactory() { return _factory; }
402 
407 
411  processor_id_type processor_id() const { return _comm->rank(); }
412 
418  std::shared_ptr<CommandLine> commandLine() const { return _command_line; }
419 
424  void setExodusFileRestart(bool flag) { _initial_from_file = flag; }
425 
430  bool getExodusFileRestart() const { return _initial_from_file; }
431 
435  void setExReaderForRestart(std::shared_ptr<libMesh::ExodusII_IO> && exreader)
436  {
437  _ex_reader = exreader;
438  }
439 
444 
448  virtual void runInputFile();
449 
453  virtual void executeExecutioner();
454 
461 
467  bool isRecovering() const;
468 
475  bool isRestarting() const;
476 
480  bool isSplitMesh() const;
481 
483 
486  bool hasRestartRecoverFileBase() const;
487  bool hasRecoverFileBase() const;
489 
491 
494  std::string getRestartRecoverFileBase() const { return _restart_recover_base; }
495  std::string getRecoverFileBase() const
496  {
497  mooseDeprecated("MooseApp::getRecoverFileBase is deprecated, use "
498  "MooseApp::getRestartRecoverFileBase() instead.");
499  return _restart_recover_base;
500  }
502 
506  void setRestartRecoverFileBase(const std::string & file_base)
507  {
508  if (file_base.empty())
510  else
511  _restart_recover_base = file_base;
512  }
513 
519 
524  bool testReStep() const { return _test_restep; }
525 
534  void setOutputFileNumbers(const std::map<std::string, unsigned int> & numbers)
535  {
536  _output_file_numbers = numbers;
537  }
538 
546  const std::map<std::string, unsigned int> & getOutputFileNumbers() const
547  {
548  return _output_file_numbers;
549  }
550 
555  const OutputWarehouse & getOutputWarehouse() const;
556 
561  const SystemInfo & getSystemInfo() const { return _sys_info; }
562 
564 
569  void dynamicAllRegistration(const std::string & app_name,
570  Factory * factory,
571  ActionFactory * action_factory,
572  Syntax * syntax,
573  std::string library_path,
574  const std::string & library_name);
575  void dynamicAppRegistration(const std::string & app_name,
576  std::string library_path,
577  const std::string & library_name,
578  bool lib_load_deps);
580 
587  std::string appNameToLibName(const std::string & app_name) const;
588 
592  std::string libNameToAppName(const std::string & library_name) const;
593 
597  std::set<std::string> getLoadedLibraryPaths() const;
598 
602  std::set<std::string> getLibrarySearchPaths(const std::string & library_path_from_param) const;
603 
608 
609  /*
610  * Register a piece of restartable data. This is data that will get
611  * written / read to / from a restart file.
612  *
613  * @param data The actual data object.
614  * @param tid The thread id of the object. Use 0 if the object is not threaded.
615  * @param read_only Restrict the data for read-only
616  * @param metaname (optional) register the data to the meta data storage (tid must be 0)
617  */
618  RestartableDataValue & registerRestartableData(std::unique_ptr<RestartableDataValue> data,
619  THREAD_ID tid,
620  bool read_only,
621  const RestartableDataMapName & metaname = "");
622 
623  /*
624  * Deprecated method to register a piece of restartable data.
625  *
626  * Use the call without a data name instead.
627  */
628  RestartableDataValue & registerRestartableData(const std::string & name,
629  std::unique_ptr<RestartableDataValue> data,
630  THREAD_ID tid,
631  bool read_only,
632  const RestartableDataMapName & metaname = "");
633 
634  /*
635  * Check if a restartable meta data exists or not.
636  *
637  * @param name The full (unique) name.
638  * @param metaname The name to the meta data storage
639  */
640  bool hasRestartableMetaData(const std::string & name,
641  const RestartableDataMapName & metaname) const;
642 
643  /*
644  * Retrieve restartable meta data from restartable data map
645  *
646  * @param name The full (unique) name.
647  * @param metaname The name to the meta data storage
648  * @return A reference to the restartable meta data value
649  */
650  RestartableDataValue & getRestartableMetaData(const std::string & name,
651  const RestartableDataMapName & metaname,
652  THREAD_ID tid);
653 
659  const std::filesystem::path & folder_base);
664  void loadRestartableMetaData(const std::filesystem::path & folder_base);
665 
671  std::vector<std::filesystem::path>
673  const std::filesystem::path & folder_base);
679  std::vector<std::filesystem::path>
680  writeRestartableMetaData(const std::filesystem::path & folder_base);
681 
686  const std::vector<RestartableDataMap> & getRestartableData() const { return _restartable_data; }
688  std::vector<RestartableDataMap> & getRestartableData() { return _restartable_data; }
690 
695 
700 
710  void registerRestartableDataMapName(const RestartableDataMapName & name, std::string suffix = "");
711 
715  const std::string & getRestartableDataMapName(const RestartableDataMapName & name) const;
716 
722 
728  std::vector<std::filesystem::path> backup(const std::filesystem::path & folder_base);
734  std::unique_ptr<Backup> backup();
735 
739  virtual void preBackup() {}
740 
752  void restore(const std::filesystem::path & folder_base, const bool for_restart);
753 
765  void restore(std::unique_ptr<Backup> backup, const bool for_restart);
766 
773  virtual void postRestore(const bool /* for_restart */) {}
774 
787  void restoreFromInitialBackup(const bool for_restart);
788 
798  std::unique_ptr<Backup> finalizeRestore();
799 
803  virtual std::string header() const;
804 
809  unsigned int multiAppLevel() const { return _multiapp_level; }
810 
815  unsigned int multiAppNumber() const { return _multiapp_number; }
816 
820  bool isUltimateMaster() const { return !_multiapp_level; }
821 
825  bool useMasterMesh() const { return _use_master_mesh; }
826 
830  const MooseMesh * masterMesh() const { return _master_mesh; }
831 
836 
841 
846 
856  void addMeshGenerator(const std::string & type,
857  const std::string & name,
858  const InputParameters & params)
859  {
861  }
862 
866  bool hasMeshGenerator(const MeshGeneratorName & name) const
867  {
869  }
870 
874  const MeshGenerator & getMeshGenerator(const std::string & name) const
875  {
877  }
878 
882  std::unique_ptr<MeshBase> getMeshGeneratorMesh()
883  {
885  }
886 
892  std::vector<std::string> getMeshGeneratorNames() const
893  {
895  }
896 
906  const MeshGenerator &
907  appendMeshGenerator(const std::string & type, const std::string & name, InputParameters params)
908  {
910  }
911 
918  virtual bool constructingMeshGenerators() const;
919 
921 
925  void setRestart(bool value);
926  void setRecover(bool value);
928 
930  bool checkInput() const { return _check_input; }
931 
933  bool getFPTrapFlag() const { return _trap_fpe; }
934 
938  bool hasRelationshipManager(const std::string & name) const;
939 
946  bool addRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);
947 
949  static const std::string & checkpointSuffix();
951  static std::filesystem::path metaDataFolderBase(const std::filesystem::path & folder_base,
952  const std::string & map_suffix);
954  std::filesystem::path restartFolderBase(const std::filesystem::path & folder_base) const;
955 
963  const hit::Node * getCurrentActionHitNode() const;
964 
971  bool attach_geometric_rm_final = false);
972 
979  void attachRelationshipManagers(MeshBase & mesh, MooseMesh & moose_mesh);
980 
984  const std::vector<std::shared_ptr<RelationshipManager>> & getReleationshipManagers();
985 
989  std::vector<std::pair<std::string, std::string>> getRelationshipManagerInfo() const;
990 
994  const ExecFlagEnum & getExecuteOnEnum() const { return _execute_flags; }
995 
1001  bool hasInitialBackup() const
1002  {
1003  return _initial_backup != nullptr && *_initial_backup != nullptr;
1004  }
1005 
1010 
1011  // Return the communicator for this application
1012  const std::shared_ptr<libMesh::Parallel::Communicator> getCommunicator() const { return _comm; }
1013 
1017  const std::set<std::shared_ptr<RelationshipManager>> & relationshipManagers() const
1018  {
1019  return _relationship_managers;
1020  }
1021 
1025  void checkMetaDataIntegrity() const;
1026 
1028 
1034 
1037 
1043  virtual bool errorOnJacobianNonzeroReallocation() const { return false; }
1044 
1050  template <class T>
1051  void registerInterfaceObject(T & interface);
1052 
1058  template <class T>
1059  const std::vector<T *> & getInterfaceObjects() const;
1060 
1061  static void addAppParam(InputParameters & params);
1062  static void addInputParam(InputParameters & params);
1063 
1068  bool forceRestart() const { return _force_restart; }
1069 
1072 
1075 
1076 #ifdef MOOSE_MFEM_ENABLED
1077 
1081  void setMFEMDevice(const std::string & device_string, Moose::PassKey<MFEMProblemSolve>);
1082 
1086  std::shared_ptr<mfem::Device> getMFEMDevice(Moose::PassKey<MultiApp>) { return _mfem_device; }
1087 
1091  const std::set<std::string> & getMFEMDevices(Moose::PassKey<MultiApp>) const;
1092 #endif
1093 
1101  bool isKokkosAvailable() const
1102  {
1103 #ifdef MOOSE_KOKKOS_ENABLED
1104 #ifdef MOOSE_ENABLE_KOKKOS_GPU
1105  return _has_kokkos_gpus;
1106 #else
1107  return true;
1108 #endif
1109 #else
1110  return false;
1111 #endif
1112  }
1113 
1118  bool hasKokkosObjects() const { return _has_kokkos_objects; }
1119 
1120 #ifdef MOOSE_KOKKOS_ENABLED
1121 
1126  void allocateKokkosMemoryPool(std::size_t size, unsigned int ways) const;
1127 
1133 #endif
1134 
1135 protected:
1139  void dynamicRegistration(const libMesh::Parameters & params);
1140 
1145  void loadLibraryAndDependencies(const std::string & library_filename,
1146  const libMesh::Parameters & params,
1147  bool load_dependencies = true);
1148 
1151 
1161  void registerRestartableNameWithFilter(const std::string & name,
1162  Moose::RESTARTABLE_FILTER filter);
1163 
1168  void errorCheck();
1169 
1174  void outputMachineReadableData(const std::string & param,
1175  const std::string & start_marker,
1176  const std::string & end_marker,
1177  const std::string & data) const;
1179  static void addCapability(const std::string & capability,
1180  CapabilityUtils::Type value,
1181  const std::string & doc);
1182  static void
1183  addCapability(const std::string & capability, const char * value, const std::string & doc);
1185 
1187  const std::string _type;
1188 
1190  const std::shared_ptr<libMesh::Parallel::Communicator> _comm;
1191 
1193  std::string _output_file_base;
1194 
1197 
1200 
1203 
1206 
1209 
1212 
1215 
1218  std::unique_ptr<InputParameterWarehouse> _input_parameter_warehouse;
1219 
1222 
1225 
1228 
1230  const std::shared_ptr<Parser> _parser;
1231 
1233  const std::shared_ptr<CommandLine> _command_line;
1234 
1237 
1240 
1242  std::vector<RestartableDataMap> _restartable_data;
1243 
1249 
1252 
1255 
1258 
1260  std::shared_ptr<Executioner> _executioner;
1261 
1263  std::shared_ptr<Executor> _executor;
1264 
1266  std::map<std::string, std::shared_ptr<Executor>> _executors;
1267 
1270  std::unordered_map<std::string, std::pair<std::string, std::unique_ptr<InputParameters>>>
1272 
1276 
1279  const bool _use_executor;
1280 
1282  std::shared_ptr<NullExecutor> _null_executor;
1283 
1286 
1289 
1292  {
1297 
1299 
1303  std::string _early_exit_param;
1307 
1310 
1312  std::shared_ptr<libMesh::ExodusII_IO> _ex_reader;
1313 
1316 
1318  bool _recover;
1319 
1321  bool _restart;
1322 
1325 
1327  const bool _use_split;
1328 
1330  const bool _force_restart;
1331 
1334 
1337 
1341  const bool _test_restep;
1342 
1344  std::map<std::string, unsigned int> _output_file_numbers;
1345 
1348 
1350  std::set<std::shared_ptr<RelationshipManager>> _relationship_managers;
1351 
1353  std::map<Moose::RelationshipManagerType, std::set<const RelationshipManager *>>
1355 
1360  std::unordered_map<RelationshipManager *, std::shared_ptr<libMesh::GhostingFunctor>>
1362 
1364  {
1366  std::string full_path;
1367  std::unordered_set<std::string> entry_symbols;
1368  };
1369 
1371  std::unordered_map<std::string, DynamicLibraryInfo> _lib_handles;
1372 
1373 private:
1382  void recursivelyCreateExecutors(const std::string & current_executor_name,
1383  std::list<std::string> & possible_roots,
1384  std::list<std::string> & current_branch);
1385 
1391  void registerCapabilities();
1392 
1403  void removeRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);
1404 
1405 #ifdef MOOSE_LIBTORCH_ENABLED
1406 
1412  torch::DeviceType determineLibtorchDeviceType(const MooseEnum & device) const;
1413 #endif
1414 
1418  {
1420  };
1421 
1422  template <class T>
1424  {
1425  std::vector<T *> _objects;
1426  };
1428 
1453  void createMinimalApp();
1454 
1459  void setCheckUnusedFlag(bool warn_is_error = false);
1460 
1468  bool hasRMClone(const RelationshipManager & template_rm, const MeshBase & mesh) const;
1469 
1474  RelationshipManager & getRMClone(const RelationshipManager & template_rm,
1475  const MeshBase & mesh) const;
1476 
1488  MooseMesh & moose_mesh,
1489  MeshBase & mesh,
1490  const libMesh::DofMap * dof_map = nullptr);
1491 
1499 
1507 
1512  bool showInputs() const;
1513 
1517  virtual std::string getInstallableInputs() const;
1518 
1525  bool copyInputs();
1526 
1532  bool runInputs();
1533 
1538  static void checkReservedCapability(const std::string & capability);
1539 
1541  std::unordered_map<RestartableDataMapName, std::pair<RestartableDataMap, std::string>>
1543 
1546  {
1549  };
1550 
1552  std::unique_ptr<TheWarehouse> _the_warehouse;
1553 
1555  unsigned int _multiapp_level;
1556 
1558  unsigned int _multiapp_number;
1559 
1561  const bool _use_master_mesh;
1562 
1564  const MooseMesh * const _master_mesh;
1565 
1568 
1571 
1574 
1576 
1585 
1587  std::streambuf * _output_buffer_cache;
1588 
1591 
1593  bool _cpu_profiling = false;
1594 
1596  bool _heap_profiling = false;
1597 
1600  std::map<const RelationshipManager *,
1601  std::map<const MeshBase *, std::unique_ptr<RelationshipManager>>>
1603 
1605  std::map<std::type_index, std::unique_ptr<InterfaceRegistryObjectsBase>> _interface_registry;
1606 
1611  std::unique_ptr<Backup> * const _initial_backup;
1612 
1613 #ifdef MOOSE_LIBTORCH_ENABLED
1614  const torch::DeviceType _libtorch_device;
1616 #endif
1617 
1618 #ifdef MOOSE_MFEM_ENABLED
1619  std::shared_ptr<mfem::Device> _mfem_device;
1621 
1623  std::set<std::string> _mfem_devices;
1624 #endif
1625 
1626  // Allow FEProblemBase to set the recover/restart state, so make it a friend
1627  friend class FEProblemBase;
1628  friend class Restartable;
1629  friend class SubProblem;
1630 
1631 #ifdef MOOSE_KOKKOS_ENABLED
1632 
1635  void queryKokkosGPUs();
1636 
1641 #endif
1642 
1646  bool _has_kokkos_gpus = false;
1647 
1651  bool _has_kokkos_objects = false;
1652 };
1653 
1654 template <class T>
1655 void
1657 {
1658  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1659 
1661  auto it = _interface_registry.find(typeid(T));
1662  if (it == _interface_registry.end())
1663  {
1664  auto new_registry = std::make_unique<InterfaceRegistryObjects<T>>();
1665  registry = new_registry.get();
1666  _interface_registry.emplace(typeid(T), std::move(new_registry));
1667  }
1668  else
1669  registry = static_cast<InterfaceRegistryObjects<T> *>(it->second.get());
1670 
1671  mooseAssert(std::count(registry->_objects.begin(), registry->_objects.end(), &interface) == 0,
1672  "Interface already registered");
1673  registry->_objects.push_back(&interface);
1674 }
1675 
1676 template <class T>
1677 const std::vector<T *> &
1679 {
1680  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1681 
1682  const auto it = _interface_registry.find(typeid(T));
1683  if (it != _interface_registry.end())
1684  return static_cast<InterfaceRegistryObjects<T> *>(it->second.get())->_objects;
1685  const static std::vector<T *> empty;
1686  return empty;
1687 }
1688 
1689 #ifdef MOOSE_MFEM_ENABLED
1690 inline const std::set<std::string> &
1692 {
1693  return _mfem_devices;
1694 }
1695 #endif
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:2462
virtual bool constructingMeshGenerators() const
Whether this app is constructing mesh generators.
Definition: MooseApp.C:3567
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:2430
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:1288
static const std::string & checkpointSuffix()
The file suffix for the checkpoint mesh.
Definition: MooseApp.C:3112
std::string getFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed Note: When stripLeadingPath is false...
Definition: MooseApp.C:2476
void addExecutorParams(const std::string &type, const std::string &name, const InputParameters &params)
Adds the parameters for an Executor to the list of parameters.
Definition: MooseApp.C:2019
bool defaultAutomaticScaling() const
Whether to enable automatic scaling by default.
Definition: MooseApp.h:1009
bool & useNonlinear()
Returns a writable Boolean indicating whether this app will use a Nonlinear or Eigen System...
Definition: MooseApp.h:391
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:142
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1555
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision.h file.
Definition: MooseApp.C:2278
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1251
const std::set< std::string > & getMFEMDevices(Moose::PassKey< MultiApp >) const
Get the configured MFEM devices.
Definition: MooseApp.h:1691
void setOutputPosition(const Point &p)
Tell the app to output in a specific position.
Definition: MooseApp.C:2419
bool hasMeshGenerator(const MeshGeneratorName &name) const
Definition: MooseApp.h:866
std::vector< std::string > sub_transformed_vars
The names of variables to transform for fixed point solve algorithms (e.g. secant, etc.).
Definition: MooseApp.h:125
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:1187
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
void setExecutioner(std::shared_ptr< Executioner > &&executioner)
Set the Executioner for this App.
Definition: MooseApp.h:343
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:1271
A class for creating restricted objects.
Definition: Restartable.h:28
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:820
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:1309
Stores configuration options relating to the fixed-point solving capability.
Definition: MooseApp.h:119
Storage container for all InputParamter objects.
const MeshGenerator & getMeshGenerator(const std::string &name) const
Definition: MooseApp.h:874
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
The relationship managers that have been attached (type -> RMs)
Definition: MooseApp.h:1354
auto getRestartableDataMapBegin()
Iterator based access to the extra RestartableDataMap objects; see Checkpoint.C for use case...
Definition: MooseApp.h:1033
Reader for restartable data written by the RestartableDataWriter.
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:1336
void dynamicRegistration(const libMesh::Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2740
bool hasRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname) const
Definition: MooseApp.C:2574
std::vector< PostprocessorName > sub_transformed_pps
The names of postprocessors to transform for fixed point solve algorithms (e.g. secant, etc.).
Definition: MooseApp.h:127
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:1269
PerfGraph & createRecoverablePerfGraph()
Creates a recoverable PerfGraph.
Definition: MooseApp.C:3536
std::string libNameToAppName(const std::string &library_name) const
Converts a library name to an application name:
Definition: MooseApp.C:2510
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:964
void registerCapabilities()
Register all base MooseApp capabilities to the Moose::Capabilities registry.
const std::shared_ptr< Parser > _parser
Parser for parsing the input file (owns the root hit node)
Definition: MooseApp.h:1230
std::string getFrameworkVersion() const
Returns the framework version.
Definition: MooseApp.C:1251
Base class for everything in MOOSE with a name and a type.
Definition: MooseBase.h:49
void setRecover(bool value)
Definition: MooseApp.C:2958
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo() const
Returns the Relationship managers info suitable for printing.
Definition: MooseApp.C:3392
void setExecutor(std::shared_ptr< Executor > &&executor)
Definition: MooseApp.h:344
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:1211
bool hasOutputPosition() const
Whether or not an output position has been set.
Definition: MooseApp.h:276
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Definition: MooseApp.C:3143
torch::DeviceType determineLibtorchDeviceType(const MooseEnum &device) const
Function to determine the device which should be used by libtorch on this application.
Definition: MooseApp.C:3575
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1196
const std::vector< RestartableDataMap > & getRestartableData() const
Return reference to the restartable data object.
Definition: MooseApp.h:687
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1199
Generic factory class for build all sorts of objects.
Definition: Factory.h:28
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...
Definition: MooseApp.h:546
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1552
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:1988
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
Definition: MooseApp.h:418
std::vector< std::string > getMeshGeneratorNames() const
Definition: MooseApp.h:892
bool hasInitialBackup() const
Definition: MooseApp.h:1001
static Moose::ParameterRegistry & registry
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:3119
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:2940
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
Definition: MooseApp.h:994
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:1285
static const RestartableDataMapName MESH_META_DATA
Definition: MooseApp.h:130
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:1542
FixedPointConfig & fixedPointConfig()
This info is stored here because we need a "globalish" place to put it in order to allow communicatio...
Definition: MooseApp.h:386
virtual std::string appBinaryName() const
Definition: MooseApp.h:144
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
Definition: MooseApp.C:1709
const bool _use_master_mesh
Whether to use the parent app mesh for this app.
Definition: MooseApp.h:1561
static void addInputParam(InputParameters &params)
Definition: MooseApp.C:102
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:3151
void deallocateKokkosMemoryPool()
Deallocate Kokkos memory pool.
bool runInputs()
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
Definition: MooseApp.C:2349
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1873
virtual void run()
Run the application.
Definition: MooseApp.C:2175
void removeRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Purge this relationship manager from meshes and DofMaps and finally from us.
Definition: MooseApp.C:3166
std::unique_ptr< libMesh::MeshBase > getSavedMesh(const std::string &name)
Get the saved mesh by name.
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:1208
void createExecutors()
After adding all of the Executor Params - this function will actually cause all of them to be built...
Definition: MooseApp.C:2092
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:2040
Builds lists and maps that help in knowing which physical hardware nodes each rank is on...
Definition: RankMap.h:23
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 forceRestart() const
Whether or not we are forcefully restarting (allowing the load of potentially incompatibie checkpoint...
Definition: MooseApp.h:1068
std::filesystem::path restartFolderBase(const std::filesystem::path &folder_base) const
The file suffix for restartable data.
Definition: MooseApp.C:3127
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:1327
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:809
bool hasRelationshipManager(const std::string &name) const
Returns a Boolean indicating whether a RelationshipManater exists with the same name.
Definition: MooseApp.C:3038
Base class for MOOSE-based applications.
Definition: MooseApp.h:103
Storage for action instances.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:1347
const std::vector< std::shared_ptr< RelationshipManager > > & getReleationshipManagers()
Retrieve the relationship managers.
bool hasRestartableDataMap(const RestartableDataMapName &name) const
Definition: MooseApp.C:3511
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
Definition: MooseApp.h:1623
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1214
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:225
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1266
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:2625
const bool _test_restep
Whether or not this simulation should fail its middle timestep and repeat (for testing) ...
Definition: MooseApp.h:1341
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1333
int exitCode() const
Get the shell exit code for the application.
Definition: MooseApp.h:157
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:411
Real getStartTime() const
Definition: MooseApp.h:300
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
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:1344
const hit::Node * getCurrentActionHitNode() const
Definition: MooseApp.C:3135
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1224
RestartableDataReader _rd_reader
Definition: MooseApp.h:1575
void checkMetaDataIntegrity() const
Function to check the integrity of the restartable meta data structure.
Definition: MooseApp.C:3468
static InputParameters validParams()
Definition: MooseApp.C:109
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:1847
unsigned int multiAppNumber() const
The MultiApp number.
Definition: MooseApp.h:815
bool isSplitMesh() const
Whether or not this is a split mesh operation.
Definition: MooseApp.C:1853
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:3500
ActionFactory & getActionFactory()
Retrieve a writable reference to the ActionFactory associated with this App.
Definition: MooseApp.h:406
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
SolutionInvalidity & _solution_invalidity
The SolutionInvalidity object for this application.
Definition: MooseApp.h:1254
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...
Definition: MooseApp.h:1361
std::shared_ptr< libMesh::ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
Definition: MooseApp.h:1312
FEProblemBase & feProblem() const
Definition: MooseApp.C:2000
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition: MooseApp.h:401
MooseApp(const InputParameters &parameters)
Constructor is protected so that this object is constructed through the AppFactory object...
Definition: MooseApp.C:439
std::optional< MooseEnum > getComputeDevice() const
Get the device accelerated computations are supposed to be running on.
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1242
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:3208
void setOutputFileBase(const std::string &output_file_base)
Override the selection of the output file base name.
Definition: MooseApp.C:1718
std::string getRecoverFileBase() const
Definition: MooseApp.h:495
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:1257
This class wraps provides and tracks access to command line parameters.
Definition: CommandLine.h:29
const bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1339
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.
int _exit_code
The exit code.
Definition: MooseApp.h:1306
SystemInfo _sys_info
System Information.
Definition: MooseApp.h:1236
Storage for restartable data that is ordered based on insertion order.
bool checkInput() const
Returns whether the Application is running in check input mode.
Definition: MooseApp.h:930
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.
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh...
Definition: MooseApp.h:430
const RankMap & rankMap()
The RankMap is a useful object for determining how the processes are laid out on the physical nodes o...
Definition: MooseApp.h:168
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1570
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...
Definition: MooseApp.C:3277
uint8_t processor_id_type
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:460
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1205
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
Definition: MooseApp.h:506
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:2603
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
The Kokkos class that manages memory pool for dynamically-sized temporary arrays in Kokkos parallel f...
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
Definition: MooseApp.C:2246
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
Definition: MooseApp.C:3064
RestartableDataValue & getRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname, THREAD_ID tid)
Definition: MooseApp.C:2584
std::vector< RestartableDataMap > & getRestartableData()
Definition: MooseApp.h:688
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1282
bool & useEigenvalue()
Returns a writable Boolean indicating whether this app will use an eigenvalue executioner.
Definition: MooseApp.h:396
bool hasKokkosObjects() const
Get whether there is any Kokkos object added by actions.
Definition: MooseApp.h:1118
const std::string & getLastInputFileName() const
Definition: MooseApp.C:1702
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:739
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:2169
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers() const
Return the container of relationship managers.
Definition: MooseApp.h:1017
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:773
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:2753
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1321
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1899
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
Definition: MooseTypes.h:792
Moose::Builder & builder()
Returns a writable reference to the builder.
Definition: MooseApp.h:220
bool unusedFlagIsError() const
Returns whether the flag for unused parameters is set to throw an error.
Definition: MooseApp.h:1074
void mooseDeprecated(Args &&... args) const
Definition: MooseBase.h:314
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
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...
Definition: MooseApp.h:424
bool _has_kokkos_gpus
Flag whether every process has an associated Kokkos GPU.
Definition: MooseApp.h:1646
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1605
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition: MooseApp.h:179
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:2522
std::unique_ptr< MeshBase > getMeshGeneratorMesh()
Definition: MooseApp.h:882
void queryKokkosGPUs()
Query the Kokkos GPUs in the system and check whether every process has an associated GPU...
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:50
void setRestart(bool value)
Sets the restart/recover flags.
Definition: MooseApp.C:2952
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Definition: TheWarehouse.h:185
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:1260
torch::DeviceType getLibtorchDevice() const
Get the device torch is supposed to be running on.
Definition: MooseApp.h:111
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...
Definition: MooseApp.h:534
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:92
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:1221
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:93
void restoreFromInitialBackup(const bool for_restart)
Restores from a "initial" backup, that is, one set in _initial_backup.
Definition: MooseApp.C:1949
const ActionWarehouse & actionWarehouse() const
Return a const reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:215
const Parser & parser() const
Definition: MooseApp.C:2027
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
bool isKokkosAvailable() const
Get whether Kokkos is available.
Definition: MooseApp.h:1101
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:211
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1545
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:1318
Point _output_position
The output position.
Definition: MooseApp.h:1202
const MooseMesh * masterMesh() const
Returns a pointer to the master mesh.
Definition: MooseApp.h:830
bool testReStep() const
Whether or not this simulation should fail a timestep and repeat (for testing).
Definition: MooseApp.h:524
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:518
const std::shared_ptr< CommandLine > _command_line
The CommandLine object.
Definition: MooseApp.h:1233
libMesh::ExodusII_IO * getExReaderForRestart() const
Get the Exodus reader to restart variables from an Exodus mesh file.
Definition: MooseApp.h:443
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1301
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:1257
SolutionInvalidity & createRecoverableSolutionInvalidity()
Creates a recoverable SolutionInvalidity.
Definition: MooseApp.C:3554
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1596
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
Definition: MooseApp.h:1567
Class for storing and utilizing output objects.
Interface for objects interacting with the PerfGraph.
const bool _force_restart
Whether or not we are forcefully attempting to load checkpoints (–force-restart) ...
Definition: MooseApp.h:1330
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:2163
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:2914
void setGlobalTimeOffset(Real offset)
Each App has it&#39;s own local time.
Definition: MooseApp.h:306
The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidit...
std::unordered_map< std::string, DynamicLibraryInfo > _lib_handles
The library archive (name only), registration method and the handle to the method.
Definition: MooseApp.h:1371
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:3608
Point getOutputPosition() const
Get the output position.
Definition: MooseApp.h:282
Definition: Moose.h:42
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.
Definition: MooseApp.h:907
static std::string mainMeshGeneratorName()
The name reserved for the "main" mesh generator which is the one used for the numerical solver downst...
const std::string & getRestartableDataMapName(const RestartableDataMapName &name) const
Definition: MooseApp.C:3527
FixedPointConfig _fixed_point_config
Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and u...
Definition: MooseApp.h:1275
const ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:1584
UNUSED_CHECK
Indicates whether warnings, errors, or no output is displayed when unused parameters are detected...
Definition: MooseApp.h:1291
bool hasRecoverFileBase() const
Definition: MooseApp.C:1865
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:1602
const MooseMesh * masterDisplacedMesh() const
Returns a pointer to the master displaced mesh.
Definition: MooseApp.h:835
bool hasRestartRecoverFileBase() const
Return true if the recovery file base is set.
Definition: MooseApp.C:1859
void registerRestartableDataMapName(const RestartableDataMapName &name, std::string suffix="")
Reserve a location for storing custom RestartableDataMap objects.
Definition: MooseApp.C:3517
static void checkReservedCapability(const std::string &capability)
Helper that reports an error if the given capability is reserved and should not be added via addCapab...
Definition: MooseApp.C:2406
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
Definition: MooseApp.C:1914
void loadRestartableMetaData(const std::filesystem::path &folder_base)
Loads all available restartable meta data if it is available with the folder base folder_base...
Definition: MooseApp.C:2618
ChainControlDataSystem _chain_control_system
The system that manages the ChainControls.
Definition: MooseApp.h:1573
const SystemInfo & getSystemInfo() const
Get SystemInfo object.
Definition: MooseApp.h:561
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:1809
Real sub_relaxation_factor
relaxation factor to be used for a MultiApp&#39;s subapps.
Definition: MooseApp.h:123
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1315
void addExecutor(const std::string &type, const std::string &name, const InputParameters &params)
Definition: MooseApp.C:2007
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
NullExecutor * getNullExecutor() const
Definition: MooseApp.h:336
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
bool getFPTrapFlag() const
Returns whether FPE trapping is turned on (either because of debug or user requested) ...
Definition: MooseApp.h:933
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1239
const torch::DeviceType _libtorch_device
The libtorch device this app is using (converted from compute_device)
Definition: MooseApp.h:1615
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.
Definition: MooseApp.h:856
std::string RestartableDataMapName
Definition: MooseTypes.h:214
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1350
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1227
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1193
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1587
static void addAppParam(InputParameters &params)
Definition: MooseApp.C:95
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1593
bool unusedFlagIsWarning() const
Returns whether the flag for unused parameters is set to throw a warning only.
Definition: MooseApp.h:1071
auto getRestartableDataMapEnd()
Definition: MooseApp.h:1035
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:1734
bool hasStartTime() const
Definition: MooseApp.h:295
System that manages ChainControls.
std::variant< bool, int, std::string > Type
A capability can have a bool, int, or string value.
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:2946
const SolutionInvalidity & solutionInvalidity() const
Definition: MooseApp.h:180
Holding syntax for parsing input files.
Definition: Syntax.h:21
bool useMasterMesh() const
Returns whether to use the parent app mesh as the mesh for this app.
Definition: MooseApp.h:825
std::unordered_set< std::string > DataNames
bool _has_kokkos_objects
Flag whether there is any Kokkos object added by actions.
Definition: MooseApp.h:1651
static const std::string MESH_META_DATA_SUFFIX
Definition: MooseApp.h:131
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1590
Factory _factory
Definition: MooseApp.h:1298
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
Definition: MooseApp.h:845
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1218
bool hasMeshGenerator(const MeshGeneratorName &name) const
const std::vector< std::string > & getInputFileNames() const
Definition: MooseApp.C:1695
void setMFEMDevice(const std::string &device_string, Moose::PassKey< MFEMProblemSolve >)
Create/configure the MFEM device with the provided device_string.
Definition: MooseApp.C:3652
static void addCapability(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
Definition: MooseApp.C:3635
const std::vector< T * > & getInterfaceObjects() const
Gets the registered interface objects for a given interface.
Definition: MooseApp.h:1678
TheWarehouse & theWarehouse()
Definition: MooseApp.h:137
const MeshGenerator & getMeshGenerator(const std::string &name) const
std::unique_ptr< Backup > finalizeRestore()
Finalizes (closes) the restoration process done in restore().
Definition: MooseApp.C:1956
System that manages MeshGenerators.
const Moose::Kokkos::MemoryPool & getKokkosMemoryPool() const
Get Kokkos memory pool.
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:1558
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.
Definition: MooseApp.C:2711
void allocateKokkosMemoryPool(std::size_t size, unsigned int ways) const
Allocate Kokkos memory pool.
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
Definition: MooseApp.h:840
const DataNames & getRecoverableData() const
Return a reference to the recoverable data object.
Definition: MooseApp.h:721
std::unordered_set< std::string > entry_symbols
Definition: MooseApp.h:1367
Parses MOOSE input using HIT/WASP.
Definition: Builder.h:56
const std::shared_ptr< libMesh::Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:1190
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:1263
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
Definition: MooseApp.h:1620
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:112
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:2964
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
Definition: MooseApp.h:162
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:1841
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:1248
Executor * getExecutor() const
Definition: MooseApp.h:335
bool _ready_to_exit
Definition: MooseApp.h:1304
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode...
Definition: PerfGraph.h:43
bool copyInputs()
Handles the copy_inputs input parameter logic: Checks to see whether the passed argument is valid (a ...
Definition: MooseApp.C:2284
virtual bool errorOnJacobianNonzeroReallocation() const
Whether this application should by default error on Jacobian nonzero reallocations.
Definition: MooseApp.h:1043
Real getGlobalTimeOffset() const
Each App has it&#39;s own local time.
Definition: MooseApp.h:312
std::shared_ptr< mfem::Device > getMFEMDevice(Moose::PassKey< MultiApp >)
Get the MFEM device object.
Definition: MooseApp.h:1086
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
Definition: MooseApp.h:494
const MooseMesh *const _master_mesh
The mesh from master app.
Definition: MooseApp.h:1564
const std::shared_ptr< libMesh::Parallel::Communicator > getCommunicator() const
Definition: MooseApp.h:1012
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
void disableCheckUnusedFlag()
Removes warnings and error checks for unrecognized variables in the input file.
Definition: MooseApp.C:1994
bool useExecutor() const
Definition: MooseApp.h:337
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1324
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1279
Abstract definition of a RestartableData value.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:173
Class for parsing input files.
Definition: Parser.h:87
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:2482
std::string getExecutableName()
Gets the name of the running executable on Mac OS X and linux.
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:2494
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.
Definition: MooseApp.h:1656
static ParameterRegistry & get()
Get the singleton registry.
virtual ~MooseApp()
Definition: MooseApp.C:1210
void setExReaderForRestart(std::shared_ptr< libMesh::ExodusII_IO > &&exreader)
Set the Exodus reader to restart variables from an Exodus mesh file.
Definition: MooseApp.h:435
unsigned int THREAD_ID
Definition: MooseTypes.h:209
void setStartTime(Real time)
Set the starting time for the simulation.
Definition: MooseApp.C:2469
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1263
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:1773
std::set< std::string > getLoadedLibraryPaths() const
Return the paths of loaded libraries.
Definition: MooseApp.C:2903
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:1303
void dynamicAppRegistration(const std::string &app_name, std::string library_path, const std::string &library_name, bool lib_load_deps)
Definition: MooseApp.C:2654
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:1611