https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ControlData< T > Class Template Reference

Concrete definition of a parameter value for a specified type. More...

#include <ControlData.h>

Inheritance diagram for ControlData< T >:
[legend]

Public Member Functions

 ControlData (MooseApp &moose_app, std::string name)
 Constructor. More...
 
const T & get () const
 
const T & getOld () const
 
T & set ()
 
virtual std::string type () override
 String identifying the type of parameter stored. More...
 
virtual void copyValuesBack () override
 Copy the current value into old (i.e. More...
 
const std::string & name () const
 The full (unique) name of this particular piece of data. More...
 
const THMControlgetControl () const
 Get the pointer to the control object that declared this control data. More...
 
void setControl (THMControl *ctrl)
 Set the pointer to the control object that declared this control data. More...
 
void setDeclared ()
 Mark the data as declared. More...
 
bool getDeclared ()
 Get the declared state. More...
 

Protected Member Functions

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
 

Protected Attributes

const std::string _name
 The full (unique) name of this particular piece of data. More...
 
bool _declared
 true if the data was declared by calling declareControlData. All data must be declared up front. More...
 
THMControl_control
 The control object that declared this control data. More...
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 

Private Attributes

T & _value
 Stored value. More...
 
T & _value_old
 Stored old value. More...
 

Detailed Description

template<typename T>
class ControlData< T >

Concrete definition of a parameter value for a specified type.

Definition at line 91 of file ControlData.h.

Constructor & Destructor Documentation

◆ ControlData()

template<typename T>
ControlData< T >::ControlData ( MooseApp moose_app,
std::string  name 
)
inline

Constructor.

Parameters
nameThe full (unique) name for this piece of data.

Definition at line 98 of file ControlData.h.

99  : ControlDataValue(moose_app, name),
100  _value(declareRestartableData<T>(name)),
101  _value_old(declareRestartableData<T>(name + "_old"))
102  {
103  }
T & _value_old
Stored old value.
Definition: ControlData.h:131
T & _value
Stored value.
Definition: ControlData.h:129
const std::string & name() const
The full (unique) name of this particular piece of data.
Definition: ControlData.h:50
ControlDataValue(MooseApp &moose_app, const std::string &name)
Constructor.
Definition: ControlData.h:28

Member Function Documentation

◆ copyValuesBack()

template<typename T >
void ControlData< T >::copyValuesBack ( )
inlineoverridevirtual

Copy the current value into old (i.e.

shift it "back in time")

Implements ControlDataValue.

Definition at line 145 of file ControlData.h.

146 {
147  _value_old = _value;
148 }
T & _value_old
Stored old value.
Definition: ControlData.h:131
T & _value
Stored value.
Definition: ControlData.h:129

◆ get()

template<typename T>
const T& ControlData< T >::get ( ) const
inline
Returns
a read-only reference to the parameter value.

Definition at line 108 of file ControlData.h.

Referenced by THMControl::getControlDataByName(), RealControlDataValuePostprocessor::getValue(), BoolControlDataValuePostprocessor::getValue(), and THMParsedFunctionWrapper::initialize().

108 { return _value; }
T & _value
Stored value.
Definition: ControlData.h:129

◆ getControl()

const THMControl* ControlDataValue::getControl ( ) const
inlineinherited

Get the pointer to the control object that declared this control data.

Definition at line 55 of file ControlData.h.

Referenced by Simulation::controlDataIntegrityCheck().

55 { return _control; }
THMControl * _control
The control object that declared this control data.
Definition: ControlData.h:83

◆ getDeclared()

bool ControlDataValue::getDeclared ( )
inlineinherited

Get the declared state.

Definition at line 70 of file ControlData.h.

Referenced by Simulation::declareControlData().

70 { return _declared; }
bool _declared
true if the data was declared by calling declareControlData. All data must be declared up front...
Definition: ControlData.h:81

◆ getOld()

template<typename T>
const T& ControlData< T >::getOld ( ) const
inline
Returns
a read-only reference to the old value.

Definition at line 113 of file ControlData.h.

Referenced by THMControl::getControlDataOldByName().

113 { return _value_old; }
T & _value_old
Stored old value.
Definition: ControlData.h:131

◆ name()

const std::string& ControlDataValue::name ( ) const
inlineinherited

The full (unique) name of this particular piece of data.

Definition at line 50 of file ControlData.h.

50 { return _name; }
const std::string _name
The full (unique) name of this particular piece of data.
Definition: ControlData.h:79

◆ set()

template<typename T>
T& ControlData< T >::set ( )
inline
Returns
a writable reference to the parameter value.

Definition at line 118 of file ControlData.h.

Referenced by THMControl::declareComponentControlData(), and THMControl::declareControlData().

118 { return _value; }
T & _value
Stored value.
Definition: ControlData.h:129

◆ setControl()

void ControlDataValue::setControl ( THMControl ctrl)
inlineinherited

Set the pointer to the control object that declared this control data.

Definition at line 60 of file ControlData.h.

Referenced by Simulation::declareControlData().

60 { _control = ctrl; }
THMControl * _control
The control object that declared this control data.
Definition: ControlData.h:83

◆ setDeclared()

void ControlDataValue::setDeclared ( )
inlineinherited

Mark the data as declared.

Definition at line 65 of file ControlData.h.

Referenced by Simulation::declareControlData().

65 { _declared = true; }
bool _declared
true if the data was declared by calling declareControlData. All data must be declared up front...
Definition: ControlData.h:81

◆ type()

template<typename T >
std::string ControlData< T >::type ( )
inlineoverridevirtual

String identifying the type of parameter stored.

Implements ControlDataValue.

Definition at line 138 of file ControlData.h.

139 {
140  return typeid(T).name();
141 }
const std::string & name() const
The full (unique) name of this particular piece of data.
Definition: ControlData.h:50

Member Data Documentation

◆ _control

THMControl* ControlDataValue::_control
protectedinherited

The control object that declared this control data.

Definition at line 83 of file ControlData.h.

Referenced by ControlDataValue::getControl(), and ControlDataValue::setControl().

◆ _declared

bool ControlDataValue::_declared
protectedinherited

true if the data was declared by calling declareControlData. All data must be declared up front.

Definition at line 81 of file ControlData.h.

Referenced by ControlDataValue::getDeclared(), and ControlDataValue::setDeclared().

◆ _name

const std::string ControlDataValue::_name
protectedinherited

The full (unique) name of this particular piece of data.

Definition at line 79 of file ControlData.h.

Referenced by ControlDataValue::name().

◆ _value

template<typename T>
T& ControlData< T >::_value
private

Stored value.

Definition at line 129 of file ControlData.h.

Referenced by ControlData< Real >::get(), and ControlData< Real >::set().

◆ _value_old

template<typename T>
T& ControlData< T >::_value_old
private

Stored old value.

Definition at line 131 of file ControlData.h.

Referenced by ControlData< Real >::getOld().


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