https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PostprocessorAsControlAction.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
11#include "Simulation.h"
12#include "THMProblem.h"
13
14registerMooseAction("ThermalHydraulicsApp", PostprocessorAsControlAction, "add_postprocessor");
15
18{
21 "This action adds a control object that copies a postprocessor value into the control "
22 "system so that users can work with the postprocessor name directly.");
23 return params;
24}
25
30
31void
33{
34 THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
35 if (thm_problem)
36 {
37 const std::string class_name = "THMAddControlAction";
39 params.set<std::string>("type") = "CopyPostprocessorValueControl";
40
41 std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
42 _action_factory.create(class_name, _name + "_copy_ctrl", params));
43
44 action->getObjectParams().set<PostprocessorName>("postprocessor") = _name;
45
46 _awh.addActionBlock(action);
47 }
48}
registerMooseAction("ThermalHydraulicsApp", PostprocessorAsControlAction, "add_postprocessor")
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name)
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< FEProblemBase > & _problem
ActionWarehouse & _awh
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const std::string & _name
static InputParameters validParams()
ActionFactory & _action_factory
This action creates a control value named the same as the postprocessor being added.
PostprocessorAsControlAction(const InputParameters &params)
Specialization of FEProblem to run with component subsystem.
Definition THMProblem.h:19