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 "Parser.h"
29 #include "Builder.h"
30 #include "ActionWarehouse.h"
31 #include "Factory.h"
32 #include "ActionFactory.h"
33 #include "OutputWarehouse.h"
34 #include "RestartableData.h"
35 #include "RestartableDataMap.h"
36 #include "ConsoleStreamInterface.h"
37 #include "PerfGraph.h"
38 #include "PerfGraphInterface.h"
39 #include "TheWarehouse.h"
40 #include "RankMap.h"
41 #include "MeshGeneratorSystem.h"
42 #include "ChainControlDataSystem.h"
43 #include "RestartableDataReader.h"
44 #include "Backup.h"
45 #include "MooseBase.h"
46 #include "Capabilities.h"
47 #include "MoosePassKey.h"
48 
49 #include "libmesh/parallel_object.h"
50 #include "libmesh/mesh_base.h"
51 #include "libmesh/point.h"
52 
53 // C++ includes
54 #include <list>
55 #include <map>
56 #include <set>
57 #include <unordered_set>
58 #include <typeindex>
59 #include <filesystem>
60 #include <variant>
61 
62 // Forward declarations
63 class Executioner;
64 class Executor;
65 class NullExecutor;
66 class FEProblemBase;
68 class SystemInfo;
69 class CommandLine;
71 class SolutionInvalidity;
72 class MultiApp;
73 #ifdef MOOSE_MFEM_ENABLED
74 class MFEMExecutioner;
75 #endif
76 
77 namespace libMesh
78 {
79 class ExodusII_IO;
80 }
81 namespace hit
82 {
83 class Node;
84 }
85 
97  public PerfGraphInterface,
99  public MooseBase
100 {
101 public:
102 #ifdef MOOSE_LIBTORCH_ENABLED
103  torch::DeviceType getLibtorchDevice() const { return _libtorch_device; }
105 #endif
106 
113  {
118  std::vector<std::string> sub_transformed_vars;
120  std::vector<PostprocessorName> sub_transformed_pps;
121  };
122 
124  static const std::string MESH_META_DATA_SUFFIX;
125 
126  static InputParameters validParams();
127 
128  virtual ~MooseApp();
129 
131 
135  virtual std::string getPrintableName() const { return "Application"; }
136 
137  virtual std::string appBinaryName() const
138  {
140  name = name.substr(0, name.find_last_of("-"));
141  if (name.find_first_of("/") != std::string::npos)
142  name = name.substr(name.find_first_of("/") + 1, std::string::npos);
143  return name;
144  }
145 
150  int exitCode() const { return _exit_code; }
151 
155  void setExitCode(const int exit_code) { _exit_code = exit_code; }
156 
161  const InputParameters & parameters() { return _pars; }
162 
167  const RankMap & rankMap() { return _rank_map; }
168 
173 
181 
183 
188  template <typename T>
189  const T & getParam(const std::string & name);
190 
191  template <typename T>
192  const T & getParam(const std::string & name) const;
194 
202  template <typename T>
203  const T & getRenamedParam(const std::string & old_name, const std::string & new_name) const;
204 
205  inline bool isParamValid(const std::string & name) const { return _pars.isParamValid(name); }
206 
207  inline bool isParamSetByUser(const std::string & nm) const { return _pars.isParamSetByUser(nm); }
208 
212  virtual void run();
213 
217  std::string getFrameworkVersion() const;
218 
222  virtual std::string getVersion() const;
223 
227  std::string getPrintableVersion() const;
228 
232  virtual void setupOptions();
233 
242 
247 
251  Syntax & syntax() { return _syntax; }
252 
256  const std::vector<std::string> & getInputFileNames() const;
257 
261  const std::string & getLastInputFileName() const;
262 
267  void setOutputFileBase(const std::string & output_file_base);
268 
279  std::string getOutputFileBase(bool for_non_moose_build_output = false) const;
280 
284  void setOutputPosition(const Point & p);
285 
290  std::list<std::string> getCheckpointDirectories() const;
291 
296  std::list<std::string> getCheckpointFiles() const;
297 
302  bool hasOutputPosition() const { return _output_position_set; }
303 
308  Point getOutputPosition() const { return _output_position; }
309 
316  void setStartTime(Real time);
317 
321  bool hasStartTime() const { return _start_time_set; }
322 
326  Real getStartTime() const { return _start_time; }
327 
332  void setGlobalTimeOffset(Real offset) { _global_time_offset = offset; }
333 
339 
345  std::string getFileName(bool stripLeadingPath = true) const;
346 
350  void setErrorOverridden();
351 
355  void disableCheckUnusedFlag();
356 
360  Executioner * getExecutioner() const;
361  Executor * getExecutor() const { return _executor.get(); }
362  NullExecutor * getNullExecutor() const { return _null_executor.get(); }
363  bool useExecutor() const { return _use_executor; }
364  FEProblemBase & feProblem() const;
365 
369  void setExecutioner(std::shared_ptr<Executioner> && executioner) { _executioner = executioner; }
370  void setExecutor(std::shared_ptr<Executor> && executor) { _executor = executor; }
371  void
372  addExecutor(const std::string & type, const std::string & name, const InputParameters & params);
373 
378  void addExecutorParams(const std::string & type,
379  const std::string & name,
380  const InputParameters & params);
381 
385  Parser & parser();
386 
391  void createExecutors();
392 
400  Executor & getExecutor(const std::string & name, bool fail_if_not_found = true);
401 
410 
414  bool & useNonlinear() { return _use_nonlinear; }
415 
419  bool & useEigenvalue() { return _use_eigen_value; }
420 
424  Factory & getFactory() { return _factory; }
425 
430 
434  processor_id_type processor_id() const { return _comm->rank(); }
435 
441  std::shared_ptr<CommandLine> commandLine() const { return _command_line; }
442 
447  void setExodusFileRestart(bool flag) { _initial_from_file = flag; }
448 
453  bool getExodusFileRestart() const { return _initial_from_file; }
454 
458  void setExReaderForRestart(std::shared_ptr<libMesh::ExodusII_IO> && exreader)
459  {
460  _ex_reader = exreader;
461  }
462 
467 
471  virtual void runInputFile();
472 
476  virtual void executeExecutioner();
477 
484 
490  bool isRecovering() const;
491 
498  bool isRestarting() const;
499 
503  bool isSplitMesh() const;
504 
506 
509  bool hasRestartRecoverFileBase() const;
510  bool hasRecoverFileBase() const;
512 
514 
517  std::string getRestartRecoverFileBase() const { return _restart_recover_base; }
518  std::string getRecoverFileBase() const
519  {
520  mooseDeprecated("MooseApp::getRecoverFileBase is deprecated, use "
521  "MooseApp::getRestartRecoverFileBase() instead.");
522  return _restart_recover_base;
523  }
525 
529  void setRestartRecoverFileBase(const std::string & file_base)
530  {
531  if (file_base.empty())
533  else
534  _restart_recover_base = file_base;
535  }
536 
542 
551  void setOutputFileNumbers(const std::map<std::string, unsigned int> & numbers)
552  {
553  _output_file_numbers = numbers;
554  }
555 
563  const std::map<std::string, unsigned int> & getOutputFileNumbers() const
564  {
565  return _output_file_numbers;
566  }
567 
572  const OutputWarehouse & getOutputWarehouse() const;
573 
578  const SystemInfo * getSystemInfo() const { return _sys_info.get(); }
579 
581 
586  void dynamicAllRegistration(const std::string & app_name,
587  Factory * factory,
588  ActionFactory * action_factory,
589  Syntax * syntax,
590  std::string library_path,
591  const std::string & library_name);
592  void dynamicAppRegistration(const std::string & app_name,
593  std::string library_path,
594  const std::string & library_name,
595  bool lib_load_deps);
597 
604  std::string appNameToLibName(const std::string & app_name) const;
605 
609  std::string libNameToAppName(const std::string & library_name) const;
610 
614  std::set<std::string> getLoadedLibraryPaths() const;
615 
619  std::set<std::string> getLibrarySearchPaths(const std::string & library_path_from_param) const;
620 
625 
626  /*
627  * Register a piece of restartable data. This is data that will get
628  * written / read to / from a restart file.
629  *
630  * @param data The actual data object.
631  * @param tid The thread id of the object. Use 0 if the object is not threaded.
632  * @param read_only Restrict the data for read-only
633  * @param metaname (optional) register the data to the meta data storage (tid must be 0)
634  */
635  RestartableDataValue & registerRestartableData(std::unique_ptr<RestartableDataValue> data,
636  THREAD_ID tid,
637  bool read_only,
638  const RestartableDataMapName & metaname = "");
639 
640  /*
641  * Deprecated method to register a piece of restartable data.
642  *
643  * Use the call without a data name instead.
644  */
645  RestartableDataValue & registerRestartableData(const std::string & name,
646  std::unique_ptr<RestartableDataValue> data,
647  THREAD_ID tid,
648  bool read_only,
649  const RestartableDataMapName & metaname = "");
650 
651  /*
652  * Check if a restartable meta data exists or not.
653  *
654  * @param name The full (unique) name.
655  * @param metaname The name to the meta data storage
656  */
657  bool hasRestartableMetaData(const std::string & name,
658  const RestartableDataMapName & metaname) const;
659 
660  /*
661  * Retrieve restartable meta data from restartable data map
662  *
663  * @param name The full (unique) name.
664  * @param metaname The name to the meta data storage
665  * @return A reference to the restartable meta data value
666  */
667  RestartableDataValue & getRestartableMetaData(const std::string & name,
668  const RestartableDataMapName & metaname,
669  THREAD_ID tid);
670 
676  const std::filesystem::path & folder_base);
681  void loadRestartableMetaData(const std::filesystem::path & folder_base);
682 
688  std::vector<std::filesystem::path>
690  const std::filesystem::path & folder_base);
696  std::vector<std::filesystem::path>
697  writeRestartableMetaData(const std::filesystem::path & folder_base);
698 
703  const std::vector<RestartableDataMap> & getRestartableData() const { return _restartable_data; }
705  std::vector<RestartableDataMap> & getRestartableData() { return _restartable_data; }
707 
712 
717 
727  void registerRestartableDataMapName(const RestartableDataMapName & name, std::string suffix = "");
728 
732  const std::string & getRestartableDataMapName(const RestartableDataMapName & name) const;
733 
739 
745  std::vector<std::filesystem::path> backup(const std::filesystem::path & folder_base);
751  std::unique_ptr<Backup> backup();
752 
756  virtual void preBackup() {}
757 
769  void restore(const std::filesystem::path & folder_base, const bool for_restart);
770 
782  void restore(std::unique_ptr<Backup> backup, const bool for_restart);
783 
790  virtual void postRestore(const bool /* for_restart */) {}
791 
804  void restoreFromInitialBackup(const bool for_restart);
805 
815  std::unique_ptr<Backup> finalizeRestore();
816 
820  virtual std::string header() const;
821 
826  unsigned int multiAppLevel() const { return _multiapp_level; }
827 
832  unsigned int multiAppNumber() const { return _multiapp_number; }
833 
837  bool isUltimateMaster() const { return !_multiapp_level; }
838 
842  bool useMasterMesh() const { return _use_master_mesh; }
843 
847  const MooseMesh * masterMesh() const { return _master_mesh; }
848 
853 
858 
863 
873  void addMeshGenerator(const std::string & type,
874  const std::string & name,
875  const InputParameters & params)
876  {
878  }
879 
883  bool hasMeshGenerator(const MeshGeneratorName & name) const
884  {
886  }
887 
891  const MeshGenerator & getMeshGenerator(const std::string & name) const
892  {
894  }
895 
899  std::unique_ptr<MeshBase> getMeshGeneratorMesh()
900  {
902  }
903 
909  std::vector<std::string> getMeshGeneratorNames() const
910  {
912  }
913 
923  const MeshGenerator &
924  appendMeshGenerator(const std::string & type, const std::string & name, InputParameters params)
925  {
927  }
928 
935  virtual bool constructingMeshGenerators() const;
936 
938 
942  void setRestart(bool value);
943  void setRecover(bool value);
945 
947  bool checkInput() const { return _check_input; }
948 
950  bool getFPTrapFlag() const { return _trap_fpe; }
951 
955  bool hasRelationshipManager(const std::string & name) const;
956 
963  bool addRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);
964 
966  static const std::string & checkpointSuffix();
968  static std::filesystem::path metaDataFolderBase(const std::filesystem::path & folder_base,
969  const std::string & map_suffix);
971  std::filesystem::path restartFolderBase(const std::filesystem::path & folder_base) const;
972 
980  const hit::Node * getCurrentActionHitNode() const;
981 
988  bool attach_geometric_rm_final = false);
989 
996  void attachRelationshipManagers(MeshBase & mesh, MooseMesh & moose_mesh);
997 
1001  const std::vector<std::shared_ptr<RelationshipManager>> & getReleationshipManagers();
1002 
1006  std::vector<std::pair<std::string, std::string>> getRelationshipManagerInfo() const;
1007 
1011  const ExecFlagEnum & getExecuteOnEnum() const { return _execute_flags; }
1012 
1018  bool hasInitialBackup() const
1019  {
1020  return _initial_backup != nullptr && *_initial_backup != nullptr;
1021  }
1022 
1027 
1028  // Return the communicator for this application
1029  const std::shared_ptr<libMesh::Parallel::Communicator> getCommunicator() const { return _comm; }
1030 
1034  const std::set<std::shared_ptr<RelationshipManager>> & relationshipManagers() const
1035  {
1036  return _relationship_managers;
1037  }
1038 
1042  void checkMetaDataIntegrity() const;
1043 
1045 
1051 
1054 
1060  virtual bool errorOnJacobianNonzeroReallocation() const { return false; }
1061 
1067  template <class T>
1068  void registerInterfaceObject(T & interface);
1069 
1075  template <class T>
1076  const std::vector<T *> & getInterfaceObjects() const;
1077 
1078  static void addAppParam(InputParameters & params);
1079  static void addInputParam(InputParameters & params);
1080 
1085  bool forceRestart() const { return _force_restart; }
1086 
1089 
1092 
1093 #ifdef MOOSE_MFEM_ENABLED
1094 
1098  void setMFEMDevice(const std::string & device_string, Moose::PassKey<MFEMExecutioner>);
1099 
1103  std::shared_ptr<mfem::Device> getMFEMDevice(Moose::PassKey<MultiApp>) { return _mfem_device; }
1104 
1108  const std::set<std::string> & getMFEMDevices(Moose::PassKey<MultiApp>) const;
1109 #endif
1110 
1111 protected:
1115  void dynamicRegistration(const libMesh::Parameters & params);
1116 
1121  void loadLibraryAndDependencies(const std::string & library_filename,
1122  const libMesh::Parameters & params,
1123  bool load_dependencies = true);
1124 
1127 
1137  void registerRestartableNameWithFilter(const std::string & name,
1138  Moose::RESTARTABLE_FILTER filter);
1139 
1144  void errorCheck();
1145 
1150  void outputMachineReadableData(const std::string & param,
1151  const std::string & start_marker,
1152  const std::string & end_marker,
1153  const std::string & data) const;
1155  static void addCapability(const std::string & capability,
1156  CapabilityUtils::Type value,
1157  const std::string & doc);
1158  static void
1159  addCapability(const std::string & capability, const char * value, const std::string & doc);
1161 
1164 
1166  const std::string _type;
1167 
1169  const std::shared_ptr<libMesh::Parallel::Communicator> _comm;
1170 
1172  std::string _output_file_base;
1173 
1176 
1179 
1182 
1185 
1188 
1191 
1193  std::shared_ptr<CommandLine> _command_line;
1194 
1197 
1200  std::unique_ptr<InputParameterWarehouse> _input_parameter_warehouse;
1201 
1204 
1207 
1210 
1212  const std::shared_ptr<Parser> _parser;
1213 
1216 
1218  std::vector<RestartableDataMap> _restartable_data;
1219 
1225 
1228 
1231 
1234 
1236  std::shared_ptr<Executioner> _executioner;
1237 
1239  std::shared_ptr<Executor> _executor;
1240 
1242  std::map<std::string, std::shared_ptr<Executor>> _executors;
1243 
1246  std::unordered_map<std::string, std::pair<std::string, std::unique_ptr<InputParameters>>>
1248 
1252 
1255  const bool _use_executor;
1256 
1258  std::shared_ptr<NullExecutor> _null_executor;
1259 
1262 
1265 
1267  std::unique_ptr<SystemInfo> _sys_info;
1268 
1271  {
1276 
1278 
1282  std::string _early_exit_param;
1286 
1289 
1291  std::shared_ptr<libMesh::ExodusII_IO> _ex_reader;
1292 
1295 
1297  bool _recover;
1298 
1300  bool _restart;
1301 
1304 
1306  const bool _use_split;
1307 
1309  const bool _force_restart;
1310 
1313 
1316 
1319 
1321  std::map<std::string, unsigned int> _output_file_numbers;
1322 
1325 
1327  std::set<std::shared_ptr<RelationshipManager>> _relationship_managers;
1328 
1330  std::map<Moose::RelationshipManagerType, std::set<const RelationshipManager *>>
1332 
1337  std::unordered_map<RelationshipManager *, std::shared_ptr<libMesh::GhostingFunctor>>
1339 
1341  {
1343  std::string full_path;
1344  std::unordered_set<std::string> entry_symbols;
1345  };
1346 
1348  std::unordered_map<std::string, DynamicLibraryInfo> _lib_handles;
1349 
1350 private:
1359  void recursivelyCreateExecutors(const std::string & current_executor_name,
1360  std::list<std::string> & possible_roots,
1361  std::list<std::string> & current_branch);
1362 
1368  void registerCapabilities();
1369 
1380  void removeRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);
1381 
1382 #ifdef MOOSE_LIBTORCH_ENABLED
1383 
1389  torch::DeviceType determineLibtorchDeviceType(const MooseEnum & device) const;
1390 #endif
1391 
1395  {
1397  };
1398 
1399  template <class T>
1401  {
1402  std::vector<T *> _objects;
1403  };
1405 
1430  void createMinimalApp();
1431 
1436  void setCheckUnusedFlag(bool warn_is_error = false);
1437 
1445  bool hasRMClone(const RelationshipManager & template_rm, const MeshBase & mesh) const;
1446 
1451  RelationshipManager & getRMClone(const RelationshipManager & template_rm,
1452  const MeshBase & mesh) const;
1453 
1465  MooseMesh & moose_mesh,
1466  MeshBase & mesh,
1467  const libMesh::DofMap * dof_map = nullptr);
1468 
1476 
1484 
1489  bool showInputs() const;
1490 
1494  virtual std::string getInstallableInputs() const;
1495 
1502  bool copyInputs();
1503 
1509  bool runInputs();
1510 
1512  std::unordered_map<RestartableDataMapName, std::pair<RestartableDataMap, std::string>>
1514 
1517  {
1520  };
1521 
1523  std::unique_ptr<TheWarehouse> _the_warehouse;
1524 
1526  unsigned int _multiapp_level;
1527 
1529  unsigned int _multiapp_number;
1530 
1532  const bool _use_master_mesh;
1533 
1535  const MooseMesh * const _master_mesh;
1536 
1539 
1542 
1545 
1547 
1556 
1558  std::streambuf * _output_buffer_cache;
1559 
1562 
1564  bool _cpu_profiling = false;
1565 
1567  bool _heap_profiling = false;
1568 
1571  std::map<const RelationshipManager *,
1572  std::map<const MeshBase *, std::unique_ptr<RelationshipManager>>>
1574 
1576  std::map<std::type_index, std::unique_ptr<InterfaceRegistryObjectsBase>> _interface_registry;
1577 
1582  std::unique_ptr<Backup> * const _initial_backup;
1583 
1584 #ifdef MOOSE_LIBTORCH_ENABLED
1585  const torch::DeviceType _libtorch_device;
1587 #endif
1588 
1589 #ifdef MOOSE_MFEM_ENABLED
1590  std::shared_ptr<mfem::Device> _mfem_device;
1592 
1594  std::set<std::string> _mfem_devices;
1595 #endif
1596 
1597  // Allow FEProblemBase to set the recover/restart state, so make it a friend
1598  friend class FEProblemBase;
1599  friend class Restartable;
1600  friend class SubProblem;
1601 };
1602 
1603 template <typename T>
1604 const T &
1605 MooseApp::getParam(const std::string & name)
1606 {
1607  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
1608 }
1609 
1610 template <typename T>
1611 const T &
1612 MooseApp::getParam(const std::string & name) const
1613 {
1614  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0), this);
1615 }
1616 
1617 template <typename T>
1618 const T &
1619 MooseApp::getRenamedParam(const std::string & old_name, const std::string & new_name) const
1620 {
1621  // this enables having a default on the new parameter but bypassing it with the old one
1622  // Most important: accept new parameter
1623  if (isParamSetByUser(new_name) && !isParamValid(old_name))
1624  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1625  // Second most: accept old parameter
1626  else if (isParamValid(old_name) && !isParamSetByUser(new_name))
1627  return InputParameters::getParamHelper(old_name, _pars, static_cast<T *>(0), this);
1628  // Third most: accept default for new parameter
1629  else if (isParamValid(new_name) && !isParamValid(old_name))
1630  return InputParameters::getParamHelper(new_name, _pars, static_cast<T *>(0), this);
1631  // Refuse: no default, no value passed
1632  else if (!isParamValid(old_name) && !isParamValid(new_name))
1633  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1634  "' is being retrieved without being set.\n"
1635  "Did you mispell it?");
1636  // Refuse: both old and new parameters set by user
1637  else
1638  mooseError(_pars.blockFullpath() + ": parameter '" + new_name +
1639  "' may not be provided alongside former parameter '" + old_name + "'");
1640 }
1641 
1642 template <class T>
1643 void
1645 {
1646  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1647 
1648  InterfaceRegistryObjects<T> * registry = nullptr;
1649  auto it = _interface_registry.find(typeid(T));
1650  if (it == _interface_registry.end())
1651  {
1652  auto new_registry = std::make_unique<InterfaceRegistryObjects<T>>();
1653  registry = new_registry.get();
1654  _interface_registry.emplace(typeid(T), std::move(new_registry));
1655  }
1656  else
1657  registry = static_cast<InterfaceRegistryObjects<T> *>(it->second.get());
1658 
1659  mooseAssert(std::count(registry->_objects.begin(), registry->_objects.end(), &interface) == 0,
1660  "Interface already registered");
1661  registry->_objects.push_back(&interface);
1662 }
1663 
1664 template <class T>
1665 const std::vector<T *> &
1667 {
1668  static_assert(!std::is_base_of<MooseObject, T>::value, "T is not an interface");
1669 
1670  const auto it = _interface_registry.find(typeid(T));
1671  if (it != _interface_registry.end())
1672  return static_cast<InterfaceRegistryObjects<T> *>(it->second.get())->_objects;
1673  const static std::vector<T *> empty;
1674  return empty;
1675 }
1676 
1677 #ifdef MOOSE_MFEM_ENABLED
1678 inline const std::set<std::string> &
1680 {
1681  return _mfem_devices;
1682 }
1683 #endif
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:2387
virtual bool constructingMeshGenerators() const
Whether this app is constructing mesh generators.
Definition: MooseApp.C:3492
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:2355
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:1264
static const std::string & checkpointSuffix()
The file suffix for the checkpoint mesh.
Definition: MooseApp.C:3037
std::string getFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed Note: When stripLeadingPath is false...
Definition: MooseApp.C:2401
Parser & parser()
Definition: MooseApp.C:1981
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:1973
bool defaultAutomaticScaling() const
Whether to enable automatic scaling by default.
Definition: MooseApp.h:1026
bool & useNonlinear()
Returns a writable Boolean indicating whether this app will use a Nonlinear or Eigen System...
Definition: MooseApp.h:414
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:135
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:1526
virtual std::string getInstallableInputs() const
Method to retrieve the installable inputs from a given applications <app>Revision.h file.
Definition: MooseApp.C:2216
PerfGraph & _perf_graph
The PerfGraph object for this application (recoverable)
Definition: MooseApp.h:1227
const std::set< std::string > & getMFEMDevices(Moose::PassKey< MultiApp >) const
Get the configured MFEM devices.
Definition: MooseApp.h:1679
void setOutputPosition(const Point &p)
Tell the app to output in a specific position.
Definition: MooseApp.C:2344
bool hasMeshGenerator(const MeshGeneratorName &name) const
Definition: MooseApp.h:883
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:118
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:1166
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:369
std::unordered_map< std::string, std::pair< std::string, std::unique_ptr< InputParameters > > > _executor_params
Used in building the Executors Maps the name of the Executor block to the <type, params> ...
Definition: MooseApp.h:1247
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:837
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:1288
Stores configuration options relating to the fixed-point solving capability.
Definition: MooseApp.h:112
Storage container for all InputParamter objects.
const MeshGenerator & getMeshGenerator(const std::string &name) const
Definition: MooseApp.h:891
std::map< Moose::RelationshipManagerType, std::set< const RelationshipManager * > > _attached_relationship_managers
The relationship managers that have been attached (type -> RMs)
Definition: MooseApp.h:1331
auto getRestartableDataMapBegin()
Iterator based access to the extra RestartableDataMap objects; see Checkpoint.C for use case...
Definition: MooseApp.h:1050
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:1315
void dynamicRegistration(const libMesh::Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:2665
bool hasRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname) const
Definition: MooseApp.C:2499
std::vector< PostprocessorName > sub_transformed_pps
The names of postprocessors to transform for fixed point solve algorithms (e.g. secant, etc.).
Definition: MooseApp.h:120
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:1222
PerfGraph & createRecoverablePerfGraph()
Creates a recoverable PerfGraph.
Definition: MooseApp.C:3461
std::string libNameToAppName(const std::string &library_name) const
Converts a library name to an application name:
Definition: MooseApp.C:2435
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:963
void registerCapabilities()
Register all base MooseApp capabilities to the Moose::Capabilities registry.
const std::shared_ptr< Parser > _parser
Parser for parsing the input file.
Definition: MooseApp.h:1212
std::string getFrameworkVersion() const
Returns the framework version.
Definition: MooseApp.C:1204
Base class for everything in MOOSE with a name and a type.
Definition: MooseBase.h:32
void setRecover(bool value)
Definition: MooseApp.C:2883
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo() const
Returns the Relationship managers info suitable for printing.
Definition: MooseApp.C:3317
void setExecutor(std::shared_ptr< Executor > &&executor)
Definition: MooseApp.h:370
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:1190
bool hasOutputPosition() const
Whether or not an output position has been set.
Definition: MooseApp.h:302
bool hasRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Definition: MooseApp.C:3068
torch::DeviceType determineLibtorchDeviceType(const MooseEnum &device) const
Function to determine the device which should be used by libtorch on this application.
Definition: MooseApp.C:3500
bool _file_base_set_by_user
Whether or not file base is set through input or setOutputFileBase by MultiApp.
Definition: MooseApp.h:1175
const std::vector< RestartableDataMap > & getRestartableData() const
Return reference to the restartable data object.
Definition: MooseApp.h:704
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:1178
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:563
std::unique_ptr< TheWarehouse > _the_warehouse
The combined warehouse for storing any MooseObject based object.
Definition: MooseApp.h:1523
void setCheckUnusedFlag(bool warn_is_error=false)
Set a flag so that the parser will either warn or error when unused variables are seen after parsing ...
Definition: MooseApp.C:1942
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
Definition: MooseApp.h:441
std::vector< std::string > getMeshGeneratorNames() const
Definition: MooseApp.h:909
bool hasInitialBackup() const
Definition: MooseApp.h:1018
static std::filesystem::path metaDataFolderBase(const std::filesystem::path &folder_base, const std::string &map_suffix)
The file suffix for meta data (header and data)
Definition: MooseApp.C:3044
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:2865
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
Definition: MooseApp.h:1011
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:1261
static const RestartableDataMapName MESH_META_DATA
Definition: MooseApp.h:123
std::unordered_map< RestartableDataMapName, std::pair< RestartableDataMap, std::string > > _restartable_meta_data
General storage for custom RestartableData that can be added to from outside applications.
Definition: MooseApp.h:1513
FixedPointConfig & fixedPointConfig()
This info is stored here because we need a "globalish" place to put it in order to allow communicatio...
Definition: MooseApp.h:409
virtual std::string appBinaryName() const
Definition: MooseApp.h:137
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
Get the output file base name.
Definition: MooseApp.C:1663
const bool _use_master_mesh
Whether to use the parent app mesh for this app.
Definition: MooseApp.h:1532
static void addInputParam(InputParameters &params)
Definition: MooseApp.C:101
RelationshipManager & getRMClone(const RelationshipManager &template_rm, const MeshBase &mesh) const
Return the relationship manager clone originally created from the provided template relationship mana...
Definition: MooseApp.C:3076
bool runInputs()
Handles the run input parameter logic: Checks to see whether a directory exists in user space and lau...
Definition: MooseApp.C:2287
void registerRestartableNameWithFilter(const std::string &name, Moose::RESTARTABLE_FILTER filter)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:1827
virtual void run()
Run the application.
Definition: MooseApp.C:2123
void removeRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Purge this relationship manager from meshes and DofMaps and finally from us.
Definition: MooseApp.C:3091
std::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:1187
void createExecutors()
After adding all of the Executor Params - this function will actually cause all of them to be built...
Definition: MooseApp.C:2040
void recursivelyCreateExecutors(const std::string &current_executor_name, std::list< std::string > &possible_roots, std::list< std::string > &current_branch)
Internal function used to recursively create the executor objects.
Definition: MooseApp.C:1988
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:1085
std::filesystem::path restartFolderBase(const std::filesystem::path &folder_base) const
The file suffix for restartable data.
Definition: MooseApp.C:3052
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:1306
void setMFEMDevice(const std::string &device_string, Moose::PassKey< MFEMExecutioner >)
Create/configure the MFEM device with the provided device_string.
Definition: MooseApp.C:3571
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:826
bool hasRelationshipManager(const std::string &name) const
Returns a Boolean indicating whether a RelationshipManater exists with the same name.
Definition: MooseApp.C:2963
Base class for MOOSE-based applications.
Definition: MooseApp.h:96
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:1324
const std::vector< std::shared_ptr< RelationshipManager > > & getReleationshipManagers()
Retrieve the relationship managers.
const InputParameters & _pars
Parameters of this object.
Definition: MooseApp.h:1163
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:205
bool hasRestartableDataMap(const RestartableDataMapName &name) const
Definition: MooseApp.C:3436
std::set< std::string > _mfem_devices
MFEM supported devices based on user-provided config.
Definition: MooseApp.h:1594
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:1196
Syntax & syntax()
Returns a writable reference to the syntax object.
Definition: MooseApp.h:251
std::map< std::string, std::shared_ptr< Executor > > _executors
Pointers to all of the Executors for this run.
Definition: MooseApp.h:1242
std::vector< std::filesystem::path > writeRestartableMetaData(const RestartableDataMapName &name, const std::filesystem::path &folder_base)
Writes the restartable meta data for name with a folder base of folder_base.
Definition: MooseApp.C:2550
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:1312
int exitCode() const
Get the shell exit code for the application.
Definition: MooseApp.h:150
processor_id_type processor_id() const
Returns the MPI processor ID of the current processor.
Definition: MooseApp.h:434
Real getStartTime() const
Definition: MooseApp.h:326
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:1321
const hit::Node * getCurrentActionHitNode() const
Definition: MooseApp.C:3060
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:1206
RestartableDataReader _rd_reader
Definition: MooseApp.h:1546
void checkMetaDataIntegrity() const
Function to check the integrity of the restartable meta data structure.
Definition: MooseApp.C:3393
static InputParameters validParams()
Definition: MooseApp.C:108
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:1801
unsigned int multiAppNumber() const
The MultiApp number.
Definition: MooseApp.h:832
bool isSplitMesh() const
Whether or not this is a split mesh operation.
Definition: MooseApp.C:1807
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
Return a reference to restartable data for the specific type flag.
Definition: MooseApp.C:3425
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:1267
ActionFactory & getActionFactory()
Retrieve a writable reference to the ActionFactory associated with this App.
Definition: MooseApp.h:429
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:161
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
SolutionInvalidity & _solution_invalidity
The SolutionInvalidity object for this application.
Definition: MooseApp.h:1230
std::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:1338
std::shared_ptr< libMesh::ExodusII_IO > _ex_reader
The Exodus reader when _initial_from_file is set to true.
Definition: MooseApp.h:1291
FEProblemBase & feProblem() const
Definition: MooseApp.C:1954
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition: MooseApp.h:424
MooseApp(const InputParameters &parameters)
Constructor is protected so that this object is constructed through the AppFactory object...
Definition: MooseApp.C:435
std::vector< RestartableDataMap > _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:1218
RelationshipManager & createRMFromTemplateAndInit(const RelationshipManager &template_rm, MooseMesh &moose_mesh, MeshBase &mesh, const libMesh::DofMap *dof_map=nullptr)
Take an input relationship manager, clone it, and then initialize it with provided mesh and optional ...
Definition: MooseApp.C:3133
void setOutputFileBase(const std::string &output_file_base)
Override the selection of the output file base name.
Definition: MooseApp.C:1672
std::string getRecoverFileBase() const
Definition: MooseApp.h:518
const RankMap _rank_map
The RankMap is a useful object for determining how the processes are laid out on the physical hardwar...
Definition: MooseApp.h:1233
This class wraps provides and tracks access to command line parameters.
Definition: CommandLine.h:29
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:1285
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:947
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:453
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:167
MeshGeneratorSystem _mesh_generator_system
The system that manages the MeshGenerators.
Definition: MooseApp.h:1541
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:3202
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:483
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:1184
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
Definition: MooseApp.h:529
void possiblyLoadRestartableMetaData(const RestartableDataMapName &name, const std::filesystem::path &folder_base)
Loads the restartable meta data for name if it is available with the folder base folder_base.
Definition: MooseApp.C:2528
bool showInputs() const
Prints a message showing the installable inputs for a given application (if getInstallableInputs has ...
Definition: MooseApp.C:2184
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
Definition: MooseApp.C:2989
RestartableDataValue & getRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname, THREAD_ID tid)
Definition: MooseApp.C:2509
std::vector< RestartableDataMap > & getRestartableData()
Definition: MooseApp.h:705
std::shared_ptr< NullExecutor > _null_executor
Used to return an executor that does nothing.
Definition: MooseApp.h:1258
bool & useEigenvalue()
Returns a writable Boolean indicating whether this app will use an eigenvalue executioner.
Definition: MooseApp.h:419
const std::string & getLastInputFileName() const
Definition: MooseApp.C:1656
virtual void preBackup()
Insertion point for other apps that is called before backup()
Definition: MooseApp.h:756
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:2117
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers() const
Return the container of relationship managers.
Definition: MooseApp.h:1034
virtual void postRestore(const bool)
Insertion point for other apps that is called after restore()
Definition: MooseApp.h:790
void loadLibraryAndDependencies(const std::string &library_filename, const libMesh::Parameters &params, bool load_dependencies=true)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:2678
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:1193
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:1300
std::unique_ptr< Backup > backup()
Backs up the application memory in a Backup.
Definition: MooseApp.C:1853
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
Definition: MooseTypes.h:791
Moose::Builder & builder()
Returns a writable reference to the builder.
Definition: MooseApp.h:246
bool unusedFlagIsError() const
Returns whether the flag for unused parameters is set to throw an error.
Definition: MooseApp.h:1091
const SystemInfo * getSystemInfo() const
Get SystemInfo object.
Definition: MooseApp.h:578
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:447
std::map< std::type_index, std::unique_ptr< InterfaceRegistryObjectsBase > > _interface_registry
Registration for interface objects.
Definition: MooseApp.h:1576
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition: MooseApp.h:178
RestartableDataValue & registerRestartableData(std::unique_ptr< RestartableDataValue > data, THREAD_ID tid, bool read_only, const RestartableDataMapName &metaname="")
Definition: MooseApp.C:2447
std::unique_ptr< MeshBase > getMeshGeneratorMesh()
Definition: MooseApp.h:899
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:50
An inteface for the _console for outputting to the Console object.
void setRestart(bool value)
Sets the restart/recover flags.
Definition: MooseApp.C:2877
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:1236
torch::DeviceType getLibtorchDevice() const
Get the device torch is supposed to be running on.
Definition: MooseApp.h:104
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:551
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:1203
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
void restoreFromInitialBackup(const bool for_restart)
Restores from a "initial" backup, that is, one set in _initial_backup.
Definition: MooseApp.C:1903
const ActionWarehouse & actionWarehouse() const
Return a const reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:241
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
Definition: MooseApp.h:237
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:1516
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:1297
Point _output_position
The output position.
Definition: MooseApp.h:1181
const MooseMesh * masterMesh() const
Returns a pointer to the master mesh.
Definition: MooseApp.h:847
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:541
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353
libMesh::ExodusII_IO * getExReaderForRestart() const
Get the Exodus reader to restart variables from an Exodus mesh file.
Definition: MooseApp.h:466
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:1280
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:1210
SolutionInvalidity & createRecoverableSolutionInvalidity()
Creates a recoverable SolutionInvalidity.
Definition: MooseApp.C:3479
bool _heap_profiling
Memory profiling.
Definition: MooseApp.h:1567
const MooseMesh *const _master_displaced_mesh
The displaced mesh from master app.
Definition: MooseApp.h:1538
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:1309
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:2111
std::set< std::string > getLibrarySearchPaths(const std::string &library_path_from_param) const
Return the paths searched by MOOSE when loading libraries.
Definition: MooseApp.C:2839
void setGlobalTimeOffset(Real offset)
Each App has it&#39;s own local time.
Definition: MooseApp.h:332
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:1348
void outputMachineReadableData(const std::string &param, const std::string &start_marker, const std::string &end_marker, const std::string &data) const
Outputs machine readable data (JSON, YAML, etc.) either to the screen (if no filename was provided as...
Definition: MooseApp.C:3529
Point getOutputPosition() const
Get the output position.
Definition: MooseApp.h:308
Definition: MooseApp.h:81
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:924
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:3452
FixedPointConfig _fixed_point_config
Multiapp-related fixed point algorithm configuration details primarily intended to be passed to and u...
Definition: MooseApp.h:1251
const ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:1555
UNUSED_CHECK
Indicates whether warnings, errors, or no output is displayed when unused parameters are detected...
Definition: MooseApp.h:1270
bool hasRecoverFileBase() const
Definition: MooseApp.C:1819
std::map< const RelationshipManager *, std::map< const MeshBase *, std::unique_ptr< RelationshipManager > > > _template_to_clones
Map from a template relationship manager to a map in which the key-value pairs represent the MeshBase...
Definition: MooseApp.h:1573
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
const MooseMesh * masterDisplacedMesh() const
Returns a pointer to the master displaced mesh.
Definition: MooseApp.h:852
bool hasRestartRecoverFileBase() const
Return true if the recovery file base is set.
Definition: MooseApp.C:1813
void registerRestartableDataMapName(const RestartableDataMapName &name, std::string suffix="")
Reserve a location for storing custom RestartableDataMap objects.
Definition: MooseApp.C:3442
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
Definition: MooseApp.C:1868
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:2543
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:1605
ChainControlDataSystem _chain_control_system
The system that manages the ChainControls.
Definition: MooseApp.h:1544
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:1763
Real sub_relaxation_factor
relaxation factor to be used for a MultiApp&#39;s subapps.
Definition: MooseApp.h:116
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:1294
void addExecutor(const std::string &type, const std::string &name, const InputParameters &params)
Definition: MooseApp.C:1961
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:362
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:950
Moose::Builder _builder
Builder for building app related parser tree.
Definition: MooseApp.h:1215
const torch::DeviceType _libtorch_device
The libtorch device this app is using.
Definition: MooseApp.h:1586
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:873
bool _test_checkpoint_half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:1318
std::string RestartableDataMapName
Definition: MooseTypes.h:214
std::set< std::shared_ptr< RelationshipManager > > _relationship_managers
The relationship managers that have been added.
Definition: MooseApp.h:1327
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:1209
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:1172
std::streambuf * _output_buffer_cache
Cache output buffer so the language server can turn it off then back on.
Definition: MooseApp.h:1558
static void addAppParam(InputParameters &params)
Definition: MooseApp.C:94
bool _cpu_profiling
CPU profiling.
Definition: MooseApp.h:1564
bool unusedFlagIsWarning() const
Returns whether the flag for unused parameters is set to throw a warning only.
Definition: MooseApp.h:1088
auto getRestartableDataMapEnd()
Definition: MooseApp.h:1052
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:1688
bool hasStartTime() const
Definition: MooseApp.h:321
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:2871
const SolutionInvalidity & solutionInvalidity() const
Definition: MooseApp.h:179
std::string blockFullpath() const
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:842
std::unordered_set< std::string > DataNames
static const std::string MESH_META_DATA_SUFFIX
Definition: MooseApp.h:124
const bool _automatic_automatic_scaling
Whether to turn on automatic scaling by default.
Definition: MooseApp.h:1561
Factory _factory
Definition: MooseApp.h:1277
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
Definition: MooseApp.h:862
std::unique_ptr< InputParameterWarehouse > _input_parameter_warehouse
Input parameter storage structure; unique_ptr so we can control its destruction order.
Definition: MooseApp.h:1200
const T & getRenamedParam(const std::string &old_name, const std::string &new_name) const
Retrieve a renamed parameter for the object.
Definition: MooseApp.h:1619
bool hasMeshGenerator(const MeshGeneratorName &name) const
const std::vector< std::string > & getInputFileNames() const
Definition: MooseApp.C:1649
static void addCapability(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
Definition: MooseApp.C:3556
const std::vector< T * > & getInterfaceObjects() const
Gets the registered interface objects for a given interface.
Definition: MooseApp.h:1666
TheWarehouse & theWarehouse()
Definition: MooseApp.h:130
const MeshGenerator & getMeshGenerator(const std::string &name) const
std::unique_ptr< Backup > finalizeRestore()
Finalizes (closes) the restoration process done in restore().
Definition: MooseApp.C:1910
System that manages MeshGenerators.
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:1529
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:2636
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
Definition: MooseApp.h:857
const DataNames & getRecoverableData() const
Return a reference to the recoverable data object.
Definition: MooseApp.h:738
std::unordered_set< std::string > entry_symbols
Definition: MooseApp.h:1344
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:1169
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:1216
std::shared_ptr< mfem::Device > _mfem_device
The MFEM Device object.
Definition: MooseApp.h:1591
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:2889
void setExitCode(const int exit_code)
Sets the exit code that the application will exit with.
Definition: MooseApp.h:155
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:1795
DataNames _recoverable_data_names
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:1224
Executor * getExecutor() const
Definition: MooseApp.h:361
bool _ready_to_exit
Definition: MooseApp.h:1283
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:2222
virtual bool errorOnJacobianNonzeroReallocation() const
Whether this application should by default error on Jacobian nonzero reallocations.
Definition: MooseApp.h:1060
Real getGlobalTimeOffset() const
Each App has it&#39;s own local time.
Definition: MooseApp.h:338
std::shared_ptr< mfem::Device > getMFEMDevice(Moose::PassKey< MultiApp >)
Get the MFEM device object.
Definition: MooseApp.h:1103
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
Definition: MooseApp.h:517
const MooseMesh *const _master_mesh
The mesh from master app.
Definition: MooseApp.h:1535
const std::shared_ptr< libMesh::Parallel::Communicator > getCommunicator() const
Definition: MooseApp.h:1029
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:1948
bool useExecutor() const
Definition: MooseApp.h:363
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:1303
const bool _use_executor
Indicates whether we are operating in the new/experimental executor mode instead of using the legacy ...
Definition: MooseApp.h:1255
Abstract definition of a RestartableData value.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:172
Class for parsing input files.
Definition: Parser.h:100
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:2407
std::string getExecutableName()
This function returns the name of the running executable.
std::string appNameToLibName(const std::string &app_name) const
Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg)
Definition: MooseApp.C:2419
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.
Definition: MooseApp.h:1644
virtual ~MooseApp()
Definition: MooseApp.C:1169
void setExReaderForRestart(std::shared_ptr< libMesh::ExodusII_IO > &&exreader)
Set the Exodus reader to restart variables from an Exodus mesh file.
Definition: MooseApp.h:458
unsigned int THREAD_ID
Definition: MooseTypes.h:209
void setStartTime(Real time)
Set the starting time for the simulation.
Definition: MooseApp.C:2394
std::shared_ptr< Executor > _executor
Pointer to the Executor of this run.
Definition: MooseApp.h:1239
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:1727
std::set< std::string > getLoadedLibraryPaths() const
Return the paths of loaded libraries.
Definition: MooseApp.C:2828
std::string _early_exit_param
Indicates if simulation is ready to exit, and keeps track of which param caused it to exit...
Definition: MooseApp.h:1282
void dynamicAppRegistration(const std::string &app_name, std::string library_path, const std::string &library_name, bool lib_load_deps)
Definition: MooseApp.C:2579
std::unique_ptr< Backup > *const _initial_backup
The backup for use in initial setup; this will get set from the _initial_backup input parameter that ...
Definition: MooseApp.h:1582
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
bool isParamSetByUser(const std::string &nm) const
Definition: MooseApp.h:207
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type, const MooseBase *moose_base=nullptr)