21 "Action to create shortcut syntax-specified checkpoints and automatic checkpoints.");
23 params.
addParam<
bool>(
"checkpoint",
false,
"Create checkpoint files using the default options.");
24 params.
addParam<
bool>(
"wall_time_checkpoint",
26 "Enables the output of checkpoints based on elapsed wall time.");
38 const auto num_checkpoints = checkpoints.size();
40 const bool shortcut_syntax = getParam<bool>(
"checkpoint");
42 if (num_checkpoints > 1)
43 checkpoints[0]->
mooseError(
"Multiple Checkpoint objects are not allowed and there is more than " 44 "one Checkpoint defined in the 'Outputs' block.");
45 if (num_checkpoints == 1 && shortcut_syntax)
47 "Shortcut checkpoint syntax cannot be used with another Checkpoint object in the " 50 if (num_checkpoints == 0)
55 cp_params.
set<
bool>(
"_built_by_moose") =
true;
56 cp_params.set<
bool>(
"wall_time_checkpoint") = getParam<bool>(
"wall_time_checkpoint");
65 _problem->addOutput(
"Checkpoint",
"checkpoint", cp_params);
75 checkpoint->_time_step_interval = 1;
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
CheckpointType
Enumerated type for determining what type of checkpoint this is.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Factory & _factory
The Factory associated with the MooseApp.
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
std::vector< T * > getOutputs(const std::vector< OutputName > &names)
Return a vector of objects by names.
AutoCheckpointAction(const InputParameters ¶ms)
static InputParameters validParams()
static InputParameters validParams()
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
MooseApp & _app
The MOOSE application this is associated with.
registerMooseAction("MooseApp", AutoCheckpointAction, "auto_checkpoint_action")
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
void setAutosaveFlag(CheckpointType flag)
Sets the autosave flag manually if the object has already been initialized.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.