www.mooseframework.org
TransientMultiApp.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // MOOSE includes
11 #include "TransientMultiApp.h"
12 
14 #include "AuxiliarySystem.h"
15 #include "Console.h"
16 #include "LayeredSideFluxAverage.h"
17 #include "MooseMesh.h"
18 #include "Output.h"
19 #include "TimeStepper.h"
20 #include "Transient.h"
21 #include "NonlinearSystem.h"
22 
23 #include "libmesh/mesh_tools.h"
24 #include "libmesh/numeric_vector.h"
25 
27 
28 template <>
31 {
34 
35  params.addParam<bool>("sub_cycling",
36  false,
37  "Set to true to allow this MultiApp to take smaller "
38  "timesteps than the rest of the simulation. More "
39  "than one timestep will be performed for each "
40  "'master' timestep");
41 
42  params.addParam<bool>("interpolate_transfers",
43  false,
44  "Only valid when sub_cycling. This allows "
45  "transferred values to be interpolated "
46  "over the time frame the MultiApp is "
47  "executing over when sub_cycling");
48 
49  params.addParam<bool>("detect_steady_state",
50  false,
51  "If true then while sub_cycling a steady state check will be "
52  "done. In this mode output will only be done once the "
53  "MultiApp reaches the target time or steady state is reached");
54 
55  params.addParam<Real>("steady_state_tol",
56  1e-8,
57  "The relative difference between the new "
58  "solution and the old solution that will be "
59  "considered to be at steady state");
60 
61  params.addParam<bool>("output_sub_cycles", false, "If true then every sub-cycle will be output.");
62  params.addParam<bool>(
63  "print_sub_cycles", true, "Toggle the display of sub-cycles on the screen.");
64 
65  params.addParam<unsigned int>(
66  "max_failures", 0, "Maximum number of solve failures tolerated while sub_cycling.");
67 
68  params.addParam<bool>("tolerate_failure",
69  false,
70  "If true this MultiApp won't participate in dt "
71  "decisions and will always be fast-forwarded to "
72  "the current time.");
73 
74  params.addParam<bool>(
75  "catch_up",
76  false,
77  "If true this will allow failed solves to attempt to 'catch up' using smaller timesteps.");
78 
79  params.addParam<bool>("keep_solution_during_restore",
80  false,
81  "This is useful when doing Picard with catch_up steps. It takes the "
82  "solution from the final catch_up step and re-uses it as the initial guess "
83  "for the next picard iteration");
84 
85  params.addParam<Real>("max_catch_up_steps",
86  2,
87  "Maximum number of steps to allow an app to take "
88  "when trying to catch back up after a failed "
89  "solve.");
90 
91  return params;
92 }
93 
95  : MultiApp(parameters),
96  _sub_cycling(getParam<bool>("sub_cycling")),
97  _interpolate_transfers(getParam<bool>("interpolate_transfers")),
98  _detect_steady_state(getParam<bool>("detect_steady_state")),
99  _steady_state_tol(getParam<Real>("steady_state_tol")),
100  _output_sub_cycles(getParam<bool>("output_sub_cycles")),
101  _max_failures(getParam<unsigned int>("max_failures")),
102  _tolerate_failure(getParam<bool>("tolerate_failure")),
103  _failures(0),
104  _catch_up(getParam<bool>("catch_up")),
105  _max_catch_up_steps(getParam<Real>("max_catch_up_steps")),
106  _keep_solution_during_restore(getParam<bool>("keep_solution_during_restore")),
107  _first(declareRecoverableData<bool>("first", true)),
108  _auto_advance(false),
109  _print_sub_cycles(getParam<bool>("print_sub_cycles"))
110 {
111  // Transfer interpolation only makes sense for sub-cycling solves
113  paramError("interpolate_transfers",
114  "MultiApp ",
115  name(),
116  " is set to interpolate_transfers but is not sub_cycling! That is not valid!");
117 
118  // Subcycling overrides catch up, we don't want to confuse users by allowing them to set both.
119  if (_sub_cycling && _catch_up)
120  paramError("catch_up",
121  "MultiApp ",
122  name(),
123  " \"sub_cycling\" and \"catch_up\" cannot both be set to true simultaneously.");
124 
126  paramError("keep_solution_during_restore",
127  "In MultiApp ",
128  name(),
129  " it doesn't make any sense to keep a solution during restore when doing "
130  "sub_cycling. Consider trying \"catch_up\" steps instead");
131 
133  paramError("keep_solution_during_restore",
134  "In MultiApp ",
135  name(),
136  " \"keep_solution_during_restore\" requires \"catch_up = true\". Either disable "
137  "\"keep_solution_during_restart\" or set \"catch_up = true\"");
138 
140  paramInfo("tolerate_failure",
141  "In MultiApp ",
142  name(),
143  " both \"sub_cycling\" and \"tolerate_failure\" are set to true. \"tolerate_failure\""
144  " will be ignored.");
145 }
146 
147 NumericVector<Number> &
148 TransientMultiApp::appTransferVector(unsigned int app, std::string var_name)
149 {
150  if (std::find(_transferred_vars.begin(), _transferred_vars.end(), var_name) ==
151  _transferred_vars.end())
152  _transferred_vars.push_back(var_name);
153 
155  return appProblemBase(app).getAuxiliarySystem().system().get_vector("transfer");
156 
158 }
159 
160 void
162 {
164 
165  if (!_has_an_app)
166  return;
167 
169 
170  if (_has_an_app)
171  {
173  // Grab Transient Executioners from each app
174  for (unsigned int i = 0; i < _my_num_apps; i++)
175  setupApp(i);
176  }
177 }
178 
179 void
181 {
182  // Must be restarting / recovering so hold off on restoring
183  // Instead - the restore will happen in createApp()
184  // Note that _backups was already populated by dataLoad()
185  if (_apps.empty())
186  return;
187 
189  {
191 
192  for (unsigned int i = 0; i < _my_num_apps; i++)
193  _end_solutions[i] =
195  }
196 
198 
200  {
201  for (unsigned int i = 0; i < _my_num_apps; i++)
203 
204  _end_solutions.clear();
205  }
206 }
207 
208 bool
209 TransientMultiApp::solveStep(Real dt, Real target_time, bool auto_advance)
210 {
211  if (!_has_an_app)
212  return true;
213 
214  _auto_advance = auto_advance;
215 
216  _console << COLOR_CYAN << "Solving MultiApp '" << name() << "' with target time " << target_time
217  << " and dt " << dt << " with auto-advance " << (auto_advance ? "on" : "off")
218  << COLOR_DEFAULT << std::endl;
219 
220  // "target_time" must always be in global time
221  target_time += _app.getGlobalTimeOffset();
222 
224  bool return_value = true;
225 
226  // Make sure we swap back the communicator regardless of how this routine is exited
227  try
228  {
229  int rank;
230  int ierr;
231  ierr = MPI_Comm_rank(_communicator.get(), &rank);
232  mooseCheckMPIErr(ierr);
233 
234  for (unsigned int i = 0; i < _my_num_apps; i++)
235  {
237 
239 
240  // The App might have a different local time from the rest of the problem
241  Real app_time_offset = _apps[i]->getGlobalTimeOffset();
242 
243  // Maybe this MultiApp was already solved
244  if ((ex->getTime() + app_time_offset + 2e-14 >= target_time) ||
245  (ex->getTime() >= ex->endTime()))
246  continue;
247 
248  if (_sub_cycling)
249  {
250  Real time_old = ex->getTime() + app_time_offset;
251 
253  {
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_old = libmesh_aux_system.get_vector("transfer_old");
259 
260  solution.close();
261 
262  // Save off the current auxiliary solution
263  transfer_old = solution;
264 
265  transfer_old.close();
266 
267  // Snag all of the local dof indices for all of these variables
268  AllLocalDofIndicesThread aldit(libmesh_aux_system, _transferred_vars);
269  ConstElemRange & elem_range = *problem.mesh().getActiveLocalElementRange();
270  Threads::parallel_reduce(elem_range, aldit);
271 
273  }
274 
275  // Disable/enable output for sub cycling
276  problem.allowOutput(_output_sub_cycles); // disables all outputs, including console
277  problem.allowOutput<Console>(_print_sub_cycles); // re-enables Console to print, if desired
278 
279  ex->setTargetTime(target_time - app_time_offset);
280 
281  // unsigned int failures = 0;
282 
283  bool at_steady = false;
284 
285  if (_first && !_app.isRecovering())
286  problem.advanceState();
287 
288  bool local_first = _first;
289 
290  // Now do all of the solves we need
291  while ((!at_steady && ex->getTime() + app_time_offset + 2e-14 < target_time) ||
292  !ex->lastSolveConverged())
293  {
294  if (local_first != true)
295  ex->incrementStepOrReject();
296 
297  local_first = false;
298 
299  ex->preStep();
300  ex->computeDT();
301 
303  {
304  // See what time this executioner is going to go to.
305  Real future_time = ex->getTime() + app_time_offset + ex->getDT();
306 
307  // How far along we are towards the target time:
308  Real step_percent = (future_time - time_old) / (target_time - time_old);
309 
310  Real one_minus_step_percent = 1.0 - step_percent;
311 
312  // Do the interpolation for each variable that was transferred to
314  AuxiliarySystem & aux_system = problem.getAuxiliarySystem();
315  System & libmesh_aux_system = aux_system.system();
316 
317  NumericVector<Number> & solution = *libmesh_aux_system.solution;
318  NumericVector<Number> & transfer = libmesh_aux_system.get_vector("transfer");
319  NumericVector<Number> & transfer_old = libmesh_aux_system.get_vector("transfer_old");
320 
321  solution.close(); // Just to be sure
322  transfer.close();
323  transfer_old.close();
324 
325  for (const auto & dof : _transferred_dofs)
326  {
327  solution.set(dof,
328  (transfer_old(dof) * one_minus_step_percent) +
329  (transfer(dof) * step_percent));
330  // solution.set(dof, transfer_old(dof));
331  // solution.set(dof, transfer(dof));
332  // solution.set(dof, 1);
333  }
334 
335  solution.close();
336  }
337 
338  ex->takeStep();
339 
340  bool converged = ex->lastSolveConverged();
341 
342  if (!converged)
343  {
344  mooseWarning(
345  "While sub_cycling ", name(), _first_local_app + i, " failed to converge!\n");
346 
347  _failures++;
348 
349  if (_failures > _max_failures)
350  {
351  std::stringstream oss;
352  oss << "While sub_cycling " << name() << _first_local_app << i << " REALLY failed!";
353  throw MultiAppSolveFailure(oss.str());
354  }
355  }
356 
357  Real solution_change_norm = ex->getSolutionChangeNorm();
358 
360  _console << "Solution change norm: " << solution_change_norm << std::endl;
361 
362  if (converged && _detect_steady_state && solution_change_norm < _steady_state_tol)
363  {
364  _console << "Detected Steady State! Fast-forwarding to " << target_time << std::endl;
365 
366  at_steady = true;
367 
368  // Indicate that the next output call (occurs in ex->endStep()) should output,
369  // regardless of intervals etc...
370  problem.forceOutput();
371 
372  // Clean up the end
373  ex->endStep(target_time - app_time_offset);
374  ex->postStep();
375  }
376  else
377  {
378  ex->endStep();
379  ex->postStep();
380  }
381  }
382 
383  // If we were looking for a steady state, but didn't reach one, we still need to output one
384  // more time, regardless of interval
385  // Note: if we turn off the output for all time steps for sub-scycling, we still need to
386  // have one output at the end.
387  if ((!at_steady && _detect_steady_state) || !_output_sub_cycles)
388  problem.outputStep(EXEC_FORCED);
389 
390  } // sub_cycling
391  else if (_tolerate_failure)
392  {
393  ex->takeStep(dt);
394  ex->endStep(target_time - app_time_offset);
395  ex->postStep();
396  }
397  else
398  {
399  if (_first && !_app.isRecovering())
400  problem.advanceState();
401 
402  if (auto_advance)
403  problem.allowOutput(true);
404 
405  ex->takeStep(dt);
406 
407  if (auto_advance)
408  {
409  ex->endStep();
410  ex->postStep();
411 
412  if (!ex->lastSolveConverged())
413  {
414  mooseWarning(name(), _first_local_app + i, " failed to converge!\n");
415 
416  if (_catch_up)
417  {
418  _console << "Starting Catch Up!" << std::endl;
419 
420  bool caught_up = false;
421 
422  unsigned int catch_up_step = 0;
423 
424  Real catch_up_dt = dt / 2;
425 
426  while (!caught_up && catch_up_step < _max_catch_up_steps)
427  {
428  _console << "Solving " << name() << " catch up step " << catch_up_step << std::endl;
429  ex->incrementStepOrReject();
430 
431  ex->computeDT();
432  ex->takeStep(catch_up_dt); // Cut the timestep in half to try two half-step solves
433  ex->endStep();
434 
435  if (ex->lastSolveConverged())
436  {
437  if (ex->getTime() + app_time_offset +
438  (ex->timestepTol() * std::abs(ex->getTime())) >=
439  target_time)
440  {
441  problem.outputStep(EXEC_FORCED);
442  caught_up = true;
443  }
444  }
445  else
446  catch_up_dt /= 2.0;
447 
448  ex->postStep();
449 
450  catch_up_step++;
451  }
452 
453  if (!caught_up)
454  throw MultiAppSolveFailure(name() + " Failed to catch up!\n");
455  }
456  }
457  }
458  else // auto_advance == false
459  {
460  if (!ex->lastSolveConverged())
461  {
462  // Even if we don't allow auto_advance - we can still catch up to the current time if
463  // possible
464  if (_catch_up)
465  {
466  _console << "Starting Catch Up!" << std::endl;
467 
468  bool caught_up = false;
469 
470  unsigned int catch_up_step = 0;
471 
472  Real catch_up_dt = dt / 2;
473 
474  // Note: this loop will _break_ if target_time is satisfied
475  while (catch_up_step < _max_catch_up_steps)
476  {
477  _console << "Solving " << name() << " catch up step " << catch_up_step << std::endl;
478  ex->incrementStepOrReject();
479 
480  ex->computeDT();
481  ex->takeStep(catch_up_dt); // Cut the timestep in half to try two half-step solves
482 
483  // This is required because we can't call endStep() yet
484  // (which normally increments time)
485  Real current_time = ex->getTime() + ex->getDT();
486 
487  if (ex->lastSolveConverged())
488  {
489  if (current_time + app_time_offset +
490  (ex->timestepTol() * std::abs(current_time)) >=
491  target_time)
492  {
493  caught_up = true;
494  break; // break here so that we don't run endStep() or postStep() since this
495  // MultiApp should NOT be auto_advanced
496  }
497  }
498  else
499  catch_up_dt /= 2.0;
500 
501  ex->endStep();
502  ex->postStep();
503 
504  catch_up_step++;
505  }
506 
507  if (!caught_up)
508  throw MultiAppSolveFailure(name() + " Failed to catch up!\n");
509  }
510  else
511  throw MultiAppSolveFailure(name() + " failed to converge");
512  }
513  }
514  }
515 
516  // Re-enable all output (it may of been disabled by sub-cycling)
517  problem.allowOutput(true);
518  }
519 
520  _first = false;
521 
522  _console << "Successfully Solved MultiApp " << name() << "." << std::endl;
523  }
524  catch (MultiAppSolveFailure & e)
525  {
526  mooseWarning(e.what());
527  _console << "Failed to Solve MultiApp " << name() << ", attempting to recover." << std::endl;
528  return_value = false;
529  }
530 
531  _transferred_vars.clear();
532 
533  return return_value;
534 }
535 
536 void
538 {
539  if (!_sub_cycling)
540  {
541  for (unsigned int i = 0; i < _my_num_apps; i++)
542  {
544 
545  // The App might have a different local time from the rest of the problem
546  Real app_time_offset = _apps[i]->getGlobalTimeOffset();
547 
548  // Only increment the step if we are after (target_time) the
549  // start_time (app_time_offset) of this sub_app.
550  if (app_time_offset < target_time)
551  ex->incrementStepOrReject();
552  }
553  }
554 }
555 
556 void
558 {
559  if (!_sub_cycling)
560  {
561  for (unsigned int i = 0; i < _my_num_apps; i++)
562  {
564  ex->endStep();
565  ex->postStep();
566  }
567  }
568 }
569 
570 bool
572 {
574 }
575 
576 Real
578 {
579  if (_sub_cycling) // Bow out of the timestep selection dance
580  return std::numeric_limits<Real>::max();
581 
582  Real smallest_dt = std::numeric_limits<Real>::max();
583 
584  if (_has_an_app)
585  {
587 
588  for (unsigned int i = 0; i < _my_num_apps; i++)
589  {
591  ex->computeDT();
592  Real dt = ex->getDT();
593 
594  smallest_dt = std::min(dt, smallest_dt);
595  }
596  }
597 
598  if (_tolerate_failure) // Bow out of the timestep selection dance, we do this down here because we
599  // need to call computeConstrainedDT at least once for these
600  // executioners...
601  return std::numeric_limits<Real>::max();
602 
603  _communicator.min(smallest_dt);
604  return smallest_dt;
605 }
606 
608  unsigned int global_app,
609  Real /*time*/) // FIXME: Note that we are passing in time but also grabbing it below
610 {
611  if (hasLocalApp(global_app))
612  {
613  unsigned int local_app = globalAppToLocal(global_app);
614 
615  // Grab the current time the App is at so we can start the new one at the same place
616  Real time =
617  _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset();
618 
619  // Reset the Multiapp
620  MultiApp::resetApp(global_app, time);
621 
623 
624  // Setup the app, disable the output so that the initial condition does not output
625  // When an app is reset the initial condition was effectively already output before reset
626  FEProblemBase & problem = appProblemBase(local_app);
627  problem.allowOutput(false);
628  setupApp(local_app, time);
629  problem.allowOutput(true);
630  }
631 }
632 
633 void TransientMultiApp::setupApp(unsigned int i, Real /*time*/) // FIXME: Should we be passing time?
634 {
635  auto & app = _apps[i];
636  Transient * ex = dynamic_cast<Transient *>(app->getExecutioner());
637  if (!ex)
638  mooseError("MultiApp ", name(), " is not using a Transient Executioner!");
639 
640  // Get the FEProblemBase for the current MultiApp
642 
643  // Update the file numbers for the outputs from the parent application
644  app->getOutputWarehouse().setFileNumbers(_app.getOutputFileNumbers());
645 
646  // Call initialization method of Executioner (Note, this preforms the output of the initial time
647  // step, if desired)
648  ex->init();
649 
651  {
652  AuxiliarySystem & aux_system = problem.getAuxiliarySystem();
653  System & libmesh_aux_system = aux_system.system();
654 
655  // We'll store a copy of the auxiliary system's solution at the old time in here
656  libmesh_aux_system.add_vector("transfer_old", false);
657 
658  // This will be where we'll transfer the value to for the "target" time
659  libmesh_aux_system.add_vector("transfer", false);
660  }
661 
662  ex->preExecute();
663  if (!_app.isRecovering())
664  {
665  problem.timeStep()++;
666  problem.advanceState();
667  }
668  _transient_executioners[i] = ex;
669 }
bool hasLocalApp(unsigned int global_app)
Whether or not the given global app number is on this processor.
Definition: MultiApp.C:535
virtual NumericVector< Number > & appTransferVector(unsigned int app, std::string var_name) override
Get the vector to transfer to for this MultiApp.
Utility class for catching solve failure errors so that MOOSE can recover state before continuing...
virtual Real getDT()
Definition: Transient.C:552
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:737
virtual void restore()
Restore the state of every Sub App.
Definition: MultiApp.C:409
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:30
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
virtual void finishStep() override
Calls multi-apps executioners&#39; endStep and postStep methods which creates output and advances time (n...
bool _print_sub_cycles
Flag for toggling console output on sub cycles.
const ExecFlagType EXEC_FORCED
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:620
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:155
virtual void computeDT()
Definition: Transient.C:343
An output object for writing to the console (screen)
Definition: Console.h:24
virtual void restore() override
Restore the state of every Sub App.
unsigned int _max_failures
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
Definition: MultiApp.h:373
virtual void init() override
Initialize the executioner.
Definition: Transient.C:205
FEProblemBase & feProblem()
Return a reference to this Executioner&#39;s FEProblemBase instance.
Definition: Executioner.C:68
void setupApp(unsigned int i, Real time=0.0)
Setup the executioner for the local app.
virtual void endStep(Real input_time=-1.0)
Definition: Transient.C:441
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void resetApp(unsigned int global_app, Real time) override
"Reset" the App corresponding to the global App number passed in.
MultiApp Implementation for Transient Apps.
std::vector< std::unique_ptr< NumericVector< Real > > > _end_solutions
The solution from the end of the previous solve, this is cloned from the Nonlinear solution during re...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
void paramInfo(const std::string &param, Args... args)
Emits an informational message prefixed with the file and line number of the given param (from the in...
Definition: MooseObject.h:138
InputParameters validParams< TransientMultiApp >()
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual Real getTime()
Get the current time.
Definition: Transient.h:97
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...
virtual void takeStep(Real input_dt=-1.0)
Do whatever is necessary to advance one step.
Definition: Transient.C:399
virtual bool lastSolveConverged() const override
Whether or not the last solve converged.
Definition: Transient.C:608
std::set< dof_id_type > _all_dof_indices
TransientMultiApp(const InputParameters &parameters)
InputParameters validParams< MultiApp >()
Definition: MultiApp.C:43
virtual bool needsRestoration() override
Whether or not this MultiApp should be restored at the beginning of each Picard iteration.
std::set< dof_id_type > _transferred_dofs
The DoFs associated with all of the currently transferred variables.
NumericVector< Number > & solution() override
FEProblemBase & appProblemBase(unsigned int app)
Get the FEProblemBase for the global app is part of.
Definition: MultiApp.C:487
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:349
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:552
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
virtual int & timeStep() const
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
Definition: MultiApp.h:346
bool _has_an_app
Whether or not this processor as an App at all
Definition: MultiApp.h:418
NumericVector< Number > & solution() override
void paramError(const std::string &param, Args... args)
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseObject.h:108
Real computeDT()
Finds the smallest dt from among any of the apps.
virtual void preExecute() override
Override this for actions that should take place before execution.
Definition: Transient.C:262
std::map< std::string, unsigned int > & getOutputFileNumbers()
Store a map of outputter names and file numbers The MultiApp system requires this to get the file num...
Definition: MooseApp.h:412
unsigned int _first_local_app
The number of the first app on this processor.
Definition: MultiApp.h:349
Real & endTime()
Get the end time.
Definition: Transient.h:166
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
Definition: MultiApp.C:233
Real & timestepTol()
Get the timestep tolerance.
Definition: Transient.h:172
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:177
virtual MooseMesh & mesh() override
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
virtual void preStep()
Definition: Transient.C:289
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
ierr
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void postStep()
Definition: Transient.C:295
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:57
virtual NonlinearSystem & getNonlinearSystem()
registerMooseObject("MooseApp", TransientMultiApp)
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:859
Real getGlobalTimeOffset() const
Each App has it&#39;s own local time.
Definition: MooseApp.h:229
MPI_Comm & _my_comm
The MPI communicator this object is going to use.
Definition: MultiApp.h:358
A system that holds auxiliary variables.
InputParameters validParams< TransientInterface >()
virtual Executioner * getExecutioner(unsigned int app)
Definition: MultiApp.C:366
virtual void incrementTStep(Real target_time) override
Advances the multi-apps time step which is important for dt selection.
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:626
virtual bool solveStep(Real dt, Real target_time, bool auto_advance=true) override
Re-solve all of the Apps.
unsigned int globalAppToLocal(unsigned int global_app)
Map a global App number to the local number.
Definition: MultiApp.C:797