https://mooseframework.inl.gov
BoolControlDataValuePostprocessor.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 "THMProblem.h"
12 
14 
17 {
19  params.addClassDescription("Output the value of a boolean ControlData as a postprocessor");
20  params.addRequiredParam<std::string>("control_data_name",
21  "The name of the control data to output.");
22  return params;
23 }
24 
26  const InputParameters & parameters)
27  : GeneralPostprocessor(parameters), _control_data_name(getParam<std::string>("control_data_name"))
28 {
29  THMProblem * thm_problem =
30  dynamic_cast<THMProblem *>(getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"));
31  if (thm_problem)
32  {
33  _thm_problem = thm_problem;
35  }
36  else
37  mooseError(name(),
38  ": Cannot use BoolControlDataValuePostprocessor without the component system.");
39 }
40 
41 void
43 {
44 }
45 
46 void
48 {
49 }
50 
51 Real
53 {
54  if (_control_data_value->get())
55  return 1.;
56  else
57  return 0.;
58 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
const T & get() const
Definition: ControlData.h:108
BoolControlDataValuePostprocessor(const InputParameters &parameters)
registerMooseObject("ThermalHydraulicsApp", BoolControlDataValuePostprocessor)
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
const ControlData< bool > * _control_data_value
The boolean value of the control data.
static InputParameters validParams()
const std::string & _control_data_name
The name of the control data value.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ControlData< T > * getControlData(const std::string &name)
Get control data of type T and name &#39;name&#39;, if it does not exist it will be created.
Definition: Simulation.h:290
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
Reads a boolean control value data and prints it out.