https://mooseframework.inl.gov
THMAddControlAction.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "THMAddControlAction.h"
11 #include "THMProblem.h"
12 #include "FEProblem.h"
13 #include "Factory.h"
14 #include "Control.h"
15 #include "THMControl.h"
16 
17 registerMooseAction("ThermalHydraulicsApp", THMAddControlAction, "THM:add_control_logic");
18 
21 {
23  params.addClassDescription("Adds Controls from the ControlLogic block.");
24  return params;
25 }
26 
28  : AddControlAction(parameters)
29 {
30 }
31 
32 void
34 {
35  THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
36  if (thm_problem)
37  {
38  _moose_object_pars.addPrivateParam<FEProblemBase *>("_fe_problem_base", _problem.get());
39  _moose_object_pars.addPrivateParam<THMProblem *>("_thm_problem", thm_problem);
40  std::shared_ptr<Control> control = _factory.create<Control>(_type, _name, _moose_object_pars);
41  _problem->getControlWarehouse().addObject(control);
42  }
43  else
45 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
void addPrivateParam(const std::string &name, const T &value)
static InputParameters validParams()
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
registerMooseAction("ThermalHydraulicsApp", THMAddControlAction, "THM:add_control_logic")
Factory & _factory
Action for adding THM control objects.
const std::string _name
virtual void act() override
std::string _type
InputParameters _moose_object_pars
void addClassDescription(const std::string &doc_string)
std::shared_ptr< FEProblemBase > & _problem
virtual void act() override
THMAddControlAction(const InputParameters &parameters)
Class constructor.
static InputParameters validParams()