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

Automatically generates Sub-App positions from positions in the master app's mesh. More...

#include <AutoPositionsMultiApp.h>

Inheritance diagram for AutoPositionsMultiApp:
[legend]

Public Types

enum  TEST_TYPE { ALL, ANY }
 A flag changing the behavior of hasBoundary. More...
 

Public Member Functions

 AutoPositionsMultiApp (const InputParameters &parameters)
 
virtual NumericVector< Number > & appTransferVector (unsigned int app, std::string var_name) override
 Get the vector to transfer to for this MultiApp. More...
 
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 needsRestoration () override
 Whether or not this MultiApp should be restored at the beginning of each Picard iteration. More...
 
virtual void resetApp (unsigned int global_app, Real time) override
 "Reset" the App corresponding to the global App number passed in. More...
 
Real computeDT ()
 Finds the smallest dt from among any of the apps. More...
 
virtual void preExecute ()
 
virtual void postExecute ()
 
virtual bool isSolved () const
 Method that reports whether the application has been fully solved or not. More...
 
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 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...
 
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 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...
 
virtual const std::set< BoundaryID > & boundaryIDs () const
 Return the boundary IDs for this object. More...
 
const std::vector< BoundaryName > & boundaryNames () const
 Return the boundary names for this object. More...
 
unsigned int numBoundaryIDs () const
 Return the number of boundaries for this object. More...
 
bool hasBoundary (const BoundaryName &name) const
 Test if the supplied boundary name is valid for this object. More...
 
bool hasBoundary (const std::vector< BoundaryName > &names) const
 Test if the supplied vector of boundary names are valid for this object. More...
 
bool hasBoundary (const BoundaryID &id) const
 Test if the supplied boundary ids are valid for this object. More...
 
bool hasBoundary (const std::vector< BoundaryID > &ids, TEST_TYPE type=ALL) const
 Test if the supplied vector boundary ids are valid for this object. More...
 
bool hasBoundary (const std::set< BoundaryID > &ids, TEST_TYPE type=ALL) const
 Test if the supplied set of boundary ids are valid for this object. More...
 
bool isBoundarySubset (const std::set< BoundaryID > &ids) const
 Test if the class boundary ids are a subset of the supplied objects. More...
 
bool isBoundarySubset (const std::vector< BoundaryID > &ids) const
 
template<typename T >
bool hasBoundaryMaterialProperty (const std::string &prop_name) const
 Check if a material property is valid for all boundaries of this object. More...
 
virtual bool boundaryRestricted () const
 Returns true if this object has been restricted to a boundary. More...
 
const std::set< BoundaryID > & meshBoundaryIDs () const
 Returns the set of all boundary ids for the entire mesh. More...
 

Static Public Member Functions

static MultiMooseEnum getExecuteOptions ()
 Returns the available options for the 'execute_on' input parameters. More...
 
static bool restricted (const std::set< BoundaryID > &ids)
 Helper for determining if the object is boundary restricted. 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 () override
 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...
 
bool hasBoundaryMaterialPropertyHelper (const std::string &prop_name) const
 A helper method to avoid circular #include problems. 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...
 

Detailed Description

Automatically generates Sub-App positions from positions in the master app's mesh.

Definition at line 28 of file AutoPositionsMultiApp.h.

Member Enumeration Documentation

A flag changing the behavior of hasBoundary.

Enumerator
ALL 
ANY 

Definition at line 40 of file BoundaryRestrictable.h.

Constructor & Destructor Documentation

AutoPositionsMultiApp::AutoPositionsMultiApp ( const InputParameters parameters)

Definition at line 34 of file AutoPositionsMultiApp.C.

35  : TransientMultiApp(parameters), BoundaryRestrictable(this, true) // true for applying to nodesets
36 {
37 }
TransientMultiApp(const InputParameters &parameters)
BoundaryRestrictable(const MooseObject *moose_object, bool nodal)
Class constructor Populates the _bnd_ids for the given boundary names supplied with the &#39;boundary&#39; in...

Member Function Documentation

void TransientMultiApp::advanceStep ( )
overridevirtualinherited

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 428 of file TransientMultiApp.C.

429 {
430  if (!_auto_advance && !_sub_cycling)
431  {
432  for (unsigned int i = 0; i < _my_num_apps; i++)
433  {
434  /*FEProblemBase * problem =*/appProblemBase(_first_local_app + i);
436 
437  ex->endStep();
438  ex->postStep();
439  ex->incrementStepOrReject();
440  }
441  }
442 }
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
virtual void endStep(Real input_time=-1.0)
Definition: Transient.C:586
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
virtual void incrementStepOrReject()
This is where the solve step is actually incremented.
Definition: Transient.C:353
std::vector< Transient * > _transient_executioners
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
virtual void postStep()
Definition: Transient.C:292
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 > & TransientMultiApp::appTransferVector ( unsigned int  app,
std::string  var_name 
)
overridevirtualinherited

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 from MultiApp.

Definition at line 119 of file TransientMultiApp.C.

120 {
121  if (std::find(_transferred_vars.begin(), _transferred_vars.end(), var_name) ==
122  _transferred_vars.end())
123  _transferred_vars.push_back(var_name);
124 
126  return appProblemBase(app).getAuxiliarySystem().system().get_vector("transfer");
127 
129 }
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
std::vector< std::string > _transferred_vars
The variables that have been transferred to. Used when doing transfer interpolation. This will be cleared after each solve.
AuxiliarySystem & getAuxiliarySystem()
virtual NumericVector< Number > & solution() override
virtual System & system() override
Get the reference to the libMesh system.
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
const std::set< BoundaryID > & BoundaryRestrictable::boundaryIDs ( ) const
virtualinherited

Return the boundary IDs for this object.

Returns
A set of all boundary ids for which the object is restricted

Definition at line 153 of file BoundaryRestrictable.C.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addInterfaceKernel(), fillPositions(), Material::getZeroMaterialProperty(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), and Material::registerPropName().

154 {
155  return _bnd_ids;
156 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const std::vector< BoundaryName > & BoundaryRestrictable::boundaryNames ( ) const
inherited

Return the boundary names for this object.

Returns
A set of all boundary names for which the object is restricted

Definition at line 159 of file BoundaryRestrictable.C.

Referenced by NearestNodeDistanceAux::NearestNodeDistanceAux(), and NearestNodeValueAux::NearestNodeValueAux().

160 {
161  return _boundary_names;
162 }
std::vector< BoundaryName > _boundary_names
Vector the the boundary names.
bool BoundaryRestrictable::boundaryRestricted ( ) const
virtualinherited

Returns true if this object has been restricted to a boundary.

See also
MooseObject

Definition at line 171 of file BoundaryRestrictable.C.

Referenced by DerivativeMaterialInterface< T >::haveMaterialProperty().

172 {
174 }
static bool restricted(const std::set< BoundaryID > &ids)
Helper for determining if the object is boundary restricted.
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
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
Real TransientMultiApp::computeDT ( )
inherited

Finds the smallest dt from among any of the apps.

Definition at line 451 of file TransientMultiApp.C.

452 {
453  if (_sub_cycling) // Bow out of the timestep selection dance
454  return std::numeric_limits<Real>::max();
455 
456  Real smallest_dt = std::numeric_limits<Real>::max();
457 
458  if (_has_an_app)
459  {
461 
462  for (unsigned int i = 0; i < _my_num_apps; i++)
463  {
465  ex->computeDT();
466  Real dt = ex->getDT();
467 
468  smallest_dt = std::min(dt, smallest_dt);
469  }
470  }
471 
472  if (_tolerate_failure) // Bow out of the timestep selection dance, we do this down here because we
473  // need to call computeConstrainedDT at least once for these
474  // executioners...
475  return std::numeric_limits<Real>::max();
476 
477  _communicator.min(smallest_dt);
478  return smallest_dt;
479 }
virtual Real getDT()
Definition: Transient.C:694
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
virtual void computeDT()
Definition: Transient.C:347
std::vector< Transient * > _transient_executioners
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
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 AutoPositionsMultiApp::fillPositions ( )
overrideprotectedvirtual

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

Reimplemented from MultiApp.

Definition at line 40 of file AutoPositionsMultiApp.C.

41 {
42  MooseMesh & master_mesh = _fe_problem.mesh();
43 
44  const std::set<BoundaryID> & bids = boundaryIDs();
45 
46  for (const auto & boundary_id : bids)
47  {
48  // Grab the nodes on the boundary ID and add a Sub-App at each one.
49  const std::vector<dof_id_type> & boundary_node_ids = master_mesh.getNodeList(boundary_id);
50 
51  for (const auto & boundary_node_id : boundary_node_ids)
52  {
53  Node & node = master_mesh.nodeRef(boundary_node_id);
54 
55  _positions.push_back(node);
56  }
57  }
58 }
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
FEProblemBase & _fe_problem
The FEProblemBase this MultiApp is part of.
Definition: MultiApp.h:305
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:437
virtual MooseMesh & mesh() override
std::vector< Point > _positions
The positions of all of the apps.
Definition: MultiApp.h:311
const std::vector< dof_id_type > & getNodeList(boundary_id_type nodeset_id) const
Return a writable reference to a vector of node IDs that belong to nodeset_id.
Definition: MooseMesh.C:2435
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 BoundaryRestrictable::hasBoundary ( const BoundaryName &  name) const
inherited

Test if the supplied boundary name is valid for this object.

Parameters
nameA BoundaryName to check
Returns
True if the given id is valid for this object

Definition at line 183 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::hasBoundary(), and BoundaryRestrictable::hasBoundaryMaterialPropertyHelper().

184 {
185  // Create a vector and utilize the getBoundaryIDs function, which
186  // handles the ANY_BOUNDARY_ID (getBoundaryID does not)
187  return hasBoundary(_bnd_mesh->getBoundaryIDs({name}));
188 }
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1990
MooseMesh * _bnd_mesh
Point to mesh.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
bool BoundaryRestrictable::hasBoundary ( const std::vector< BoundaryName > &  names) const
inherited

Test if the supplied vector of boundary names are valid for this object.

Parameters
namesA vector of BoundaryNames to check
Returns
True if the given ids are valid for this object

Definition at line 191 of file BoundaryRestrictable.C.

192 {
193  return hasBoundary(_bnd_mesh->getBoundaryIDs(names));
194 }
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1990
MooseMesh * _bnd_mesh
Point to mesh.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
bool BoundaryRestrictable::hasBoundary ( const BoundaryID id) const
inherited

Test if the supplied boundary ids are valid for this object.

Parameters
idA BoundaryID to check
Returns
True if the given id is valid for this object

Definition at line 197 of file BoundaryRestrictable.C.

198 {
199  if (_bnd_ids.empty() || _bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
200  return true;
201  else
202  return _bnd_ids.find(id) != _bnd_ids.end();
203 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
bool BoundaryRestrictable::hasBoundary ( const std::vector< BoundaryID > &  ids,
TEST_TYPE  type = ALL 
) const
inherited

Test if the supplied vector boundary ids are valid for this object.

Parameters
idsA vector of BoundaryIDs ids to check
typeA flag for the type of matching to perform: ALL requires that all supplied ids must match those of the object; ANY requires that any one of the supplied ids must match those of the object
Returns
True if the all of the given ids are found within the ids for this object

Definition at line 206 of file BoundaryRestrictable.C.

207 {
208  std::set<BoundaryID> ids_set(ids.begin(), ids.end());
209  return hasBoundary(ids_set, type);
210 }
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
MatType type
bool BoundaryRestrictable::hasBoundary ( const std::set< BoundaryID > &  ids,
TEST_TYPE  type = ALL 
) const
inherited

Test if the supplied set of boundary ids are valid for this object.

Parameters
idsA std::set of BoundaryIDs to check
typeA flag for the type of matching to perform: ALL requires that all supplied ids must match those of the object; ANY requires that any one of the supplied ids must match those of the object
Returns
True if the all of the given ids are found within the ids for this object
See also
isSubset

Definition at line 213 of file BoundaryRestrictable.C.

214 {
215  // An empty input is assumed to be ANY_BOUNDARY_ID
216  if (ids.empty() || ids.find(Moose::ANY_BOUNDARY_ID) != ids.end())
217  return true;
218 
219  // All supplied IDs must match those of the object
220  else if (type == ALL)
221  {
222  if (_bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
223  return true;
224  else
225  return std::includes(_bnd_ids.begin(), _bnd_ids.end(), ids.begin(), ids.end());
226  }
227  // Any of the supplied IDs must match those of the object
228  else
229  {
230  // Loop through the supplied ids
231  for (const auto & id : ids)
232  {
233  // Test the current supplied id
234  bool test = hasBoundary(id);
235 
236  // If the id exists in the stored ids, then return true, otherwise
237  if (test)
238  return true;
239  }
240  return false;
241  }
242 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
MatType type
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
template<typename T >
bool BoundaryRestrictable::hasBoundaryMaterialProperty ( const std::string &  prop_name) const
inherited

Check if a material property is valid for all boundaries of this object.

This method returns true if the supplied property name has been declared in a Material object on the boundary ids for this object.

Template Parameters
TThe type of material property
Parameters
prop_namethe name of the property to query
Returns
true if the property exists for all boundary ids of the object, otherwise false

Definition at line 228 of file BoundaryRestrictable.h.

229 {
230  // If you get here the supplied property is defined on all boundaries, but is still subject
231  // existence in the MateialData class
232  return hasBoundaryMaterialPropertyHelper(prop_name) &&
233  _bnd_material_data->haveProperty<T>(prop_name);
234 }
bool hasBoundaryMaterialPropertyHelper(const std::string &prop_name) const
A helper method to avoid circular #include problems.
std::shared_ptr< MaterialData > _bnd_material_data
Pointer to MaterialData for boundary (.
bool BoundaryRestrictable::hasBoundaryMaterialPropertyHelper ( const std::string &  prop_name) const
protectedinherited

A helper method to avoid circular #include problems.

See also
hasBoundaryMaterialProperty

Definition at line 274 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::hasBoundaryMaterialProperty().

275 {
276  // Reference to MaterialWarehouse for testing and retrieving boundary ids
278 
279  // Complete set of BoundaryIDs that this object is defined
280  const std::set<BoundaryID> & ids =
282 
283  // Loop over each BoundaryID for this object
284  for (const auto & id : ids)
285  {
286  // Storage of material properties that have been DECLARED on this BoundaryID
287  std::set<std::string> declared_props;
288 
289  // If boundary materials exist, populated the set of properties that were declared
290  if (warehouse.hasActiveBoundaryObjects(id))
291  {
292  const std::vector<std::shared_ptr<Material>> & mats = warehouse.getActiveBoundaryObjects(id);
293  for (const auto & mat : mats)
294  {
295  const std::set<std::string> & mat_props = mat->getSuppliedItems();
296  declared_props.insert(mat_props.begin(), mat_props.end());
297  }
298  }
299 
300  // If the supplied property is not in the list of properties on the current id, return false
301  if (declared_props.find(prop_name) == declared_props.end())
302  return false;
303  }
304 
305  // If you get here the supplied property is defined on all boundaries
306  return true;
307 }
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
Material objects are special in that they have additional objects created automatically (see FEProble...
const std::set< BoundaryID > & meshBoundaryIDs() const
Returns the set of all boundary ids for the entire mesh.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
const MaterialWarehouse & getMaterialWarehouse()
FEProblemBase * _bnd_feproblem
Pointer to FEProblemBase.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
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 TransientMultiApp::initialSetup ( )
overridevirtualinherited

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

Reimplemented from MultiApp.

Definition at line 132 of file TransientMultiApp.C.

133 {
135 
136  if (!_has_an_app)
137  return;
138 
140 
141  if (_has_an_app)
142  {
144  // Grab Transient Executioners from each app
145  for (unsigned int i = 0; i < _my_num_apps; i++)
146  setupApp(i);
147  }
148 }
void setupApp(unsigned int i, Real time=0.0)
Setup the executioner for the local app.
std::vector< Transient * > _transient_executioners
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 initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
Definition: MultiApp.C:191
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
bool BoundaryRestrictable::isBoundarySubset ( const std::set< BoundaryID > &  ids) const
inherited

Test if the class boundary ids are a subset of the supplied objects.

Parameters
idsA std::set of boundaries to check
Returns
True if all of the boundary ids for this class are found within the given ids (opposite of hasBoundary)
See also
hasBoundary

Definition at line 245 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::isBoundarySubset().

246 {
247  // An empty input is assumed to be ANY_BOUNDARY_ID
248  if (ids.empty() || ids.find(Moose::ANY_BOUNDARY_ID) != ids.end())
249  return true;
250 
251  if (_bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
252  return std::includes(ids.begin(),
253  ids.end(),
254  _bnd_mesh->meshBoundaryIds().begin(),
255  _bnd_mesh->meshBoundaryIds().end());
256  else
257  return std::includes(ids.begin(), ids.end(), _bnd_ids.begin(), _bnd_ids.end());
258 }
const std::set< BoundaryID > & meshBoundaryIds() const
Returns a read-only reference to the set of boundary IDs currently present in the Mesh...
Definition: MooseMesh.C:2163
MooseMesh * _bnd_mesh
Point to mesh.
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
bool BoundaryRestrictable::isBoundarySubset ( const std::vector< BoundaryID > &  ids) const
inherited

Definition at line 261 of file BoundaryRestrictable.C.

262 {
263  std::set<BoundaryID> ids_set(ids.begin(), ids.end());
264  return isBoundarySubset(ids_set);
265 }
bool isBoundarySubset(const std::set< BoundaryID > &ids) const
Test if the class boundary ids are a subset of the supplied objects.
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 MultiApp::isSolved ( ) const
inlinevirtualinherited

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 in FullSolveMultiApp.

Definition at line 75 of file MultiApp.h.

75 { return false; }
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
const std::set< BoundaryID > & BoundaryRestrictable::meshBoundaryIDs ( ) const
inherited

Returns the set of all boundary ids for the entire mesh.

Returns
A const reference the the boundary ids for the entire mesh

Definition at line 268 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::hasBoundaryMaterialPropertyHelper().

269 {
270  return _bnd_mesh->getBoundaryIDs();
271 }
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1990
MooseMesh * _bnd_mesh
Point to mesh.
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(), FullSolveMultiApp::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(), FullSolveMultiApp::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
bool TransientMultiApp::needsRestoration ( )
overridevirtualinherited

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

Reimplemented from MultiApp.

Definition at line 445 of file TransientMultiApp.C.

unsigned int BoundaryRestrictable::numBoundaryIDs ( ) const
inherited

Return the number of boundaries for this object.

Returns
The number of boundary ids

Definition at line 165 of file BoundaryRestrictable.C.

166 {
167  return (unsigned int)_bnd_ids.size();
168 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
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 TransientMultiApp::resetApp ( unsigned int  global_app,
Real  time 
)
overridevirtualinherited

"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 from MultiApp.

Definition at line 481 of file TransientMultiApp.C.

484 {
485  if (hasLocalApp(global_app))
486  {
487  unsigned int local_app = globalAppToLocal(global_app);
488 
489  // Grab the current time the App is at so we can start the new one at the same place
490  Real time =
491  _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset();
492 
493  // Reset the Multiapp
494  MultiApp::resetApp(global_app, time);
495 
497 
498  // Setup the app, disable the output so that the initial condition does not output
499  // When an app is reset the initial condition was effectively already output before reset
500  FEProblemBase & problem = appProblemBase(local_app);
501  problem.allowOutput(false);
502  setupApp(local_app, time);
503  problem.allowOutput(true);
504  }
505 }
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
void setupApp(unsigned int i, Real time=0.0)
Setup the executioner for the local app.
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
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
std::vector< Transient * > _transient_executioners
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
void allowOutput(bool state)
Ability to enable/disable all output calls.
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 BoundaryRestrictable::restricted ( const std::set< BoundaryID > &  ids)
staticinherited

Helper for determining if the object is boundary restricted.

This is needed for the MaterialPropertyInterface.

Definition at line 177 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::boundaryRestricted().

178 {
179  return ids.find(Moose::ANY_BOUNDARY_ID) == ids.end();
180 }
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
bool TransientMultiApp::solveStep ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
overridevirtualinherited

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 151 of file TransientMultiApp.C.

152 {
153  if (!_has_an_app)
154  return true;
155 
156  _auto_advance = auto_advance;
157 
158  _console << "Solving MultiApp " << name() << std::endl;
159 
160  // "target_time" must always be in global time
161  target_time += _app.getGlobalTimeOffset();
162 
164  bool return_value = true;
165 
166  // Make sure we swap back the communicator regardless of how this routine is exited
167  try
168  {
169  int rank;
170  int ierr;
171  ierr = MPI_Comm_rank(_orig_comm, &rank);
172  mooseCheckMPIErr(ierr);
173 
174  for (unsigned int i = 0; i < _my_num_apps; i++)
175  {
176 
178 
180 
181  // The App might have a different local time from the rest of the problem
182  Real app_time_offset = _apps[i]->getGlobalTimeOffset();
183 
184  if ((ex->getTime() + app_time_offset) + 2e-14 >=
185  target_time) // Maybe this MultiApp was already solved
186  continue;
187 
188  if (_sub_cycling)
189  {
190  Real time_old = ex->getTime() + app_time_offset;
191 
193  {
194  AuxiliarySystem & aux_system = problem.getAuxiliarySystem();
195  System & libmesh_aux_system = aux_system.system();
196 
197  NumericVector<Number> & solution = *libmesh_aux_system.solution;
198  NumericVector<Number> & transfer_old = libmesh_aux_system.get_vector("transfer_old");
199 
200  solution.close();
201 
202  // Save off the current auxiliary solution
203  transfer_old = solution;
204 
205  transfer_old.close();
206 
207  // Snag all of the local dof indices for all of these variables
208  AllLocalDofIndicesThread aldit(libmesh_aux_system, _transferred_vars);
209  ConstElemRange & elem_range = *problem.mesh().getActiveLocalElementRange();
210  Threads::parallel_reduce(elem_range, aldit);
211 
212  _transferred_dofs = aldit._all_dof_indices;
213  }
214 
215  // Disable/enable output for sub cycling
216  problem.allowOutput(_output_sub_cycles); // disables all outputs, including console
217  problem.allowOutput<Console>(_print_sub_cycles); // re-enables Console to print, if desired
218 
219  ex->setTargetTime(target_time - app_time_offset);
220 
221  // unsigned int failures = 0;
222 
223  bool at_steady = false;
224 
225  if (_first && !_app.isRecovering())
226  problem.advanceState();
227 
228  bool local_first = _first;
229 
230  // Now do all of the solves we need
231  while ((!at_steady && ex->getTime() + app_time_offset + 2e-14 < target_time) ||
232  !ex->lastSolveConverged())
233  {
234  if (local_first != true)
235  ex->incrementStepOrReject();
236 
237  local_first = false;
238 
239  ex->preStep();
240  ex->computeDT();
241 
243  {
244  // See what time this executioner is going to go to.
245  Real future_time = ex->getTime() + app_time_offset + ex->getDT();
246 
247  // How far along we are towards the target time:
248  Real step_percent = (future_time - time_old) / (target_time - time_old);
249 
250  Real one_minus_step_percent = 1.0 - step_percent;
251 
252  // Do the interpolation for each variable that was transferred to
254  AuxiliarySystem & aux_system = problem.getAuxiliarySystem();
255  System & libmesh_aux_system = aux_system.system();
256 
257  NumericVector<Number> & solution = *libmesh_aux_system.solution;
258  NumericVector<Number> & transfer = libmesh_aux_system.get_vector("transfer");
259  NumericVector<Number> & transfer_old = libmesh_aux_system.get_vector("transfer_old");
260 
261  solution.close(); // Just to be sure
262  transfer.close();
263  transfer_old.close();
264 
265  for (const auto & dof : _transferred_dofs)
266  {
267  solution.set(dof,
268  (transfer_old(dof) * one_minus_step_percent) +
269  (transfer(dof) * step_percent));
270  // solution.set(dof, transfer_old(dof));
271  // solution.set(dof, transfer(dof));
272  // solution.set(dof, 1);
273  }
274 
275  solution.close();
276  }
277 
278  ex->takeStep();
279 
280  bool converged = ex->lastSolveConverged();
281 
282  if (!converged)
283  {
284  mooseWarning(
285  "While sub_cycling ", name(), _first_local_app + i, " failed to converge!\n");
286 
287  _failures++;
288 
289  if (_failures > _max_failures)
290  {
291  std::stringstream oss;
292  oss << "While sub_cycling " << name() << _first_local_app << i << " REALLY failed!";
293  throw MultiAppSolveFailure(oss.str());
294  }
295  }
296 
297  Real solution_change_norm = ex->getSolutionChangeNorm();
298 
300  _console << "Solution change norm: " << solution_change_norm << std::endl;
301 
302  if (converged && _detect_steady_state && solution_change_norm < _steady_state_tol)
303  {
304  _console << "Detected Steady State! Fast-forwarding to " << target_time << std::endl;
305 
306  at_steady = true;
307 
308  // Indicate that the next output call (occurs in ex->endStep()) should output,
309  // regardless of intervals etc...
310  problem.forceOutput();
311 
312  // Clean up the end
313  ex->endStep(target_time - app_time_offset);
314  ex->postStep();
315  }
316  else
317  {
318  ex->endStep();
319  ex->postStep();
320  }
321  }
322 
323  // If we were looking for a steady state, but didn't reach one, we still need to output one
324  // more time, regardless of interval
325  if (!at_steady)
326  problem.outputStep(EXEC_FORCED);
327 
328  } // sub_cycling
329  else if (_tolerate_failure)
330  {
331  ex->takeStep(dt);
332  ex->endStep(target_time - app_time_offset);
333  ex->postStep();
334  }
335  else
336  {
337  _console << "Solving Normal Step!" << std::endl;
338 
339  if (_first && !_app.isRecovering())
340  problem.advanceState();
341 
342  if (auto_advance)
343  if (_first != true)
344  ex->incrementStepOrReject();
345 
346  if (auto_advance)
347  problem.allowOutput(true);
348 
349  ex->takeStep(dt);
350 
351  if (auto_advance)
352  {
353  ex->endStep();
354  ex->postStep();
355 
356  if (!ex->lastSolveConverged())
357  {
358  mooseWarning(name(), _first_local_app + i, " failed to converge!\n");
359 
360  if (_catch_up)
361  {
362  _console << "Starting Catch Up!" << std::endl;
363 
364  bool caught_up = false;
365 
366  unsigned int catch_up_step = 0;
367 
368  Real catch_up_dt = dt / 2;
369 
370  while (!caught_up && catch_up_step < _max_catch_up_steps)
371  {
372  Moose::err << "Solving " << name() << "catch up step " << catch_up_step
373  << std::endl;
374  ex->incrementStepOrReject();
375 
376  ex->computeDT();
377  ex->takeStep(catch_up_dt); // Cut the timestep in half to try two half-step solves
378 
379  if (ex->lastSolveConverged())
380  {
381  if (ex->getTime() + app_time_offset +
382  ex->timestepTol() * std::abs(ex->getTime()) >=
383  target_time)
384  {
385  problem.outputStep(EXEC_FORCED);
386  caught_up = true;
387  }
388  }
389  else
390  catch_up_dt /= 2.0;
391 
392  ex->endStep();
393  ex->postStep();
394 
395  catch_up_step++;
396  }
397 
398  if (!caught_up)
399  throw MultiAppSolveFailure(name() + " Failed to catch up!\n");
400  }
401  }
402  }
403  else if (!ex->lastSolveConverged())
404  throw MultiAppSolveFailure(name() + " failed to converge");
405  }
406 
407  // Re-enable all output (it may of been disabled by sub-cycling)
408  problem.allowOutput(true);
409  }
410 
411  _first = false;
412 
413  _console << "Successfully Solved MultiApp " << name() << "." << std::endl;
414  }
415  catch (MultiAppSolveFailure & e)
416  {
417  mooseWarning(e.what());
418  _console << "Failed to Solve MultiApp " << name() << ", attempting to recover." << std::endl;
419  return_value = false;
420  }
421 
422  _transferred_vars.clear();
423 
424  return return_value;
425 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
Utility class for catching solve failure errors so that MOOSE can recover state before continuing...
virtual Real getDT()
Definition: Transient.C:694
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:724
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
void mooseWarning(Args &&...args) const
Definition: MooseObject.h:89
bool _print_sub_cycles
Flag for toggling console output on sub cycles.
virtual bool lastSolveConverged() override
Whether or not the last solve converged.
Definition: Transient.C:745
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:607
virtual void setTargetTime(Real target_time)
Can be used to set the next "target time" which is a time to nail perfectly.
Definition: Transient.C:763
Real getGlobalTimeOffset()
Each App has it&#39;s own local time.
Definition: MooseApp.h:207
virtual void computeDT()
Definition: Transient.C:347
An output object for writing to the console (screen)
Definition: Console.h:30
unsigned int _max_failures
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:350
virtual void endStep(Real input_time=-1.0)
Definition: Transient.C:586
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual Real getTime()
Get the current time.
Definition: Transient.h:103
Grab all the local dof indices for the variables passed in, in the system passed in.
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
MPI_Comm _orig_comm
The comm that was passed to us specifying our pool of processors.
Definition: MultiApp.h:332
Forces execution to occur (output only)
Definition: MooseTypes.h:106
virtual void takeStep(Real input_dt=-1.0)
Do whatever is necessary to advance one step.
Definition: Transient.C:392
std::set< dof_id_type > _transferred_dofs
The DoFs associated with all of the currently transferred variables.
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:407
void forceOutput()
Indicates that the next call to outputStep should be forced.
bool & _first
Is it our first time through the execution loop?
virtual void incrementStepOrReject()
This is where the solve step is actually incremented.
Definition: Transient.C:353
std::vector< std::string > _transferred_vars
The variables that have been transferred to. Used when doing transfer interpolation. This will be cleared after each solve.
AuxiliarySystem & getAuxiliarySystem()
std::vector< Transient * > _transient_executioners
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
Real & timestepTol()
Get the timestep tolerance.
Definition: Transient.h:178
unsigned int _failures
virtual System & system() override
Get the reference to the libMesh system.
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
virtual MooseMesh & mesh() override
virtual void preStep()
Definition: Transient.C:286
ierr
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void postStep()
Definition: Transient.C:292
MPI_Comm _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:335
A system that holds auxiliary variables.
void allowOutput(bool state)
Ability to enable/disable all output calls.
virtual void outputStep(ExecFlagType type)
Output the current step.
Real getSolutionChangeNorm()
Get the Relative L2 norm of the change in the solution.
Definition: Transient.C:769
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().

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 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(), FullSolveMultiApp::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().

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: