39 std::vector<TimeStepper *> timesteppers;
43 if (timesteppers.empty())
45 const auto ts_name =
"ConstantDT";
49 if (!transient->parameters().isParamSetByAddParam(
"end_time") &&
50 !transient->parameters().isParamSetByAddParam(
"num_steps") &&
51 transient->parameters().isParamSetByAddParam(
"dt"))
52 params.set<Real>(
"dt") =
53 (transient->getParam<Real>(
"end_time") - transient->getParam<Real>(
"start_time")) /
54 static_cast<Real
>(transient->getParam<
unsigned int>(
"num_steps"));
56 params.set<Real>(
"dt") = transient->getParam<Real>(
"dt");
58 params.set<
bool>(
"reset_dt") = transient->getParam<
bool>(
"reset_dt");
62 transient->setTimeStepper(*ts);
70 if (!no_time_stepper || !no_time_steppers)
72 std::vector<TimeStepper *> timesteppers;
76 .queryInto(timesteppers);
78 mooseAssert(timesteppers.size(),
"Timesteppers not found");
80 if (timesteppers.size() == 1)
81 transient->setTimeStepper(*timesteppers[0]);
83 for (
auto ts : timesteppers)
85 transient->setTimeStepper(*ts);
87 mooseAssert(transient->getTimeStepper(),
"Not set");
91 if (!no_time_stepper && !no_time_steppers)
92 mooseError(
"Both [TimeStepper] and [TimeSteppers] are used to setup the time stepper. The "
93 "[TimeStepper] block will be ignored. Note [TimeStepper] will be deprecated "
94 "soon. Please consider [TimeSteppers] for future use.");
registerMooseAction("MooseApp", SetupTimeStepperAction, "setup_time_steppers")
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
A TimeStepper that takes time steppers as inputs and computes the minimum time step size among all ti...
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
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...
Factory & _factory
The Factory associated with the MooseApp.
Set up the final time stepper for the simulation.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
SetupTimeStepperAction(const InputParameters ¶meters)
static InputParameters validParams()
Base class for time stepping.
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...