www.mooseframework.org
SetupTimeStepperAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "SetupTimeStepperAction.h"
16 #include "Transient.h"
17 #include "Factory.h"
18 #include "TimeStepper.h"
19 
20 template <>
23 {
25 
26  return params;
27 }
28 
30  : MooseObjectAction(parameters)
31 {
32 }
33 
34 void
36 {
37  if (_problem->isTransient())
38  {
39  Transient * transient = dynamic_cast<Transient *>(_executioner.get());
40  if (transient == NULL)
41  mooseError("You can setup time stepper only with executioners of transient type.");
42 
43  _moose_object_pars.set<FEProblemBase *>("_fe_problem_base") = _problem.get();
44  _moose_object_pars.set<Transient *>("_executioner") = transient;
45  std::shared_ptr<TimeStepper> ts =
47  transient->setTimeStepper(ts);
48  }
49 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:46
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
virtual void act() override
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for time stepping.
Definition: TimeStepper.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Factory & _factory
The Factory associated with the MooseApp.
Definition: Action.h:101
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< Executioner > & _executioner
Convenience reference to an executioner.
Definition: Action.h:134
InputParameters validParams< MooseObjectAction >()
std::string _type
The Object type that is being created.
InputParameters _moose_object_pars
The parameters for the object to be created.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:131
SetupTimeStepperAction(InputParameters parameters)
InputParameters validParams< SetupTimeStepperAction >()