https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
UnitTripControl Class Reference

This control block uses a user-defined condition to determine if a trip happened. More...

#include <UnitTripControl.h>

Inheritance diagram for UnitTripControl:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 UnitTripControl (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void init () override
 
virtual void execute () override
 
const std::vector< std::string > & getControlDataDependencies () const
 Return the Controls that must run before this Control. More...
 
std::vector< std::string > & getDependencies ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
PerfGraphperfGraph ()
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static MultiMooseEnum getExecuteOptions ()
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

void buildConditionFunction ()
 Build the function that is used to evaluate the condition of this trip control. More...
 
template<typename T >
T & declareComponentControlData (const std::string &data_name)
 Declare control data with name 'component:data_name'. More...
 
template<typename T >
T & declareControlData (const std::string &data_name)
 Declare control data with name 'data_name'. More...
 
template<typename T >
const T & getControlData (const std::string &param_name)
 Get a reference to control data that are specified in the input parameter 'param_name'. More...
 
template<typename T >
const T & getControlDataOld (const std::string &param_name)
 Get a reference to control data value from a previous time step that is specified in the input parameter 'param_name'. More...
 
template<typename T >
const T & getControlDataByName (const std::string &data_name)
 Get a reference to control data that are specified by 'data_name' name. More...
 
template<typename T >
const T & getControlDataOldByName (const std::string &data_name)
 Get a reference to control data value from previous time step that is specified by 'data_name' name. More...
 
template<typename T >
const T & getComponentControlDataOld (const std::string &data_name)
 Get a reference to a component control data value from previous time step. More...
 
bool hasControllableParameterByName (const std::string &name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
virtual void addUserObjectDependencyHelper (const UserObject &) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
const std::string verifyFunction (const std::string &function_str)
 

Protected Attributes

std::string _condition
 The user-defined condition. More...
 
bool & _state
 The state of this control object. More...
 
const bool & _latch
 Determines if the state of the trip should stay true for the rest of the simulation after the trip happened. More...
 
bool _tripped
 true if the trip happened, otherwise false More...
 
std::unique_ptr< THMParsedFunctionWrapper_condition_ptr
 Pointer to the Parsed function wrapper object. More...
 
THMProblem_sim
 
std::vector< std::string > _control_data_depends_on
 A list of control data that are required to run before this control may run. More...
 
FEProblemBase_fe_problem
 
std::vector< std::string > _depends_on
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
const Parallel::Communicator & _communicator
 
FEProblemBase_pfb_feproblem
 
const std::vector< std::string > _vars
 
const std::vector< std::string > _vals
 
std::unique_ptr< MooseParsedFunctionWrapper_function_ptr
 

Detailed Description

This control block uses a user-defined condition to determine if a trip happened.

Definition at line 20 of file UnitTripControl.h.

Constructor & Destructor Documentation

◆ UnitTripControl()

UnitTripControl::UnitTripControl ( const InputParameters parameters)

Definition at line 33 of file UnitTripControl.C.

36  _condition(verifyFunction(getParam<std::string>("condition"))),
37  _state(declareComponentControlData<bool>("state")),
38  _latch(getParam<bool>("latch")),
39  _tripped(false)
40 {
41 }
THMControl(const InputParameters &parameters)
Definition: THMControl.C:23
const bool & _latch
Determines if the state of the trip should stay true for the rest of the simulation after the trip ha...
std::string _condition
The user-defined condition.
bool _tripped
true if the trip happened, otherwise false
const std::string verifyFunction(const std::string &function_str)
const InputParameters & parameters() const
bool & _state
The state of this control object.
MooseParsedFunctionBase(const InputParameters &parameters)

Member Function Documentation

◆ buildConditionFunction()

void UnitTripControl::buildConditionFunction ( )
protected

Build the function that is used to evaluate the condition of this trip control.

Definition at line 44 of file UnitTripControl.C.

Referenced by init(), and initialSetup().

45 {
46  if (!_condition_ptr)
47  {
48  THREAD_ID tid = 0;
49  if (isParamValid("_tid"))
50  tid = getParam<THREAD_ID>("_tid");
51 
52  _condition_ptr = std::make_unique<THMParsedFunctionWrapper>(
54  }
55 }
FEProblemBase & _pfb_feproblem
const std::vector< std::string > _vals
bool isParamValid(const std::string &name) const
std::string _condition
The user-defined condition.
std::unique_ptr< THMParsedFunctionWrapper > _condition_ptr
Pointer to the Parsed function wrapper object.
THMProblem * _sim
Definition: THMControl.h:90
const std::vector< std::string > _vars
unsigned int THREAD_ID

◆ declareComponentControlData()

template<typename T >
T & THMControl::declareComponentControlData ( const std::string &  data_name)
protectedinherited

Declare control data with name 'component:data_name'.

Parameters
data_nameA unique name for the control data

Definition at line 101 of file THMControl.h.

102 {
103  std::string full_name = name() + ":" + data_name;
104  ControlData<T> * data_ptr = _sim->declareControlData<T>(full_name, this);
105  return data_ptr->set();
106 }
virtual const std::string & name() const
Concrete definition of a parameter value for a specified type.
Definition: ControlData.h:91
ControlData< T > * declareControlData(const std::string &name, THMControl *ctrl)
Declare control data of type T and name &#39;name&#39;, if it does not exist it will be created.
Definition: Simulation.h:311
THMProblem * _sim
Definition: THMControl.h:90

◆ declareControlData()

template<typename T >
T & THMControl::declareControlData ( const std::string &  data_name)
protectedinherited

Declare control data with name 'data_name'.

Parameters
data_nameA unique name for the control data

Definition at line 110 of file THMControl.h.

111 {
112  ControlData<T> * data_ptr = _sim->declareControlData<T>(data_name, this);
113  return data_ptr->set();
114 }
Concrete definition of a parameter value for a specified type.
Definition: ControlData.h:91
ControlData< T > * declareControlData(const std::string &name, THMControl *ctrl)
Declare control data of type T and name &#39;name&#39;, if it does not exist it will be created.
Definition: Simulation.h:311
THMProblem * _sim
Definition: THMControl.h:90

◆ execute()

void UnitTripControl::execute ( )
overridevirtual

Implements Control.

Definition at line 76 of file UnitTripControl.C.

77 {
78  if (_latch && _tripped)
79  {
80  _state = true;
81  return;
82  }
83 
84  Real result = _condition_ptr->evaluate(_t, Point(0., 0., 0.));
85  if (result == 0.)
86  _state = false;
87  else if (result == 1.)
88  {
89  _state = true;
90  _tripped = true;
91  }
92  else
93  mooseError(name(),
94  ": The user-provided condition expression did not return a boolean value (0 or 1).");
95 }
const bool & _latch
Determines if the state of the trip should stay true for the rest of the simulation after the trip ha...
virtual const std::string & name() const
bool _tripped
true if the trip happened, otherwise false
Real & _t
std::unique_ptr< THMParsedFunctionWrapper > _condition_ptr
Pointer to the Parsed function wrapper object.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
bool & _state
The state of this control object.

◆ getComponentControlDataOld()

template<typename T >
const T & THMControl::getComponentControlDataOld ( const std::string &  data_name)
protectedinherited

Get a reference to a component control data value from previous time step.

Parameters
data_nameThe name of the control data

Definition at line 165 of file THMControl.h.

166 {
167  std::string full_name = name() + ":" + data_name;
168  return getControlDataOldByName<T>(full_name);
169 }
virtual const std::string & name() const

◆ getControlData()

template<typename T >
const T & THMControl::getControlData ( const std::string &  param_name)
protectedinherited

Get a reference to control data that are specified in the input parameter 'param_name'.

Parameters
param_nameThe parameter name that contains the name of the control data

Definition at line 118 of file THMControl.h.

119 {
120  std::string data_name = getParam<std::string>(param_name);
121  return getControlDataByName<T>(data_name);
122 }

◆ getControlDataByName()

template<typename T >
const T & THMControl::getControlDataByName ( const std::string &  data_name)
protectedinherited

Get a reference to control data that are specified by 'data_name' name.

Parameters
data_nameThe name of the control data

Definition at line 134 of file THMControl.h.

135 {
136  ControlData<T> * data_ptr = _sim->getControlData<T>(data_name);
137  if (data_ptr == nullptr)
138  mooseError("Trying to get control data '",
139  data_name,
140  "', but it does not exist in the system. Check your spelling.");
141 
142  // set up dependencies for this control object
143  auto it = std::find(_control_data_depends_on.begin(), _control_data_depends_on.end(), data_name);
144  if (it == _control_data_depends_on.end())
145  _control_data_depends_on.push_back(data_name);
146 
147  return data_ptr->get();
148 }
const T & get() const
Definition: ControlData.h:108
Concrete definition of a parameter value for a specified type.
Definition: ControlData.h:91
std::vector< std::string > _control_data_depends_on
A list of control data that are required to run before this control may run.
Definition: THMControl.h:93
THMProblem * _sim
Definition: THMControl.h:90
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

◆ getControlDataDependencies()

const std::vector<std::string>& THMControl::getControlDataDependencies ( ) const
inlineinherited

Return the Controls that must run before this Control.

Definition at line 26 of file THMControl.h.

Referenced by Simulation::controlDataIntegrityCheck().

27  {
29  }
std::vector< std::string > _control_data_depends_on
A list of control data that are required to run before this control may run.
Definition: THMControl.h:93

◆ getControlDataOld()

template<typename T >
const T & THMControl::getControlDataOld ( const std::string &  param_name)
protectedinherited

Get a reference to control data value from a previous time step that is specified in the input parameter 'param_name'.

Parameters
param_nameThe parameter name that contains the name of the control data

Definition at line 126 of file THMControl.h.

127 {
128  std::string data_name = getParam<std::string>(param_name);
129  return getControlDataOldByName<T>(data_name);
130 }

◆ getControlDataOldByName()

template<typename T >
const T & THMControl::getControlDataOldByName ( const std::string &  data_name)
protectedinherited

Get a reference to control data value from previous time step that is specified by 'data_name' name.

Parameters
data_nameThe name of the control data

Definition at line 152 of file THMControl.h.

153 {
154  ControlData<T> * data_ptr = _sim->getControlData<T>(data_name);
155  if (data_ptr == nullptr)
156  mooseError("Trying to get control data '",
157  data_name,
158  "', but it does not exist in the system. Check your spelling.");
159 
160  return data_ptr->getOld();
161 }
const T & getOld() const
Definition: ControlData.h:113
Concrete definition of a parameter value for a specified type.
Definition: ControlData.h:91
THMProblem * _sim
Definition: THMControl.h:90
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

◆ init()

void UnitTripControl::init ( )
overridevirtual

Reimplemented from THMControl.

Definition at line 64 of file UnitTripControl.C.

65 {
67 
68  // establish dependency so that the control data graph is properly evaluated
69  for (auto & ctrl_name : _condition_ptr->getRealControlData())
70  getControlDataByName<Real>(ctrl_name->name());
71  for (auto & ctrl_name : _condition_ptr->getBoolControlData())
72  getControlDataByName<bool>(ctrl_name->name());
73 }
std::unique_ptr< THMParsedFunctionWrapper > _condition_ptr
Pointer to the Parsed function wrapper object.
void buildConditionFunction()
Build the function that is used to evaluate the condition of this trip control.

◆ initialSetup()

void UnitTripControl::initialSetup ( )
overridevirtual

Reimplemented from Control.

Definition at line 58 of file UnitTripControl.C.

59 {
61 }
void buildConditionFunction()
Build the function that is used to evaluate the condition of this trip control.

◆ validParams()

InputParameters UnitTripControl::validParams ( )
static

Definition at line 16 of file UnitTripControl.C.

17 {
20  params.addClassDescription(
21  "Trips a boolean based on the evaluation of a parsed condition expression");
22  params.addRequiredCustomTypeParam<std::string>(
23  "condition",
24  "FunctionExpression",
25  "The condition that this trip unit uses to determine its state.");
26  params.addParam<bool>("latch",
27  false,
28  "Determines if the output of this control stays true after the trip went "
29  "from false to true.");
30  return params;
31 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
Definition: THMControl.C:13
static InputParameters validParams()
void addRequiredCustomTypeParam(const std::string &name, const std::string &custom_type, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _condition

std::string UnitTripControl::_condition
protected

The user-defined condition.

Definition at line 36 of file UnitTripControl.h.

Referenced by buildConditionFunction().

◆ _condition_ptr

std::unique_ptr<THMParsedFunctionWrapper> UnitTripControl::_condition_ptr
protected

Pointer to the Parsed function wrapper object.

Definition at line 45 of file UnitTripControl.h.

Referenced by buildConditionFunction(), execute(), and init().

◆ _control_data_depends_on

std::vector<std::string> THMControl::_control_data_depends_on
protectedinherited

A list of control data that are required to run before this control may run.

Definition at line 93 of file THMControl.h.

Referenced by THMControl::getControlDataByName(), and THMControl::getControlDataDependencies().

◆ _latch

const bool& UnitTripControl::_latch
protected

Determines if the state of the trip should stay true for the rest of the simulation after the trip happened.

Definition at line 40 of file UnitTripControl.h.

Referenced by execute().

◆ _sim

THMProblem* THMControl::_sim
protectedinherited

◆ _state

bool& UnitTripControl::_state
protected

The state of this control object.

Definition at line 38 of file UnitTripControl.h.

Referenced by execute().

◆ _tripped

bool UnitTripControl::_tripped
protected

true if the trip happened, otherwise false

Definition at line 42 of file UnitTripControl.h.

Referenced by execute().


The documentation for this class was generated from the following files: