www.mooseframework.org
SetupPredictorAction.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 // MOOSE includes
16 #include "SetupPredictorAction.h"
17 #include "Transient.h"
18 #include "Predictor.h"
19 #include "Factory.h"
20 #include "NonlinearSystemBase.h"
21 
22 template <>
25 {
27 
28  return params;
29 }
30 
32  : MooseObjectAction(parameters)
33 {
34 }
35 
36 void
38 {
39  if (_problem->isTransient())
40  {
41  Transient * transient = dynamic_cast<Transient *>(_executioner.get());
42  if (transient == NULL)
43  mooseError("You can setup time stepper only with executioners of transient type.");
44 
45  _moose_object_pars.set<FEProblemBase *>("_fe_problem_base") = _problem.get();
46  _moose_object_pars.set<Transient *>("_executioner") = transient;
47  std::shared_ptr<Predictor> predictor =
49  _problem->getNonlinearSystemBase().setPredictor(predictor);
50  }
51 }
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
virtual void act() override
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
Base class for predictors.
Definition: Predictor.h:39
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.
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.
InputParameters validParams< SetupPredictorAction >()
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
SetupPredictorAction(InputParameters parameters)