www.mooseframework.org
DetermineSystemType.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 "DetermineSystemType.h"
16 #include "MooseApp.h"
17 
18 template <>
21 {
23  params.mooseObjectSyntaxVisibility(false);
24  return params;
25 }
26 
28 {
29 }
30 
31 void
33 {
38  if (_moose_object_pars.isParamValid("_eigen") && _moose_object_pars.get<bool>("_eigen"))
39  _app.useNonlinear() = false;
40 
41  auto _action_params = _action_factory.getValidParams("CreateProblemAction");
42 
43  if (_moose_object_pars.isParamValid("_use_eigen_value") &&
44  _moose_object_pars.get<bool>("_use_eigen_value"))
45  {
46  _app.useEigenvalue() = true;
47  _action_params.set<std::string>("type") = "EigenProblem";
48  }
49  else
50  {
51  _action_params.set<std::string>("type") = "FEProblem";
52  }
53 
54  // if we have Problem block in input file, "CreateProblemAction" will be handled by parser
55  if (_awh.hasActions("create_problem"))
56  return;
57 
58  // Create "CreateProblemAction"
59  auto action = _action_factory.create(
60  "CreateProblemAction", _action_params.get<std::string>("type"), _action_params);
61 
62  // Add the action to the warehouse
63  _awh.addActionBlock(action);
64 }
bool & useNonlinear()
Set a Boolean indicating whether this app will use a Nonlinear or Eigen System.
Definition: MooseApp.h:243
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
Definition: Action.h:122
ActionFactory & _action_factory
Builds Actions.
Definition: Action.h:104
void mooseObjectSyntaxVisibility(bool visibility)
Mutators for controlling whether or not the outermost level of syntax will be collapsed when printed...
InputParameters getValidParams(const std::string &name)
Definition: ActionFactory.C:74
InputParameters validParams< DetermineSystemType >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addActionBlock(std::shared_ptr< Action > blk)
This method add an Action instance to the warehouse.
bool hasActions(const std::string &task) const
Check if Actions associated with passed in task exist.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
bool & useEigenvalue()
Set a Boolean indicating whether this app will use an eigenvalue executioner.
Definition: MooseApp.h:248
InputParameters validParams< MooseObjectAction >()
InputParameters _moose_object_pars
The parameters for the object to be created.
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters parameters)
Definition: ActionFactory.C:26
virtual void act() override
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:98
DetermineSystemType(InputParameters parameters)