www.mooseframework.org
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
MooseApp Class Reference

Base class for MOOSE-based applications. More...

#include <MooseApp.h>

Inheritance diagram for MooseApp:
[legend]

Public Member Functions

virtual ~MooseApp ()
 
const std::string & name () const
 Get the name of the object. More...
 
virtual std::string getPrintableName () const
 Get printable name of the application. More...
 
InputParametersparameters ()
 Get the parameters of the object. More...
 
const std::string & type () const
 Get the type of this object as a string. More...
 
bool isParamValid (const std::string &name) const
 
virtual void run ()
 Run the application. More...
 
std::string getFrameworkVersion () const
 Returns the framework version. More...
 
virtual std::string getVersion () const
 Returns the current version of the framework or application (default: framework version). More...
 
std::string getPrintableVersion () const
 Non-virtual method for printing out the version string in a consistent format. More...
 
virtual void setupOptions ()
 Setup options based on InputParameters. More...
 
ActionWarehouseactionWarehouse ()
 
Parserparser ()
 
Syntaxsyntax ()
 
void setInputFileName (std::string input_file_name)
 Set the input file name. More...
 
std::string getInputFileName ()
 Returns the input file name that was set with setInputFileName. More...
 
void setOutputFileBase (std::string output_file_base)
 Override the selection of the output file base name. More...
 
std::string getOutputFileBase ()
 Override the selection of the output file base name. More...
 
void setOutputPosition (Point p)
 Tell the app to output in a specific position. More...
 
std::list< std::string > getCheckpointFiles ()
 Extract all possible checkpoint file names. More...
 
bool hasOutputPosition ()
 Whether or not an output position has been set. More...
 
Point getOutputPosition ()
 Get the output position. More...
 
void setStartTime (const Real time)
 Set the starting time for the simulation. More...
 
bool hasStartTime ()
 
Real getStartTime ()
 
void setGlobalTimeOffset (const Real offset)
 Each App has it's own local time. More...
 
Real getGlobalTimeOffset ()
 Each App has it's own local time. More...
 
std::string getFileName (bool stripLeadingPath=true) const
 Return the filename that was parsed. More...
 
void setCheckUnusedFlag (bool warn_is_error=false)
 Set a flag so that the parser will either warn or error when unused variables are seen after parsing is complete. More...
 
void setErrorOverridden ()
 Set a flag so that the parser will throw an error if overridden parameters are detected. More...
 
void disableCheckUnusedFlag ()
 Removes warnings and error checks for unrecognized variables in the input file. More...
 
ExecutionergetExecutioner ()
 Retrieve the Executioner for this App. More...
 
std::shared_ptr< Executioner > & executioner ()
 Retrieve the Executioner shared pointer for this App. More...
 
bool & useNonlinear ()
 Set a Boolean indicating whether this app will use a Nonlinear or Eigen System. More...
 
bool & useEigenvalue ()
 Set a Boolean indicating whether this app will use an eigenvalue executioner. More...
 
FactorygetFactory ()
 Retrieve the Factory associated with this App. More...
 
ActionFactorygetActionFactory ()
 Retrieve the ActionFactory associated with this App. More...
 
std::shared_ptr< CommandLinecommandLine ()
 Get the command line. More...
 
bool & setFileRestart ()
 This method is here so we can determine whether or not we need to use a separate reader to read the mesh BEFORE we create the mesh. More...
 
virtual void runInputFile ()
 Actually build everything in the input file. More...
 
virtual void executeExecutioner ()
 Execute the Executioner that was built. More...
 
bool getDistributedMeshOnCommandLine () const
 Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibility) on the command line and false otherwise. More...
 
bool getParallelMeshOnCommandLine () const
 Deprecated. More...
 
bool isRecovering () const
 Whether or not this is a "recover" calculation. More...
 
bool isRestarting () const
 Whether or not this is a "restart" calculation. More...
 
bool hasRecoverFileBase ()
 Return true if the recovery file base is set. More...
 
std::string getRecoverFileBase ()
 The file_base for the recovery file. More...
 
void setRecoverFileBase (std::string recover_base)
 mutator for recover_base (set by RecoverBaseAction) More...
 
std::string getRecoverFileSuffix ()
 The suffix for the recovery file. More...
 
void setRecoverFileSuffix (std::string recover_suffix)
 mutator for recover_suffix More...
 
bool halfTransient ()
 Whether or not this simulation should only run half its transient (useful for testing recovery) More...
 
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 numbering to propagate down through the Multiapps. More...
 
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 numbering to propogate down through the multiapps. More...
 
bool hasOutputWarehouse ()
 Return true if the output position has been set. More...
 
OutputWarehousegetOutputWarehouse ()
 Get the OutputWarehouse objects. More...
 
const SystemInfogetSystemInfo () const
 Get SystemInfo object. More...
 
std::string appNameToLibName (const std::string &app_name) const
 Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg) More...
 
std::string libNameToAppName (const std::string &library_name) const
 Converts a library name to an application name: More...
 
std::set< std::string > getLoadedLibraryPaths () const
 Return the loaded library filenames in a std::vector. More...
 
InputParameterWarehousegetInputParameterWarehouse ()
 Get the InputParameterWarehouse for MooseObjects. More...
 
virtual void registerRestartableData (std::string name, RestartableDataValue *data, THREAD_ID tid)
 
const RestartableDatasgetRestartableData ()
 Return reference to the restatable data object. More...
 
std::set< std::string > & getRecoverableData ()
 Return a reference to the recoverable data object. More...
 
std::shared_ptr< Backupbackup ()
 Create a Backup from the current App. More...
 
void restore (std::shared_ptr< Backup > backup, bool for_restart=false)
 Restore a Backup. More...
 
virtual std::string header () const
 Returns a string to be printed at the beginning of a simulation. More...
 
unsigned int multiAppLevel () const
 The MultiApp Level. More...
 
unsigned int multiAppNumber () const
 The MultiApp number. More...
 
bool isUltimateMaster ()
 Whether or not this app is the ultimate master app. More...
 
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. More...
 
const MeshModifiergetMeshModifier (const std::string &name) const
 Get a mesh modifier with its name. More...
 
std::vector< std::string > getMeshModifierNames () const
 Get names of all mesh modifiers Note: This function should be called after all mesh modifiers are added with the 'add_mesh_modifier' task. More...
 
void clearMeshModifiers ()
 Clear all mesh modifers. More...
 
void executeMeshModifiers ()
 Execute and clear the Mesh Modifiers data structure. More...
 
bool checkInput () const
 Returns whether the Application is running in check input mode. More...
 
template<typename T >
const T & getParam (const std::string &name)
 Retrieve a parameter for the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 
void dynamicObjectRegistration (const std::string &app_name, Factory *factory, std::string library_path)
 Thes methods are called to register applications or objects on demand. More...
 
void dynamicAppRegistration (const std::string &app_name, std::string library_path)
 
void dynamicSyntaxAssociation (const std::string &app_name, Syntax *syntax, ActionFactory *action_factory, std::string library_path)
 
void setRestart (const bool &value)
 Sets the restart/recover flags. More...
 
void setRecover (const bool &value)
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Types

enum  UNUSED_CHECK { OFF, WARN_UNUSED, ERROR_UNUSED }
 Indicates whether warnings, errors, or no output is displayed when unused parameters are detected. More...
 

Protected Member Functions

bool hasCachedBackup ()
 Whether or not this MooseApp has cached a Backup to use for restart / recovery. More...
 
void restoreCachedBackup ()
 Restore from a cached backup. More...
 
void dynamicRegistration (const Parameters &params)
 Helper method for dynamic loading of objects. More...
 
void loadLibraryAndDependencies (const std::string &library_filename, const Parameters &params)
 Recursively loads libraries and dependencies in the proper order to fully register a MOOSE application that may have several dependencies. More...
 
 MooseApp (InputParameters parameters)
 Constructor is protected so that this object is constructed through the AppFactory object. More...
 
virtual void meshOnly (std::string mesh_file_name)
 Don't run the simulation, just complete all of the mesh preperation steps and exit. More...
 
virtual void registerRecoverableData (std::string name)
 NOTE: This is an internal function meant for MOOSE use only! More...
 
void errorCheck ()
 Runs post-initialization error checking that cannot be run correctly unless the simulation has been fully set up and initialized. More...
 

Protected Attributes

std::string _name
 The name of this object. More...
 
InputParameters _pars
 Parameters of this object. More...
 
const std::string _type
 The string representation of the type of this object as registered (see registerApp(AppName)) More...
 
const std::shared_ptr< Parallel::Communicator > _comm
 The MPI communicator this App is going to use. More...
 
std::string _input_filename
 Input file name used. More...
 
std::string _output_file_base
 The output file basename. More...
 
bool _output_position_set
 Whether or not an output position has been set for this app. More...
 
Point _output_position
 The output position. More...
 
bool _start_time_set
 Whether or not an start time has been set. More...
 
Real _start_time
 The time at which to start the simulation. More...
 
Real _global_time_offset
 Offset of the local App time to the "global" problem time. More...
 
std::shared_ptr< CommandLine_command_line
 Command line object. More...
 
Syntax _syntax
 Syntax of the input file. More...
 
OutputWarehouse _output_warehouse
 OutputWarehouse object for this App. More...
 
InputParameterWarehouse_input_parameter_warehouse
 Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly controlled) More...
 
ActionFactory _action_factory
 The Factory responsible for building Actions. More...
 
ActionWarehouse _action_warehouse
 Where built actions are stored. More...
 
Parser _parser
 Parser for parsing the input file. More...
 
std::shared_ptr< Executioner_executioner
 Pointer to the executioner of this run (typically build by actions) More...
 
bool _use_nonlinear
 Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) More...
 
bool _use_eigen_value
 Boolean to indicate whether to use an eigenvalue executioner. More...
 
std::unique_ptr< SystemInfo_sys_info
 System Information. More...
 
enum MooseApp::UNUSED_CHECK _enable_unused_check
 
Factory _factory
 
bool _error_overridden
 Indicates whether warnings or errors are displayed when overridden parameters are detected. More...
 
bool _ready_to_exit
 
bool _initial_from_file
 This variable indicates when a request has been made to restart from an Exodus file. More...
 
bool _distributed_mesh_on_command_line
 This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh. More...
 
bool _recover
 Whether or not this is a recovery run. More...
 
bool _restart
 Whether or not this is a restart run. More...
 
std::string _recover_base
 The base name to recover from. If blank then we will find the newest recovery file. More...
 
std::string _recover_suffix
 The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO. More...
 
bool _half_transient
 Whether or not this simulation should only run half its transient (useful for testing recovery) More...
 
std::map< std::string, unsigned int > _output_file_numbers
 Map of outputer name and file number (used by MultiApps to propagate file numbers down through the multiapps) More...
 
bool _check_input
 true if we want to just check the input file More...
 
std::map< std::pair< std::string, std::string >, void * > _lib_handles
 The library, registration method and the handle to the method. More...
 

Private Types

enum  RegistrationType { APPLICATION, OBJECT, SYNTAX }
 Enumeration for holding the valid types of dynamic registrations allowed. More...
 

Private Member Functions

void createMinimalApp ()
 Method for creating the minimum required actions for an application (no input file) More...
 

Private Attributes

RestartableDatas _restartable_data
 Where the restartable data is held (indexed on tid) More...
 
std::set< std::string > _recoverable_data
 Data names that will only be read from the restart file during RECOVERY. More...
 
unsigned int _multiapp_level
 Level of multiapp, the master is level 0. This used by the Console to indent output. More...
 
unsigned int _multiapp_number
 Numbering in all the sub-apps on the same level. More...
 
std::map< std::string, std::shared_ptr< MeshModifier > > _mesh_modifiers
 Holds the mesh modifiers until they have completed, then this structure is cleared. More...
 
std::shared_ptr< Backup_cached_backup
 Cache for a Backup to use for restart / recovery. More...
 

Friends

class FEProblemBase
 
class Restartable
 
class SubProblem
 

Detailed Description

Base class for MOOSE-based applications.

This generic class for application provides:

Each application should register its own objects and register its own special syntax

Definition at line 58 of file MooseApp.h.

Member Enumeration Documentation

Enumeration for holding the valid types of dynamic registrations allowed.

Enumerator
APPLICATION 
OBJECT 
SYNTAX 

Definition at line 711 of file MooseApp.h.

712  {
713  APPLICATION,
714  OBJECT,
715  SYNTAX
716  };
enum MooseApp::UNUSED_CHECK
protected

Indicates whether warnings, errors, or no output is displayed when unused parameters are detected.

Enumerator
OFF 
WARN_UNUSED 
ERROR_UNUSED 

Definition at line 634 of file MooseApp.h.

635  {
636  OFF,
637  WARN_UNUSED,
enum MooseApp::UNUSED_CHECK _enable_unused_check

Constructor & Destructor Documentation

MooseApp::~MooseApp ( )
virtual

Definition at line 270 of file MooseApp.C.

271 {
273  _executioner.reset();
274 
276 
277 #ifdef LIBMESH_HAVE_DLOPEN
278  // Close any open dynamic libraries
279  for (const auto & it : _lib_handles)
280  dlclose(it.second);
281 #endif
282 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:610
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:675
void clear()
This method deletes all of the Actions in the warehouse.
MooseApp::MooseApp ( InputParameters  parameters)
protected

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

Definition at line 218 of file MooseApp.C.

Referenced by hasCachedBackup().

219  : ConsoleStreamInterface(*this),
220  ParallelObject(*parameters.get<std::shared_ptr<Parallel::Communicator>>(
221  "_comm")), // Can't call getParam() before pars is set
222  _name(parameters.get<std::string>("_app_name")),
223  _pars(parameters),
224  _type(getParam<std::string>("_type")),
225  _comm(getParam<std::shared_ptr<Parallel::Communicator>>("_comm")),
226  _output_position_set(false),
227  _start_time_set(false),
228  _start_time(0.0),
229  _global_time_offset(0.0),
230  _output_warehouse(*this),
232  _action_factory(*this),
234  _parser(*this, _action_warehouse),
235  _use_nonlinear(true),
236  _use_eigen_value(false),
238  _factory(*this),
239  _error_overridden(false),
240  _ready_to_exit(false),
241  _initial_from_file(false),
243  _recover(false),
244  _restart(false),
245  _recover_suffix("cpr"),
246  _half_transient(false),
247  _check_input(getParam<bool>("check_input")),
248  _restartable_data(libMesh::n_threads()),
250  isParamValid("_multiapp_level") ? parameters.get<unsigned int>("_multiapp_level") : 0),
252  isParamValid("_multiapp_number") ? parameters.get<unsigned int>("_multiapp_number") : 0)
253 {
254  if (isParamValid("_argc") && isParamValid("_argv"))
255  {
256  int argc = getParam<int>("_argc");
257  char ** argv = getParam<char **>("_argv");
258 
259  _sys_info = libmesh_make_unique<SystemInfo>(argc, argv);
260  }
261  if (isParamValid("_command_line"))
262  _command_line = getParam<std::shared_ptr<CommandLine>>("_command_line");
263  else
264  mooseError("Valid CommandLine object required");
265 
266  if (getParam<bool>("error_deprecated") && getParam<bool>("allow_deprecated"))
267  mooseError("Both error deprecated and allowed deprecated were set.");
268 }
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:628
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:719
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:574
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:648
Storage container for all InputParamter objects.
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:705
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:598
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:586
bool _use_nonlinear
Boolean to indicate whether to use a Nonlinear or EigenSystem (inspected by actions) ...
Definition: MooseApp.h:625
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:595
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:672
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:604
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:631
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:666
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:592
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:601
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:657
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:610
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:613
ConsoleStreamInterface(MooseApp &app)
A class for providing a helper stream object for writting message to all the Output objects...
enum MooseApp::UNUSED_CHECK _enable_unused_check
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:654
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:644
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:738
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:651
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:607
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:577
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:103
Factory _factory
Definition: MooseApp.h:641
std::string _name
The name of this object.
Definition: MooseApp.h:568
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:722
bool _ready_to_exit
Definition: MooseApp.h:645
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:663

Member Function Documentation

ActionWarehouse& MooseApp::actionWarehouse ( )
inline
void MooseApp::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 at line 1133 of file MooseApp.C.

Referenced by AddMeshModifierAction::act(), and isUltimateMaster().

1136 {
1137  std::shared_ptr<MeshModifier> mesh_modifier =
1138  _factory.create<MeshModifier>(modifier_name, name, parameters);
1139 
1140  _mesh_modifiers.insert(std::make_pair(MooseUtils::shortName(name), mesh_modifier));
1141 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:46
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:81
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:31
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:325
Factory _factory
Definition: MooseApp.h:641
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:725
std::string MooseApp::appNameToLibName ( const std::string &  app_name) const

Converts an application name to a library name: Examples: AnimalApp -> libanimal-oprof.la (assuming METHOD=oprof) ThreeWordAnimalApp -> libthree_word_animal-dbg.la (assuming METHOD=dbg)

Definition at line 846 of file MooseApp.C.

Referenced by dynamicAppRegistration(), dynamicRegistration(), and getSystemInfo().

847 {
848  std::string library_name(app_name);
849 
850  // Strip off the App part (should always be the last 3 letters of the name)
851  size_t pos = library_name.find("App");
852  if (pos != library_name.length() - 3)
853  mooseError("Invalid application name: ", library_name);
854  library_name.erase(pos);
855 
856  // Now get rid of the camel case, prepend lib, and append the method and suffix
857  return std::string("lib") + MooseUtils::camelCaseToUnderscore(library_name) + '-' +
858  QUOTE(METHOD) + ".la";
859 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string camelCaseToUnderscore(const std::string &camel_case_name)
Function for converting a camel case name to a name containing underscores.
Definition: MooseUtils.C:281
std::shared_ptr< Backup > MooseApp::backup ( )

Create a Backup from the current App.

A Backup contains all the data necessary to be able to restore the state of an App.

Definition at line 684 of file MooseApp.C.

Referenced by getRecoverableData(), and restore().

685 {
686  FEProblemBase & fe_problem = _executioner->feProblem();
687 
688  RestartableDataIO rdio(fe_problem);
689 
690  return rdio.createBackup();
691 }
Class for doing restart.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
bool MooseApp::checkInput ( ) const
inline

Returns whether the Application is running in check input mode.

Definition at line 519 of file MooseApp.h.

519 { return _check_input; }
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:672
void MooseApp::clearMeshModifiers ( )

Clear all mesh modifers.

Definition at line 1207 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::completeSetup(), and isUltimateMaster().

1208 {
1209  _mesh_modifiers.clear();
1210 }
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:725
std::shared_ptr<CommandLine> MooseApp::commandLine ( )
inline

Get the command line.

Returns
The reference to the command line object Setup options based on InputParameters.

Definition at line 265 of file MooseApp.h.

Referenced by FEProblemBase::addMultiApp(), MultiApp::createApp(), Parser::errorCheck(), Parser::hitCLIFilter(), Parser::parse(), and ExodusFormatter::printInputFile().

265 { return _command_line; }
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:601
void MooseApp::createMinimalApp ( )
private

Method for creating the minimum required actions for an application (no input file)

Mimics the following input file:

[Mesh] type = GeneratedMesh dim = 1 nx = 1 []

[Executioner] type = Transient num_steps = 1 dt = 1 []

[Problem] solve = false []

[Outputs] console = false []

Definition at line 1239 of file MooseApp.C.

Referenced by setupOptions().

1240 {
1241  // SetupMeshAction (setup_mesh)
1242  {
1243  // Build the Action parameters
1244  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
1245  action_params.set<std::string>("type") = "GeneratedMesh";
1246  action_params.set<std::string>("task") = "setup_mesh";
1247 
1248  // Create The Action
1249  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1250  _action_factory.create("SetupMeshAction", "Mesh", action_params));
1251 
1252  // Set the object parameters
1253  InputParameters & params = action->getObjectParams();
1254  params.set<MooseEnum>("dim") = "1";
1255  params.set<unsigned int>("nx") = 1;
1256 
1257  // Add Action to the warehouse
1259  }
1260 
1261  // SetupMeshAction (init_mesh)
1262  {
1263  // Action parameters
1264  InputParameters action_params = _action_factory.getValidParams("SetupMeshAction");
1265  action_params.set<std::string>("type") = "GeneratedMesh";
1266  action_params.set<std::string>("task") = "init_mesh";
1267 
1268  // Build the action
1269  std::shared_ptr<Action> action =
1270  _action_factory.create("SetupMeshAction", "Mesh", action_params);
1272  }
1273 
1274  // Executioner
1275  {
1276  // Build the Action parameters
1277  InputParameters action_params = _action_factory.getValidParams("CreateExecutionerAction");
1278  action_params.set<std::string>("type") = "Transient";
1279 
1280  // Create the action
1281  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1282  _action_factory.create("CreateExecutionerAction", "Executioner", action_params));
1283 
1284  // Set the object parameters
1285  InputParameters & params = action->getObjectParams();
1286  params.set<unsigned int>("num_steps") = 1;
1287  params.set<Real>("dt") = 1;
1288 
1289  // Add Action to the warehouse
1291  }
1292 
1293  // Problem
1294  {
1295  // Build the Action parameters
1296  InputParameters action_params = _action_factory.getValidParams("CreateProblemAction");
1297  action_params.set<std::string>("type") = "FEProblem";
1298 
1299  // Create the action
1300  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
1301  _action_factory.create("CreateProblemAction", "Problem", action_params));
1302 
1303  // Set the object parameters
1304  InputParameters & params = action->getObjectParams();
1305  params.set<bool>("solve") = false;
1306 
1307  // Add Action to the warehouse
1309  }
1310 
1311  // Outputs
1312  {
1313  // Build the Action parameters
1314  InputParameters action_params = _action_factory.getValidParams("CommonOutputAction");
1315  action_params.set<bool>("console") = false;
1316 
1317  // Create action
1318  std::shared_ptr<Action> action =
1319  _action_factory.create("CommonOutputAction", "Outputs", action_params);
1320 
1321  // Add Action to the warehouse
1323  }
1324 
1326 }
InputParameters getValidParams(const std::string &name)
Definition: ActionFactory.C:74
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addActionBlock(std::shared_ptr< Action > blk)
This method add an Action instance to the warehouse.
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:613
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
void build()
Builds all auto-buildable tasks.
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters parameters)
Definition: ActionFactory.C:26
void MooseApp::disableCheckUnusedFlag ( )

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

Definition at line 727 of file MooseApp.C.

Referenced by getGlobalTimeOffset().

728 {
730 }
enum MooseApp::UNUSED_CHECK _enable_unused_check
void MooseApp::dynamicAppRegistration ( const std::string &  app_name,
std::string  library_path 
)

Definition at line 885 of file MooseApp.C.

Referenced by getSystemInfo(), and MultiApp::initialSetup().

886 {
887  Parameters params;
888  params.set<std::string>("app_name") = app_name;
889  params.set<RegistrationType>("reg_type") = APPLICATION;
890  params.set<std::string>("registration_method") = app_name + "__registerApps";
891  params.set<std::string>("library_path") = library_path;
892 
893  dynamicRegistration(params);
894 
895  // At this point the application should be registered so check it
896  if (!AppFactory::instance().isRegistered(app_name))
897  {
898  std::ostringstream oss;
899  std::set<std::string> paths = getLoadedLibraryPaths();
900 
901  oss << "Unable to locate library for \"" << app_name
902  << "\".\nWe attempted to locate the library \"" << appNameToLibName(app_name)
903  << "\" in the following paths:\n\t";
904  std::copy(paths.begin(), paths.end(), infix_ostream_iterator<std::string>(oss, "\n\t"));
905  oss << "\n\nMake sure you have compiled the library and either set the \"library_path\" "
906  "variable "
907  << "in your input file or exported \"MOOSE_LIBRARY_PATH\".\n"
908  << "Compiled in debug mode to see the list of libraries checked for dynamic loading "
909  "methods.";
910  mooseError(oss.str());
911  }
912 }
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:949
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::set< std::string > getLoadedLibraryPaths() const
Return the loaded library filenames in a std::vector.
Definition: MooseApp.C:1110
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:846
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:711
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:22
void MooseApp::dynamicObjectRegistration ( const std::string &  app_name,
Factory factory,
std::string  library_path 
)

Thes methods are called to register applications or objects on demand.

This method attempts to load a dynamic library and register it when it is needed. Throws an error if no suitable library is found that contains the app_name in question.

Definition at line 915 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), and getSystemInfo().

918 {
919  Parameters params;
920  params.set<std::string>("app_name") = app_name;
921  params.set<RegistrationType>("reg_type") = OBJECT;
922  params.set<std::string>("registration_method") = app_name + "__registerObjects";
923  params.set<std::string>("library_path") = library_path;
924 
925  params.set<Factory *>("factory") = factory;
926 
927  dynamicRegistration(params);
928 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:152
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:949
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:711
void MooseApp::dynamicRegistration ( const Parameters &  params)
protected

Helper method for dynamic loading of objects.

Definition at line 949 of file MooseApp.C.

Referenced by dynamicAppRegistration(), dynamicObjectRegistration(), dynamicSyntaxAssociation(), and hasCachedBackup().

950 {
951  // first convert the app name to a library name
952  std::string library_name = appNameToLibName(params.get<std::string>("app_name"));
953 
954  // Create a vector of paths that we can search inside for libraries
955  std::vector<std::string> paths;
956 
957  std::string library_path = params.get<std::string>("library_path");
958 
959  if (library_path != "")
960  MooseUtils::tokenize(library_path, paths, 1, ":");
961 
962  char * moose_lib_path_env = std::getenv("MOOSE_LIBRARY_PATH");
963  if (moose_lib_path_env)
964  {
965  std::string moose_lib_path(moose_lib_path_env);
966  std::vector<std::string> tmp_paths;
967 
968  MooseUtils::tokenize(moose_lib_path, tmp_paths, 1, ":");
969 
970  // merge the two vectors together (all possible search paths)
971  paths.insert(paths.end(), tmp_paths.begin(), tmp_paths.end());
972  }
973 
974  // Attempt to dynamically load the library
975  for (const auto & path : paths)
976  if (MooseUtils::checkFileReadable(path + '/' + library_name, false, false))
977  loadLibraryAndDependencies(path + '/' + library_name, params);
978  else
979  mooseWarning("Unable to open library file \"",
980  path + '/' + library_name,
981  "\". Double check for spelling errors.");
982 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
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:985
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:846
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true)
Checks to see if a file is readable (exists and permissions)
Definition: MooseUtils.C:121
void mooseWarning(Args &&...args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:194
void MooseApp::dynamicSyntaxAssociation ( const std::string &  app_name,
Syntax syntax,
ActionFactory action_factory,
std::string  library_path 
)

Definition at line 931 of file MooseApp.C.

Referenced by DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), and getSystemInfo().

935 {
936  Parameters params;
937  params.set<std::string>("app_name") = app_name;
938  params.set<RegistrationType>("reg_type") = SYNTAX;
939  params.set<std::string>("registration_method") = app_name + "__associateSyntax";
940  params.set<std::string>("library_path") = library_path;
941 
942  params.set<Syntax *>("syntax") = syntax;
943  params.set<ActionFactory *>("action_factory") = action_factory;
944 
945  dynamicRegistration(params);
946 }
void dynamicRegistration(const Parameters &params)
Helper method for dynamic loading of objects.
Definition: MooseApp.C:949
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:70
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:711
Holding syntax for parsing input files.
Definition: Syntax.h:26
void MooseApp::errorCheck ( )
protected

Runs post-initialization error checking that cannot be run correctly unless the simulation has been fully set up and initialized.

Definition at line 572 of file MooseApp.C.

Referenced by executeExecutioner(), hasCachedBackup(), and run().

573 {
574  bool warn = _enable_unused_check == WARN_UNUSED;
575  bool err = _enable_unused_check == ERROR_UNUSED;
576  _parser.errorCheck(*_comm, warn, err);
577 
578  auto apps = _executioner->feProblem().getMultiAppWarehouse().getObjects();
579  for (auto app : apps)
580  for (unsigned int i = 0; i < app->numLocalApps(); i++)
581  app->localApp(i)->errorCheck();
582 }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
enum MooseApp::UNUSED_CHECK _enable_unused_check
const std::shared_ptr< Parallel::Communicator > _comm
The MPI communicator this App is going to use.
Definition: MooseApp.h:577
void errorCheck(const Parallel::Communicator &comm, bool warn_unused, bool err_unused)
Definition: Parser.C:573
void MooseApp::executeExecutioner ( )
virtual

Execute the Executioner that was built.

Definition at line 585 of file MooseApp.C.

Referenced by run(), and setFileRestart().

586 {
587  // If ready to exit has been set, then just return
588  if (_ready_to_exit)
589  return;
590 
591  // run the simulation
592  if (_executioner)
593  {
594 #ifdef LIBMESH_HAVE_PETSC
596 #endif
597 
598  _executioner->init();
599  errorCheck();
600  _executioner->execute();
601  }
602  else
603  mooseError("No executioner was specified (go fix your input file)");
604 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:601
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
PetscErrorCode petscSetupOutput(CommandLine *cmd_line)
Definition: PetscSupport.C:265
bool _ready_to_exit
Definition: MooseApp.h:645
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:572
void MooseApp::executeMeshModifiers ( )

Execute and clear the Mesh Modifiers data structure.

Set preparation flag after modifers are run. The final preparation will be handled by the SetupMeshComplete Action.

Definition at line 1159 of file MooseApp.C.

Referenced by SetupMeshCompleteAction::act(), and isUltimateMaster().

1160 {
1162 
1163  // Add all of the dependencies into the resolver and sort them
1164  for (const auto & it : _mesh_modifiers)
1165  {
1166  // Make sure an item with no dependencies comes out too!
1167  resolver.addItem(it.second);
1168 
1169  std::vector<std::string> & modifiers = it.second->getDependencies();
1170  for (const auto & depend_name : modifiers)
1171  {
1172  auto depend_it = _mesh_modifiers.find(depend_name);
1173 
1174  if (depend_it == _mesh_modifiers.end())
1175  mooseError("The MeshModifier \"",
1176  depend_name,
1177  "\" was not created, did you make a "
1178  "spelling mistake or forget to include it "
1179  "in your input file?");
1180 
1181  resolver.insertDependency(it.second, depend_it->second);
1182  }
1183  }
1184 
1185  const auto & ordered_modifiers = resolver.getSortedValues();
1186 
1187  if (ordered_modifiers.size())
1188  {
1189  MooseMesh * mesh = _action_warehouse.mesh().get();
1190  MooseMesh * displaced_mesh = _action_warehouse.displacedMesh().get();
1191 
1192  // Run the MeshModifiers in the proper order
1193  for (const auto & modifier : ordered_modifiers)
1194  modifier->modifyMesh(mesh, displaced_mesh);
1195 
1200  mesh->prepared(false);
1201  if (displaced_mesh)
1202  displaced_mesh->prepared(false);
1203  }
1204 }
std::shared_ptr< MooseMesh > & displacedMesh()
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
const std::vector< T > & getSortedValues()
This function also returns dependency resolved values but with a simpler single vector interface...
std::shared_ptr< MooseMesh > & mesh()
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
void addItem(const T &value)
Add an independent item to the set.
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:725
bool prepared() const
Setter/getter for the _is_prepared flag.
Definition: MooseMesh.C:2139
void insertDependency(const T &key, const T &value)
Insert a dependency pair - the first value or the "key" depends on the second value or the "value"...
std::shared_ptr<Executioner>& MooseApp::executioner ( )
inline

Retrieve the Executioner shared pointer for this App.

Definition at line 238 of file MooseApp.h.

Referenced by CreateExecutionerAction::act(), and TimePeriod::TimePeriod().

238 { return _executioner; }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
ActionFactory& MooseApp::getActionFactory ( )
inline

Retrieve the ActionFactory associated with this App.

Definition at line 258 of file MooseApp.h.

258 { return _action_factory; }
ActionFactory _action_factory
The Factory responsible for building Actions.
Definition: MooseApp.h:613
std::list< std::string > MooseApp::getCheckpointFiles ( )

Extract all possible checkpoint file names.

Parameters
filesA Set of checkpoint filenames to populate

Definition at line 779 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act(), and setOutputFileBase().

780 {
781  // Extract the CommonOutputAction
782  const auto & common_actions = _action_warehouse.getActionListByName("common_output");
783  mooseAssert(common_actions.size() == 1, "Should be only one common_output Action");
784 
785  const Action * common = *common_actions.begin();
786 
787  // Storage for the directory names
788  std::list<std::string> checkpoint_dirs;
789 
790  // If file_base is set in CommonOutputAction, add this file to the list of potential checkpoint
791  // files
792  if (common->isParamValid("file_base"))
793  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
794  // Case for normal application or master in a Multiapp setting
795  else if (getOutputFileBase().empty())
796  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, "_out_cp"));
797  // Case for a sub app in a Multiapp setting
798  else
799  checkpoint_dirs.push_back(getOutputFileBase() + "_cp");
800 
801  // Add the directories from any existing checkpoint objects
802  const auto & actions = _action_warehouse.getActionListByName("add_output");
803  for (const auto & action : actions)
804  {
805  // Get the parameters from the MooseObjectAction
806  MooseObjectAction * moose_object_action = static_cast<MooseObjectAction *>(action);
807  const InputParameters & params = moose_object_action->getObjectParams();
808 
809  // Loop through the actions and add the necessary directories to the list to check
810  if (moose_object_action->getParam<std::string>("type") == "Checkpoint")
811  {
812  if (params.isParamValid("file_base"))
813  checkpoint_dirs.push_back(common->getParam<std::string>("file_base") + "_cp");
814  else
815  {
816  std::ostringstream oss;
817  oss << "_" << action->name() << "_cp";
818  checkpoint_dirs.push_back(FileOutput::getOutputFileBase(*this, oss.str()));
819  }
820  }
821  }
822 
823  return MooseUtils::getFilesInDirs(checkpoint_dirs);
824 }
static std::string getOutputFileBase(MooseApp &app, std::string suffix="_out")
Returns the default output file base.
Definition: FileOutput.C:112
std::list< std::string > getFilesInDirs(const std::list< std::string > &directory_list)
Retrieves the names of all of the files contained within the list of directories passed into the rout...
Definition: MooseUtils.C:466
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
Base class for actions.
Definition: Action.h:39
std::string getOutputFileBase()
Override the selection of the output file base name.
Definition: MooseApp.C:536
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
InputParameters & getObjectParams()
Retreive the parameters of the object to be created by this action.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: Action.h:139
bool MooseApp::getDistributedMeshOnCommandLine ( ) const
inline

Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibility) on the command line and false otherwise.

Definition at line 288 of file MooseApp.h.

Referenced by getParallelMeshOnCommandLine(), and MooseMesh::MooseMesh().

bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:651
Executioner* MooseApp::getExecutioner ( )
inline

Retrieve the Executioner for this App.

Definition at line 233 of file MooseApp.h.

Referenced by EigenKernel::EigenKernel(), NumPicardIterations::initialize(), Console::initialSetup(), and ConsoleUtils::outputExecutionInformation().

233 { return _executioner.get(); }
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
Factory& MooseApp::getFactory ( )
inline
std::string MooseApp::getFileName ( bool  stripLeadingPath = true) const

Return the filename that was parsed.

Definition at line 834 of file MooseApp.C.

Referenced by MultiApp::createApp(), getGlobalTimeOffset(), and FileOutput::getOutputFileBase().

835 {
836  return _parser.getFileName(stripLeadingPath);
837 }
std::string getFileName(bool stripLeadingPath=true) const
Return the filename that was parsed.
Definition: Parser.C:293
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
std::string MooseApp::getFrameworkVersion ( ) const

Returns the framework version.

Definition at line 285 of file MooseApp.C.

Referenced by isParamValid().

286 {
287  return MOOSE_VERSION;
288 }
Real MooseApp::getGlobalTimeOffset ( )
inline

Each App has it's own local time.

The "global" time of the whole problem might be different. This offset is how far off the local App time is from the global time.

Definition at line 207 of file MooseApp.h.

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

207 { return _global_time_offset; }
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:598
std::string MooseApp::getInputFileName ( )
inline

Returns the input file name that was set with setInputFileName.

Definition at line 144 of file MooseApp.h.

Referenced by FileOutput::getOutputFileBase(), and Console::outputInput().

144 { return _input_filename; }
std::string _input_filename
Input file name used.
Definition: MooseApp.h:580
InputParameterWarehouse & MooseApp::getInputParameterWarehouse ( )

Get the InputParameterWarehouse for MooseObjects.

Definition at line 1121 of file MooseApp.C.

Referenced by FEProblemBase::addMaterial(), Factory::create(), getSystemInfo(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), and ControlOutput::outputControls().

1122 {
1124 }
InputParameterWarehouse * _input_parameter_warehouse
Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly co...
Definition: MooseApp.h:610
std::set< std::string > MooseApp::getLoadedLibraryPaths ( ) const

Return the loaded library filenames in a std::vector.

Definition at line 1110 of file MooseApp.C.

Referenced by dynamicAppRegistration(), getSystemInfo(), and Factory::reportUnregisteredError().

1111 {
1112  // Return the paths but not the open file handles
1113  std::set<std::string> paths;
1114  for (const auto & it : _lib_handles)
1115  paths.insert(it.first.first);
1116 
1117  return paths;
1118 }
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:675
const MeshModifier & MooseApp::getMeshModifier ( const std::string &  name) const

Get a mesh modifier with its name.

Definition at line 1144 of file MooseApp.C.

Referenced by isUltimateMaster().

1145 {
1146  return *_mesh_modifiers.find(MooseUtils::shortName(name))->second.get();
1147 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:325
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:725
std::vector< std::string > MooseApp::getMeshModifierNames ( ) const

Get names of all mesh modifiers Note: This function should be called after all mesh modifiers are added with the 'add_mesh_modifier' task.

The returned value will be undefined and depends on the ordering that mesh modifiers are added by MOOSE if the function is called during the 'add_mesh_modifier' task.

Definition at line 1150 of file MooseApp.C.

Referenced by isUltimateMaster().

1151 {
1152  std::vector<std::string> names;
1153  for (auto & pair : _mesh_modifiers)
1154  names.push_back(pair.first);
1155  return names;
1156 }
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:725
std::string MooseApp::getOutputFileBase ( )

Override the selection of the output file base name.

Definition at line 536 of file MooseApp.C.

Referenced by MultiApp::createApp(), getCheckpointFiles(), FileOutput::getOutputFileBase(), and setOutputFileBase().

537 {
538  return _output_file_base;
539 }
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:583
std::map<std::string, unsigned int>& MooseApp::getOutputFileNumbers ( )
inline

Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propogate down through the multiapps.

See also
MultiApp TransientMultiApp

Definition at line 361 of file MooseApp.h.

Referenced by TransientMultiApp::setupApp().

361 { return _output_file_numbers; }
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:669
Point MooseApp::getOutputPosition ( )
inline

Get the output position.

Returns
The position offset for the output.

Definition at line 177 of file MooseApp.h.

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

177 { return _output_position; }
Point _output_position
The output position.
Definition: MooseApp.h:589
OutputWarehouse & MooseApp::getOutputWarehouse ( )
bool MooseApp::getParallelMeshOnCommandLine ( ) const
inline

Deprecated.

Call getDistributedMeshOnCommandLine() instead.

Definition at line 293 of file MooseApp.h.

294  {
295  mooseDeprecated("getParallelMeshOnCommandLine() is deprecated, call "
296  "getDistributedMeshOnCommandLine() instead.");
298  }
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:288
template<typename T >
const T & MooseApp::getParam ( const std::string &  name)

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 738 of file MooseApp.h.

Referenced by AddOutputAction::act(), CommonOutputAction::act(), Console::Console(), MooseApp(), SetupMeshAction::setupMesh(), and type().

739 {
740  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
741 }
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
template<typename T >
const T & MooseApp::getParam ( const std::string &  name) const

Definition at line 745 of file MooseApp.h.

746 {
747  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
748 }
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
virtual std::string MooseApp::getPrintableName ( ) const
inlinevirtual

Get printable name of the application.

Definition at line 75 of file MooseApp.h.

Referenced by getPrintableVersion().

75 { return "Application"; }
std::string MooseApp::getPrintableVersion ( ) const

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

Definition at line 297 of file MooseApp.C.

Referenced by isParamValid(), and setupOptions().

298 {
299  return getPrintableName() + " Version: " + getVersion();
300 }
virtual std::string getPrintableName() const
Get printable name of the application.
Definition: MooseApp.h:75
virtual std::string getVersion() const
Returns the current version of the framework or application (default: framework version).
Definition: MooseApp.C:291
std::set<std::string>& MooseApp::getRecoverableData ( )
inline

Return a reference to the recoverable data object.

Returns
A const reference to the recoverable data

Definition at line 439 of file MooseApp.h.

Referenced by Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

439 { return _recoverable_data; }
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:708
std::string MooseApp::getRecoverFileBase ( )
inline

The file_base for the recovery file.

Definition at line 318 of file MooseApp.h.

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

318 { return _recover_base; }
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:660
std::string MooseApp::getRecoverFileSuffix ( )
inline

The suffix for the recovery file.

Definition at line 328 of file MooseApp.h.

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

328 { return _recover_suffix; }
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:663
const RestartableDatas& MooseApp::getRestartableData ( )
inline

Return reference to the restatable data object.

Returns
A const reference to the restatable data object

Definition at line 433 of file MooseApp.h.

Referenced by RestartableDataIO::createBackup(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

433 { return _restartable_data; }
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:705
Real MooseApp::getStartTime ( )
inline
Returns
The start time

Definition at line 195 of file MooseApp.h.

Referenced by Transient::Transient().

195 { return _start_time; }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:595
const SystemInfo* MooseApp::getSystemInfo ( ) const
inline

Get SystemInfo object.

Returns
A pointer to the SystemInformation object

Definition at line 377 of file MooseApp.h.

Referenced by ConsoleUtils::outputFrameworkInformation(), and ExodusFormatter::printInputFile().

377 { return _sys_info.get(); }
std::unique_ptr< SystemInfo > _sys_info
System Information.
Definition: MooseApp.h:631
std::string MooseApp::getVersion ( ) const
virtual

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

Definition at line 291 of file MooseApp.C.

Referenced by getPrintableVersion(), and isParamValid().

292 {
293  return MOOSE_VERSION;
294 }
bool MooseApp::halfTransient ( )
inline

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

Definition at line 339 of file MooseApp.h.

Referenced by TimeStepper::constrainStep(), Transient::execute(), TimeSequenceStepperBase::setupSequence(), and Transient::Transient().

339 { return _half_transient; }
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:666
bool MooseApp::hasCachedBackup ( )
inlineprotected

Whether or not this MooseApp has cached a Backup to use for restart / recovery.

Definition at line 525 of file MooseApp.h.

Referenced by FEProblemBase::initialSetup().

525 { return _cached_backup.get(); }
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:728
bool MooseApp::hasOutputPosition ( )
inline

Whether or not an output position has been set.

Returns
True if it has

Definition at line 171 of file MooseApp.h.

Referenced by Exodus::output().

171 { return _output_position_set; }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:586
bool MooseApp::hasOutputWarehouse ( )
inline

Return true if the output position has been set.

Definition at line 366 of file MooseApp.h.

366 { return _output_position_set; }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:586
bool MooseApp::hasRecoverFileBase ( )

Return true if the recovery file base is set.

Definition at line 619 of file MooseApp.C.

Referenced by SetupRecoverFileBaseAction::act(), and getParallelMeshOnCommandLine().

620 {
621  return !_recover_base.empty();
622 }
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:660
bool MooseApp::hasStartTime ( )
inline
Returns
Whether or not a start time has been programmatically set using setStartTime()

Definition at line 190 of file MooseApp.h.

Referenced by Transient::Transient().

190 { return _start_time_set; }
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:592
std::string MooseApp::header ( ) const
virtual

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

Definition at line 1127 of file MooseApp.C.

Referenced by getRecoverableData(), and setupOptions().

1128 {
1129  return std::string("");
1130 }
bool MooseApp::isParamValid ( const std::string &  name) const
inline

Definition at line 103 of file MooseApp.h.

Referenced by MooseApp(), runInputFile(), and setupOptions().

103 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
bool MooseApp::isRecovering ( ) const
bool MooseApp::isRestarting ( ) const

Whether or not this is a "restart" calculation.

Definition at line 613 of file MooseApp.C.

Referenced by MultiApp::createApp(), FileOutput::FileOutput(), getParallelMeshOnCommandLine(), Transient::init(), FEProblemBase::initialSetup(), InversePowerMethod::InversePowerMethod(), NonlinearEigen::NonlinearEigen(), restoreCachedBackup(), and TimeSequenceStepperBase::setupSequence().

614 {
615  return _restart;
616 }
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:657
bool MooseApp::isUltimateMaster ( )
inline

Whether or not this app is the ultimate master app.

(ie level == 0)

Definition at line 476 of file MooseApp.h.

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

476 { return !_multiapp_level; }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:719
std::string MooseApp::libNameToAppName ( const std::string &  library_name) const

Converts a library name to an application name:

Definition at line 862 of file MooseApp.C.

Referenced by getSystemInfo().

863 {
864  std::string app_name(library_name);
865 
866  // Strip off the leading "lib" and trailing ".la"
867  if (pcrecpp::RE("lib(.+?)(?:-\\w+)?\\.la").Replace("\\1", &app_name) == 0)
868  mooseError("Invalid library name: ", app_name);
869 
870  return MooseUtils::underscoreToCamelCase(app_name, true);
871 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string underscoreToCamelCase(const std::string &underscore_name, bool leading_upper_case)
Function for converting an underscore name to a camel case name.
Definition: MooseUtils.C:293
void MooseApp::loadLibraryAndDependencies ( const std::string &  library_filename,
const Parameters &  params 
)
protected

Recursively loads libraries and dependencies in the proper order to fully register a MOOSE application that may have several dependencies.

REQUIRES: dynamic linking loader support.

Definition at line 985 of file MooseApp.C.

Referenced by dynamicRegistration(), and hasCachedBackup().

987 {
988  std::string line;
989  std::string dl_lib_filename;
990 
991  // This RE looks for absolute path libtool filenames (i.e. begins with a slash and ends with a
992  // .la)
993  pcrecpp::RE re_deps("(/\\S*\\.la)");
994 
995  std::ifstream handle(library_filename.c_str());
996  if (handle.is_open())
997  {
998  while (std::getline(handle, line))
999  {
1000  // Look for the system dependent dynamic library filename to open
1001  if (line.find("dlname=") != std::string::npos)
1002  // Magic numbers are computed from length of this string "dlname=' and line minus that
1003  // string plus quotes"
1004  dl_lib_filename = line.substr(8, line.size() - 9);
1005 
1006  if (line.find("dependency_libs=") != std::string::npos)
1007  {
1008  pcrecpp::StringPiece input(line);
1009  pcrecpp::StringPiece depend_library;
1010  while (re_deps.FindAndConsume(&input, &depend_library))
1011  // Recurse here to load dependent libraries in depth-first order
1012  loadLibraryAndDependencies(depend_library.as_string(), params);
1013 
1014  // There's only one line in the .la file containing the dependency libs so break after
1015  // finding it
1016  break;
1017  }
1018  }
1019  handle.close();
1020  }
1021 
1022  std::string registration_method_name = params.get<std::string>("registration_method");
1023  // Time to load the library, First see if we've already loaded this particular dynamic library
1024  if (_lib_handles.find(std::make_pair(library_filename, registration_method_name)) ==
1025  _lib_handles.end() && // make sure we haven't already loaded this library
1026  dl_lib_filename != "") // AND make sure we have a library name (we won't for static linkage)
1027  {
1028  std::pair<std::string, std::string> lib_name_parts =
1029  MooseUtils::splitFileName(library_filename);
1030 
1031  // Assemble the actual filename using the base path of the *.la file and the dl_lib_filename
1032  std::string dl_lib_full_path = lib_name_parts.first + '/' + dl_lib_filename;
1033 
1034 #ifdef LIBMESH_HAVE_DLOPEN
1035  void * handle = dlopen(dl_lib_full_path.c_str(), RTLD_LAZY);
1036 #else
1037  void * handle = NULL;
1038 #endif
1039 
1040  if (!handle)
1041  mooseError("Cannot open library: ", dl_lib_full_path.c_str(), "\n");
1042 
1043 // get the pointer to the method in the library. The dlsym()
1044 // function returns a null pointer if the symbol cannot be found,
1045 // we also explicitly set the pointer to NULL if dlsym is not
1046 // available.
1047 #ifdef LIBMESH_HAVE_DLOPEN
1048  void * registration_method = dlsym(handle, registration_method_name.c_str());
1049 #else
1050  void * registration_method = NULL;
1051 #endif
1052 
1053  if (!registration_method)
1054  {
1055 // We found a dynamic library that doesn't have a dynamic
1056 // registration method in it. This shouldn't be an error, so
1057 // we'll just move on.
1058 #ifdef DEBUG
1059  mooseWarning("Unable to find extern \"C\" method \"",
1060  registration_method_name,
1061  "\" in library: ",
1062  dl_lib_full_path,
1063  ".\n",
1064  "This doesn't necessarily indicate an error condition unless you believe that "
1065  "the method should exist in that library.\n");
1066 #endif
1067 
1068 #ifdef LIBMESH_HAVE_DLOPEN
1069  dlclose(handle);
1070 #endif
1071  }
1072  else // registration_method is valid!
1073  {
1074  // TODO: Look into cleaning this up
1075  switch (params.get<RegistrationType>("reg_type"))
1076  {
1077  case APPLICATION:
1078  {
1079  typedef void (*register_app_t)();
1080  register_app_t * reg_ptr = reinterpret_cast<register_app_t *>(&registration_method);
1081  (*reg_ptr)();
1082  break;
1083  }
1084  case OBJECT:
1085  {
1086  typedef void (*register_app_t)(Factory *);
1087  register_app_t * reg_ptr = reinterpret_cast<register_app_t *>(&registration_method);
1088  (*reg_ptr)(params.get<Factory *>("factory"));
1089  break;
1090  }
1091  case SYNTAX:
1092  {
1093  typedef void (*register_app_t)(Syntax *, ActionFactory *);
1094  register_app_t * reg_ptr = reinterpret_cast<register_app_t *>(&registration_method);
1095  (*reg_ptr)(params.get<Syntax *>("syntax"), params.get<ActionFactory *>("action_factory"));
1096  break;
1097  }
1098  default:
1099  mooseError("Unhandled RegistrationType");
1100  }
1101 
1102  // Store the handle so we can close it later
1103  _lib_handles.insert(
1104  std::make_pair(std::make_pair(library_filename, registration_method_name), handle));
1105  }
1106  }
1107 }
Generic factory class for build all sorts of objects.
Definition: Factory.h:152
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
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:985
std::pair< std::string, std::string > splitFileName(std::string full_file)
Function for splitting path and filename.
Definition: MooseUtils.C:251
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:70
RegistrationType
Enumeration for holding the valid types of dynamic registrations allowed.
Definition: MooseApp.h:711
std::map< std::pair< std::string, std::string >, void * > _lib_handles
The library, registration method and the handle to the method.
Definition: MooseApp.h:675
Holding syntax for parsing input files.
Definition: Syntax.h:26
void mooseWarning(Args &&...args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:194
void MooseApp::meshOnly ( std::string  mesh_file_name)
protectedvirtual

Don't run the simulation, just complete all of the mesh preperation steps and exit.

These actions should be the minimum set necessary to generate and output a Mesh.

Definition at line 625 of file MooseApp.C.

Referenced by hasCachedBackup(), and runInputFile().

626 {
632  _action_warehouse.executeActionsWithAction("set_global_params");
634  _action_warehouse.executeActionsWithAction("add_partitioner");
637  _action_warehouse.executeActionsWithAction("add_mesh_modifier");
638  _action_warehouse.executeActionsWithAction("execute_mesh_modifiers");
639  _action_warehouse.executeActionsWithAction("uniform_refine_mesh");
640  _action_warehouse.executeActionsWithAction("setup_mesh_complete");
641 
642  std::shared_ptr<MooseMesh> & mesh = _action_warehouse.mesh();
643 
644  // If no argument specified or if the argument following --mesh-only starts
645  // with a dash, try to build an output filename based on the input mesh filename.
646  if (mesh_file_name.empty() || (mesh_file_name.find('-') == 0))
647  {
648  mesh_file_name = _parser.getFileName();
649  size_t pos = mesh_file_name.find_last_of('.');
650 
651  // Default to writing out an ExodusII mesh base on the input filename.
652  mesh_file_name = mesh_file_name.substr(0, pos) + "_in.e";
653  }
654 
655  // If we're writing an Exodus file, write the Mesh using its logical
656  // element dimension rather than the spatial dimension, unless it's
657  // a 1D Mesh. One reason to prefer this approach is that sidesets
658  // are displayed incorrectly for 2D triangular elements in both
659  // Paraview and Cubit if num_dim==3 in the Exodus file. We do the
660  // same thing in MOOSE's Exodus Output object, so we are mimicking
661  // that behavior here.
662  if (mesh_file_name.find(".e") + 2 == mesh_file_name.size())
663  {
664  ExodusII_IO exio(mesh->getMesh());
665  if (mesh->getMesh().mesh_dimension() != 1)
666  exio.use_mesh_dimension_instead_of_spatial_dimension(true);
667 
668  exio.write(mesh_file_name);
669  }
670  else
671  {
672  // Just write the file using the name requested by the user.
673  mesh->getMesh().write(mesh_file_name);
674  }
675 }
void executeActionsWithAction(const std::string &name)
This method executes only the actions in the warehouse that satisfy the task passed in...
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
std::string getFileName(bool stripLeadingPath=true) const
Return the filename that was parsed.
Definition: Parser.C:293
std::shared_ptr< MooseMesh > & mesh()
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
unsigned int MooseApp::multiAppLevel ( ) const
inline

The MultiApp Level.

Returns
The current number of levels from the master app

Definition at line 465 of file MooseApp.h.

Referenced by FEProblemBase::checkNonlinearConvergence(), MultiApp::createApp(), Console::initialSetup(), OutputWarehouse::mooseConsole(), setupOptions(), and Console::write().

465 { return _multiapp_level; }
unsigned int _multiapp_level
Level of multiapp, the master is level 0. This used by the Console to indent output.
Definition: MooseApp.h:719
unsigned int MooseApp::multiAppNumber ( ) const
inline

The MultiApp number.

Returns
The numbering in all the sub-apps on the same level

Definition at line 471 of file MooseApp.h.

471 { return _multiapp_number; }
unsigned int _multiapp_number
Numbering in all the sub-apps on the same level.
Definition: MooseApp.h:722
const std::string& MooseApp::name ( ) const
inline

Get the name of the object.

In the case of MooseApp, the name of the object is NOT the name of the application. It's the name of the created application which is usually "main". If you have subapps, then each individual subapp will have a unique name which typically comes from the input file (e.g. sub0, sub1, etc...).

Returns
The name of the object

Definition at line 70 of file MooseApp.h.

Referenced by addMeshModifier(), callMooseErrorRaw(), FEProblemBase::checkNonlinearConvergence(), Console::Console(), MultiApp::createApp(), Console::initialSetup(), OutputWarehouse::mooseConsole(), Parser::parse(), registerRestartableData(), runInputFile(), type(), and Console::write().

70 { return _name; }
std::string _name
The name of this object.
Definition: MooseApp.h:568
InputParameters& MooseApp::parameters ( )
inline

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 81 of file MooseApp.h.

Referenced by addMeshModifier(), and isUltimateMaster().

81 { return _pars; }
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
Parser& MooseApp::parser ( )
inline

Definition at line 132 of file MooseApp.h.

132 { return _parser; }
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
void MooseApp::registerRecoverableData ( std::string  name)
protectedvirtual

NOTE: This is an internal function meant for MOOSE use only!

Register a piece of recoverable data. This is data that will get written / read to / from a restart file.

However, this data will ONLY get read from the restart file during a RECOVERY operation!

Parameters
nameThe full (unique) name.

Definition at line 678 of file MooseApp.C.

Referenced by hasCachedBackup(), and SubProblem::registerRecoverableData().

679 {
680  _recoverable_data.insert(name);
681 }
std::set< std::string > _recoverable_data
Data names that will only be read from the restart file during RECOVERY.
Definition: MooseApp.h:708
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
void MooseApp::registerRestartableData ( std::string  name,
RestartableDataValue data,
THREAD_ID  tid 
)
virtual

Definition at line 874 of file MooseApp.C.

Referenced by getSystemInfo(), and SubProblem::registerRestartableData().

875 {
876  std::map<std::string, RestartableDataValue *> & restartable_data = _restartable_data[tid];
877 
878  if (restartable_data.find(name) != restartable_data.end())
879  mooseError("Attempted to declare restartable twice with the same name: ", name);
880 
881  restartable_data[name] = data;
882 }
RestartableDatas _restartable_data
Where the restartable data is held (indexed on tid)
Definition: MooseApp.h:705
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
void MooseApp::restore ( std::shared_ptr< Backup backup,
bool  for_restart = false 
)

Restore a Backup.

This sets the App's state.

Parameters
backupThe Backup holding the data for the app
for_restartWhether this restoration is explicitly for the first restoration of restart data

Definition at line 694 of file MooseApp.C.

Referenced by getRecoverableData(), and restoreCachedBackup().

695 {
696  // This means that a Backup is coming through to use for restart / recovery
697  // We should just cache it for now
698  if (!_executioner)
699  {
701  return;
702  }
703 
704  FEProblemBase & fe_problem = _executioner->feProblem();
705 
706  RestartableDataIO rdio(fe_problem);
707 
708  rdio.restoreBackup(backup, for_restart);
709 }
Class for doing restart.
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:728
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< Backup > backup()
Create a Backup from the current App.
Definition: MooseApp.C:684
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
void MooseApp::restoreCachedBackup ( )
protected

Restore from a cached backup.

Definition at line 1227 of file MooseApp.C.

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

1228 {
1229  if (!_cached_backup.get())
1230  mooseError("No cached Backup to restore!");
1231 
1233 
1234  // Release our hold on this Backup
1235  _cached_backup.reset();
1236 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::shared_ptr< Backup > _cached_backup
Cache for a Backup to use for restart / recovery.
Definition: MooseApp.h:728
void restore(std::shared_ptr< Backup > backup, bool for_restart=false)
Restore a Backup.
Definition: MooseApp.C:694
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:613
void MooseApp::run ( )
virtual

Run the application.

Definition at line 739 of file MooseApp.C.

Referenced by isParamValid().

740 {
741  Moose::perf_log.push("Full Runtime", "Application");
742 
743  Moose::perf_log.push("Application Setup", "Setup");
744  try
745  {
746  setupOptions();
747  runInputFile();
748  }
749  catch (std::exception & err)
750  {
751  mooseError(err.what());
752  }
753  Moose::perf_log.pop("Application Setup", "Setup");
754 
755  if (!_check_input)
757  else
758  {
759  errorCheck();
760  // Output to stderr, so it is easier for peacock to get the result
761  Moose::err << "Syntax OK" << std::endl;
762  }
763 
764  Moose::perf_log.pop("Full Runtime", "Application");
765 }
virtual void setupOptions()
Setup options based on InputParameters.
Definition: MooseApp.C:303
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:672
PerfLog perf_log
Perflog to be used by applications.
virtual void executeExecutioner()
Execute the Executioner that was built.
Definition: MooseApp.C:585
virtual void runInputFile()
Actually build everything in the input file.
Definition: MooseApp.C:542
void errorCheck()
Runs post-initialization error checking that cannot be run correctly unless the simulation has been f...
Definition: MooseApp.C:572
void MooseApp::runInputFile ( )
virtual

Actually build everything in the input file.

Definition at line 542 of file MooseApp.C.

Referenced by run(), and setFileRestart().

543 {
544 
545  std::string mesh_file_name;
546  if (isParamValid("mesh_only"))
547  {
548  meshOnly(getParam<std::string>("mesh_only"));
549  _ready_to_exit = true;
550  }
551 
552  // If ready to exit has been set, then just return
553  if (_ready_to_exit)
554  return;
555 
557 
558  if (getParam<bool>("list_constructed_objects"))
559  {
560  // TODO: ask multiapps for their constructed objects
561  std::vector<std::string> obj_list = _factory.getConstructedObjects();
562  Moose::out << "**START OBJECT DATA**\n";
563  for (const auto & name : obj_list)
564  Moose::out << name << "\n";
565  Moose::out << "**END OBJECT DATA**\n" << std::endl;
566  _ready_to_exit = true;
567  return;
568  }
569 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
std::vector< std::string > getConstructedObjects() const
Get a list of all constructed Moose Object types.
Definition: Factory.C:127
virtual void meshOnly(std::string mesh_file_name)
Don&#39;t run the simulation, just complete all of the mesh preperation steps and exit.
Definition: MooseApp.C:625
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:103
Factory _factory
Definition: MooseApp.h:641
void executeAllActions()
This method loops over all actions in the warehouse and executes them.
bool _ready_to_exit
Definition: MooseApp.h:645
void MooseApp::setCheckUnusedFlag ( bool  warn_is_error = false)

Set a flag so that the parser will either warn or error when unused variables are seen after parsing is complete.

_enable_unused_check is initialized to WARN_UNUSED. If an application chooses to promote this value to ERROR_UNUSED programmatically prior to running the simulation, we certainly don't want to allow it to fall back. Therefore, we won't set it if it's already at the highest value (i.e. error). If however a developer turns it off, it can still be turned on.

Definition at line 712 of file MooseApp.C.

Referenced by getGlobalTimeOffset(), and setupOptions().

713 {
720  if (_enable_unused_check != ERROR_UNUSED || warn_is_error)
721  _enable_unused_check = warn_is_error ? ERROR_UNUSED : WARN_UNUSED;
722  else
723  mooseInfo("Ignoring request to turn off or warn about unused parameters.\n");
724 }
void mooseInfo(Args &&...args)
Emit an informational message with the given stringified, concatenated args.
Definition: MooseError.h:210
enum MooseApp::UNUSED_CHECK _enable_unused_check
void MooseApp::setErrorOverridden ( )

Set a flag so that the parser will throw an error if overridden parameters are detected.

Definition at line 733 of file MooseApp.C.

Referenced by getGlobalTimeOffset(), and setupOptions().

734 {
735  _error_overridden = true;
736 }
bool _error_overridden
Indicates whether warnings or errors are displayed when overridden parameters are detected...
Definition: MooseApp.h:644
bool& MooseApp::setFileRestart ( )
inline

This method is here so we can determine whether or not we need to use a separate reader to read the mesh BEFORE we create the mesh.

Definition at line 271 of file MooseApp.h.

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

271 { return _initial_from_file; }
bool _initial_from_file
This variable indicates when a request has been made to restart from an Exodus file.
Definition: MooseApp.h:648
void MooseApp::setGlobalTimeOffset ( const Real  offset)
inline

Each App has it's own local time.

The "global" time of the whole problem might be different. This offset is how far off the local App time is from the global time.

Definition at line 201 of file MooseApp.h.

201 { _global_time_offset = offset; }
Real _global_time_offset
Offset of the local App time to the "global" problem time.
Definition: MooseApp.h:598
void MooseApp::setInputFileName ( std::string  input_file_name)

Set the input file name.

Definition at line 530 of file MooseApp.C.

Referenced by syntax().

531 {
532  _input_filename = input_filename;
533 }
std::string _input_filename
Input file name used.
Definition: MooseApp.h:580
void MooseApp::setOutputFileBase ( std::string  output_file_base)
inline

Override the selection of the output file base name.

Definition at line 149 of file MooseApp.h.

149 { _output_file_base = output_file_base; }
std::string _output_file_base
The output file basename.
Definition: MooseApp.h:583
void MooseApp::setOutputFileNumbers ( std::map< std::string, unsigned int >  numbers)
inline

Store a map of outputter names and file numbers The MultiApp system requires this to get the file numbering to propagate down through the Multiapps.

Parameters
numbersMap of outputter names and file numbers
See also
MultiApp TransientMultiApp OutputWarehouse

Definition at line 349 of file MooseApp.h.

350  {
351  _output_file_numbers = numbers;
352  }
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:669
void MooseApp::setOutputPosition ( Point  p)

Tell the app to output in a specific position.

Definition at line 768 of file MooseApp.C.

Referenced by setOutputFileBase().

769 {
770  _output_position_set = true;
771  _output_position = p;
773 
774  if (_executioner.get() != NULL)
775  _executioner->parentOutputPositionChanged();
776 }
bool _output_position_set
Whether or not an output position has been set for this app.
Definition: MooseApp.h:586
void meshChanged()
Calls the meshChanged method for every output object.
std::shared_ptr< Executioner > _executioner
Pointer to the executioner of this run (typically build by actions)
Definition: MooseApp.h:622
Point _output_position
The output position.
Definition: MooseApp.h:589
OutputWarehouse _output_warehouse
OutputWarehouse object for this App.
Definition: MooseApp.h:607
void MooseApp::setRecover ( const bool &  value)

Definition at line 1221 of file MooseApp.C.

Referenced by isUltimateMaster().

1222 {
1223  _recover = value;
1224 }
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:654
void MooseApp::setRecoverFileBase ( std::string  recover_base)
inline

mutator for recover_base (set by RecoverBaseAction)

Definition at line 323 of file MooseApp.h.

Referenced by SetupRecoverFileBaseAction::act().

323 { _recover_base = recover_base; }
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:660
void MooseApp::setRecoverFileSuffix ( std::string  recover_suffix)
inline

mutator for recover_suffix

Definition at line 333 of file MooseApp.h.

333 { _recover_suffix = recover_suffix; }
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:663
void MooseApp::setRestart ( const bool &  value)

Sets the restart/recover flags.

Parameters
stateThe state to set the flag to

Definition at line 1213 of file MooseApp.C.

Referenced by isUltimateMaster(), and FEProblemBase::setRestartFile().

1214 {
1215  _restart = value;
1216 
1217  std::shared_ptr<FEProblemBase> fe_problem = _action_warehouse.problemBase();
1218 }
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
std::shared_ptr< FEProblemBase > & problemBase()
bool _restart
Whether or not this is a restart run.
Definition: MooseApp.h:657
void MooseApp::setStartTime ( const Real  time)

Set the starting time for the simulation.

This will override any choice made in the input file.

Parameters
timeThe start time for the simulation.

Definition at line 827 of file MooseApp.C.

Referenced by EigenExecutionerBase::EigenExecutionerBase(), getOutputPosition(), and Transient::Transient().

828 {
829  _start_time_set = true;
830  _start_time = time;
831 }
Real _start_time
The time at which to start the simulation.
Definition: MooseApp.h:595
bool _start_time_set
Whether or not an start time has been set.
Definition: MooseApp.h:592
void MooseApp::setupOptions ( )
virtual

Setup options based on InputParameters.

Deprecated messages can be toggled to errors independently from everything else. Normally they are toggled with the –error flag but that behavior can be modified with the –allow-warnings.

Definition at line 303 of file MooseApp.C.

Referenced by isParamValid(), and run().

304 {
305  // Print the header, this is as early as possible
306  std::string hdr(header() + "\n");
307  if (multiAppLevel() > 0)
309  Moose::out << hdr << std::flush;
310 
311  if (getParam<bool>("error_unused"))
312  setCheckUnusedFlag(true);
313  else if (getParam<bool>("warn_unused"))
314  setCheckUnusedFlag(false);
315 
316  if (getParam<bool>("error_override"))
318 
319  _distributed_mesh_on_command_line = getParam<bool>("distributed_mesh");
320 
321  _half_transient = getParam<bool>("half_transient");
322 
323  // The no_timing flag takes precedence over the timing flag.
324  if (getParam<bool>("no_timing"))
325  _pars.set<bool>("timing") = false;
326 
327  if (isParamValid("trap_fpe") && isParamValid("no_trap_fpe"))
328  mooseError("Cannot use both \"--trap-fpe\" and \"--no-trap-fpe\" flags.");
329  if (isParamValid("trap_fpe"))
330  Moose::_trap_fpe = true;
331  else if (isParamValid("no_trap_fpe"))
332  Moose::_trap_fpe = false;
333 
334  // Turn all warnings in MOOSE to errors (almost see next logic block)
335  Moose::_warnings_are_errors = getParam<bool>("error");
336 
342  if (getParam<bool>("error_deprecated") ||
343  (Moose::_warnings_are_errors && !getParam<bool>("allow_deprecated")))
345  else
347 
348  if (isUltimateMaster()) // makes sure coloring isn't reset incorrectly in multi-app settings
349  {
350  // Toggle the color console off
351  Moose::setColorConsole(true, true); // set default color condition
352  if (getParam<bool>("no_color"))
353  Moose::setColorConsole(false);
354 
355  char * c_color = std::getenv("MOOSE_COLOR");
356  std::string color = "on";
357  if (c_color)
358  color = c_color;
359  if (getParam<std::string>("color") != "default-on")
360  color = getParam<std::string>("color");
361 
362  if (color == "auto")
364  else if (color == "on")
365  Moose::setColorConsole(true, true);
366  else if (color == "off")
367  Moose::setColorConsole(false);
368  else
369  mooseWarning("ignoring invalid --color arg (want 'auto', 'on', or 'off')");
370  }
371 
372  // this warning goes below --color processing to honor that setting for
373  // the warning. And below settings for warnings/error setup.
374  if (getParam<bool>("no_color"))
375  mooseDeprecated("The --no-color flag is deprecated. Use '--color off' instead.");
376 
377 // If there's no threading model active, but the user asked for
378 // --n-threads > 1 on the command line, throw a mooseError. This is
379 // intended to prevent situations where the user has potentially
380 // built MOOSE incorrectly (neither TBB nor pthreads found) and is
381 // asking for multiple threads, not knowing that there will never be
382 // any threads launched.
383 #if !LIBMESH_USING_THREADS
384  if (libMesh::command_line_value("--n-threads", 1) > 1)
385  mooseError("You specified --n-threads > 1, but there is no threading model active!");
386 #endif
387 
388  // Build a minimal running application, ignoring the input file.
389  if (getParam<bool>("minimal"))
391 
392  else if (getParam<bool>("display_version"))
393  {
394  Moose::perf_log.disable_logging();
395  Moose::out << getPrintableVersion() << std::endl;
396  _ready_to_exit = true;
397  return;
398  }
399  else if (getParam<bool>("help"))
400  {
401  Moose::perf_log.disable_logging();
402 
403  _command_line->printUsage();
404  _ready_to_exit = true;
405  }
406  else if (isParamValid("dump"))
407  {
408  Moose::perf_log.disable_logging();
409 
410  // Get command line argument following --dump on command line
411  std::string following_arg = getParam<std::string>("dump");
412 
413  // The argument following --dump is a parameter search string,
414  // which can be empty.
415  std::string param_search;
416  if (!following_arg.empty() && (following_arg.find('-') != 0))
417  param_search = following_arg;
418 
419  JsonSyntaxTree tree(param_search);
421  JsonInputFileFormatter formatter;
422  Moose::out << "### START DUMP DATA ###\n"
423  << formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###\n";
424  _ready_to_exit = true;
425  }
426  else if (isParamValid("definition"))
427  {
428  Moose::perf_log.disable_logging();
429  JsonSyntaxTree tree("");
431  SONDefinitionFormatter formatter;
432  Moose::out << formatter.toString(tree.getRoot()) << "\n";
433  _ready_to_exit = true;
434  }
435  else if (isParamValid("yaml"))
436  {
437  Moose::perf_log.disable_logging();
438 
440 
441  // Get command line argument following --yaml on command line
442  std::string yaml_following_arg = getParam<std::string>("yaml");
443 
444  // If the argument following --yaml is non-existent or begins with
445  // a dash, call buildFullTree() with an empty string, otherwise
446  // pass the argument following --yaml.
447  if (yaml_following_arg.empty() || (yaml_following_arg.find('-') == 0))
449  else
450  _parser.buildFullTree(yaml_following_arg);
451 
452  _ready_to_exit = true;
453  }
454  else if (isParamValid("json"))
455  {
456  Moose::perf_log.disable_logging();
457 
458  // Get command line argument following --json on command line
459  std::string json_following_arg = getParam<std::string>("json");
460 
461  // The argument following --json is a parameter search string,
462  // which can be empty.
463  std::string search;
464  if (!json_following_arg.empty() && (json_following_arg.find('-') != 0))
465  search = json_following_arg;
466 
467  JsonSyntaxTree tree(search);
469 
470  Moose::out << "**START JSON DATA**\n" << tree.getRoot() << "\n**END JSON DATA**\n";
471  _ready_to_exit = true;
472  }
473  else if (getParam<bool>("syntax"))
474  {
475  Moose::perf_log.disable_logging();
476 
477  std::multimap<std::string, Syntax::ActionInfo> syntax = _syntax.getAssociatedActions();
478  Moose::out << "**START SYNTAX DATA**\n";
479  for (const auto & it : syntax)
480  Moose::out << it.first << "\n";
481  Moose::out << "**END SYNTAX DATA**\n" << std::endl;
482  _ready_to_exit = true;
483  }
484  else if (_input_filename != "" ||
485  isParamValid("input_file")) // They already specified an input filename
486  {
487  if (_input_filename == "")
488  _input_filename = getParam<std::string>("input_file");
489 
490  if (isParamValid("recover"))
491  {
492  // We need to set the flag manually here since the recover parameter is a string type (takes
493  // an optional filename)
494  _recover = true;
495 
496  // Get command line argument following --recover on command line
497  std::string recover_following_arg = getParam<std::string>("recover");
498 
499  // If the argument following --recover is non-existent or begins with
500  // a dash then we are going to eventually find the newest recovery file to use
501  if (!(recover_following_arg.empty() || (recover_following_arg.find('-') == 0)))
502  _recover_base = recover_following_arg;
503  }
504 
505  // Optionally get command line argument following --recoversuffix
506  // on command line. Currently this argument applies to both
507  // recovery and restart files.
508  if (isParamValid("recoversuffix"))
509  {
510  _recover_suffix = getParam<std::string>("recoversuffix");
511  }
512 
515  }
516  else
517  {
518  Moose::perf_log.disable_logging();
519 
520  if (_check_input)
521  mooseError("You specified --check-input, but did not provide an input file. Add -i "
522  "<inputfile> to your command line.");
523 
524  _command_line->printUsage();
525  _ready_to_exit = true;
526  }
527 }
const std::multimap< std::string, ActionInfo > & getAssociatedActions() const
Definition: Syntax.h:108
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:465
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:712
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:1282
std::string toString(const moosecontrib::Json::Value &root)
Returns a string representation of the tree in input file format.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN)
Indents the supplied message given the prefix and color.
Definition: MooseUtils.C:438
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
bool _check_input
true if we want to just check the input file
Definition: MooseApp.h:672
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:604
Syntax & syntax()
Definition: MooseApp.h:134
ActionWarehouse _action_warehouse
Where built actions are stored.
Definition: MooseApp.h:616
This class produces a dump of the InputFileParameters in the Standard Object Notation (SON) format fo...
Holds the syntax in a Json::Value tree.
bool _half_transient
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:666
std::string toString(const JsonVal &root)
returns a string representation of the tree in input file format
std::string getPrintableVersion() const
Non-virtual method for printing out the version string in a consistent format.
Definition: MooseApp.C:297
Parser _parser
Parser for parsing the input file.
Definition: MooseApp.h:619
void initSyntaxFormatter(SyntaxFormatterType type, bool dump_mode)
Creates a syntax formatter for printing.
Definition: Parser.C:617
void setErrorOverridden()
Set a flag so that the parser will throw an error if overridden parameters are detected.
Definition: MooseApp.C:733
std::shared_ptr< CommandLine > _command_line
Command line object.
Definition: MooseApp.h:601
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:1284
PerfLog perf_log
Perflog to be used by applications.
bool _recover
Whether or not this is a recovery run.
Definition: MooseApp.h:654
std::string _input_filename
Input file name used.
Definition: MooseApp.h:580
This class produces produces a dump of the InputFileParameters that appears like the normal input fil...
InputParameters _pars
Parameters of this object.
Definition: MooseApp.h:571
bool _trap_fpe
Variable indicating whether we will enable FPE trapping for this run.
Definition: Moose.C:1262
std::string _recover_base
The base name to recover from. If blank then we will find the newest recovery file.
Definition: MooseApp.h:660
bool _distributed_mesh_on_command_line
This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh...
Definition: MooseApp.h:651
bool isParamValid(const std::string &name) const
Definition: MooseApp.h:103
void build()
Builds all auto-buildable tasks.
bool setColorConsole(bool use_color, bool force=false)
Turns color escape sequences on/off for info written to stdout.
Definition: Moose.C:1276
void buildJsonSyntaxTree(JsonSyntaxTree &tree) const
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
Definition: Parser.C:634
std::string _name
The name of this object.
Definition: MooseApp.h:568
virtual std::string header() const
Returns a string to be printed at the beginning of a simulation.
Definition: MooseApp.C:1127
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:476
void createMinimalApp()
Method for creating the minimum required actions for an application (no input file) ...
Definition: MooseApp.C:1239
bool _ready_to_exit
Definition: MooseApp.h:645
std::string _recover_suffix
The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.
Definition: MooseApp.h:663
void parse(const std::string &input_filename)
Parse an input file consisting of hit syntax and setup objects in the MOOSE derived application...
Definition: Parser.C:481
void buildFullTree(const std::string &search_string)
Use MOOSE Factories to construct a full parse tree for documentation or echoing input.
Definition: Parser.C:750
void mooseWarning(Args &&...args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:194
Syntax& MooseApp::syntax ( )
inline

Definition at line 134 of file MooseApp.h.

Referenced by getSystemInfo(), and setupOptions().

134 { return _syntax; }
Syntax _syntax
Syntax of the input file.
Definition: MooseApp.h:604
const std::string& MooseApp::type ( ) const
inline

Get the type of this object as a string.

This is a string version of the class name (e.g. MooseTestApp).

Returns
The the type of the object

Definition at line 88 of file MooseApp.h.

88 { return _type; }
const std::string _type
The string representation of the type of this object as registered (see registerApp(AppName)) ...
Definition: MooseApp.h:574
bool& MooseApp::useEigenvalue ( )
inline

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

Definition at line 248 of file MooseApp.h.

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

248 { return _use_eigen_value; }
bool _use_eigen_value
Boolean to indicate whether to use an eigenvalue executioner.
Definition: MooseApp.h:628
bool& MooseApp::useNonlinear ( )
inline

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

Definition at line 243 of file MooseApp.h.

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

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

Friends And Related Function Documentation

friend class FEProblemBase
friend

Definition at line 731 of file MooseApp.h.

friend class Restartable
friend

Definition at line 732 of file MooseApp.h.

friend class SubProblem
friend

Definition at line 733 of file MooseApp.h.

Member Data Documentation

ActionFactory MooseApp::_action_factory
protected

The Factory responsible for building Actions.

Definition at line 613 of file MooseApp.h.

Referenced by createMinimalApp(), and getActionFactory().

ActionWarehouse MooseApp::_action_warehouse
protected
std::shared_ptr<Backup> MooseApp::_cached_backup
private

Cache for a Backup to use for restart / recovery.

Definition at line 728 of file MooseApp.h.

Referenced by hasCachedBackup(), restore(), and restoreCachedBackup().

bool MooseApp::_check_input
protected

true if we want to just check the input file

Definition at line 672 of file MooseApp.h.

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

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

The MPI communicator this App is going to use.

Definition at line 577 of file MooseApp.h.

Referenced by errorCheck().

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

Command line object.

Definition at line 601 of file MooseApp.h.

Referenced by commandLine(), executeExecutioner(), MooseApp(), and setupOptions().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

bool MooseApp::_distributed_mesh_on_command_line
protected

This variable indicates that DistributedMesh should be used for the libMesh mesh underlying MooseMesh.

Definition at line 651 of file MooseApp.h.

Referenced by getDistributedMeshOnCommandLine(), and setupOptions().

enum MooseApp::UNUSED_CHECK MooseApp::_enable_unused_check
protected
bool MooseApp::_error_overridden
protected

Indicates whether warnings or errors are displayed when overridden parameters are detected.

Definition at line 644 of file MooseApp.h.

Referenced by setErrorOverridden().

std::shared_ptr<Executioner> MooseApp::_executioner
protected

Pointer to the executioner of this run (typically build by actions)

Definition at line 622 of file MooseApp.h.

Referenced by backup(), errorCheck(), executeExecutioner(), executioner(), getExecutioner(), restore(), setOutputPosition(), and ~MooseApp().

Factory MooseApp::_factory
protected

Definition at line 641 of file MooseApp.h.

Referenced by addMeshModifier(), getFactory(), and runInputFile().

Real MooseApp::_global_time_offset
protected

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

Definition at line 598 of file MooseApp.h.

Referenced by getGlobalTimeOffset(), and setGlobalTimeOffset().

bool MooseApp::_half_transient
protected

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

Definition at line 666 of file MooseApp.h.

Referenced by halfTransient(), and setupOptions().

bool MooseApp::_initial_from_file
protected

This variable indicates when a request has been made to restart from an Exodus file.

Definition at line 648 of file MooseApp.h.

Referenced by setFileRestart().

std::string MooseApp::_input_filename
protected

Input file name used.

Definition at line 580 of file MooseApp.h.

Referenced by getInputFileName(), setInputFileName(), and setupOptions().

InputParameterWarehouse* MooseApp::_input_parameter_warehouse
protected

Input parameter storage structure (this is a raw pointer so the destruction time can be explicitly controlled)

Definition at line 610 of file MooseApp.h.

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

std::map<std::pair<std::string, std::string>, void *> MooseApp::_lib_handles
protected

The library, registration method and the handle to the method.

Definition at line 675 of file MooseApp.h.

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

std::map<std::string, std::shared_ptr<MeshModifier> > MooseApp::_mesh_modifiers
private

Holds the mesh modifiers until they have completed, then this structure is cleared.

Definition at line 725 of file MooseApp.h.

Referenced by addMeshModifier(), clearMeshModifiers(), executeMeshModifiers(), getMeshModifier(), and getMeshModifierNames().

unsigned int MooseApp::_multiapp_level
private

Level of multiapp, the master is level 0. This used by the Console to indent output.

Definition at line 719 of file MooseApp.h.

Referenced by isUltimateMaster(), and multiAppLevel().

unsigned int MooseApp::_multiapp_number
private

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

Definition at line 722 of file MooseApp.h.

Referenced by multiAppNumber().

std::string MooseApp::_name
protected

The name of this object.

Definition at line 568 of file MooseApp.h.

Referenced by name(), and setupOptions().

std::string MooseApp::_output_file_base
protected

The output file basename.

Definition at line 583 of file MooseApp.h.

Referenced by getOutputFileBase(), and setOutputFileBase().

std::map<std::string, unsigned int> MooseApp::_output_file_numbers
protected

Map of outputer name and file number (used by MultiApps to propagate file numbers down through the multiapps)

Definition at line 669 of file MooseApp.h.

Referenced by getOutputFileNumbers(), and setOutputFileNumbers().

Point MooseApp::_output_position
protected

The output position.

Definition at line 589 of file MooseApp.h.

Referenced by getOutputPosition(), and setOutputPosition().

bool MooseApp::_output_position_set
protected

Whether or not an output position has been set for this app.

Definition at line 586 of file MooseApp.h.

Referenced by hasOutputPosition(), hasOutputWarehouse(), and setOutputPosition().

OutputWarehouse MooseApp::_output_warehouse
protected

OutputWarehouse object for this App.

Definition at line 607 of file MooseApp.h.

Referenced by getOutputWarehouse(), and setOutputPosition().

InputParameters MooseApp::_pars
protected

Parameters of this object.

Definition at line 571 of file MooseApp.h.

Referenced by getParam(), isParamValid(), parameters(), and setupOptions().

Parser MooseApp::_parser
protected

Parser for parsing the input file.

Definition at line 619 of file MooseApp.h.

Referenced by errorCheck(), getFileName(), meshOnly(), parser(), and setupOptions().

bool MooseApp::_ready_to_exit
protected

Definition at line 645 of file MooseApp.h.

Referenced by executeExecutioner(), runInputFile(), and setupOptions().

bool MooseApp::_recover
protected

Whether or not this is a recovery run.

Definition at line 654 of file MooseApp.h.

Referenced by isRecovering(), setRecover(), and setupOptions().

std::string MooseApp::_recover_base
protected

The base name to recover from. If blank then we will find the newest recovery file.

Definition at line 660 of file MooseApp.h.

Referenced by getRecoverFileBase(), hasRecoverFileBase(), setRecoverFileBase(), and setupOptions().

std::string MooseApp::_recover_suffix
protected

The file suffix to recover from. If blank then we will use "cpr" for binary CheckpointIO.

Definition at line 663 of file MooseApp.h.

Referenced by getRecoverFileSuffix(), setRecoverFileSuffix(), and setupOptions().

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

Data names that will only be read from the restart file during RECOVERY.

Definition at line 708 of file MooseApp.h.

Referenced by getRecoverableData(), and registerRecoverableData().

bool MooseApp::_restart
protected

Whether or not this is a restart run.

Definition at line 657 of file MooseApp.h.

Referenced by isRestarting(), and setRestart().

RestartableDatas MooseApp::_restartable_data
private

Where the restartable data is held (indexed on tid)

Definition at line 705 of file MooseApp.h.

Referenced by getRestartableData(), and registerRestartableData().

Real MooseApp::_start_time
protected

The time at which to start the simulation.

Definition at line 595 of file MooseApp.h.

Referenced by getStartTime(), and setStartTime().

bool MooseApp::_start_time_set
protected

Whether or not an start time has been set.

Definition at line 592 of file MooseApp.h.

Referenced by hasStartTime(), and setStartTime().

Syntax MooseApp::_syntax
protected

Syntax of the input file.

Definition at line 604 of file MooseApp.h.

Referenced by setupOptions(), and syntax().

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

System Information.

Definition at line 631 of file MooseApp.h.

Referenced by getSystemInfo(), and MooseApp().

const std::string MooseApp::_type
protected

The string representation of the type of this object as registered (see registerApp(AppName))

Definition at line 574 of file MooseApp.h.

Referenced by type().

bool MooseApp::_use_eigen_value
protected

Boolean to indicate whether to use an eigenvalue executioner.

Definition at line 628 of file MooseApp.h.

Referenced by useEigenvalue().

bool MooseApp::_use_nonlinear
protected

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

Definition at line 625 of file MooseApp.h.

Referenced by useNonlinear().


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