https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | 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.
 
const Tget () const
 
const TgetOld () const
 
Tset ()
 
virtual std::string type () override
 String identifying the type of parameter stored.
 
virtual void copyValuesBack () override
 Copy the current value into old (i.e.
 
const std::string & name () const
 The full (unique) name of this particular piece of data.
 
const THMControlgetControl () const
 Get the pointer to the control object that declared this control data.
 
void setControl (THMControl *ctrl)
 Set the pointer to the control object that declared this control data.
 
void setDeclared ()
 Mark the data as declared.
 
bool getDeclared ()
 Get the declared state.
 

Protected Member Functions

TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (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.
 
bool _declared
 true if the data was declared by calling declareControlData. All data must be declared up front.
 
THMControl_control
 The control object that declared this control data.
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 

Private Member Functions

RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 

Private Attributes

T_value
 Stored value.
 
T_value_old
 Stored old value.
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 

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 }
Abstract definition of a ControlData value.
Definition ControlData.h:21
const std::string & name() const
The full (unique) name of this particular piece of data.
Definition ControlData.h:50
T & _value
Stored value.
T & _value_old
Stored old value.

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{
148}

◆ 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.

108{ return _value; }

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

◆ 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.

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

Referenced by Simulation::controlDataIntegrityCheck().

◆ getDeclared()

bool ControlDataValue::getDeclared ( )
inlineinherited

Get the declared state.

Definition at line 70 of file ControlData.h.

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

Referenced by Simulation::declareControlData().

◆ 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.

113{ return _value_old; }

Referenced by THMControl::getControlDataOldByName().

◆ 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.

118{ return _value; }

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

◆ 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.

60{ _control = ctrl; }

Referenced by Simulation::declareControlData().

◆ setDeclared()

void ControlDataValue::setDeclared ( )
inlineinherited

Mark the data as declared.

Definition at line 65 of file ControlData.h.

65{ _declared = true; }

Referenced by Simulation::declareControlData().

◆ 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 double T

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< T >::get(), and ControlData< T >::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< T >::getOld().


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