https://mooseframework.inl.gov
BoolComponentParameterValuePostprocessor.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 "ControllableParameter.h"
13 
15 
18 {
20  params.addRequiredParam<std::string>("component", "The name of the component to be controlled.");
21  params.addRequiredParam<std::string>(
22  "parameter", "The name of the parameter in the component to be controlled.");
23  params.addClassDescription(
24  "Postprocessor for reading a boolean value from the control logic system.");
25  return params;
26 }
27 
29  const InputParameters & parameters)
30  : GeneralPostprocessor(parameters),
31  _input_parameter_warehouse(_app.getInputParameterWarehouse()),
32  _component_name(getParam<std::string>("component")),
33  _param_name(getParam<std::string>("parameter")),
34  _ctrl_param_name("component/" + _component_name + "/" + _param_name)
35 {
36  std::vector<bool> values =
38  if (values.size() == 0)
39  paramError("component",
40  "Either component '",
42  "' does not exist or parameter '",
44  "' does not exist in that component.");
45 }
46 
47 void
49 {
50 }
51 
52 void
54 {
55  std::vector<bool> values =
57 
58  _value = values[0];
59 }
60 
61 Real
63 {
64  return _value;
65 }
const std::string & _component_name
The name of the component we read the value from.
bool _value
The value of the boolean parameter in component &#39;_component_name&#39;.
const std::string & _param_name
The name of boolean parameter.
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", BoolComponentParameterValuePostprocessor)
static InputParameters validParams()
MooseObjectParameterName _ctrl_param_name
The name of the control parameter in MOOSE.
void paramError(const std::string &param, Args... args) const
BoolComponentParameterValuePostprocessor(const InputParameters &parameters)
Postprocessor for reading a boolean value from the control logic system.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
std::vector< T > getControllableParameterValues(const MooseObjectParameterName &input) const