www.mooseframework.org
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
FullSolveMultiApp Class Reference

This type of MultiApp will completely solve itself the first time it is asked to take a step. More...

#include <FullSolveMultiApp.h>

Inheritance diagram for FullSolveMultiApp:
[legend]

Public Member Functions

 FullSolveMultiApp (const InputParameters &parameters)
 
virtual void initialSetup () override
 Gets called at the beginning of the simulation before this object is asked to do its job. More...
 
virtual bool solveStep (Real dt, Real target_time, bool auto_advance=true) override
 Re-solve all of the Apps. More...
 
virtual void advanceStep () override
 Actually advances time and causes output. More...
 
virtual bool isSolved () const override
 Method that reports whether the application has been fully solved or not. More...
 
virtual void preExecute ()
 
virtual void postExecute ()
 
virtual void preTransfer (Real dt, Real target_time)
 Gets called just before transfers are done to the MultiApp (Which is just before the MultiApp is solved) More...
 
virtual void backup ()
 Save off the state of every Sub App. More...
 
virtual void restore ()
 Restore the state of every Sub App. More...
 
virtual bool needsRestoration ()
 Whether or not this MultiApp should be restored at the beginning of each Picard iteration. More...
 
virtual ExecutionergetExecutioner (unsigned int app)
 
virtual BoundingBox getBoundingBox (unsigned int app)
 Get the BoundingBox for the mesh associated with app The bounding box will be shifted to be in the correct position within the master domain. More...
 
FEProblemBaseproblemBase ()
 Get the FEProblemBase this MultiApp is part of. More...
 
FEProblemBaseappProblemBase (unsigned int app)
 Get the FEProblemBase for the global app is part of. More...
 
FEProblemappProblem (unsigned int app)
 Get the FEProblem for the global app is part of. More...
 
const UserObjectappUserObjectBase (unsigned int app, const std::string &name)
 Get a UserObject base for a specific global app. More...
 
Real appPostprocessorValue (unsigned int app, const std::string &name)
 Get a Postprocessor value for a specified global app. More...
 
virtual NumericVector< Number > & appTransferVector (unsigned int app, std::string var_name)
 Get the vector to transfer to for this MultiApp. More...
 
unsigned int numGlobalApps ()
 
unsigned int numLocalApps ()
 
unsigned int firstLocalApp ()
 
bool hasApp ()
 Whether or not this MultiApp has an app on this processor. More...
 
bool hasLocalApp (unsigned int global_app)
 Whether or not the given global app number is on this processor. More...
 
MooseApplocalApp (unsigned int local_app)
 Get the local MooseApp object. More...
 
Point position (unsigned int app)
 The physical position of a global App number. More...
 
virtual void resetApp (unsigned int global_app, Real time=0.0)
 "Reset" the App corresponding to the global App number passed in. More...
 
virtual void moveApp (unsigned int global_app, Point p)
 Move the global_app to Point p. More...
 
virtual void parentOutputPositionChanged ()
 For apps outputting in position we need to change their output positions if their parent app moves. More...
 
MPI_Comm & comm ()
 Get the MPI communicator this MultiApp is operating on. More...
 
bool isRootProcessor ()
 Whether or not this processor is the "root" processor for the sub communicator. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
virtual void timestepSetup ()
 Gets called at the beginning of the timestep before this object is asked to do its job. More...
 
virtual void jacobianSetup ()
 Gets called just before the Jacobian is computed and before this object is asked to do its job. More...
 
virtual void residualSetup ()
 Gets called just before the residual is computed and before this object is asked to do its job. More...
 
virtual void subdomainSetup ()
 Gets called when the subdomain changes (i.e. More...
 
virtual const std::vector< ExecFlagType > & execFlags () const
 Get the execution flag for the object. More...
 
ExecFlagType execBitFlags () const
 Build and return the execution flags as a bitfield. More...
 

Static Public Member Functions

static MultiMooseEnum getExecuteOptions ()
 Returns the available options for the 'execute_on' input parameters. More...
 

Public Attributes

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

Protected Member Functions

virtual void fillPositions ()
 must fill in _positions with the positions of the sub-aps More...
 
void createApp (unsigned int i, Real start_time)
 Helper function for creating an App instance. More...
 
void buildComm ()
 Create an MPI communicator suitable for each app. More...
 
unsigned int globalAppToLocal (unsigned int global_app)
 Map a global App number to the local number. More...
 
virtual void preRunInputFile ()
 call back executed right before app->runInputFile() More...
 
void init (unsigned int num)
 Initialize the MultiApp by creating the provided number of apps. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 

Protected Attributes

FEProblemBase_fe_problem
 The FEProblemBase this MultiApp is part of. More...
 
std::string _app_type
 The type of application to build. More...
 
std::vector< Point > _positions
 The positions of all of the apps. More...
 
const bool _use_positions
 Toggle use of "positions". More...
 
std::vector< FileName > _input_files
 The input file for each app's simulation. More...
 
std::string _output_base
 The output file basename for each multiapp. More...
 
unsigned int _total_num_apps
 The total number of apps to simulate. More...
 
unsigned int _my_num_apps
 The number of apps this object is involved in simulating. More...
 
unsigned int _first_local_app
 The number of the first app on this processor. More...
 
MPI_Comm _orig_comm
 The comm that was passed to us specifying our pool of processors. More...
 
MPI_Comm _my_comm
 The MPI communicator this object is going to use. More...
 
int _orig_num_procs
 The number of processors in the original comm. More...
 
int _orig_rank
 The mpi "rank" of this processor in the original communicator. More...
 
std::string _node_name
 Node Name. More...
 
int _my_rank
 The mpi "rank" of this processor in the sub communicator. More...
 
std::vector< std::shared_ptr< MooseApp > > _apps
 Pointers to each of the Apps. More...
 
Real _inflation
 Relative bounding box inflation. More...
 
unsigned int _max_procs_per_app
 Maximum number of processors to give to each app. More...
 
bool _output_in_position
 Whether or not to move the output of the MultiApp into position. More...
 
Real _reset_time
 The time at which to reset apps. More...
 
std::vector< unsigned int > _reset_apps
 The apps to be reset. More...
 
bool _reset_happened
 Whether or not apps have been reset. More...
 
Real _move_time
 The time at which to move apps. More...
 
std::vector< unsigned int > _move_apps
 The apps to be moved. More...
 
std::vector< Point > _move_positions
 The new positions for the apps to be moved. More...
 
bool _move_happened
 Whether or not the move has happened. More...
 
bool _has_an_app
 Whether or not this processor as an App at all More...
 
SubAppBackups_backups
 Backups for each local App. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
std::vector< ExecFlagType_exec_flags
 execution flag (when is the object executed/evaluated) More...
 
const ExecFlagType_current_execute_flag
 Reference to FEProblemBase. More...
 

Private Attributes

std::vector< Executioner * > _executioners
 
bool _solved
 Whether or not this MultiApp has already been solved. More...
 

Detailed Description

This type of MultiApp will completely solve itself the first time it is asked to take a step.

Each "step" after that it will do nothing.

Definition at line 31 of file FullSolveMultiApp.h.

Constructor & Destructor Documentation

FullSolveMultiApp::FullSolveMultiApp ( const InputParameters parameters)

Definition at line 30 of file FullSolveMultiApp.C.

31  : MultiApp(parameters), _solved(false)
32 {
33 }
MultiApp(const InputParameters &parameters)
Definition: MultiApp.C:144
bool _solved
Whether or not this MultiApp has already been solved.

Member Function Documentation

virtual void FullSolveMultiApp::advanceStep ( )
inlineoverridevirtual

Actually advances time and causes output.

If auto_advance=true was used in solveStep() then this function will do nothing.

Implements MultiApp.

Definition at line 40 of file FullSolveMultiApp.h.

40 {}
Real MultiApp::appPostprocessorValue ( unsigned int  app,
const std::string &  name 
)
inherited

Get a Postprocessor value for a specified global app.

Parameters
appThe global app number you want to get a Postprocessor from.
nameThe name of the Postprocessor.

Definition at line 440 of file MultiApp.C.

441 {
442  if (!_has_an_app)
443  mooseError("No app for ", MultiApp::name(), " on processor ", _orig_rank);
444 
446 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
PostprocessorValue & getPostprocessorValue(const PostprocessorName &name)
Get a reference to the value associated with the postprocessor.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
FEProblem & MultiApp::appProblem ( unsigned int  app)
inherited

Get the FEProblem for the global app is part of.

Parameters
appThe global app number

Definition at line 418 of file MultiApp.C.

419 {
421  "MultiApp::appProblem() is deprecated, call MultiApp::appProblemBase() instead.\n");
422  if (!_has_an_app)
423  mooseError("No app for ", name(), " on processor ", _orig_rank);
424 
425  unsigned int local_app = globalAppToLocal(app);
426 
427  return dynamic_cast<FEProblem &>(_apps[local_app]->getExecutioner()->feProblem());
428 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition: FEProblem.h:30
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
void mooseDeprecated(Args &&...args) const
Definition: MooseObject.h:95
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:680
FEProblemBase & MultiApp::appProblemBase ( unsigned int  app)
inherited

Get the FEProblemBase for the global app is part of.

Parameters
appThe global app number

Definition at line 407 of file MultiApp.C.

Referenced by TransientMultiApp::advanceStep(), MultiApp::appPostprocessorValue(), TransientMultiApp::appTransferVector(), MultiApp::appTransferVector(), MultiApp::appUserObjectBase(), MultiApp::getBoundingBox(), TransientMultiApp::resetApp(), TransientMultiApp::setupApp(), and TransientMultiApp::solveStep().

408 {
409  if (!_has_an_app)
410  mooseError("No app for ", name(), " on processor ", _orig_rank);
411 
412  unsigned int local_app = globalAppToLocal(app);
413 
414  return _apps[local_app]->getExecutioner()->feProblem();
415 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:680
NumericVector< Number > & MultiApp::appTransferVector ( unsigned int  app,
std::string  var_name 
)
virtualinherited

Get the vector to transfer to for this MultiApp.

In general this is the Auxiliary system solution vector.

Parameters
appThe global app number you want the transfer vector for.
var_nameThe name of the variable you are going to be transferring to.
Returns
The vector to fill.

Reimplemented in TransientMultiApp.

Definition at line 449 of file MultiApp.C.

450 {
452 }
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
AuxiliarySystem & getAuxiliarySystem()
virtual NumericVector< Number > & solution() override
const UserObject & MultiApp::appUserObjectBase ( unsigned int  app,
const std::string &  name 
)
inherited

Get a UserObject base for a specific global app.

Parameters
appThe global app number you want to get a UserObject from.
nameThe name of the UserObject.

Definition at line 431 of file MultiApp.C.

Referenced by MultiAppDTKUserObjectEvaluator::evaluate().

432 {
433  if (!_has_an_app)
434  mooseError("No app for ", MultiApp::name(), " on processor ", _orig_rank);
435 
437 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
const UserObject & getUserObjectBase(const std::string &name)
Get the user object by its name.
void MultiApp::backup ( )
virtualinherited

Save off the state of every Sub App.

This allows us to "Restore" this state later

Definition at line 339 of file MultiApp.C.

Referenced by dataStore().

340 {
341  for (unsigned int i = 0; i < _my_num_apps; i++)
342  _backups[i] = _apps[i]->backup();
343 }
virtual void backup()
Save off the state of every Sub App.
Definition: MultiApp.C:339
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
SubAppBackups & _backups
Backups for each local App.
Definition: MultiApp.h:386
void MultiApp::buildComm ( )
protectedinherited

Create an MPI communicator suitable for each app.

Also find out which communicator we are using and what our first local app is.

Definition at line 584 of file MultiApp.C.

Referenced by MultiApp::init().

585 {
586  int ierr;
587 
588  ierr = MPI_Comm_size(_orig_comm, &_orig_num_procs);
589  mooseCheckMPIErr(ierr);
590  ierr = MPI_Comm_rank(_orig_comm, &_orig_rank);
591  mooseCheckMPIErr(ierr);
592 
593  struct utsname sysInfo;
594  uname(&sysInfo);
595 
596  _node_name = sysInfo.nodename;
597 
598  // If we have more apps than processors then we're just going to divide up the work
599  if (_total_num_apps >= (unsigned)_orig_num_procs)
600  {
601  _my_comm = MPI_COMM_SELF;
602  _my_rank = 0;
603 
605  unsigned int jobs_left = _total_num_apps - (_my_num_apps * _orig_num_procs);
606 
607  if (jobs_left != 0)
608  {
609  // Spread the remaining jobs out over the first set of processors
610  if ((unsigned)_orig_rank < jobs_left) // (these are the "jobs_left_pids" ie the pids that are
611  // snatching up extra jobs)
612  {
613  _my_num_apps += 1;
615  }
616  else
617  {
618  unsigned int num_apps_in_jobs_left_pids = (_my_num_apps + 1) * jobs_left;
619  unsigned int distance_to_jobs_left_pids = _orig_rank - jobs_left;
620 
621  _first_local_app = num_apps_in_jobs_left_pids + (_my_num_apps * distance_to_jobs_left_pids);
622  }
623  }
624  else
626 
627  return;
628  }
629 
630  // In this case we need to divide up the processors that are going to work on each app
631  int rank;
632  ierr = MPI_Comm_rank(_orig_comm, &rank);
633  mooseCheckMPIErr(ierr);
634 
635  unsigned int procs_per_app = _orig_num_procs / _total_num_apps;
636 
637  if (_max_procs_per_app < procs_per_app)
638  procs_per_app = _max_procs_per_app;
639 
640  int my_app = rank / procs_per_app;
641  unsigned int procs_for_my_app = procs_per_app;
642 
643  if ((unsigned int)my_app > _total_num_apps - 1 && procs_for_my_app == _max_procs_per_app)
644  {
645  // If we've already hit the max number of procs per app then this processor
646  // won't have an app at all
647  _my_num_apps = 0;
648  _has_an_app = false;
649  }
650  else if ((unsigned int)my_app >=
651  _total_num_apps - 1) // The last app will gain any left-over procs
652  {
653  my_app = _total_num_apps - 1;
654  // procs_for_my_app += _orig_num_procs % _total_num_apps;
655  _first_local_app = my_app;
656  _my_num_apps = 1;
657  }
658  else
659  {
660  _first_local_app = my_app;
661  _my_num_apps = 1;
662  }
663 
664  if (_has_an_app)
665  {
666  ierr = MPI_Comm_split(_orig_comm, _first_local_app, rank, &_my_comm);
667  mooseCheckMPIErr(ierr);
668  ierr = MPI_Comm_rank(_my_comm, &_my_rank);
669  mooseCheckMPIErr(ierr);
670  }
671  else
672  {
673  ierr = MPI_Comm_split(_orig_comm, MPI_UNDEFINED, rank, &_my_comm);
674  mooseCheckMPIErr(ierr);
675  _my_rank = 0;
676  }
677 }
unsigned int _max_procs_per_app
Maximum number of processors to give to each app.
Definition: MultiApp.h:356
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
int _orig_num_procs
The number of processors in the original comm.
Definition: MultiApp.h:338
MPI_Comm _orig_comm
The comm that was passed to us specifying our pool of processors.
Definition: MultiApp.h:332
unsigned int _total_num_apps
The total number of apps to simulate.
Definition: MultiApp.h:323
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
std::string _node_name
Node Name.
Definition: MultiApp.h:344
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
int _my_rank
The mpi "rank" of this processor in the sub communicator.
Definition: MultiApp.h:347
ierr
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
MPI_Comm& MultiApp::comm ( )
inlineinherited

Get the MPI communicator this MultiApp is operating on.

Returns
The MPI comm for this MultiApp

Definition at line 256 of file MultiApp.h.

Referenced by MultiAppDTKUserObjectEvaluator::evaluate().

256 { return _my_comm; }
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
void MultiApp::createApp ( unsigned int  i,
Real  start_time 
)
protectedinherited

Helper function for creating an App instance.

Parameters
iThe local app number to create.
start_timeThe initial time for the App

Definition at line 516 of file MultiApp.C.

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

517 {
518 
519  // Define the app name
520  std::ostringstream multiapp_name;
521  std::string full_name;
522  multiapp_name << name() << std::setw(std::ceil(std::log10(_total_num_apps)))
523  << std::setprecision(0) << std::setfill('0') << std::right << _first_local_app + i;
524 
525  // Only add parent name if it the parent is not the main app
526  if (_app.multiAppLevel() > 0)
527  full_name = _app.name() + "_" + multiapp_name.str();
528  else
529  full_name = multiapp_name.str();
530 
532  app_params.set<FEProblemBase *>("_parent_fep") = &_fe_problem;
533  app_params.set<std::shared_ptr<CommandLine>>("_command_line") = _app.commandLine();
534  app_params.set<unsigned int>("_multiapp_level") = _app.multiAppLevel() + 1;
535  app_params.set<unsigned int>("_multiapp_number") = _first_local_app + i;
536  _apps[i].reset(AppFactory::instance().create(_app_type, full_name, app_params, _my_comm));
537  auto & app = _apps[i];
538 
539  std::string input_file = "";
540  if (_input_files.size() == 1) // If only one input file was provided, use it for all the solves
541  input_file = _input_files[0];
542  else
543  input_file = _input_files[_first_local_app + i];
544 
545  std::ostringstream output_base;
546 
547  // Create an output base by taking the output base of the master problem and appending
548  // the name of the multiapp + a number to it
549  if (!_app.getOutputFileBase().empty())
550  output_base << _app.getOutputFileBase() + "_";
551  else
552  {
553  std::string base = _app.getFileName();
554  size_t pos = base.find_last_of('.');
555  output_base << base.substr(0, pos) + "_out_";
556  }
557 
558  // Append the sub app name to the output file base
559  output_base << multiapp_name.str();
560  app->setGlobalTimeOffset(start_time);
561  app->setInputFileName(input_file);
562  app->setOutputFileBase(output_base.str());
563  app->setOutputFileNumbers(_app.getOutputWarehouse().getFileNumbers());
564  app->setRestart(_app.isRestarting());
565  app->setRecover(_app.isRecovering());
566 
567  // This means we have a backup of this app that we need to give to it
568  // Note: This won't do the restoration immediately. The Backup
569  // will be cached by the MooseApp object so that it can be used
570  // during FEProblemBase::initialSetup() during runInputFile()
571  if (_app.isRestarting() || _app.isRecovering())
572  app->restore(_backups[i]);
573 
574  if (_use_positions && getParam<bool>("output_in_position"))
575  app->setOutputPosition(_app.getOutputPosition() + _positions[_first_local_app + i]);
576 
577  // Update the MultiApp level for the app that was just created
578  app->setupOptions();
579  preRunInputFile();
580  app->runInputFile();
581 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:607
const bool _use_positions
Toggle use of "positions".
Definition: MultiApp.h:314
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:465
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
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...
FEProblemBase & _fe_problem
The FEProblemBase this MultiApp is part of.
Definition: MultiApp.h:305
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::string getOutputFileBase()
Override the selection of the output file base name.
Definition: MooseApp.C:536
std::shared_ptr< CommandLine > commandLine()
Get the command line.
Definition: MooseApp.h:265
std::map< std::string, unsigned int > getFileNumbers()
Extracts the file numbers from the output objects.
std::string _app_type
The type of application to build.
Definition: MultiApp.h:308
unsigned int _total_num_apps
The total number of apps to simulate.
Definition: MultiApp.h:323
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:22
SubAppBackups & _backups
Backups for each local App.
Definition: MultiApp.h:386
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
Point getOutputPosition()
Get the output position.
Definition: MooseApp.h:177
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
std::vector< FileName > _input_files
The input file for each app&#39;s simulation.
Definition: MultiApp.h:317
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:613
virtual void preRunInputFile()
call back executed right before app->runInputFile()
Definition: MultiApp.C:690
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
Definition: AppFactory.C:50
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
std::string getFileName(bool stripLeadingPath=true) const
Return the filename that was parsed.
Definition: MooseApp.C:834
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:840
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
ExecFlagType SetupInterface::execBitFlags ( ) const
inherited

Build and return the execution flags as a bitfield.

Definition at line 100 of file SetupInterface.C.

Referenced by EigenExecutionerBase::init().

101 {
102  unsigned int exec_bit_field = EXEC_NONE;
103  for (unsigned int i = 0; i < _exec_flags.size(); ++i)
104  exec_bit_field |= _exec_flags[i];
105 
106  return static_cast<ExecFlagType>(exec_bit_field);
107 }
std::vector< ExecFlagType > _exec_flags
execution flag (when is the object executed/evaluated)
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
const std::vector< ExecFlagType > & SetupInterface::execFlags ( ) const
virtualinherited

Get the execution flag for the object.

Reimplemented in MultiAppTransfer.

Definition at line 94 of file SetupInterface.C.

Referenced by ExecuteMooseObjectWarehouse< T >::addObjectMask(), and MultiAppTransfer::execFlags().

95 {
96  return _exec_flags;
97 }
std::vector< ExecFlagType > _exec_flags
execution flag (when is the object executed/evaluated)
void MultiApp::fillPositions ( )
protectedvirtualinherited

must fill in _positions with the positions of the sub-aps

Reimplemented in AutoPositionsMultiApp.

Definition at line 209 of file MultiApp.C.

Referenced by MultiApp::MultiApp().

210 {
211  if (_move_apps.size() != _move_positions.size())
212  mooseError("The number of apps to move and the positions to move them to must be the same for "
213  "MultiApp ",
214  _name);
215 
216  if (isParamValid("positions") && isParamValid("positions_file"))
217  mooseError(
218  "Both 'positions' and 'positions_file' cannot be specified simultaneously in MultiApp ",
219  name());
220 
221  if (isParamValid("positions"))
222  {
223  _positions = getParam<std::vector<Point>>("positions");
224 
225  if (_positions.size() < _input_files.size())
226  mooseError("Not enough positions for the number of input files provided in MultiApp ",
227  name());
228  }
229  else if (isParamValid("positions_file"))
230  {
231  std::vector<FileName> positions_files = getParam<std::vector<FileName>>("positions_file");
232  std::vector<FileName> input_files = getParam<std::vector<FileName>>("input_files");
233 
234  if (input_files.size() != 1 && positions_files.size() != input_files.size())
235  mooseError("Number of input_files for MultiApp ",
236  name(),
237  " must either be only one or match the number of positions_file files");
238 
239  // Clear out the _input_files because we're going to rebuild it
240  if (input_files.size() != 1)
241  _input_files.clear();
242 
243  for (unsigned int p_file_it = 0; p_file_it < positions_files.size(); p_file_it++)
244  {
245  std::string positions_file = positions_files[p_file_it];
246 
247  std::vector<Real> positions_vec;
248 
249  // Read the file on the root processor then broadcast it
250  if (processor_id() == 0)
251  {
252  MooseUtils::checkFileReadable(positions_file);
253 
254  std::ifstream is(positions_file.c_str());
255  std::istream_iterator<Real> begin(is), end;
256  positions_vec.insert(positions_vec.begin(), begin, end);
257 
258  if (positions_vec.size() % LIBMESH_DIM != 0)
259  mooseError("Number of entries in 'positions_file' ",
260  positions_file,
261  " must be divisible by ",
262  LIBMESH_DIM,
263  " in MultiApp ",
264  name());
265  }
266 
267  // Bradcast the vector to all processors
268  std::size_t num_positions = positions_vec.size();
269  _communicator.broadcast(num_positions);
270  positions_vec.resize(num_positions);
271  _communicator.broadcast(positions_vec);
272 
273  for (unsigned int i = 0; i < positions_vec.size(); i += LIBMESH_DIM)
274  {
275  if (input_files.size() != 1)
276  _input_files.push_back(input_files[p_file_it]);
277 
278  Point position;
279 
280  // This is here so it will theoretically work with LIBMESH_DIM=1 or 2. That is completely
281  // untested!
282  for (unsigned int j = 0; j < LIBMESH_DIM; j++)
283  position(j) = positions_vec[i + j];
284 
285  _positions.push_back(position);
286  }
287  }
288  }
289  else
290  {
291  _positions = {Point()};
292 
293  if (_positions.size() < _input_files.size())
294  mooseError("Not enough positions for the number of input files provided in MultiApp ",
295  name());
296  }
297 
298  mooseAssert(_input_files.size() == 1 || _positions.size() == _input_files.size(),
299  "Number of positions and input files are not the same!");
300 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
Point position(unsigned int app)
The physical position of a global App number.
Definition: MultiApp.h:222
std::vector< Point > _move_positions
The new positions for the apps to be moved.
Definition: MultiApp.h:377
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
std::vector< unsigned int > _move_apps
The apps to be moved.
Definition: MultiApp.h:374
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
std::vector< FileName > _input_files
The input file for each app&#39;s simulation.
Definition: MultiApp.h:317
unsigned int MultiApp::firstLocalApp ( )
inlineinherited
Returns
The global number of the first app on the local processor.

Definition at line 197 of file MultiApp.h.

Referenced by MultiAppDTKUserObjectEvaluator::createSourceGeometry().

197 { return _first_local_app; }
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
BoundingBox MultiApp::getBoundingBox ( unsigned int  app)
virtualinherited

Get the BoundingBox for the mesh associated with app The bounding box will be shifted to be in the correct position within the master domain.

If the MultiApp is in an RZ coordinate system the box will be the size it would be if the geometry were 3D (ie if you were to revolve the geometry around the axis to create the 3D geometry).

Parameters
appThe global app number you want to get the bounding box for

Definition at line 359 of file MultiApp.C.

Referenced by MultiAppDTKUserObjectEvaluator::createSourceGeometry().

360 {
361  if (!_has_an_app)
362  mooseError("No app for ", name(), " on processor ", _orig_rank);
363 
364  FEProblemBase & problem = appProblemBase(app);
365 
366  BoundingBox bbox = {};
367  {
369  bbox = MeshTools::create_bounding_box(problem.mesh());
370  }
371 
372  Point min = bbox.min();
373  Point max = bbox.max();
374 
375  Point inflation_amount = (max - min) * _inflation;
376 
377  Point inflated_min = min - inflation_amount;
378  Point inflated_max = max + inflation_amount;
379 
380  // This is where the app is located. We need to shift by this amount.
381  Point p = position(app);
382 
383  Point shifted_min = inflated_min;
384  Point shifted_max = inflated_max;
385 
386  // If the problem is RZ then we're going to invent a box that would cover the whole "3D" app
387  // FIXME: Assuming all subdomains are the same coordinate system type!
388  if (problem.getCoordSystem(*(problem.mesh().meshSubdomains().begin())) == Moose::COORD_RZ)
389  {
390  shifted_min(0) = -inflated_max(0);
391  shifted_min(1) = inflated_min(1);
392  shifted_min(2) = -inflated_max(0);
393 
394  shifted_max(0) = inflated_max(0);
395  shifted_max(1) = inflated_max(1);
396  shifted_max(2) = inflated_max(0);
397  }
398 
399  // Shift them to the position they're supposed to be
400  shifted_min += p;
401  shifted_max += p;
402 
403  return BoundingBox(shifted_min, shifted_max);
404 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
Point position(unsigned int app)
The physical position of a global App number.
Definition: MultiApp.h:222
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:2157
Real _inflation
Relative bounding box inflation.
Definition: MultiApp.h:353
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
virtual Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) override
virtual MooseMesh & mesh() override
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
MultiMooseEnum SetupInterface::getExecuteOptions ( )
staticinherited

Returns the available options for the 'execute_on' input parameters.

Returns
A MooseEnum with the available 'execute_on' options, the default is 'residual'

Definition at line 110 of file SetupInterface.C.

Referenced by AddNodalNormalsAction::act(), AdvancedOutput::addValidParams(), AdvancedOutput::initExecutionTypes(), OutputOnWarehouse::OutputOnWarehouse(), validParams< CommonOutputAction >(), validParams< Output >(), and validParams< SetupInterface >().

111 {
112  return MultiMooseEnum("none=0x00 initial=0x01 linear=0x02 nonlinear=0x04 timestep_end=0x08 "
113  "timestep_begin=0x10 final=0x20 custom=0x100",
114  "linear");
115 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Executioner * MultiApp::getExecutioner ( unsigned int  app)
virtualinherited
Parameters
appThe global app number to get the Executioner for
Returns
The Executioner associated with that App.

Definition at line 323 of file MultiApp.C.

324 {
325  if (!_has_an_app)
326  mooseError("No app for ", name(), " on processor ", _orig_rank);
327 
328  return _apps[globalAppToLocal(app)]->getExecutioner();
329 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
int _orig_rank
The mpi "rank" of this processor in the original communicator.
Definition: MultiApp.h:341
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:680
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

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

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

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

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
unsigned int MultiApp::globalAppToLocal ( unsigned int  global_app)
protectedinherited

Map a global App number to the local number.

Note: This will error if given a global number that doesn't map to a local number.

Parameters
global_appThe global app number.
Returns
The local app number.

Definition at line 680 of file MultiApp.C.

Referenced by MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::getExecutioner(), MultiApp::moveApp(), TransientMultiApp::resetApp(), and MultiApp::resetApp().

681 {
682  if (global_app >= _first_local_app && global_app <= _first_local_app + (_my_num_apps - 1))
683  return global_app - _first_local_app;
684 
685  _console << _first_local_app << " " << global_app << '\n';
686  mooseError("Invalid global_app!");
687 }
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
bool MultiApp::hasApp ( )
inlineinherited

Whether or not this MultiApp has an app on this processor.

Definition at line 202 of file MultiApp.h.

202 { return _has_an_app; }
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
bool MultiApp::hasLocalApp ( unsigned int  global_app)
inherited

Whether or not the given global app number is on this processor.

Parameters
global_appThe global app number in question
Returns
True if the global app is on this processor

Definition at line 455 of file MultiApp.C.

Referenced by MultiApp::moveApp(), TransientMultiApp::resetApp(), and MultiApp::resetApp().

456 {
457  if (_has_an_app && global_app >= _first_local_app &&
458  global_app <= _first_local_app + (_my_num_apps - 1))
459  return true;
460 
461  return false;
462 }
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
void MultiApp::init ( unsigned int  num)
protectedinherited

Initialize the MultiApp by creating the provided number of apps.

This is called in the constructor, by default it utilizes the 'positions' input parameters.

Definition at line 181 of file MultiApp.C.

Referenced by MultiApp::MultiApp().

182 {
183  _total_num_apps = num;
184  buildComm();
185  _backups.reserve(_my_num_apps);
186  for (unsigned int i = 0; i < _my_num_apps; i++)
187  _backups.emplace_back(std::make_shared<Backup>());
188 }
void buildComm()
Create an MPI communicator suitable for each app.
Definition: MultiApp.C:584
unsigned int _total_num_apps
The total number of apps to simulate.
Definition: MultiApp.h:323
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
SubAppBackups & _backups
Backups for each local App.
Definition: MultiApp.h:386
void FullSolveMultiApp::initialSetup ( )
overridevirtual

Gets called at the beginning of the simulation before this object is asked to do its job.

Reimplemented from MultiApp.

Definition at line 36 of file FullSolveMultiApp.C.

37 {
39 
40  if (_has_an_app)
41  {
43 
45 
46  // Grab Executioner from each app
47  for (unsigned int i = 0; i < _my_num_apps; i++)
48  {
49  auto & app = _apps[i];
50  Executioner * ex = app->getExecutioner();
51 
52  if (!ex)
53  mooseError("Executioner does not exist!");
54 
55  ex->init();
56 
57  _executioners[i] = ex;
58  }
59  }
60 }
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
std::vector< Executioner * > _executioners
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:41
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
virtual void init()
Initialize the executioner.
Definition: Executioner.C:130
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
Definition: MultiApp.C:191
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), MultiAppNearestNodeTransfer::getLocalNodes(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
bool MultiApp::isRootProcessor ( )
inlineinherited

Whether or not this processor is the "root" processor for the sub communicator.

The "root" processor has rank 0 in the sub communicator

Definition at line 262 of file MultiApp.h.

262 { return _my_rank == 0; }
int _my_rank
The mpi "rank" of this processor in the sub communicator.
Definition: MultiApp.h:347
virtual bool FullSolveMultiApp::isSolved ( ) const
inlineoverridevirtual

Method that reports whether the application has been fully solved or not.

Most transient multiapps are never fully solved, however this method can be overridden in derived classes.

Reimplemented from MultiApp.

Definition at line 42 of file FullSolveMultiApp.h.

42 { return _solved; }
bool _solved
Whether or not this MultiApp has already been solved.
void SetupInterface::jacobianSetup ( )
virtualinherited

Gets called just before the Jacobian is computed and before this object is asked to do its job.

Definition at line 79 of file SetupInterface.C.

80 {
81 }
MooseApp * MultiApp::localApp ( unsigned int  local_app)
inherited

Get the local MooseApp object.

Parameters
local_appThe local app number

Definition at line 465 of file MultiApp.C.

466 {
467  mooseAssert(local_app < _apps.size(), "Index out of range: " + Moose::stringify(local_app));
468  return _apps[local_app].get();
469 }
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), VTKOutput::output(), XDA::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
void MultiApp::moveApp ( unsigned int  global_app,
Point  p 
)
virtualinherited

Move the global_app to Point p.

Parameters
global_appThe global app number in question
pThe new position of the App.

Definition at line 491 of file MultiApp.C.

Referenced by MultiApp::preTransfer().

492 {
493  if (_use_positions)
494  {
495  _positions[global_app] = p;
496 
497  if (hasLocalApp(global_app))
498  {
499  unsigned int local_app = globalAppToLocal(global_app);
500 
502  _apps[local_app]->setOutputPosition(p);
503  }
504  }
505 }
bool hasLocalApp(unsigned int global_app)
Whether or not the given global app number is on this processor.
Definition: MultiApp.C:455
const bool _use_positions
Toggle use of "positions".
Definition: MultiApp.h:314
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
bool _output_in_position
Whether or not to move the output of the MultiApp into position.
Definition: MultiApp.h:359
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:680
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
virtual bool MultiApp::needsRestoration ( )
inlinevirtualinherited

Whether or not this MultiApp should be restored at the beginning of each Picard iteration.

Reimplemented in TransientMultiApp.

Definition at line 124 of file MultiApp.h.

124 { return true; }
unsigned int MultiApp::numGlobalApps ( )
inlineinherited
Returns
Number of Global Apps in this MultiApp

Definition at line 187 of file MultiApp.h.

187 { return _total_num_apps; }
unsigned int _total_num_apps
The total number of apps to simulate.
Definition: MultiApp.h:323
unsigned int MultiApp::numLocalApps ( )
inlineinherited
Returns
Number of Apps on local processor.

Definition at line 192 of file MultiApp.h.

Referenced by MultiAppDTKUserObjectEvaluator::createSourceGeometry().

192 { return _apps.size(); }
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
void MultiApp::parentOutputPositionChanged ( )
virtualinherited

For apps outputting in position we need to change their output positions if their parent app moves.

Definition at line 508 of file MultiApp.C.

509 {
511  for (unsigned int i = 0; i < _apps.size(); i++)
512  _apps[i]->setOutputPosition(_app.getOutputPosition() + _positions[_first_local_app + i]);
513 }
const bool _use_positions
Toggle use of "positions".
Definition: MultiApp.h:314
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:329
Point getOutputPosition()
Get the output position.
Definition: MooseApp.h:177
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
bool _output_in_position
Whether or not to move the output of the MultiApp into position.
Definition: MultiApp.h:359
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
Point MultiApp::position ( unsigned int  app)
inlineinherited

The physical position of a global App number.

Parameters
appThe global app number you want the position for.
Returns
the position

Definition at line 222 of file MultiApp.h.

Referenced by MultiAppDTKUserObjectEvaluator::evaluate(), MultiApp::fillPositions(), and MultiApp::getBoundingBox().

222 { return _positions[app]; }
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
void MultiApp::postExecute ( )
virtualinherited

Definition at line 332 of file MultiApp.C.

333 {
334  for (const auto & app_ptr : _apps)
335  app_ptr->getExecutioner()->postExecute();
336 }
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
virtual void MultiApp::preExecute ( )
inlinevirtualinherited

Definition at line 64 of file MultiApp.h.

64 {}
void MultiApp::preRunInputFile ( )
protectedvirtualinherited

call back executed right before app->runInputFile()

Definition at line 690 of file MultiApp.C.

Referenced by MultiApp::createApp().

691 {
692 }
void MultiApp::preTransfer ( Real  dt,
Real  target_time 
)
virtualinherited

Gets called just before transfers are done to the MultiApp (Which is just before the MultiApp is solved)

Definition at line 303 of file MultiApp.C.

304 {
305  // First, see if any Apps need to be Reset
306  if (!_reset_happened && target_time + 1e-14 >= _reset_time)
307  {
308  _reset_happened = true;
309  for (auto & app : _reset_apps)
310  resetApp(app);
311  }
312 
313  // Now move any apps that should be moved
314  if (_use_positions && !_move_happened && target_time + 1e-14 >= _move_time)
315  {
316  _move_happened = true;
317  for (unsigned int i = 0; i < _move_apps.size(); i++)
319  }
320 }
std::vector< unsigned int > _reset_apps
The apps to be reset.
Definition: MultiApp.h:365
const bool _use_positions
Toggle use of "positions".
Definition: MultiApp.h:314
Real _move_time
The time at which to move apps.
Definition: MultiApp.h:371
std::vector< Point > _move_positions
The new positions for the apps to be moved.
Definition: MultiApp.h:377
bool _reset_happened
Whether or not apps have been reset.
Definition: MultiApp.h:368
bool _move_happened
Whether or not the move has happened.
Definition: MultiApp.h:380
Real _reset_time
The time at which to reset apps.
Definition: MultiApp.h:362
std::vector< unsigned int > _move_apps
The apps to be moved.
Definition: MultiApp.h:374
virtual void resetApp(unsigned int global_app, Real time=0.0)
"Reset" the App corresponding to the global App number passed in.
Definition: MultiApp.C:472
virtual void moveApp(unsigned int global_app, Point p)
Move the global_app to Point p.
Definition: MultiApp.C:491
FEProblemBase& MultiApp::problemBase ( )
inlineinherited

Get the FEProblemBase this MultiApp is part of.

Definition at line 146 of file MultiApp.h.

146 { return _fe_problem; }
FEProblemBase & _fe_problem
The FEProblemBase this MultiApp is part of.
Definition: MultiApp.h:305
void MultiApp::resetApp ( unsigned int  global_app,
Real  time = 0.0 
)
virtualinherited

"Reset" the App corresponding to the global App number passed in.

"Reset" means that the App will be deleted and recreated. The time for the new App will be set to the current simulation time. This might be handy if some sub-app in your simulation needs to get replaced by a "new" piece of material.

Parameters
global_appThe global app number to reset.
timeThe time to set as the the time for the new app, this should really be the time the old app was at.

Reimplemented in TransientMultiApp.

Definition at line 472 of file MultiApp.C.

Referenced by MultiApp::preTransfer(), and TransientMultiApp::resetApp().

473 {
475 
476  if (hasLocalApp(global_app))
477  {
478  unsigned int local_app = globalAppToLocal(global_app);
479 
480  // Extract the file numbers from the output, so that the numbering is maintained after reset
481  std::map<std::string, unsigned int> m = _apps[local_app]->getOutputWarehouse().getFileNumbers();
482 
483  createApp(local_app, time);
484 
485  // Reset the file numbers of the newly reset apps
486  _apps[local_app]->getOutputWarehouse().setFileNumbers(m);
487  }
488 }
bool hasLocalApp(unsigned int global_app)
Whether or not the given global app number is on this processor.
Definition: MultiApp.C:455
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
PetscInt m
void createApp(unsigned int i, Real start_time)
Helper function for creating an App instance.
Definition: MultiApp.C:516
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:680
void SetupInterface::residualSetup ( )
virtualinherited

Gets called just before the residual is computed and before this object is asked to do its job.

Definition at line 84 of file SetupInterface.C.

85 {
86 }
void MultiApp::restore ( )
virtualinherited

Restore the state of every Sub App.

This allows us to "Restore" this state later

Definition at line 346 of file MultiApp.C.

Referenced by dataLoad().

347 {
348  // Must be restarting / recovering so hold off on restoring
349  // Instead - the restore will happen in createApp()
350  // Note that _backups was already populated by dataLoad()
351  if (_apps.empty())
352  return;
353 
354  for (unsigned int i = 0; i < _my_num_apps; i++)
355  _apps[i]->restore(_backups[i]);
356 }
virtual void restore()
Restore the state of every Sub App.
Definition: MultiApp.C:346
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
SubAppBackups & _backups
Backups for each local App.
Definition: MultiApp.h:386
bool FullSolveMultiApp::solveStep ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
overridevirtual

Re-solve all of the Apps.

Can be called multiple times to resolve the same timestep if auto_advance=false. Time is not actually advanced until advanceStep() is called.

Note that auto_advance=false might not be compatible with the options for the MultiApp

Returns
Whether or not all of the solves were successful (i.e. all solves made it to the target_time)

Implements MultiApp.

Definition at line 63 of file FullSolveMultiApp.C.

64 {
65  if (!auto_advance)
66  mooseError("FullSolveMultiApp is not compatible with auto_advance=false");
67 
68  if (!_has_an_app)
69  return true;
70 
71  if (_solved)
72  return true;
73 
75 
76  int rank;
77  int ierr;
78  ierr = MPI_Comm_rank(_orig_comm, &rank);
79  mooseCheckMPIErr(ierr);
80 
81  bool last_solve_converged = true;
82  for (unsigned int i = 0; i < _my_num_apps; i++)
83  {
84  Executioner * ex = _executioners[i];
85  ex->execute();
86  if (!ex->lastSolveConverged())
87  last_solve_converged = false;
88  }
89 
90  _solved = true;
91 
92  return last_solve_converged;
93 }
bool _solved
Whether or not this MultiApp has already been solved.
MPI_Comm _orig_comm
The comm that was passed to us specifying our pool of processors.
Definition: MultiApp.h:332
virtual void execute()=0
Pure virtual execute function MUST be overridden by children classes.
std::vector< Executioner * > _executioners
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:41
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:326
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:383
virtual bool lastSolveConverged()
Whether or not the last solve converged.
Definition: Executioner.C:174
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
ierr
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
void SetupInterface::subdomainSetup ( )
virtualinherited

Gets called when the subdomain changes (i.e.

in a Jacobian or residual loop) and before this object is asked to do its job

Reimplemented in Material, Constraint, GeneralUserObject, and NodalUserObject.

Definition at line 89 of file SetupInterface.C.

90 {
91 }
void SetupInterface::timestepSetup ( )
virtualinherited

Gets called at the beginning of the timestep before this object is asked to do its job.

Reimplemented in SolutionUserObject, NumNonlinearIterations, and MemoryUsage.

Definition at line 74 of file SetupInterface.C.

75 {
76 }

Member Data Documentation

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen::NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

std::string MultiApp::_app_type
protectedinherited

The type of application to build.

Definition at line 308 of file MultiApp.h.

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

std::vector<std::shared_ptr<MooseApp> > MultiApp::_apps
protectedinherited
SubAppBackups& MultiApp::_backups
protectedinherited

Backups for each local App.

Definition at line 386 of file MultiApp.h.

Referenced by MultiApp::backup(), MultiApp::createApp(), MultiApp::init(), and MultiApp::restore().

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().

const ExecFlagType& SetupInterface::_current_execute_flag
protectedinherited

Reference to FEProblemBase.

Definition at line 85 of file SetupInterface.h.

const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

std::vector<ExecFlagType> SetupInterface::_exec_flags
protectedinherited

execution flag (when is the object executed/evaluated)

Definition at line 82 of file SetupInterface.h.

Referenced by SetupInterface::execBitFlags(), SetupInterface::execFlags(), and SetupInterface::SetupInterface().

std::vector<Executioner *> FullSolveMultiApp::_executioners
private

Definition at line 45 of file FullSolveMultiApp.h.

Referenced by initialSetup(), and solveStep().

FEProblemBase& MultiApp::_fe_problem
protectedinherited

The FEProblemBase this MultiApp is part of.

Definition at line 305 of file MultiApp.h.

Referenced by MultiApp::createApp(), and AutoPositionsMultiApp::fillPositions().

unsigned int MultiApp::_first_local_app
protectedinherited
bool MultiApp::_has_an_app
protectedinherited
Real MultiApp::_inflation
protectedinherited

Relative bounding box inflation.

Definition at line 353 of file MultiApp.h.

Referenced by MultiApp::getBoundingBox().

std::vector<FileName> MultiApp::_input_files
protectedinherited

The input file for each app's simulation.

Definition at line 317 of file MultiApp.h.

Referenced by MultiApp::createApp(), and MultiApp::fillPositions().

unsigned int MultiApp::_max_procs_per_app
protectedinherited

Maximum number of processors to give to each app.

Definition at line 356 of file MultiApp.h.

Referenced by MultiApp::buildComm().

std::vector<unsigned int> MultiApp::_move_apps
protectedinherited

The apps to be moved.

Definition at line 374 of file MultiApp.h.

Referenced by MultiApp::fillPositions(), and MultiApp::preTransfer().

bool MultiApp::_move_happened
protectedinherited

Whether or not the move has happened.

Definition at line 380 of file MultiApp.h.

Referenced by MultiApp::preTransfer().

std::vector<Point> MultiApp::_move_positions
protectedinherited

The new positions for the apps to be moved.

Definition at line 377 of file MultiApp.h.

Referenced by MultiApp::fillPositions(), and MultiApp::preTransfer().

Real MultiApp::_move_time
protectedinherited

The time at which to move apps.

Definition at line 371 of file MultiApp.h.

Referenced by MultiApp::preTransfer().

MPI_Comm MultiApp::_my_comm
protectedinherited
unsigned int MultiApp::_my_num_apps
protectedinherited
int MultiApp::_my_rank
protectedinherited

The mpi "rank" of this processor in the sub communicator.

Definition at line 347 of file MultiApp.h.

Referenced by MultiApp::buildComm().

const std::string& MooseObject::_name
protectedinherited
std::string MultiApp::_node_name
protectedinherited

Node Name.

Definition at line 344 of file MultiApp.h.

Referenced by MultiApp::buildComm().

MPI_Comm MultiApp::_orig_comm
protectedinherited

The comm that was passed to us specifying our pool of processors.

Definition at line 332 of file MultiApp.h.

Referenced by MultiApp::buildComm(), solveStep(), and TransientMultiApp::solveStep().

int MultiApp::_orig_num_procs
protectedinherited

The number of processors in the original comm.

Definition at line 338 of file MultiApp.h.

Referenced by MultiApp::buildComm().

int MultiApp::_orig_rank
protectedinherited
std::string MultiApp::_output_base
protectedinherited

The output file basename for each multiapp.

Definition at line 320 of file MultiApp.h.

bool MultiApp::_output_in_position
protectedinherited

Whether or not to move the output of the MultiApp into position.

Definition at line 359 of file MultiApp.h.

Referenced by MultiApp::moveApp(), and MultiApp::parentOutputPositionChanged().

const InputParameters& MooseObject::_pars
protectedinherited
std::vector<Point> MultiApp::_positions
protectedinherited
std::vector<unsigned int> MultiApp::_reset_apps
protectedinherited

The apps to be reset.

Definition at line 365 of file MultiApp.h.

Referenced by MultiApp::preTransfer().

bool MultiApp::_reset_happened
protectedinherited

Whether or not apps have been reset.

Definition at line 368 of file MultiApp.h.

Referenced by MultiApp::preTransfer().

Real MultiApp::_reset_time
protectedinherited

The time at which to reset apps.

Definition at line 362 of file MultiApp.h.

Referenced by MultiApp::preTransfer().

bool FullSolveMultiApp::_solved
private

Whether or not this MultiApp has already been solved.

Definition at line 48 of file FullSolveMultiApp.h.

Referenced by isSolved(), and solveStep().

unsigned int MultiApp::_total_num_apps
protectedinherited

The total number of apps to simulate.

Definition at line 323 of file MultiApp.h.

Referenced by MultiApp::buildComm(), MultiApp::createApp(), and MultiApp::init().

const bool MultiApp::_use_positions
protectedinherited

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