17 #include "libmesh/mesh_tools.h" 27 "no_backup_and_restore",
29 "True to turn off backup/restore for this multiapp. This is useful when doing steady-state " 30 "Picard iterations where we want to use the solution of previous Picard iteration as the " 31 "initial guess of the current Picard iteration");
33 "keep_full_output_history",
35 "Whether or not to keep the full output history when this multiapp has multiple entries");
36 params.
addParam<
bool>(
"ignore_solve_not_converge",
38 "True to continue main app even if a sub app's solve does not converge.");
43 :
MultiApp(parameters), _ignore_diverge(getParam<bool>(
"ignore_solve_not_converge"))
50 if (getParam<bool>(
"no_backup_and_restore"))
59 if (getParam<bool>(
"no_backup_and_restore"))
79 auto & app =
_apps[i];
89 mooseError(
"Requesting to ignore failed solutions, but 'Executioner/error_on_dtmin' is " 90 "true in sub-application. Set this parameter to false in sub-application to " 91 "avoid an error if Transient solve fails.");
105 mooseError(
"FullSolveMultiApp is not compatible with auto_advance=false");
117 mooseCheckMPIErr(
ierr);
119 bool last_solve_converged =
true;
123 if (!getParam<bool>(
"keep_full_output_history"))
124 _apps[i]->getOutputWarehouse().reset();
141 _apps[i]->getOutputWarehouse().getOutputs<
Console>().size() > 0)
144 _console << COLOR_RED <<
"Subapp " <<
_apps[i]->
name() <<
" solve Did NOT Converge!" 145 << COLOR_DEFAULT << std::endl;
147 _console << COLOR_GREEN <<
"Subapp " <<
_apps[i]->name() <<
" solve converged!" << COLOR_DEFAULT
Transient executioners usually loop through a number of timesteps...
virtual void initialSetup() override
Method to be called in main-app initial setup for create sub-apps if using positions is false...
virtual void restore(bool force=true)
Restore the state of every Sub App.
virtual void backup()
Save off the state of every Sub App.
bool verboseMultiApps() const
Whether or not to use verbose printing for MultiApps.
virtual void init()
Initialize the executioner.
An output object for writing to the console (screen)
const PerfID _solve_step_timer
Timers.
std::vector< std::shared_ptr< MooseApp > > _apps
Pointers to each of the Apps.
const Parallel::Communicator & _communicator
FEProblemBase & _fe_problem
The FEProblemBase this MultiApp is part of.
virtual const std::string & name() const
Get the name of the class.
const bool _ignore_diverge
Switch to tell executioner to keep going despite app solve not converging.
virtual void execute()=0
Pure virtual execute function MUST be overridden by children classes.
FullSolveMultiApp(const InputParameters ¶meters)
std::vector< Executioner * > _executioners
virtual void backup() override
Save off the state of every Sub App.
Executioners are objects that do the actual work of solving your problem.
static InputParameters validParams()
unsigned int _my_num_apps
The number of apps this object is involved in simulating.
bool _has_an_app
Whether or not this processor as an App at all
registerMooseObject("MooseApp", FullSolveMultiApp)
virtual void initialSetup() override
Method to be called in main-app initial setup for create sub-apps if using positions is false...
virtual void restore(bool force=true) override
Restore the state of every Sub App.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void showStatusMessage(unsigned int i) const
This function is called after each sub-application solve and is meant to display information about th...
const InputParameters & parameters() const
Get the parameters of the object.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual bool lastSolveConverged() const =0
Whether or not the last solve converged.
static InputParameters validParams()
A MultiApp represents one or more MOOSE applications that are running simultaneously.
virtual bool solveStep(Real dt, Real target_time, bool auto_advance=true) override
Re-solve all of the Apps.
MPI_Comm & _my_comm
The MPI communicator this object is going to use.
This type of MultiApp will do a full solve when it is asked to take a step.