www.mooseframework.org
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
InputParameterWarehouse Class Reference

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< MooseObjectParameterNamegetControllableParameterNames (const MooseObjectParameterName &input) const
 Return a vector of parameters names matching the supplied name. More...
 
InputParametersaddInputParameters (const std::string &name, const InputParameters &parameters, 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 InputParametersgetInputParametersObject (const std::string &name, THREAD_ID tid=0) const
 Return a const reference to the InputParameters for the named object. More...
 
const InputParametersgetInputParametersObject (const std::string &tag, const std::string &name, THREAD_ID tid=0) const
 
const InputParametersgetInputParametersObject (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)
 
InputParametersgetInputParameters (const std::string &name, THREAD_ID tid=0) const
 Return a reference to the InputParameters for the named object. More...
 
InputParametersgetInputParameters (const std::string &tag, const std::string &name, THREAD_ID tid=0) const
 
InputParametersgetInputParameters (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ InputParameterWarehouse()

InputParameterWarehouse::InputParameterWarehouse ( )

Class constructor.

Definition at line 14 of file InputParameterWarehouse.C.

16 {
17 }
unsigned int n_threads()
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > _input_parameters
Storage for the InputParameters objects TODO: Remove multimap.
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...

◆ ~InputParameterWarehouse()

virtual InputParameterWarehouse::~InputParameterWarehouse ( )
virtualdefault

Destruction.

Member Function Documentation

◆ addControllableObjectAlias()

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.

208 {
209  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
210  {
211  std::vector<ControllableItem *> secondaries =
212  getControllableItems(MooseObjectParameterName(secondary, "*"), tid);
213  for (auto secondary_ptr : secondaries)
214  {
215  MooseObjectParameterName alias_param(alias, secondary_ptr->name().parameter());
216  MooseObjectParameterName secondary_param(secondary, secondary_ptr->name().parameter());
217  addControllableParameterAlias(alias_param, secondary_param);
218  }
219  }
220 }
std::vector< ControllableItem * > getControllableItems(const MooseObjectParameterName &desired, THREAD_ID tid=0) const
Returns a ControllableItem iterator, if the name is located.
unsigned int n_threads()
void addControllableParameterAlias(const MooseObjectParameterName &alias, const MooseObjectParameterName &secondary)
Method for creating alias to an existing controllable parameters.
A class for storing an input parameter name.
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addControllableParameterAlias()

void InputParameterWarehouse::addControllableParameterAlias ( const MooseObjectParameterName alias,
const MooseObjectParameterName secondary 
)

Method for creating alias to an existing controllable parameters.

Parameters
aliasThe new name to serve as an alias.
secondaryThe name of the secondary parameter to be aliased.

Definition at line 223 of file InputParameterWarehouse.C.

Referenced by addControllableObjectAlias().

225 {
226  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
227  {
228  std::vector<ControllableItem *> secondaries = getControllableItems(secondary, tid);
229  if (secondaries.empty() && tid == 0) // some objects only exist on tid 0
230  mooseError("Unable to locate secondary parameter with name ", secondary);
231 
232  for (auto secondary_ptr : secondaries)
233  _controllable_items[tid].emplace_back(
234  std::make_unique<ControllableAlias>(alias, secondary_ptr));
235  }
236 }
std::vector< ControllableItem * > getControllableItems(const MooseObjectParameterName &desired, THREAD_ID tid=0) const
Returns a ControllableItem iterator, if the name is located.
unsigned int n_threads()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addControllableParameterConnection()

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().

177 {
178  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
179  {
180  std::vector<ControllableItem *> primaries = getControllableItems(primary, tid);
181  if (primaries.empty() && error_on_empty && tid == 0) // some objects only exist on tid 0
182  mooseError("Unable to locate primary parameter with name ", primary);
183  else if (primaries.empty())
184  {
185  if (tid == 0)
186  return;
187  else
188  // try to connect non-threaded primary control to secondary controls of all threads
189  primaries = getControllableItems(primary, 0);
190  }
191 
192  std::vector<ControllableItem *> secondaries = getControllableItems(secondary, tid);
193  if (secondaries.empty() && error_on_empty && tid == 0) // some objects only exist on tid 0
194  mooseError("Unable to locate secondary parameter with name ", secondary);
195  else if (secondaries.empty())
196  return;
197 
198  for (auto primary_ptr : primaries)
199  for (auto secondary_ptr : secondaries)
200  if (primary_ptr != secondary_ptr)
201  primary_ptr->connect(secondary_ptr);
202  }
203 }
std::vector< ControllableItem * > getControllableItems(const MooseObjectParameterName &desired, THREAD_ID tid=0) const
Returns a ControllableItem iterator, if the name is located.
unsigned int n_threads()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addInputParameters()

InputParameters & InputParameterWarehouse::addInputParameters ( const std::string &  name,
const InputParameters parameters,
THREAD_ID  tid,
const AddRemoveParamsKey   
)

Method for adding a new InputParameters object.

Parameters
parametersThe InputParameters object to copy and store in the warehouse
Returns
A reference to the warehouse copy of the InputParameters, this is what should be passed into the MooseObjects constructors.

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().

24 {
25  // Error if the name contains "::"
26  if (name.find("::") != std::string::npos)
27  mooseError("The object name may not contain '::' in the name: ", name);
28 
29  // Create the actual InputParameters object that will be reference by the objects
30  std::shared_ptr<InputParameters> ptr = std::make_shared<InputParameters>(parameters);
31 
32  auto base = ptr->get<std::string>("_moose_base");
33 
34  // The object name defined by the base class name, this method of storing is used for
35  // determining the uniqueness of the name
36  MooseObjectName unique_name(base, name, "::");
37 
38  // Check that the Parameters do not already exist. We allow duplicate unique_names for
39  // MooseVariableBase objects because we require duplication of the variable for reference and
40  // displaced problems. We must also have std::pair(reference_var, reference_params) AND
41  // std::pair(displaced_var, displaced_params) elements because the two vars will have different
42  // values for _sys. It's a good thing we are using a multi-map as our underlying storage.
43  // We also allow duplicate unique_names for Action objects because it is allowed to have
44  // multiple [Materials] input blocks each of which can add an action but all of these actions
45  // will have the same unique name.
46  if (_input_parameters[tid].find(unique_name) != _input_parameters[tid].end() &&
47  base != "MooseVariableBase" && base != "Action")
48  mooseError("A '",
49  unique_name.tag(),
50  "' object already exists with the name '",
51  unique_name.name(),
52  "'.\n");
53 
54  // Store the parameters according to the base name
55  _input_parameters[tid].insert(
56  std::pair<MooseObjectName, std::shared_ptr<InputParameters>>(unique_name, ptr));
57 
58  // Build a list of object names
59  std::vector<MooseObjectName> object_names;
60  object_names.push_back(unique_name);
61 
62  // Store the object according to the control tags
63  if (ptr->isParamValid("control_tags"))
64  {
65  const std::vector<std::string> & tags = ptr->get<std::vector<std::string>>("control_tags");
66  for (const auto & tag : tags)
67  {
68  if (!tag.empty())
69  {
70  auto short_name = MooseUtils::shortName(name);
71  _input_parameters[tid].insert(std::pair<MooseObjectName, std::shared_ptr<InputParameters>>(
72  MooseObjectName(tag, short_name), ptr));
73  object_names.emplace_back(tag, short_name);
74  }
75  }
76  }
77 
78  // Store controllable parameters using all possible names
79  for (libMesh::Parameters::iterator map_iter = ptr->begin(); map_iter != ptr->end(); ++map_iter)
80  {
81  const std::string & pname = map_iter->first;
82  libMesh::Parameters::Value * value = MooseUtils::get(map_iter->second);
83 
84  if (ptr->isControllable(pname))
85  for (const auto & object_name : object_names)
86  {
87  MooseObjectParameterName param_name(object_name, pname);
88  _controllable_items[tid].emplace_back(std::make_shared<ControllableItem>(
89  param_name, value, ptr->getControllableExecuteOnTypes(pname)));
90  }
91  }
92 
93  // Set the name and tid parameters, and unique_name
94  std::stringstream oss;
95  oss << unique_name;
96 
97  ptr->addPrivateParam<std::string>("_unique_name", oss.str());
98  ptr->addPrivateParam<std::string>("_object_name", name);
99  ptr->addPrivateParam<THREAD_ID>("_tid", tid);
100 
101  // no more copies allowed
102  ptr->allowCopy(false);
103 
104  // Return a reference to the InputParameters object
105  return *ptr;
106 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Definition: MooseUtils.h:1147
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:598
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > _input_parameters
Storage for the InputParameters objects TODO: Remove multimap.
A class for storing an input parameter name.
A class for storing the names of MooseObject by tag and object name.
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...
map_type::iterator iterator
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ dumpChangedControls()

std::string InputParameterWarehouse::dumpChangedControls ( bool  reset_changed) const

Definition at line 261 of file InputParameterWarehouse.C.

Referenced by ControlOutput::outputChangedControls().

262 {
263  std::stringstream oss;
264  oss << std::left;
265 
266  for (const auto & item : _controllable_items[0])
267  if (item->isChanged())
268  {
269  oss << item->dump(4);
270  if (reset_changed)
271  item->resetChanged();
272  }
273  return oss.str();
274 }
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...

◆ FRIEND_TEST() [1/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
getControllableItems   
)
private

◆ FRIEND_TEST() [2/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
getControllableParameter   
)
private

◆ FRIEND_TEST() [3/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
getControllableParameterValues   
)
private

◆ FRIEND_TEST() [4/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
emptyControllableParameterValues   
)
private

◆ FRIEND_TEST() [5/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
addControllableParameterConnection   
)
private

◆ FRIEND_TEST() [6/6]

InputParameterWarehouse::FRIEND_TEST ( InputParameterWarehouseTest  ,
addControllableParameterAlias   
)
private

◆ getControllableItems()

std::vector< ControllableItem * > InputParameterWarehouse::getControllableItems ( const MooseObjectParameterName desired,
THREAD_ID  tid = 0 
) const
private

Returns a ControllableItem iterator, if the name is located.

See also
Control

Definition at line 239 of file InputParameterWarehouse.C.

Referenced by addControllableObjectAlias(), addControllableParameterAlias(), and addControllableParameterConnection().

241 {
242  std::vector<ControllableItem *> output;
243  for (auto & ptr : _controllable_items[tid])
244  if (ptr->name() == input)
245  output.push_back(ptr.get());
246  return output;
247 }
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...

◆ getControllableParameter()

ControllableParameter InputParameterWarehouse::getControllableParameter ( const MooseObjectParameterName input) const
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().

251 {
252  ControllableParameter cparam;
253  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
254  for (auto it = _controllable_items[tid].begin(); it != _controllable_items[tid].end(); ++it)
255  if ((*it)->name() == input)
256  cparam.add(it->get());
257  return cparam;
258 }
unsigned int n_threads()
The ControllableParameter class is simply a set of ControllableItem objects.
void add(ControllableItem *item)
Adds the supplied item with the other items within this object.
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ getControllableParameterNames()

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().

278 {
279  std::vector<MooseObjectParameterName> names;
280  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
281  for (auto it = _controllable_items[tid].begin(); it != _controllable_items[tid].end(); ++it)
282  if ((*it)->name() == input)
283  names.push_back((*it)->name());
284  return names;
285 }
unsigned int n_threads()
std::vector< std::vector< std::shared_ptr< ControllableItem > > > _controllable_items
Storage for controllable parameters via ControllableItem objects, a unique_ptr is used to avoid creat...
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ getControllableParameterValues()

template<typename T >
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.

216 {
218  return param.get<T>();
219 }
The ControllableParameter class is simply a set of ControllableItem objects.
ControllableParameter getControllableParameter(const MooseObjectParameterName &input) const
Returns a ControllableParameter object that contains all matches to ControllableItem objects for the ...
std::vector< T > get(bool type_check=true, bool warn_when_values_difffer=false) const
Return a copy of the values of the given type.

◆ getInputParameters() [1/4]

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().

168 {
169  return _input_parameters[tid];
170 }
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > _input_parameters
Storage for the InputParameters objects TODO: Remove multimap.

◆ getInputParameters() [2/4]

InputParameters & InputParameterWarehouse::getInputParameters ( const std::string &  name,
THREAD_ID  tid = 0 
) const
private

Return a reference to the InputParameters for the named object.

Parameters
tagThe tag of the object (e.g., 'Kernel')
nameThe name of the parameters object, including the tag (name only input) or MooseObjectName object
tidThe thread id
Returns
A reference to the warehouse copy of the InputParameters

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.

141 {
142  return getInputParameters(MooseObjectName(name), tid);
143 }
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & getInputParameters(THREAD_ID tid=0) const
Return const reference to the map containing the InputParameter objects.
A class for storing the names of MooseObject by tag and object name.

◆ getInputParameters() [3/4]

InputParameters & InputParameterWarehouse::getInputParameters ( const std::string &  tag,
const std::string &  name,
THREAD_ID  tid = 0 
) const
private

Definition at line 146 of file InputParameterWarehouse.C.

149 {
150  return getInputParameters(MooseObjectName(tag, name), tid);
151 }
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & getInputParameters(THREAD_ID tid=0) const
Return const reference to the map containing the InputParameter objects.
A class for storing the names of MooseObject by tag and object name.

◆ getInputParameters() [4/4]

InputParameters & InputParameterWarehouse::getInputParameters ( const MooseObjectName object_name,
THREAD_ID  tid = 0 
) const
private

Definition at line 154 of file InputParameterWarehouse.C.

156 {
157  // Locate the InputParameters object and error if it was not located
158  const auto iter = _input_parameters[tid].find(object_name);
159  if (iter == _input_parameters[tid].end())
160  mooseError("Unknown InputParameters object ", object_name);
161 
162  // Return a reference to the parameter
163  return *(iter->second.get());
164 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > _input_parameters
Storage for the InputParameters objects TODO: Remove multimap.

◆ getInputParametersObject() [1/3]

const InputParameters & InputParameterWarehouse::getInputParametersObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const

Return a const reference to the InputParameters for the named object.

Parameters
tagThe tag of the object (e.g., 'Kernel')
nameThe name of the parameters object, including the tag (name only input) or MooseObjectName object
tidThe thread id
Returns
A const reference to the warehouse copy of the InputParameters

Definition at line 119 of file InputParameterWarehouse.C.

120 {
121  return getInputParameters(MooseObjectName(name), tid);
122 }
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & getInputParameters(THREAD_ID tid=0) const
Return const reference to the map containing the InputParameter objects.
A class for storing the names of MooseObject by tag and object name.

◆ getInputParametersObject() [2/3]

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.

128 {
129  return getInputParameters(MooseObjectName(tag, name), tid);
130 }
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & getInputParameters(THREAD_ID tid=0) const
Return const reference to the map containing the InputParameter objects.
A class for storing the names of MooseObject by tag and object name.

◆ getInputParametersObject() [3/3]

const InputParameters & InputParameterWarehouse::getInputParametersObject ( const MooseObjectName object_name,
THREAD_ID  tid = 0 
) const

Definition at line 133 of file InputParameterWarehouse.C.

135 {
136  return getInputParameters(object_name, tid);
137 }
const std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > & getInputParameters(THREAD_ID tid=0) const
Return const reference to the map containing the InputParameter objects.

◆ removeInputParameters()

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().

112 {
113  auto moose_object_name_string = moose_object.parameters().get<std::string>("_unique_name");
114  MooseObjectName moose_object_name(moose_object_name_string);
115  _input_parameters[tid].erase(moose_object_name);
116 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< std::multimap< MooseObjectName, std::shared_ptr< InputParameters > > > _input_parameters
Storage for the InputParameters objects TODO: Remove multimap.
const InputParameters & parameters() const
Get the parameters of the object.
A class for storing the names of MooseObject by tag and object name.

Friends And Related Function Documentation

◆ Control

friend class Control
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.

Member Data Documentation

◆ _controllable_items

std::vector<std::vector<std::shared_ptr<ControllableItem> > > InputParameterWarehouse::_controllable_items
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().

◆ _input_parameters

std::vector<std::multimap<MooseObjectName, std::shared_ptr<InputParameters> > > InputParameterWarehouse::_input_parameters
private

Storage for the InputParameters objects TODO: Remove multimap.

Definition at line 153 of file InputParameterWarehouse.h.

Referenced by addInputParameters(), getInputParameters(), and removeInputParameters().


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