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)
84 if (dynamic_cast<CompositionDT *>(ts))
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.");
Transient executioners usually loop through a number of timesteps...
static InputParameters validParams()
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Base class for time stepping.
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
Factory & _factory
The Factory associated with the MooseApp.
static InputParameters validParams()
registerMooseAction("MooseApp", SetupTimeStepperAction, "setup_time_steppers")
MooseApp & _app
The MOOSE application this is associated with.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
SetupTimeStepperAction(const InputParameters ¶meters)
Set up the final time stepper for the simulation.