21 #include "libmesh/utility.h" 22 #include "libmesh/simple_range.h" 25 #include "hit/parse.h" 39 _collapse_nesting(false),
40 _moose_object_syntax_visibility(true),
41 _show_deprecated_message(true),
49 : Parameters(), _show_deprecated_message(true), _allow_copy(true)
55 : _show_deprecated_message(true), _allow_copy(true)
100 metadata._set_by_add_param =
false;
103 if (!have_parameter<MooseEnum>(
name) && !have_parameter<MultiMooseEnum>(
name))
104 metadata._valid =
true;
108 std::optional<std::string>
114 auto deprecation_message = [
this](
const auto &
name,
const auto & message) -> std::string
118 return deprecation_message(
name,
119 "The parameter '" +
name +
"' is deprecated.\n" +
120 libmesh_map_find(
_params,
name)._deprecation_message);
123 return deprecation_message(name_in, it->second.second);
145 const std::string name_example =
type.size() ?
type :
"the " +
name +
" object";
146 const std::string type_example =
type.size() ?
type :
"MyObject";
148 "Copying of the InputParameters object for ",
150 " is not allowed.\n\nThe likely cause for this error ",
151 "is having a constructor that does not use a const reference, all constructors\nfor " 152 "MooseObject based classes should be as follows:\n\n",
157 "(const InputParameters & parameters);");
182 Parameters::operator+=(rhs);
186 for (
auto it = rhs.
_params.begin(); it != rhs.
_params.end(); ++it)
187 _params[it->first] = it->second;
207 const std::string & doc_string)
212 auto params_it =
_params.find(coupled_vars_it->second);
213 if (params_it ==
_params.end())
214 mooseError(
"There must have been a mistake in the construction of the new to deprecated " 215 "coupled vars map because the old name ",
216 coupled_vars_it->second,
217 " doesn't exist in the parameters data.");
219 params_it->second._doc_string = doc_string;
226 addParam<std::vector<VariableName>>(
name, doc_string);
229 metadata._coupled_default.assign(1,
value);
230 metadata._have_coupled_default =
true;
238 const std::vector<Real> & value,
239 const std::string & doc_string)
242 addParam<std::vector<VariableName>>(
name, doc_string);
245 metadata._coupled_default =
value;
246 metadata._have_coupled_default =
true;
255 addParam<std::vector<VariableName>>(
name, doc_string);
264 const std::string & new_name,
265 const std::string & removal_date )
272 auto params_it =
_params.find(new_name);
273 std::string doc_string;
274 if (params_it !=
_params.end())
275 doc_string = params_it->second._doc_string;
277 addParam<std::vector<VariableName>>(old_name, doc_string);
281 std::string deprecation_message =
282 "The coupled variable parameter '" + old_name +
"' has been deprecated";
283 if (!removal_date.empty())
284 deprecation_message +=
" and will be removed " + removal_date;
285 deprecation_message +=
". Please use the '" + new_name +
"' coupled variable parameter instead.";
286 _params[old_name]._deprecation_message = deprecation_message;
292 const std::string & base_name,
293 const std::string & num_name,
294 const std::string & doc_string)
296 addParam<std::vector<VariableName>>(
name, doc_string);
298 _params[
name]._autobuild_vecs = std::make_pair(base_name, num_name);
301 addParam<std::string>(base_name, doc_string +
" (base_name)");
302 addParam<unsigned int>(num_name, doc_string +
" (num_name)");
307 const std::string & base_name,
308 const std::string & num_name,
309 const std::string & doc_string)
311 addRequiredParam<std::vector<VariableName>>(
name, doc_string);
319 addRequiredParam<std::vector<VariableName>>(
name, doc_string);
328 std::string doc_string;
331 for (
const auto & ch : it->second._doc_string)
334 doc_string +=
" ... ";
349 mooseError(
"Unable to set the documentation string (using setDocString) for the \"",
351 "\" parameter, the parameter does not exist.");
352 it->second._doc_string = doc;
389 if (have_parameter<MooseEnum>(
name))
393 for (
auto it =
get<std::vector<MooseEnum>>(
name).
begin();
394 it != get<std::vector<MooseEnum>>(
name).
end();
400 else if (have_parameter<MultiMooseEnum>(
name))
401 return get<MultiMooseEnum>(
name).isValid();
404 for (
auto it =
get<std::vector<MultiMooseEnum>>(
name).
begin();
405 it != get<std::vector<MultiMooseEnum>>(
name).
end();
411 else if (have_parameter<ExecFlagEnum>(
name))
412 return get<ExecFlagEnum>(
name).isValid();
434 for (
const auto & it : *
this)
451 std::vector<std::string> names;
452 MooseUtils::tokenize<std::string>(input_names, names, 1,
" ");
453 for (
auto & name_in : names)
459 map_iter->second._controllable =
true;
465 "' does not exist, thus cannot be marked as controllable.");
476 const std::set<ExecFlagType> &
500 mooseError(
"InputParameters::getBase(): Parameters do not have base; one needs to be set with " 508 InputParameters::set<std::string>(
"_moose_warehouse_system_name") =
value;
509 _params[
"_moose_warehouse_system_name"]._is_private =
true;
515 mooseAssert(have_parameter<std::string>(
"_moose_warehouse_system_name"),
516 "SystemAttributeName is not available! Call 'registerSystemAttributeName' (usually " 517 "in the validParams function) before you try accessing it!");
518 return Parameters::get<std::string>(
"_moose_warehouse_system_name");
530 const std::string & name,
537 const std::vector<std::string> &
543 const std::vector<std::tuple<std::string,
575 #define checkMooseType(param_type, name) \ 576 if (have_parameter<param_type>(name) || have_parameter<std::vector<param_type>>(name)) \ 577 error = "non-controllable type '" + type(name) + "' for parameter '" + \ 578 paramFullpath(param_name) + "' marked controllable"; 586 std::vector<std::string> required_param_errors;
587 for (
const auto & it : *
this)
597 required_param_errors.push_back(
"missing required parameter '" + parampath +
"/" +
598 param_name +
"'\n\tDoc String: \"" +
603 if (required_param_errors.size())
607 for (
const auto & [
name, param_ptr] : *
this)
614 mooseError(
"For range checked parameter '" +
name +
"': " + error->second);
623 "private parameter '" +
paramFullpath(param_name) +
"' marked controllable");
625 std::optional<std::string> error;
626 checkMooseType(NonlinearVariableName, param_name);
627 checkMooseType(AuxVariableName, param_name);
628 checkMooseType(VariableName, param_name);
629 checkMooseType(BoundaryName, param_name);
630 checkMooseType(SubdomainName, param_name);
631 checkMooseType(PostprocessorName, param_name);
632 checkMooseType(VectorPostprocessorName, param_name);
633 checkMooseType(UserObjectName, param_name);
634 checkMooseType(MaterialPropertyName, param_name);
640 std::optional<std::pair<bool, std::string>>
642 const std::string & long_name,
643 const std::string & short_name,
644 const bool include_param_path)
646 #define dynamicCastRangeCheck(type, up_type, long_name, short_name) \ 649 if (const auto scalar_p = dynamic_cast<const InputParameters::Parameter<type> *>(&value)) \ 650 return rangeCheck<type, up_type>(long_name, short_name, *scalar_p, include_param_path); \ 651 if (const auto vector_p = \ 652 dynamic_cast<const InputParameters::Parameter<std::vector<type>> *>(&value)) \ 653 return rangeCheck<type, up_type>(long_name, short_name, *vector_p, include_param_path); \ 656 dynamicCastRangeCheck(
Real,
Real, long_name, short_name);
657 dynamicCastRangeCheck(
int,
long, long_name, short_name);
658 dynamicCastRangeCheck(
long,
long, long_name, short_name);
659 dynamicCastRangeCheck(
unsigned int,
long, long_name, short_name);
660 #undef dynamicCastRangeCheck 673 const auto set_absolute_path = [
this](
const std::string & param_name,
auto &
value)
679 std::filesystem::path value_path = std::string(
value);
681 if (value_path.is_absolute())
686 value = std::filesystem::absolute(file_base / value_path).c_str();
690 for (
const auto & [param_name, param_value] : *
this)
692 #define set_if_filename(type) \ 693 else if (auto type_value = dynamic_cast<Parameters::Parameter<type> *>(param_value.get())) \ 694 set_absolute_path(param_name, type_value->set()); \ 695 else if (auto type_values = dynamic_cast<Parameters::Parameter<std::vector<type>> *>( \ 696 param_value.get())) for (auto & value : type_values->set()) \ 697 set_absolute_path(param_name, value) 703 set_if_filename(FileName);
704 set_if_filename(FileNameNoExtension);
705 set_if_filename(MeshFileName);
706 set_if_filename(MatrixFileName);
707 #undef set_if_filename 709 else if (
auto data_file_name =
710 dynamic_cast<Parameters::Parameter<DataFileName> *
>(param_value.get()))
713 std::optional<std::string> error;
723 catch (std::exception & e)
733 data_file_name->set() = found_path.
path;
742 std::filesystem::path
745 mooseAssert(!have_parameter<std::string>(
"_app_name"),
746 "Not currently setup to work with app FileName parameters");
748 const hit::Node * hit_node =
nullptr;
758 return std::filesystem::current_path();
761 while (hit_node && hit_node->filename() ==
"CLI_ARGS")
762 hit_node = hit_node->parent();
767 const std::string error =
"Input context was set via a command-line argument and does not have " 768 "sufficient context for determining a file path.";
775 return std::filesystem::absolute(std::filesystem::path(hit_node->filename()).parent_path());
782 return !
_params.find(
name)->second._range_function.empty();
802 mooseError(
"No way to know if the parameter '", param_name,
"' has a default");
816 return _params.count(coupling_name) > 0 &&
_params.at(coupling_name)._have_coupled_default &&
824 _params[actual_name]._coupled_default.resize(i + 1);
826 _params[actual_name]._have_coupled_default =
true;
832 auto value_it =
_params.find(coupling_name);
834 if (value_it ==
_params.end() || !value_it->second._have_coupled_default)
835 mooseError(
"Attempted to retrieve default value for coupled variable '",
837 "' when none was provided. \n\nThere are three reasons why this may have " 838 "occurred:\n 1. The other version of params.addCoupledVar() should be used in order " 839 "to provide a default value. \n 2. This should have been a required coupled " 840 "variable added with params.addRequiredCoupledVar() \n 3. The call to get the " 841 "coupled value should have been properly guarded with isCoupled()\n");
843 return value_it->second._coupled_default.at(i);
849 auto value_it =
_params.find(coupling_name);
851 mooseError(
"Attempted to retrieve default value for coupled variable '",
853 "' when none was provided.");
854 return value_it->second._coupled_default.size();
857 std::map<std::string, std::pair<std::string, std::string>>
860 std::map<std::string, std::pair<std::string, std::string>> abv;
863 if (!it->second._autobuild_vecs.first.empty())
864 abv[it->first] = it->second._autobuild_vecs;
877 return "std::vector<VariableName>";
889 if (have_parameter<VariableName>(
name))
890 var = get<VariableName>(
name);
891 else if (have_parameter<NonlinearVariableName>(
name))
892 var = get<NonlinearVariableName>(
name);
893 else if (have_parameter<LinearVariableName>(
name))
894 var = get<LinearVariableName>(
name);
895 else if (have_parameter<AuxVariableName>(
name))
896 var = get<AuxVariableName>(
name);
897 else if (have_parameter<PostprocessorName>(
name))
898 var = get<PostprocessorName>(
name);
899 else if (have_parameter<VectorPostprocessorName>(
name))
900 var = get<VectorPostprocessorName>(
name);
901 else if (have_parameter<FunctionName>(
name))
902 var = get<FunctionName>(
name);
903 else if (have_parameter<UserObjectName>(
name))
904 var = get<UserObjectName>(
name);
905 else if (have_parameter<MaterialPropertyName>(
name))
906 var = get<MaterialPropertyName>(
name);
907 else if (have_parameter<std::string>(
name))
908 var = get<std::string>(
name);
913 std::vector<std::string>
917 std::vector<std::string> svars;
921 std::vector<VariableName>
vars = get<std::vector<VariableName>>(
name);
922 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
926 std::vector<NonlinearVariableName>
vars = get<std::vector<NonlinearVariableName>>(
name);
927 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
931 std::vector<AuxVariableName>
vars = get<std::vector<AuxVariableName>>(
name);
932 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
936 std::vector<MaterialPropertyName>
vars = get<std::vector<MaterialPropertyName>>(
name);
937 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
941 std::vector<std::string>
vars = get<std::vector<std::string>>(
name);
942 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
982 const std::string group_name)
984 std::vector<std::string> elements;
989 std::set<std::string> param_names;
990 for (
const auto & it : *
this)
991 param_names.insert(it.first);
993 for (
const auto & param_name : elements)
994 if (
_params.count(param_name) > 0)
995 _params[param_name]._group = group_name;
997 mooseError(
"Unable to find a parameter with name: ",
999 " when adding to group ",
1008 if (param.second._group == old_name)
1009 param.second._group = new_name;
1017 mooseError(
"InputParameters::setGlobalCommandLineParam: The parameter '",
1019 "' is not a command line parameter");
1020 cl_data->global =
true;
1029 std::optional<InputParameters::CommandLineMetadata>
1043 mooseError(
"InputParameters::getCommandLineMetadata: The parameter '",
1045 "' is not a command line parameter");
1054 mooseError(
"InputParameters::commandLineParamSet: The parameter '",
1056 "' is not a command line parameter");
1057 cl_data->set_by_command_line =
true;
1064 auto it =
_params.find(param_name);
1066 return it->second._group;
1067 return std::string();
1072 const std::vector<std::string> & exclude,
1073 const bool allow_private)
1080 for (
const auto & it : common)
1083 const std::string & common_name = it.first;
1085 if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
1092 for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
1093 it != common.coupledVarsEnd();
1097 const std::string var_name = *it;
1100 if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
1109 const std::vector<std::string> & include,
1113 for (
const auto & it : common)
1116 const std::string & common_name = it.first;
1119 if (std::find(include.begin(), include.end(), common_name) == include.end())
1126 for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
1127 it != common.coupledVarsEnd();
1131 const std::string var_name = *it;
1134 if (std::find(include.begin(), include.end(), var_name) == include.end())
1170 const std::string & common_name,
1172 bool override_default)
1181 const bool local_exist =
_values.find(local_name) !=
_values.end();
1182 const bool local_set =
_params.count(local_name) > 0 && !
_params[local_name]._set_by_add_param;
1183 const bool local_priv = allow_private ? false :
isPrivate(local_name);
1187 const bool common_exist = common.
_values.find(common_name) != common.
_values.end();
1188 const bool common_priv = allow_private ? false : common.
isPrivate(common_name);
1189 const bool common_valid = common.
isParamValid(common_name) || override_default;
1197 if (local_exist && common_exist && common_valid && (!local_valid || !local_set) &&
1198 (!common_priv || !local_priv))
1201 _values[local_name] = common.
_values.find(common_name)->second->clone();
1203 _params[local_name]._set_by_add_param =
1204 libmesh_map_find(common.
_params, common_name)._set_by_add_param;
1210 else if (!local_exist && !common_exist)
1211 mooseError(
"InputParameters::applyParameter(): Attempted to apply invalid parameter \"",
1223 mooseDeprecated(
"paramSetByUser() is deprecated. Use isParamSetByUser() instead.");
1239 return cl_data->set_by_command_line;
1258 return it->second._doc_string;
1263 InputParameters::addRequiredParam<MooseEnum>(
const std::string &
name,
1265 const std::string & doc_string)
1267 InputParameters::set<MooseEnum>(
name) = moose_enum;
1268 auto & metadata = _params[
name];
1269 metadata._required =
true;
1270 metadata._doc_string = doc_string;
1275 InputParameters::addRequiredParam<MultiMooseEnum>(
const std::string &
name,
1277 const std::string & doc_string)
1279 InputParameters::set<MultiMooseEnum>(
name) =
1281 auto & metadata = _params[
name];
1282 metadata._required =
true;
1283 metadata._doc_string = doc_string;
1288 InputParameters::addRequiredParam<std::vector<MooseEnum>>(
1289 const std::string &
name,
1290 const std::vector<MooseEnum> & moose_enums,
1291 const std::string & doc_string)
1293 InputParameters::set<std::vector<MooseEnum>>(
name) =
1295 auto & metadata = _params[
name];
1296 metadata._required =
true;
1297 metadata._doc_string = doc_string;
1302 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
1303 const std::string &
name,
1304 const std::vector<MultiMooseEnum> & moose_enums,
1305 const std::string & doc_string)
1308 moose_enums.size() == 1,
1309 "Only 1 MultiMooseEnum is supported in addRequiredParam<std::vector<MultiMooseEnum>> for " +
1311 mooseAssert(!moose_enums[0].items().empty(),
1312 "The MultiMooseEnum in addRequiredParam<std::vector<MultiMooseEnum>> is empty for " +
1314 InputParameters::set<std::vector<MultiMooseEnum>>(
name) =
1316 auto & metadata = _params[
name];
1317 metadata._required =
true;
1318 metadata._doc_string = doc_string;
1323 InputParameters::addParam<MooseEnum>(
const std::string & ,
1324 const std::string & )
1326 mooseError(
"You must supply a MooseEnum object when using addParam, even if the parameter is not " 1332 InputParameters::addParam<MultiMooseEnum>(
const std::string & ,
1333 const std::string & )
1335 mooseError(
"You must supply a MultiMooseEnum object when using addParam, even if the parameter " 1336 "is not required!");
1341 InputParameters::addParam<std::vector<MooseEnum>>(
const std::string & ,
1342 const std::string & )
1344 mooseError(
"You must supply a vector of MooseEnum object(s) when using addParam, even if the " 1345 "parameter is not required!");
1350 InputParameters::addParam<std::vector<MultiMooseEnum>>(
const std::string & ,
1351 const std::string & )
1354 "You must supply a vector of MultiMooseEnum object(s) when using addParam, even if the " 1355 "parameter is not required!");
1360 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
const std::string & ,
1361 const std::string & )
1363 mooseError(
"You must supply a vector of MultiMooseEnum object(s) when using addRequiredParam!");
1368 InputParameters::addPrivateParam<MooseEnum>(
const std::string & )
1370 mooseError(
"You must supply a MooseEnum object when using addPrivateParam, even if the parameter " 1371 "is not required!");
1376 InputParameters::addPrivateParam<MultiMooseEnum>(
const std::string & )
1378 mooseError(
"You must supply a MultiMooseEnum object when using addPrivateParam, even if the " 1379 "parameter is not required!");
1384 InputParameters::addDeprecatedParam<MooseEnum>(
const std::string & ,
1385 const std::string & ,
1386 const std::string & )
1388 mooseError(
"You must supply a MooseEnum object and the deprecation string when using " 1389 "addDeprecatedParam, even if the parameter is not required!");
1394 InputParameters::addDeprecatedParam<MultiMooseEnum>(
const std::string & ,
1395 const std::string & ,
1396 const std::string & )
1398 mooseError(
"You must supply a MultiMooseEnum object and the deprecation string when using " 1399 "addDeprecatedParam, even if the parameter is not required!");
1404 InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
1405 const std::string & ,
1406 const std::string & ,
1407 const std::string & )
1409 mooseError(
"You must supply a vector of MooseEnum object(s) and the deprecation string when " 1410 "using addDeprecatedParam, even if the parameter is not required!");
1415 InputParameters::setParamHelper<PostprocessorName, Real>(
const std::string & ,
1416 PostprocessorName & l_value,
1417 const Real & r_value)
1420 std::ostringstream oss;
1422 l_value = oss.str();
1427 InputParameters::setParamHelper<PostprocessorName, int>(
const std::string & ,
1428 PostprocessorName & l_value,
1429 const int & r_value)
1432 std::ostringstream oss;
1434 l_value = oss.str();
1439 InputParameters::setParamHelper<FunctionName, Real>(
const std::string & ,
1440 FunctionName & l_value,
1441 const Real & r_value)
1444 std::ostringstream oss;
1446 l_value = oss.str();
1451 InputParameters::setParamHelper<FunctionName, int>(
const std::string & ,
1452 FunctionName & l_value,
1453 const int & r_value)
1456 std::ostringstream oss;
1458 l_value = oss.str();
1463 InputParameters::setParamHelper<MaterialPropertyName, Real>(
const std::string & ,
1464 MaterialPropertyName & l_value,
1465 const Real & r_value)
1468 std::ostringstream oss;
1470 l_value = oss.str();
1475 InputParameters::setParamHelper<MaterialPropertyName, int>(
const std::string & ,
1476 MaterialPropertyName & l_value,
1477 const int & r_value)
1480 std::ostringstream oss;
1482 l_value = oss.str();
1487 InputParameters::setParamHelper<MooseFunctorName, Real>(
const std::string & ,
1488 MooseFunctorName & l_value,
1489 const Real & r_value)
1492 std::ostringstream oss;
1494 l_value = oss.str();
1499 InputParameters::setParamHelper<MooseFunctorName, int>(
const std::string & ,
1500 MooseFunctorName & l_value,
1501 const int & r_value)
1504 std::ostringstream oss;
1506 l_value = oss.str();
1511 InputParameters::getParamHelper<MooseEnum>(
const std::string & name_in,
1514 const auto name = pars.checkForRename(name_in);
1520 InputParameters::getParamHelper<MultiMooseEnum>(
const std::string & name_in,
1523 const auto name = pars.checkForRename(name_in);
1529 const std::set<std::string> & reserved)
1535 std::set<std::string>
1541 return std::set<std::string>();
1542 return it->second._reserved_values;
1549 return hit_node->fileLocation(
false);
1557 return hit_node->fullpath();
1569 const hit::Node & node,
1572 mooseAssert(node.type() == hit::NodeType::Field,
"Must be a field");
1580 return hit_node->fileLocation(
false);
1588 return hit_node->fullpath();
1595 const static pcrecpp::RE
valid(
"[\\w:/]+");
1606 return it->second._ignore;
1610 std::set<std::string>
1613 std::set<std::string> names;
1615 if (it->second._group == group)
1616 names.emplace(it->first);
1620 std::set<std::string>
1623 std::set<std::string> param_set;
1625 param_set.emplace(it->first);
1629 std::set<std::string>
1632 std::set<std::string> controllable;
1634 if (it->second._controllable)
1635 controllable.emplace(it->first);
1636 return controllable;
1642 auto prefix = param +
":";
1652 return hit_node->strVal();
1658 const std::string & moose_object_with_var_param_name)
const 1661 std::string variable_name =
getMooseType(var_param_name);
1662 if (variable_name ==
"")
1672 moose_object_with_var_param_name,
1673 "' while retrieving value for '",
1675 "' parameter! Did you forget to set '",
1677 "' or set it to '' (empty string) by accident?");
1681 variable_name = vec[0];
1684 return variable_name;
1689 const std::string & new_name,
1691 const std::string & removal_date)
1693 auto params_it =
_params.find(old_name);
1694 if (params_it ==
_params.end())
1695 mooseError(
"Requested to rename parameter '",
1697 "' but that parameter name doesn't exist in the parameters object.");
1698 mooseAssert(params_it->second._deprecation_message.empty(),
1699 "Attempting to rename the parameter, '" << old_name <<
"', that is deprecated");
1701 auto new_metadata = std::move(params_it->second);
1704 _params.emplace(new_name, std::move(new_metadata));
1707 auto values_it =
_values.find(old_name);
1708 auto new_value = std::move(values_it->second);
1709 _values.emplace(new_name, std::move(new_value));
1712 std::string deprecation_message;
1713 if (!removal_date.empty())
1714 deprecation_message =
"'" + old_name +
"' has been deprecated and will be removed on " +
1715 removal_date +
". Please use '" + new_name +
"' instead.";
1723 const std::string & new_name,
1725 const std::string & removal_date)
1729 mooseError(
"Requested to rename coupled variable '",
1731 "' but that coupled variable name doesn't exist in the parameters object.");
1741 const std::string & new_name,
1742 const std::string & new_docstring)
1749 const std::string & new_name,
1750 const std::string & new_docstring)
1757 const std::string & new_name,
1758 const std::string & removal_date)
1765 const std::string & new_name,
1766 const std::string & removal_date)
1775 return it->second.first;
1780 std::vector<std::string>
1784 "The parameter we are searching for aliases for should exist in our parameter map");
1785 std::vector<std::string> aliases = {param_name};
1788 aliases.push_back(pr.second);
1793 std::optional<Moose::DataFileUtils::Path>
1799 std::optional<std::string>
1801 const hit::Node & node,
1805 bool has_name =
false;
1807 bool has_default =
false;
1815 auto &
name = names[i];
1817 if (MooseUtils::convert<Real>(
name, real_value,
false))
1829 return {
"invalid value for '" + node.fullpath() +
1830 "': coupled vectors where some parameters are reals and others are variables are not " 1840 std::pair<std::string, const hit::Node *>
1843 const hit::Node * node =
nullptr;
1845 std::string fullpath;
1847 if (
const hit::Node * param_node =
getHitNode(param))
1849 fullpath = param_node->fullpath();
1853 else if (
const hit::Node * block_node =
getHitNode())
1856 fullpath = block_node->fullpath() +
"/" + param;
1862 return {fullpath +
": ", node};
1876 const bool with_prefix ,
1877 const hit::Node * node )
const
std::string name(const ElemQuality q)
static const std::string name_param
The name of the parameter that contains the object name.
static const std::string app_param
The name of the parameter that contains the MooseApp.
void isValid(MooseObject *obj)
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
void callMooseError(std::string msg, const bool with_prefix, const hit::Node *node=nullptr) const
External method for calling moose error with added object context.
RelationshipManagerType
Main types of Relationship Managers.
static const std::string type_param
The name of the parameter that contains the object type.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Base class for MOOSE-based applications.
static const std::string moose_base_param
The name of the parameter that contains the moose system base.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
std::string docstring(const std::string &desc)
Augment docstring if NEML2 is not enabled.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Representation of a data file path.
infix_ostream_iterator< T, charT, traits > & operator=(T const &item)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Path getPath(std::string path, const std::optional< std::string > &base=std::optional< std::string >())
Get the data path for a given path, searching the registered data.
Scoped helper for setting Moose::_throw_on_error during this scope.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
std::vector< ElemQuality > valid(const ElemType t)
std::string hitMessagePrefix(const hit::Node &node)
Get the prefix to be associated with a hit node for a message.
std::string stringJoin(const std::vector< std::string > &values, const std::string &separator=" ")
Concatenates value into a single string separated by separator.
auto index_range(const T &sizable)
ExecFlagEnum execute_flags
Storage for the registered execute flags.