https://mooseframework.inl.gov
BooleanValueTestAux.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 "BooleanValueTestAux.h"
11 
12 registerMooseObject("ThermalHydraulicsTestApp", BooleanValueTestAux);
13 
16 {
18  params.addRequiredParam<bool>("value", "Boolean value to convert into real.");
19  params.addClassDescription(
20  "Takes a boolean value and converts it into a Real value (0 for false, 1 for true)");
21  params.declareControllable("value");
22  return params;
23 }
24 
26  : AuxKernel(parameters), _value(getParam<bool>("value"))
27 {
28 }
29 
30 Real
32 {
33  if (_value)
34  return 1.;
35  else
36  return 0.;
37 }
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeValue() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ThermalHydraulicsTestApp", BooleanValueTestAux)
Takes a boolean value and converts it into a Real value (0 for false, 1 for true) ...
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
BooleanValueTestAux(const InputParameters &parameters)
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})