21 "Action to create shortcut syntax-specified checkpoints and automatic checkpoints.");
23 params.
addParam<
bool>(
"checkpoint",
"Create checkpoint files using the default options.");
35 const auto num_checkpoints = checkpoints.size();
37 const bool user_specified_checkpoint_behavior =
isParamValid(
"checkpoint");
38 const bool user_requested_checkpoint =
39 user_specified_checkpoint_behavior && getParam<bool>(
"checkpoint");
40 const bool user_requested_no_checkpoint =
41 user_specified_checkpoint_behavior && (getParam<bool>(
"checkpoint") ==
false);
43 if (num_checkpoints > 1)
44 checkpoints[0]->mooseError(
"Multiple Checkpoint objects are not allowed and there is more than " 45 "one Checkpoint defined in the 'Outputs' block.");
46 if (num_checkpoints == 1 && user_requested_checkpoint)
48 "Shortcut checkpoint syntax cannot be used with another Checkpoint object in the " 51 if (num_checkpoints == 0 &&
57 cp_params.
set<
bool>(
"_built_by_moose") =
true;
58 if (!user_requested_checkpoint)
61 cp_params.set<
unsigned int>(
"time_step_interval",
true) =
64 _problem->addOutput(
"Checkpoint",
"checkpoint", cp_params);
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
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.
auto max(const L &left, const R &right)
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")
unsigned int _time_step_interval
The output time step interval.
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.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.