Storage container for all InputParamter objects. More...
#include <InputParameterWarehouse.h>
Classes | |
class | AddRemoveParamsKey |
Class that is used as a parameter to [add/remove]InputParameters() to restrict access. More... | |
Public Member Functions | |
InputParameterWarehouse () | |
Class constructor. More... | |
virtual | ~InputParameterWarehouse ()=default |
Destruction. More... | |
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & | getInputParameters (THREAD_ID tid=0) const |
Return const reference to the map containing the InputParameter objects. More... | |
void | addControllableParameterConnection (const MooseObjectParameterName &primary, const MooseObjectParameterName &secondary, bool error_on_empty=true) |
Method for linking control parameters of different names. More... | |
void | addControllableParameterAlias (const MooseObjectParameterName &alias, const MooseObjectParameterName &secondary) |
Method for creating alias to an existing controllable parameters. More... | |
void | addControllableObjectAlias (const MooseObjectName &alias, const MooseObjectName &secondary) |
Method for creating alias for all shared controllable parameters between the two objects. More... | |
std::string | dumpChangedControls (bool reset_changed) const |
template<typename T > | |
std::vector< T > | getControllableParameterValues (const MooseObjectParameterName &input) const |
Returns a copy of the current values for a controllable parameter. More... | |
std::vector< MooseObjectParameterName > | getControllableParameterNames (const MooseObjectParameterName &input) const |
Return a vector of parameters names matching the supplied name. More... | |
InputParameters & | addInputParameters (const std::string &name, const InputParameters ¶meters, THREAD_ID tid, const AddRemoveParamsKey) |
Method for adding a new InputParameters object. More... | |
void | removeInputParameters (const MooseObject &moose_object, THREAD_ID tid, const AddRemoveParamsKey) |
Allows for the deletion and cleanup of an object while the simulation is running. More... | |
const InputParameters & | getInputParametersObject (const std::string &name, THREAD_ID tid=0) const |
Return a const reference to the InputParameters for the named object. More... | |
const InputParameters & | getInputParametersObject (const std::string &tag, const std::string &name, THREAD_ID tid=0) const |
const InputParameters & | getInputParametersObject (const MooseObjectName &object_name, THREAD_ID tid=0) const |
Private Member Functions | |
ControllableParameter | getControllableParameter (const MooseObjectParameterName &input) const |
Returns a ControllableParameter object that contains all matches to ControllableItem objects for the provided name. More... | |
std::vector< ControllableItem * > | getControllableItems (const MooseObjectParameterName &desired, THREAD_ID tid=0) const |
Returns a ControllableItem iterator, if the name is located. More... | |
FRIEND_TEST (InputParameterWarehouseTest, getControllableItems) | |
FRIEND_TEST (InputParameterWarehouseTest, getControllableParameter) | |
FRIEND_TEST (InputParameterWarehouseTest, getControllableParameterValues) | |
FRIEND_TEST (InputParameterWarehouseTest, emptyControllableParameterValues) | |
FRIEND_TEST (InputParameterWarehouseTest, addControllableParameterConnection) | |
FRIEND_TEST (InputParameterWarehouseTest, addControllableParameterAlias) | |
InputParameters & | getInputParameters (const std::string &name, THREAD_ID tid=0) const |
Return a reference to the InputParameters for the named object. More... | |
InputParameters & | getInputParameters (const std::string &tag, const std::string &name, THREAD_ID tid=0) const |
InputParameters & | getInputParameters (const MooseObjectName &object_name, THREAD_ID tid=0) const |
Private Attributes | |
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > | _input_parameters |
Storage for the InputParameters objects TODO: Remove multimap. More... | |
std::vector< std::vector< std::shared_ptr< ControllableItem > > > | _controllable_items |
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creating multiple copies. More... | |
Friends | |
class | Control |
Only controls are allowed to call getControllableParameter. More... | |
Storage container for all InputParamter objects.
This object is responsible for InputParameter objects, all MooseObjects should contain a reference to the parameters object stored here.
To avoid abuse, this warehouse is also designed to restrict the ability to change the parameter to Control objects only.
Definition at line 33 of file InputParameterWarehouse.h.
InputParameterWarehouse::InputParameterWarehouse | ( | ) |
Class constructor.
Definition at line 14 of file InputParameterWarehouse.C.
|
virtualdefault |
Destruction.
void InputParameterWarehouse::addControllableObjectAlias | ( | const MooseObjectName & | alias, |
const MooseObjectName & | secondary | ||
) |
Method for creating alias for all shared controllable parameters between the two objects.
Definition at line 206 of file InputParameterWarehouse.C.
void InputParameterWarehouse::addControllableParameterAlias | ( | const MooseObjectParameterName & | alias, |
const MooseObjectParameterName & | secondary | ||
) |
Method for creating alias to an existing controllable parameters.
alias | The new name to serve as an alias. |
secondary | The name of the secondary parameter to be aliased. |
Definition at line 223 of file InputParameterWarehouse.C.
Referenced by addControllableObjectAlias().
void InputParameterWarehouse::addControllableParameterConnection | ( | const MooseObjectParameterName & | primary, |
const MooseObjectParameterName & | secondary, | ||
bool | error_on_empty = true |
||
) |
Method for linking control parameters of different names.
Definition at line 173 of file InputParameterWarehouse.C.
Referenced by FEProblemBase::addMaterialHelper(), and MooseBaseParameterInterface::connectControllableParams().
InputParameters & InputParameterWarehouse::addInputParameters | ( | const std::string & | name, |
const InputParameters & | parameters, | ||
THREAD_ID | tid, | ||
const AddRemoveParamsKey | |||
) |
Method for adding a new InputParameters object.
parameters | The InputParameters object to copy and store in the warehouse |
A new object is created from the old object because InputParameters objects are generic until Factory::create() is called and the actual MooseObject is created.
This method is protected by the AddRemoveParamsKey, because only the factories that are creating objects should be able to call this method.
Definition at line 20 of file InputParameterWarehouse.C.
Referenced by ActionFactory::create(), and Factory::initialize().
std::string InputParameterWarehouse::dumpChangedControls | ( | bool | reset_changed | ) | const |
Definition at line 261 of file InputParameterWarehouse.C.
Referenced by ControlOutput::outputChangedControls().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Returns a ControllableItem iterator, if the name is located.
Definition at line 239 of file InputParameterWarehouse.C.
Referenced by addControllableObjectAlias(), addControllableParameterAlias(), and addControllableParameterConnection().
|
private |
Returns a ControllableParameter object that contains all matches to ControllableItem objects for the provided name.
This is private because it should only be accessed via a Control object.
Definition at line 250 of file InputParameterWarehouse.C.
Referenced by Control::getControllableParameterByName(), and getControllableParameterValues().
std::vector< MooseObjectParameterName > InputParameterWarehouse::getControllableParameterNames | ( | const MooseObjectParameterName & | input | ) | const |
Return a vector of parameters names matching the supplied name.
Definition at line 277 of file InputParameterWarehouse.C.
Referenced by FEProblemBase::addMaterialHelper().
std::vector< T > InputParameterWarehouse::getControllableParameterValues | ( | const MooseObjectParameterName & | input | ) | const |
Returns a copy of the current values for a controllable parameter.
This method is designed to provide access to objects for monitoring the state of a controllable parameter.
Definition at line 214 of file InputParameterWarehouse.h.
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & InputParameterWarehouse::getInputParameters | ( | THREAD_ID | tid = 0 | ) | const |
Return const reference to the map containing the InputParameter objects.
Definition at line 167 of file InputParameterWarehouse.C.
Referenced by getInputParameters(), getInputParametersObject(), ControlOutput::outputActiveObjects(), ControlOutput::outputControls(), and ActionWarehouse::printInputFile().
|
private |
Return a reference to the InputParameters for the named object.
tag | The tag of the object (e.g., 'Kernel') |
name | The name of the parameters object, including the tag (name only input) or MooseObjectName object |
tid | The thread id |
If you are using this method to access a writable reference to input parameters, this will break the ability to control the parameters with the MOOSE control logic system. Only change parameters if you know what you are doing. Hence, this is private for a reason.
Definition at line 140 of file InputParameterWarehouse.C.
|
private |
Definition at line 146 of file InputParameterWarehouse.C.
|
private |
Definition at line 154 of file InputParameterWarehouse.C.
const InputParameters & InputParameterWarehouse::getInputParametersObject | ( | const std::string & | name, |
THREAD_ID | tid = 0 |
||
) | const |
Return a const reference to the InputParameters for the named object.
tag | The tag of the object (e.g., 'Kernel') |
name | The name of the parameters object, including the tag (name only input) or MooseObjectName object |
tid | The thread id |
Definition at line 119 of file InputParameterWarehouse.C.
const InputParameters & InputParameterWarehouse::getInputParametersObject | ( | const std::string & | tag, |
const std::string & | name, | ||
THREAD_ID | tid = 0 |
||
) | const |
Definition at line 125 of file InputParameterWarehouse.C.
const InputParameters & InputParameterWarehouse::getInputParametersObject | ( | const MooseObjectName & | object_name, |
THREAD_ID | tid = 0 |
||
) | const |
Definition at line 133 of file InputParameterWarehouse.C.
void InputParameterWarehouse::removeInputParameters | ( | const MooseObject & | moose_object, |
THREAD_ID | tid, | ||
const AddRemoveParamsKey | |||
) |
Allows for the deletion and cleanup of an object while the simulation is running.
Definition at line 109 of file InputParameterWarehouse.C.
Referenced by Factory::releaseSharedObjects().
|
friend |
Only controls are allowed to call getControllableParameter.
The Control::getControllableParameter is the only method that calls getControllableParameter. However, this method cannot be made a friend explicitly because the method would need to be public. If the method is public then it is possible to call the method by getting access to the Control object.
Definition at line 201 of file InputParameterWarehouse.h.
|
private |
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creating multiple copies.
All access to the objects are done via pointers. The ControllableItem objects are not designed and will not be used directly in user code. All user level access goes through the ControllableParameter object.
Definition at line 159 of file InputParameterWarehouse.h.
Referenced by addControllableParameterAlias(), addInputParameters(), dumpChangedControls(), getControllableItems(), getControllableParameter(), and getControllableParameterNames().
|
private |
Storage for the InputParameters objects TODO: Remove multimap.
Definition at line 153 of file InputParameterWarehouse.h.
Referenced by addInputParameters(), getInputParameters(), and removeInputParameters().