26 if (
name.find(
"::") != std::string::npos)
27 mooseError(
"The object name may not contain '::' in the name: ",
name);
30 std::shared_ptr<InputParameters> ptr = std::make_shared<InputParameters>(parameters);
32 const auto & base = ptr->getBase();
47 base !=
"MooseVariableBase" && base !=
"Action")
50 "' object already exists with the name '",
56 std::pair<
MooseObjectName, std::shared_ptr<InputParameters>>(unique_name, ptr));
59 std::vector<MooseObjectName> object_names;
60 object_names.push_back(unique_name);
63 if (ptr->isParamValid(
"control_tags"))
65 const std::vector<std::string> & tags = ptr->get<std::vector<std::string>>(
"control_tags");
66 for (
const auto & tag : tags)
73 object_names.emplace_back(tag, short_name);
81 const std::string & pname = map_iter->first;
84 if (ptr->isControllable(pname))
85 for (
const auto & object_name : object_names)
89 param_name,
value, ptr->getControllableExecuteOnTypes(pname)));
94 std::stringstream oss;
99 ptr->addPrivateParam<
THREAD_ID>(
"_tid", tid);
102 ptr->allowCopy(
false);
113 auto moose_object_name_string =
127 const std::string & name,
148 const std::string & name,
161 mooseError(
"Unknown InputParameters object ", object_name);
164 return *(iter->second.get());
167 const std::multimap<MooseObjectName, std::shared_ptr<InputParameters>> &
177 bool error_on_empty )
182 if (primaries.empty() && error_on_empty && tid == 0)
183 mooseError(
"Unable to locate primary parameter with name ", primary);
184 else if (primaries.empty())
194 if (secondaries.empty() && error_on_empty && tid == 0)
195 mooseError(
"Unable to locate secondary parameter with name ", secondary);
196 else if (secondaries.empty())
199 for (
auto primary_ptr : primaries)
200 for (
auto secondary_ptr : secondaries)
201 if (primary_ptr != secondary_ptr)
202 primary_ptr->connect(secondary_ptr);
212 std::vector<ControllableItem *> secondaries =
214 for (
auto secondary_ptr : secondaries)
230 if (secondaries.empty() && tid == 0)
231 mooseError(
"Unable to locate secondary parameter with name ", secondary);
233 for (
auto secondary_ptr : secondaries)
235 std::make_unique<ControllableAlias>(alias, secondary_ptr));
239 std::vector<ControllableItem *>
243 std::vector<ControllableItem *> output;
245 if (ptr->name() == input)
246 output.push_back(ptr.get());
256 if ((*it)->name() == input)
257 cparam.
add(it->get());
264 std::stringstream oss;
268 if (item->isChanged())
270 oss << item->dump(4);
272 item->resetChanged();
277 std::vector<MooseObjectParameterName>
280 std::vector<MooseObjectParameterName> names;
283 if ((*it)->name() == input)
284 names.push_back((*it)->name());
std::string name(const ElemQuality q)
const std::string & name() const
Return the name.
static const std::string name_param
The name of the parameter that contains the object name.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
The ControllableParameter class is simply a set of ControllableItem objects.
const InputParameters & parameters() const
Get the parameters of the object.
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
static const std::string unique_name_param
The name of the parameter that contains the unique object name.
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Every object that can be built by the factory should be derived from this class.
void add(ControllableItem *item)
Adds the supplied item with the other items within this object.
A class for storing an input parameter name.
A class for storing the names of MooseObject by tag and object name.
map_type::iterator iterator
const std::string & tag() const
Return the tag.