www.mooseframework.org
MooseApp.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
13 #include "Moose.h"
14 #include "Parser.h"
15 #include "ActionWarehouse.h"
16 #include "Factory.h"
17 #include "ActionFactory.h"
18 #include "OutputWarehouse.h"
19 #include "RestartableData.h"
20 #include "ConsoleStreamInterface.h"
21 #include "PerfGraph.h"
22 #include "TheWarehouse.h"
23 #include "RankMap.h"
24 
25 #include "libmesh/parallel_object.h"
26 #include "libmesh/mesh_base.h"
27 #include "libmesh/point.h"
28 
29 // C++ includes
30 #include <list>
31 #include <map>
32 #include <set>
33 
34 // Forward declarations
35 class Executioner;
36 class MooseApp;
37 class Backup;
38 class FEProblemBase;
39 class MeshModifier;
40 class MeshGenerator;
42 class SystemInfo;
43 class CommandLine;
45 
46 template <>
48 
59 class MooseApp : public ConsoleStreamInterface, public libMesh::ParallelObject
60 {
61 public:
62  virtual ~MooseApp();
63 
65 
73  const std::string & name() const { return _name; }
74 
75  virtual void checkRegistryLabels();
76 
80  virtual std::string getPrintableName() const { return "Application"; }
81 
87 
93  const std::string & type() const { return _type; }
94 
99  const RankMap & rankMap() { return _rank_map; }
100 
105 
107 
112  template <typename T>
113  const T & getParam(const std::string & name);
114 
115  template <typename T>
116  const T & getParam(const std::string & name) const;
118 
119  inline bool isParamValid(const std::string & name) const { return _pars.isParamValid(name); }
120 
124  virtual void run();
125 
129  std::string getFrameworkVersion() const;
130 
134  virtual std::string getVersion() const;
135 
139  std::string getPrintableVersion() const;
140 
144  virtual void setupOptions();
145 
147 
148  Parser & parser() { return _parser; }
149 
150  Syntax & syntax() { return _syntax; }
151 
155  void setInputFileName(std::string input_file_name);
156 
160  std::string getInputFileName() const { return _input_filename; }
161 
165  void setOutputFileBase(std::string output_file_base) { _output_file_base = output_file_base; }
166 
170  std::string getOutputFileBase() const;
171 
175  void setOutputPosition(Point p);
176 
181  std::list<std::string> getCheckpointDirectories() const;
182 
187  std::list<std::string> getCheckpointFiles() const;
188 
193  bool hasOutputPosition() const { return _output_position_set; }
194 
199  Point getOutputPosition() const { return _output_position; }
200 
207  void setStartTime(const Real time);
208 
212  bool hasStartTime() const { return _start_time_set; }
213 
217  Real getStartTime() const { return _start_time; }
218 
223  void setGlobalTimeOffset(const Real offset) { _global_time_offset = offset; }
224 
229  Real getGlobalTimeOffset() const { return _global_time_offset; }
230 
234  std::string getFileName(bool stripLeadingPath = true) const;
235 
240  void setCheckUnusedFlag(bool warn_is_error = false);
241 
245  void setErrorOverridden();
246 
250  void disableCheckUnusedFlag();
251 
255  Executioner * getExecutioner() const { return _executioner.get(); }
256 
260  std::shared_ptr<Executioner> & executioner()
261  {
262  mooseDeprecated("executioner() is deprecated. Use getExecutioner(), this interface will be "
263  "removed after 10/01/2018");
264 
265  return _executioner;
266  }
267 
271  void setExecutioner(std::shared_ptr<Executioner> && executioner) { _executioner = executioner; }
272 
276  bool & useNonlinear() { return _use_nonlinear; }
277 
281  bool & useEigenvalue() { return _use_eigen_value; }
282 
286  Factory & getFactory() { return _factory; }
287 
288  processor_id_type processor_id() { return cast_int<processor_id_type>(_comm->rank()); }
289 
294 
300  std::shared_ptr<CommandLine> commandLine() const { return _command_line; }
301 
306  bool & setFileRestart() { return _initial_from_file; }
307 
311  virtual void runInputFile();
312 
316  virtual void executeExecutioner();
317 
324 
329  {
330  mooseDeprecated("getParallelMeshOnCommandLine() is deprecated, call "
331  "getDistributedMeshOnCommandLine() instead.");
333  }
334 
338  bool isRecovering() const;
339 
343  bool isRestarting() const;
344 
348  bool isSplitMesh() const;
349 
353  bool isUseSplit() const;
354 
358  bool hasRecoverFileBase();
359 
363  std::string getRecoverFileBase() { return _recover_base; }
364 
368  void setRecoverFileBase(std::string recover_base)
369  {
370  if (recover_base.empty())
372  else
373  _recover_base = recover_base;
374  }
375 
379  std::string getRecoverFileSuffix() { return _recover_suffix; }
380 
384  void setRecoverFileSuffix(std::string recover_suffix) { _recover_suffix = recover_suffix; }
385 
390  bool halfTransient() { return _half_transient; }
391 
400  void setOutputFileNumbers(std::map<std::string, unsigned int> numbers)
401  {
402  _output_file_numbers = numbers;
403  }
404 
412  std::map<std::string, unsigned int> & getOutputFileNumbers() { return _output_file_numbers; }
413 
418 
423  const SystemInfo * getSystemInfo() const { return _sys_info.get(); }
424 
426 
431  void dynamicAllRegistration(const std::string & app_name,
432  Factory * factory,
433  ActionFactory * action_factory,
434  Syntax * syntax,
435  std::string library_path,
436  const std::string & library_name);
437  void dynamicAppRegistration(const std::string & app_name,
438  std::string library_path,
439  const std::string & library_name);
441 
448  std::string appNameToLibName(const std::string & app_name) const;
449 
453  std::string libNameToAppName(const std::string & library_name) const;
454 
458  std::set<std::string> getLoadedLibraryPaths() const;
459 
464 
465  /*
466  * Register a piece of restartable data. This is data that will get
467  * written / read to / from a restart file.
468  *
469  * @param name The full (unique) name.
470  * @param data The actual data object.
471  * @param tid The thread id of the object. Use 0 if the object is not threaded.
472  */
473  void registerRestartableData(std::string name,
474  std::unique_ptr<RestartableDataValue> data,
475  THREAD_ID tid);
476 
482 
487  std::set<std::string> & getRecoverableData() { return _recoverable_data; }
488 
495  virtual std::shared_ptr<Backup> backup();
496 
506  virtual void restore(std::shared_ptr<Backup> backup, bool for_restart = false);
507 
511  virtual std::string header() const;
512 
517  unsigned int multiAppLevel() const { return _multiapp_level; }
518 
523  unsigned int multiAppNumber() const { return _multiapp_number; }
524 
528  bool isUltimateMaster() { return !_multiapp_level; }
529 
533  void addMeshModifier(const std::string & modifier_name,
534  const std::string & name,
536 
540  const MeshModifier & getMeshModifier(const std::string & name) const;
541 
549  std::vector<std::string> getMeshModifierNames() const;
550 
554  void clearMeshModifiers();
555 
559  void executeMeshModifiers();
560 
564  void addMeshGenerator(const std::string & generator_name,
565  const std::string & name,
567 
571  const MeshGenerator & getMeshGenerator(const std::string & name) const;
572 
580  std::vector<std::string> getMeshGeneratorNames() const;
581 
586  std::unique_ptr<MeshBase> & getMeshGeneratorOutput(const std::string & name);
587 
591  void clearMeshGenerators();
592 
596  void executeMeshGenerators();
597 
601  std::unique_ptr<MeshBase> getMeshGeneratorMesh()
602  {
603  auto mesh_unique_ptr_ptr = _final_generated_meshes.front();
604 
605  // Because C++ is stupid
606  _final_generated_meshes.pop_front();
607 
608  return std::move(*mesh_unique_ptr_ptr);
609  }
610 
612 
616  void setRestart(const bool & value);
617  void setRecover(const bool & value);
619 
621  bool checkInput() const { return _check_input; }
622 
624  inline bool getFPTrapFlag() const { return _trap_fpe; }
625 
632  void addExecFlag(const ExecFlagType & flag);
633 
637  bool hasRelationshipManager(const std::string & name) const;
638 
645  bool addRelationshipManager(std::shared_ptr<RelationshipManager> relationship_manager);
646 
653 
657  const std::vector<std::shared_ptr<RelationshipManager>> & getReleationshipManagers();
658 
662  std::vector<std::pair<std::string, std::string>> getRelationshipManagerInfo() const;
663 
667  const ExecFlagEnum & getExecuteOnEnum() const { return _execute_flags; }
668 
676  void setBackupObject(std::shared_ptr<Backup> backup);
677 
678 protected:
682  bool hasCachedBackup() { return _cached_backup.get(); }
683 
687  void restoreCachedBackup();
688 
692  void dynamicRegistration(const Parameters & params);
693 
698  void loadLibraryAndDependencies(const std::string & library_filename, const Parameters & params);
699 
702 
713  void registerRecoverableData(std::string name);
714 
719  void errorCheck();
720 
722  std::string _name;
723 
726 
728  const std::string _type;
729 
731  const std::shared_ptr<Parallel::Communicator> _comm;
732 
735 
738 
740  std::string _input_filename;
741 
743  std::string _output_file_base;
744 
747 
750 
753 
756 
759 
761  std::shared_ptr<CommandLine> _command_line;
762 
765 
768 
771 
774 
777 
780 
782  std::shared_ptr<Executioner> _executioner;
783 
786 
789 
791  std::unique_ptr<SystemInfo> _sys_info;
792 
795  {
800 
802 
806 
809 
812 
814  bool _recover;
815 
817  bool _restart;
818 
821 
823  const bool _use_split;
824 
826  bool _trap_fpe;
827 
829  std::string _recover_base;
830 
832  std::string _recover_suffix;
833 
836 
838  std::map<std::string, unsigned int> _output_file_numbers;
839 
842 
843  std::vector<std::shared_ptr<RelationshipManager>> _relationship_managers;
844 
846  std::map<std::pair<std::string, std::string>, void *> _lib_handles;
847 
848 private:
873  void createMinimalApp();
874 
877 
879  std::set<std::string> _recoverable_data;
880 
883  {
886  };
887 
888  std::unique_ptr<TheWarehouse> _the_warehouse;
889 
891  unsigned int _multiapp_level;
892 
894  unsigned int _multiapp_number;
895 
897  std::map<std::string, std::shared_ptr<MeshModifier>> _mesh_modifiers;
898 
900  std::map<std::string, std::shared_ptr<MeshGenerator>> _mesh_generators;
901 
903  std::map<std::string, std::list<std::unique_ptr<MeshBase>>> _mesh_generator_outputs;
904 
906  std::list<std::unique_ptr<MeshBase> *> _final_generated_meshes;
907 
909  std::shared_ptr<Backup> _cached_backup;
910 
913 
926 
927  // Allow FEProblemBase to set the recover/restart state, so make it a friend
928  friend class FEProblemBase;
929  friend class Restartable;
930  friend class SubProblem;
931 };
932 
933 template <typename T>
934 const T &
935 MooseApp::getParam(const std::string & name)
936 {
937  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
938 }
939 
940 template <typename T>
941 const T &
942 MooseApp::getParam(const std::string & name) const
943 {
944  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
945 }
946 
std::list< std::string > getCheckpointFiles() const
Extract all possible checkpoint file names.
Definition: MooseApp.C:1035
void registerRecoverableData(std::string name)
NOTE: This is an internal function meant for MOOSE use only!
Definition: MooseApp.C:889
std::list< std::string > getCheckpointDirectories() const
Get all checkpoint directories.
Definition: MooseApp.C:984
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:788
std::string getFileName(bool stripLeadingPath=true) const
Return the filename that was parsed.
Definition: MooseApp.C:1049
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
PerfID _run_timer
Definition: MooseApp.h:921
bool & useNonlinear()
Set a Boolean indicating whether this app will use a Nonlinear or Eigen System.
Definition: MooseApp.h:276
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:80
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:891
std::shared_ptr< Executioner > & executioner()
Retrieve the Executioner for this App.
Definition: MooseApp.h:260
void setInputFileName(std::string input_file_name)
Set the input file name.
Definition: MooseApp.C:784
void setOutputFileBase(std::string output_file_base)
Override the selection of the output file base name.
Definition: MooseApp.h:165
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.h:255
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:728
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:24
void setExecutioner(std::shared_ptr< Executioner > &&executioner)
Set the Executioner for this App.
Definition: MooseApp.h:271
A class for creating restricted objects.
Definition: Restartable.h:29
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:808
Storage container for all InputParamter objects.
std::vector< std::map< std::string, std::unique_ptr< RestartableDataValue > >> RestartableDatas
Container for storing material properties.
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:448
std::string libNameToAppName(const std::string &library_name) const
Converts a library name to an application name:
Definition: MooseApp.C:1077
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:716
std::string getFrameworkVersion() const
Returns the framework version.
Definition: MooseApp.C:430
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:876
bool & setFileRestart()
This method is here so we can determine whether or not we need to use a separate reader to read the m...
Definition: MooseApp.h:306
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo() const
Returns the Relationship managers info suitable for printing.
Definition: MooseApp.C:1793
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:758
bool hasOutputPosition() const
Whether or not an output position has been set.
Definition: MooseApp.h:193
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:746
Generic factory class for build all sorts of objects.
Definition: Factory.h:153
std::unique_ptr< TheWarehouse > _the_warehouse
Definition: MooseApp.h:888
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:879
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:917
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:86
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
Definition: MooseApp.h:300
std::unique_ptr< MeshBase > & getMeshGeneratorOutput(const std::string &name)
Get a refernce to a pointer that will be the output of the MeshGenerator named name.
Definition: MooseApp.C:1464
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:1341
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
Definition: MooseApp.h:667
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:785
PerfID _run_input_file_timer
Definition: MooseApp.h:917
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:1164
std::string getRecoverFileBase()
The file_base for the recovery file.
Definition: MooseApp.h:363
PerfID _execute_mesh_generators_timer
Definition: MooseApp.h:923
PerfID _create_minimal_app_timer
Definition: MooseApp.h:925
virtual void run()
Run the application.
Definition: MooseApp.C:944
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:755
bool getParallelMeshOnCommandLine() const
Deprecated.
Definition: MooseApp.h:328
Builds lists and maps that help in knowing which physical hardware nodes each rank is on...
Definition: RankMap.h:23
const bool _use_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseApp.h:823
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:25
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:517
bool hasRelationshipManager(const std::string &name) const
Returns a Boolean indicating whether a RelationshipManater exists with the same name.
Definition: MooseApp.C:1682
Base class for MOOSE-based applications.
Definition: MooseApp.h:59
PerfID _execute_timer
Definition: MooseApp.h:918
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:841
const std::vector< std::shared_ptr< RelationshipManager > > & getReleationshipManagers()
Retrieve the relationship managers.
void setOutputFileNumbers(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:400
std::string getOutputFileBase() const
Override the selection of the output file base name.
Definition: MooseApp.C:790
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:119
bool halfTransient()
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:390
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:764
Syntax & syntax()
Definition: MooseApp.h:150
bool _trap_fpe
Whether or not FPE trapping should be turned on.
Definition: MooseApp.h:826
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:909
Real getStartTime() const
Definition: MooseApp.h:217
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:838
void loadLibraryAndDependencies(const std::string &library_filename, const Parameters &params)
Recursively loads libraries and dependencies in the proper order to fully register a MOOSE applicatio...
Definition: MooseApp.C:1204
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:776
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:865
unsigned int multiAppNumber() const
The MultiApp number.
Definition: MooseApp.h:523
bool isSplitMesh() const
Whether or not this is a split mesh operation.
Definition: MooseApp.C:871
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:791
ActionFactory & getActionFactory()
Retrieve the ActionFactory associated with this App.
Definition: MooseApp.h:293
std::set< std::string > & getRecoverableData()
Return a reference to the recoverable data object.
Definition: MooseApp.h:487
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void executeMeshModifiers()
Execute and clear the Mesh Modifiers data structure.
Definition: MooseApp.C:1379
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:835
Factory & getFactory()
Retrieve the Factory associated with this App.
Definition: MooseApp.h:286
unsigned int PerfID
Definition: MooseTypes.h:163
const RankMap _rank_map
The RankMap is a useful object for determining how.
Definition: MooseApp.h:737
std::string getLatestAppCheckpointFileBase(const std::list< std::string > &checkpoint_files)
Definition: MooseUtils.C:504
This class wraps provides and tracks access to command line parameters.
Definition: CommandLine.h:30
bool checkInput() const
Returns whether the Application is running in check input mode.
Definition: MooseApp.h:621
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:99
virtual std::shared_ptr< Backup > backup()
Create a Backup from the current App.
Definition: MooseApp.C:895
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:779
std::string getInputFileName() const
Returns the input file name that was set with setInputFileName.
Definition: MooseApp.h:160
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:323
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:752
void setRecoverFileSuffix(std::string recover_suffix)
mutator for recover_suffix
Definition: MooseApp.h:384
void restoreCachedBackup()
Restore from a cached backup.
Definition: MooseApp.C:1573
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
Definition: MooseApp.C:1692
void addMeshModifier(const std::string &modifier_name, const std::string &name, InputParameters parameters)
Add a mesh modifier that will act on the meshes in the system.
Definition: MooseApp.C:1353
bool & useEigenvalue()
Set a Boolean indicating whether this app will use an eigenvalue executioner.
Definition: MooseApp.h:281
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:938
PerfID _execute_mesh_modifiers_timer
Definition: MooseApp.h:922
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:761
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:817
const SystemInfo * getSystemInfo() const
Get SystemInfo object.
Definition: MooseApp.h:423
void setStartTime(const Real time)
Set the starting time for the simulation.
Definition: MooseApp.C:1042
void addMeshGenerator(const std::string &generator_name, const std::string &name, InputParameters parameters)
Add a mesh generator that will act on the meshes in the system.
Definition: MooseApp.C:1438
void executeMeshGenerators()
Execute and clear the Mesh Generators data structure.
Definition: MooseApp.C:1474
bool hasRecoverFileBase()
Return true if the recovery file base is set.
Definition: MooseApp.C:883
std::unique_ptr< MeshBase > getMeshGeneratorMesh()
Get the generated mesh generated by executeMeshGenerators();.
Definition: MooseApp.h:601
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:64
An inteface for the _console for outputting to the Console object.
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Definition: TheWarehouse.h:119
bool isUseSplit() const
Whether or not we are running with pre-split (distributed mesh)
Definition: MooseApp.C:877
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:782
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:770
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:773
std::vector< std::string > getMeshModifierNames() const
Get names of all mesh modifiers Note: This function should be called after all mesh modifiers are add...
Definition: MooseApp.C:1370
void dynamicAppRegistration(const std::string &app_name, std::string library_path, const std::string &library_name)
Definition: MooseApp.C:1101
PerfID _setup_options_timer
Definition: MooseApp.h:916
ActionWarehouse & actionWarehouse()
Definition: MooseApp.h:146
PerfID _restore_timer
Definition: MooseApp.h:920
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:882
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:32
std::map< std::string, std::shared_ptr< MeshGenerator > > _mesh_generators
Holds the mesh generators until they have completed, then this structure is cleared.
Definition: MooseApp.h:900
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:814
Point _output_position
The output position.
Definition: MooseApp.h:749
void clearMeshModifiers()
Clear all mesh modifers.
Definition: MooseApp.C:1432
void setGlobalTimeOffset(const Real offset)
Each App has it&#39;s own local time.
Definition: MooseApp.h:223
void registerRestartableData(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Definition: MooseApp.C:1089
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:236
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:804
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:436
Parser & parser()
Definition: MooseApp.h:148
InputParameters validParams< MooseApp >()
Definition: MooseApp.C:71
Class for storing and utilizing output objects.
std::string _input_filename
Input file name used.
Definition: MooseApp.h:740
PerfID _execute_executioner_timer
Definition: MooseApp.h:919
Point getOutputPosition() const
Get the output position.
Definition: MooseApp.h:199
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:846
PerfID _restore_cached_backup_timer
Definition: MooseApp.h:924
void clearMeshGenerators()
Clear all mesh modifers.
Definition: MooseApp.C:1547
void setRestart(const bool &value)
Sets the restart/recover flags.
Definition: MooseApp.C:1553
UNUSED_CHECK
Indicates whether warnings, errors, or no output is displayed when unused parameters are detected...
Definition: MooseApp.h:794
void setRecoverFileBase(std::string recover_base)
mutator for recover_base (set by RecoverBaseAction)
Definition: MooseApp.h:368
PerfGraph _perf_graph
The PerfGraph object for this applciation.
Definition: MooseApp.h:734
std::map< std::string, unsigned int > & getOutputFileNumbers()
Store a map of outputter names and file numbers The MultiApp system requires this to get the file num...
Definition: MooseApp.h:412
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:725
Helper class to hold streams for Backup and Restore operations.
Definition: Backup.h:20
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:935
std::map< std::string, std::list< std::unique_ptr< MeshBase > > > _mesh_generator_outputs
Holds the output for each mesh generator - including duplicates needed downstream.
Definition: MooseApp.h:903
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:835
virtual void restore(std::shared_ptr< Backup > backup, bool for_restart=false)
Restore a Backup.
Definition: MooseApp.C:905
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:829
std::vector< std::string > getMeshGeneratorNames() const
Get names of all mesh generators Note: This function should be called after all mesh generators are a...
Definition: MooseApp.C:1455
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:811
void setBackupObject(std::shared_ptr< Backup > backup)
Method for setting the backup object to be restored at a later time.
Definition: MooseApp.C:1567
bool hasCachedBackup()
Whether or not this MooseApp has cached a Backup to use for restart / recovery.
Definition: MooseApp.h:682
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
const RestartableDatas & getRestartableData()
Return reference to the restatable data object.
Definition: MooseApp.h:481
bool getFPTrapFlag() const
Returns whether FPE trapping is turned on (either because of debug or user requested) ...
Definition: MooseApp.h:624
ExecFlagEnum _execute_flags
Execution flags for this App.
Definition: MooseApp.h:912
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:767
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:743
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:731
processor_id_type processor_id()
Definition: MooseApp.h:288
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:796
bool hasStartTime() const
Definition: MooseApp.h:212
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:1347
Holding syntax for parsing input files.
Definition: Syntax.h:20
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
const MeshGenerator & getMeshGenerator(const std::string &name) const
Get a mesh generator with its name.
Definition: MooseApp.C:1449
void setOutputPosition(Point p)
Tell the app to output in a specific position.
Definition: MooseApp.C:973
Factory _factory
Definition: MooseApp.h:801
void addExecFlag(const ExecFlagType &flag)
WARNING: This is an internal method for MOOSE, if you need the add new ExecFlagTypes then use the reg...
Definition: MooseApp.C:1661
std::string getRecoverFileSuffix()
The suffix for the recovery file.
Definition: MooseApp.h:379
TheWarehouse & theWarehouse()
Definition: MooseApp.h:64
MooseApp(InputParameters parameters)
Constructor is protected so that this object is constructed through the AppFactory object...
Definition: MooseApp.C:259
std::string _name
The name of this object.
Definition: MooseApp.h:722
const std::string & type() const
Get the type of this object as a string.
Definition: MooseApp.h:93
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:894
virtual void checkRegistryLabels()
Definition: MooseApp.C:409
void attachRelationshipManagers(Moose::RelationshipManagerType rm_type)
Attach the relationship managers of the given type Note: Geometric relationship managers that are sup...
Definition: MooseApp.C:1731
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:1138
const MeshModifier & getMeshModifier(const std::string &name) const
Get a mesh modifier with its name.
Definition: MooseApp.C:1364
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
Holds the mesh modifiers until they have completed, then this structure is cleared.
Definition: MooseApp.h:897
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:442
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:528
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:1587
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:859
bool _ready_to_exit
Definition: MooseApp.h:805
void setRecover(const bool &value)
Definition: MooseApp.C:1561
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode...
Definition: PerfGraph.h:34
Real getGlobalTimeOffset() const
Each App has it&#39;s own local time.
Definition: MooseApp.h:229
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:30
void disableCheckUnusedFlag()
Removes warnings and error checks for unrecognized variables in the input file.
Definition: MooseApp.C:932
PerfID _setup_timer
Timers.
Definition: MooseApp.h:915
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:832
bool _split_mesh
Whether or not we are performing a split mesh operation (–split-mesh)
Definition: MooseApp.h:820
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:104
Class for parsing input files.
Definition: Parser.h:97
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1055
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:1061
virtual ~MooseApp()
Definition: MooseApp.C:414
std::list< std::unique_ptr< MeshBase > * > _final_generated_meshes
The final Mesh that is generated by the generators.
Definition: MooseApp.h:906
unsigned int THREAD_ID
Definition: MooseTypes.h:161
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:821
std::set< std::string > getLoadedLibraryPaths() const
Return the loaded library filenames in a std::vector.
Definition: MooseApp.C:1330
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
Definition: MooseApp.h:843
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.