20 #include "libmesh/utility.h" 21 #include "libmesh/simple_range.h" 24 #include "hit/parse.h" 38 _collapse_nesting(false),
39 _moose_object_syntax_visibility(true),
40 _show_deprecated_message(true),
48 : Parameters(), _show_deprecated_message(true), _allow_copy(true)
54 : _show_deprecated_message(true), _allow_copy(true)
101 metadata._set_by_add_param =
false;
104 if (!have_parameter<MooseEnum>(
name) && !have_parameter<MultiMooseEnum>(
name))
105 metadata._valid =
true;
115 auto emit_deprecation_message =
116 [
this](
const auto & deprecated_name,
const auto & deprecation_message)
122 Moose::out,
false,
true,
errorPrefix(deprecated_name),
":\n", deprecation_message,
"\n");
128 return emit_deprecation_message(
name,
129 "The parameter '" +
name +
"' is deprecated.\n" +
130 libmesh_map_find(
_params,
name)._deprecation_message);
133 return emit_deprecation_message(name_in, it->second.second);
151 const std::string &
name =
152 rhs.
get<std::string>(
"_object_name");
154 mooseError(
"Copying of the InputParameters object for the ",
156 " object is not allowed.\n\nThe likely cause for this error ",
157 "is having a constructor that does not use a const reference, all constructors\nfor " 158 "MooseObject based classes should be as follows:\n\n",
159 " MyObject::MyObject(const InputParameters & parameters);");
186 Parameters::operator+=(rhs);
190 for (
auto it = rhs.
_params.begin(); it != rhs.
_params.end(); ++it)
191 _params[it->first] = it->second;
211 const std::string & doc_string)
216 auto params_it =
_params.find(coupled_vars_it->second);
217 if (params_it ==
_params.end())
218 mooseError(
"There must have been a mistake in the construction of the new to deprecated " 219 "coupled vars map because the old name ",
220 coupled_vars_it->second,
221 " doesn't exist in the parameters data.");
223 params_it->second._doc_string = doc_string;
230 addParam<std::vector<VariableName>>(
name, doc_string);
233 metadata._coupled_default.assign(1,
value);
234 metadata._have_coupled_default =
true;
242 const std::vector<Real> & value,
243 const std::string & doc_string)
246 addParam<std::vector<VariableName>>(
name, doc_string);
249 metadata._coupled_default =
value;
250 metadata._have_coupled_default =
true;
259 addParam<std::vector<VariableName>>(
name, doc_string);
268 const std::string & new_name,
269 const std::string & removal_date )
276 auto params_it =
_params.find(new_name);
277 std::string doc_string;
278 if (params_it !=
_params.end())
279 doc_string = params_it->second._doc_string;
281 addParam<std::vector<VariableName>>(old_name, doc_string);
285 std::string deprecation_message =
286 "The coupled variable parameter '" + old_name +
"' has been deprecated";
287 if (!removal_date.empty())
288 deprecation_message +=
" and will be removed " + removal_date;
289 deprecation_message +=
". Please use the '" + new_name +
"' coupled variable parameter instead.";
290 _params[old_name]._deprecation_message = deprecation_message;
296 const std::string & base_name,
297 const std::string & num_name,
298 const std::string & doc_string)
300 addParam<std::vector<VariableName>>(
name, doc_string);
302 _params[
name]._autobuild_vecs = std::make_pair(base_name, num_name);
305 addParam<std::string>(base_name, doc_string +
" (base_name)");
306 addParam<unsigned int>(num_name, doc_string +
" (num_name)");
311 const std::string & base_name,
312 const std::string & num_name,
313 const std::string & doc_string)
315 addRequiredParam<std::vector<VariableName>>(
name, doc_string);
323 addRequiredParam<std::vector<VariableName>>(
name, doc_string);
332 std::string doc_string;
335 for (
const auto & ch : it->second._doc_string)
338 doc_string +=
" ... ";
353 mooseError(
"Unable to set the documentation string (using setDocString) for the \"",
355 "\" parameter, the parameter does not exist.");
356 it->second._doc_string = doc;
393 if (have_parameter<MooseEnum>(
name))
397 for (
auto it =
get<std::vector<MooseEnum>>(
name).
begin();
398 it != get<std::vector<MooseEnum>>(
name).
end();
404 else if (have_parameter<MultiMooseEnum>(
name))
405 return get<MultiMooseEnum>(
name).isValid();
408 for (
auto it =
get<std::vector<MultiMooseEnum>>(
name).
begin();
409 it != get<std::vector<MultiMooseEnum>>(
name).
end();
415 else if (have_parameter<ExecFlagEnum>(
name))
416 return get<ExecFlagEnum>(
name).isValid();
438 for (
const auto & it : *
this)
455 std::vector<std::string> names;
456 MooseUtils::tokenize<std::string>(input_names, names, 1,
" ");
457 for (
auto & name_in : names)
463 map_iter->second._controllable =
true;
469 "' does not exist, thus cannot be marked as controllable.");
480 const std::set<ExecFlagType> &
490 InputParameters::set<std::string>(
"_moose_base") =
value;
491 _params[
"_moose_base"]._is_private =
true;
494 std::optional<std::string>
497 if (have_parameter<std::string>(
"_moose_base"))
498 return get<std::string>(
"_moose_base");
505 InputParameters::set<std::string>(
"_moose_warehouse_system_name") =
value;
506 _params[
"_moose_warehouse_system_name"]._is_private =
true;
512 mooseAssert(have_parameter<std::string>(
"_moose_warehouse_system_name"),
513 "SystemAttributeName is not available! Call 'registerSystemAttributeName' (usually " 514 "in the validParams function) before you try accessing it!");
515 return Parameters::get<std::string>(
"_moose_warehouse_system_name");
527 const std::string & name,
534 const std::vector<std::string> &
540 const std::vector<std::tuple<std::string,
572 #define dynamicCastRangeCheck(type, up_type, long_name, short_name, param, oss) \ 575 libMesh::Parameters::Value * val = MooseUtils::get(param); \ 576 InputParameters::Parameter<type> * scalar_p = \ 577 dynamic_cast<InputParameters::Parameter<type> *>(val); \ 579 rangeCheck<type, up_type>(long_name, short_name, scalar_p, oss); \ 580 InputParameters::Parameter<std::vector<type>> * vector_p = \ 581 dynamic_cast<InputParameters::Parameter<std::vector<type>> *>(val); \ 583 rangeCheck<type, up_type>(long_name, short_name, vector_p, oss); \ 586 #define checkMooseType(param_type, name) \ 587 if (have_parameter<param_type>(name) || have_parameter<std::vector<param_type>>(name)) \ 588 oss << inputLocation(param_name) << ": non-controllable type '" << type(name) \ 589 << "' for parameter '" << paramFullpath(param_name) << "' marked controllable"; 595 std::ostringstream oss;
597 for (
const auto & it : *
this)
607 oss <<
blockLocation() <<
": missing required parameter '" << parampath +
"/" + param_name
609 oss <<
"\tDoc String: \"" +
getDocString(param_name) +
"\"" << std::endl;
614 for (
const auto & it : *
this)
616 std::string long_name(parampath +
"/" + it.first);
618 dynamicCastRangeCheck(
Real,
Real, long_name, it.first, it.second, oss);
619 dynamicCastRangeCheck(
int,
long, long_name, it.first, it.second, oss);
620 dynamicCastRangeCheck(
long,
long, long_name, it.first, it.second, oss);
621 dynamicCastRangeCheck(
unsigned int,
long, long_name, it.first, it.second, oss);
629 <<
"' marked controllable";
631 checkMooseType(NonlinearVariableName, param_name);
632 checkMooseType(AuxVariableName, param_name);
633 checkMooseType(VariableName, param_name);
634 checkMooseType(BoundaryName, param_name);
635 checkMooseType(SubdomainName, param_name);
636 checkMooseType(PostprocessorName, param_name);
637 checkMooseType(VectorPostprocessorName, param_name);
638 checkMooseType(UserObjectName, param_name);
639 checkMooseType(MaterialPropertyName, param_name);
642 if (!oss.str().empty())
654 const auto set_absolute_path = [
this](
const std::string & param_name,
auto &
value)
660 std::filesystem::path value_path = std::string(
value);
662 if (value_path.is_absolute())
667 value = std::filesystem::absolute(file_base / value_path).c_str();
671 for (
const auto & [param_name, param_value] : *
this)
673 #define set_if_filename(type) \ 674 else if (auto type_value = dynamic_cast<Parameters::Parameter<type> *>(param_value.get())) \ 675 set_absolute_path(param_name, type_value->set()); \ 676 else if (auto type_values = dynamic_cast<Parameters::Parameter<std::vector<type>> *>( \ 677 param_value.get())) for (auto & value : type_values->set()) \ 678 set_absolute_path(param_name, value) 684 set_if_filename(FileName);
685 set_if_filename(FileNameNoExtension);
686 set_if_filename(MeshFileName);
687 set_if_filename(MatrixFileName);
688 #undef set_if_filename 690 else if (
auto data_file_name =
691 dynamic_cast<Parameters::Parameter<DataFileName> *
>(param_value.get()))
694 std::optional<std::string> error;
703 catch (std::exception & e)
713 data_file_name->set() = found_path.
path;
722 std::filesystem::path
725 mooseAssert(!have_parameter<std::string>(
"_app_name"),
726 "Not currently setup to work with app FileName parameters");
728 const hit::Node * hit_node =
nullptr;
738 return std::filesystem::current_path();
741 while (hit_node && hit_node->filename() ==
"CLI_ARGS")
742 hit_node = hit_node->parent();
747 std::string prefix =
"";
751 "Input context was set via a command-line argument and does not have sufficient " 753 "determining a file path.");
756 return std::filesystem::absolute(std::filesystem::path(hit_node->filename()).parent_path());
763 return !
_params.find(
name)->second._range_function.empty();
783 mooseError(
"No way to know if the parameter '", param_name,
"' has a default");
797 return _params.count(coupling_name) > 0 &&
_params.at(coupling_name)._have_coupled_default &&
805 _params[actual_name]._coupled_default.resize(i + 1);
807 _params[actual_name]._have_coupled_default =
true;
813 auto value_it =
_params.find(coupling_name);
815 if (value_it ==
_params.end() || !value_it->second._have_coupled_default)
816 mooseError(
"Attempted to retrieve default value for coupled variable '",
818 "' when none was provided. \n\nThere are three reasons why this may have " 819 "occurred:\n 1. The other version of params.addCoupledVar() should be used in order " 820 "to provide a default value. \n 2. This should have been a required coupled " 821 "variable added with params.addRequiredCoupledVar() \n 3. The call to get the " 822 "coupled value should have been properly guarded with isCoupled()\n");
824 return value_it->second._coupled_default.at(i);
830 auto value_it =
_params.find(coupling_name);
832 mooseError(
"Attempted to retrieve default value for coupled variable '",
834 "' when none was provided.");
835 return value_it->second._coupled_default.size();
838 std::map<std::string, std::pair<std::string, std::string>>
841 std::map<std::string, std::pair<std::string, std::string>> abv;
844 if (!it->second._autobuild_vecs.first.empty())
845 abv[it->first] = it->second._autobuild_vecs;
858 return "std::vector<VariableName>";
870 if (have_parameter<VariableName>(
name))
871 var = get<VariableName>(
name);
872 else if (have_parameter<NonlinearVariableName>(
name))
873 var = get<NonlinearVariableName>(
name);
874 else if (have_parameter<LinearVariableName>(
name))
875 var = get<LinearVariableName>(
name);
876 else if (have_parameter<AuxVariableName>(
name))
877 var = get<AuxVariableName>(
name);
878 else if (have_parameter<PostprocessorName>(
name))
879 var = get<PostprocessorName>(
name);
880 else if (have_parameter<VectorPostprocessorName>(
name))
881 var = get<VectorPostprocessorName>(
name);
882 else if (have_parameter<FunctionName>(
name))
883 var = get<FunctionName>(
name);
884 else if (have_parameter<UserObjectName>(
name))
885 var = get<UserObjectName>(
name);
886 else if (have_parameter<MaterialPropertyName>(
name))
887 var = get<MaterialPropertyName>(
name);
888 else if (have_parameter<std::string>(
name))
889 var = get<std::string>(
name);
894 std::vector<std::string>
898 std::vector<std::string> svars;
902 std::vector<VariableName>
vars = get<std::vector<VariableName>>(
name);
903 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
907 std::vector<NonlinearVariableName>
vars = get<std::vector<NonlinearVariableName>>(
name);
908 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
912 std::vector<AuxVariableName>
vars = get<std::vector<AuxVariableName>>(
name);
913 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
917 std::vector<MaterialPropertyName>
vars = get<std::vector<MaterialPropertyName>>(
name);
918 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
922 std::vector<std::string>
vars = get<std::vector<std::string>>(
name);
923 std::copy(
vars.begin(),
vars.end(), std::back_inserter(svars));
931 const std::string group_name)
933 std::vector<std::string> elements;
938 std::set<std::string> param_names;
939 for (
const auto & it : *
this)
940 param_names.insert(it.first);
942 for (
const auto & param_name : elements)
943 if (
_params.count(param_name) > 0)
944 _params[param_name]._group = group_name;
946 mooseError(
"Unable to find a parameter with name: ",
948 " when adding to group ",
957 if (param.second._group == old_name)
958 param.second._group = new_name;
966 mooseError(
"InputParameters::setGlobalCommandLineParam: The parameter '",
968 "' is not a command line parameter");
969 cl_data->global =
true;
978 std::optional<InputParameters::CommandLineMetadata>
992 mooseError(
"InputParameters::getCommandLineMetadata: The parameter '",
994 "' is not a command line parameter");
1003 mooseError(
"InputParameters::commandLineParamSet: The parameter '",
1005 "' is not a command line parameter");
1006 cl_data->set_by_command_line =
true;
1013 auto it =
_params.find(param_name);
1015 return it->second._group;
1016 return std::string();
1021 const std::vector<std::string> & exclude,
1022 const bool allow_private)
1029 for (
const auto & it : common)
1032 const std::string & common_name = it.first;
1034 if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
1041 for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
1042 it != common.coupledVarsEnd();
1046 const std::string var_name = *it;
1049 if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
1058 const std::vector<std::string> & include,
1062 for (
const auto & it : common)
1066 const std::string & common_name = it.first;
1069 if (std::find(include.begin(), include.end(), common_name) == include.end())
1076 for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
1077 it != common.coupledVarsEnd();
1081 const std::string var_name = *it;
1084 if (std::find(include.begin(), include.end(), var_name) == include.end())
1120 const std::string & common_name,
1122 bool override_default)
1131 const bool local_exist =
_values.find(local_name) !=
_values.end();
1132 const bool local_set =
_params.count(local_name) > 0 && !
_params[local_name]._set_by_add_param;
1133 const bool local_priv = allow_private ? false :
isPrivate(local_name);
1137 const bool common_exist = common.
_values.find(common_name) != common.
_values.end();
1138 const bool common_priv = allow_private ? false : common.
isPrivate(common_name);
1139 const bool common_valid = common.
isParamValid(common_name) || override_default;
1147 if (local_exist && common_exist && common_valid && (!local_valid || !local_set) &&
1148 (!common_priv || !local_priv))
1151 _values[local_name] = common.
_values.find(common_name)->second->clone();
1153 _params[local_name]._set_by_add_param =
1154 libmesh_map_find(common.
_params, common_name)._set_by_add_param;
1160 else if (!local_exist && !common_exist)
1161 mooseError(
"InputParameters::applyParameter(): Attempted to apply invalid parameter \"",
1173 mooseDeprecated(
"paramSetByUser() is deprecated. Use isParamSetByUser() instead.");
1189 return cl_data->set_by_command_line;
1201 return it->second._doc_string;
1206 InputParameters::addRequiredParam<MooseEnum>(
const std::string &
name,
1208 const std::string & doc_string)
1210 InputParameters::set<MooseEnum>(
name) = moose_enum;
1211 auto & metadata = _params[
name];
1212 metadata._required =
true;
1213 metadata._doc_string = doc_string;
1218 InputParameters::addRequiredParam<MultiMooseEnum>(
const std::string &
name,
1220 const std::string & doc_string)
1222 InputParameters::set<MultiMooseEnum>(
name) =
1224 auto & metadata = _params[
name];
1225 metadata._required =
true;
1226 metadata._doc_string = doc_string;
1231 InputParameters::addRequiredParam<std::vector<MooseEnum>>(
1232 const std::string &
name,
1233 const std::vector<MooseEnum> & moose_enums,
1234 const std::string & doc_string)
1236 InputParameters::set<std::vector<MooseEnum>>(
name) =
1238 auto & metadata = _params[
name];
1239 metadata._required =
true;
1240 metadata._doc_string = doc_string;
1245 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
1246 const std::string &
name,
1247 const std::vector<MultiMooseEnum> & moose_enums,
1248 const std::string & doc_string)
1251 moose_enums.size() == 1,
1252 "Only 1 MultiMooseEnum is supported in addRequiredParam<std::vector<MultiMooseEnum>> for " +
1254 mooseAssert(!moose_enums[0].items().empty(),
1255 "The MultiMooseEnum in addRequiredParam<std::vector<MultiMooseEnum>> is empty for " +
1257 InputParameters::set<std::vector<MultiMooseEnum>>(
name) =
1259 auto & metadata = _params[
name];
1260 metadata._required =
true;
1261 metadata._doc_string = doc_string;
1266 InputParameters::addParam<MooseEnum>(
const std::string & ,
1267 const std::string & )
1269 mooseError(
"You must supply a MooseEnum object when using addParam, even if the parameter is not " 1275 InputParameters::addParam<MultiMooseEnum>(
const std::string & ,
1276 const std::string & )
1278 mooseError(
"You must supply a MultiMooseEnum object when using addParam, even if the parameter " 1279 "is not required!");
1284 InputParameters::addParam<std::vector<MooseEnum>>(
const std::string & ,
1285 const std::string & )
1287 mooseError(
"You must supply a vector of MooseEnum object(s) when using addParam, even if the " 1288 "parameter is not required!");
1293 InputParameters::addParam<std::vector<MultiMooseEnum>>(
const std::string & ,
1294 const std::string & )
1297 "You must supply a vector of MultiMooseEnum object(s) when using addParam, even if the " 1298 "parameter is not required!");
1303 InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
const std::string & ,
1304 const std::string & )
1306 mooseError(
"You must supply a vector of MultiMooseEnum object(s) when using addRequiredParam!");
1311 InputParameters::addPrivateParam<MooseEnum>(
const std::string & )
1313 mooseError(
"You must supply a MooseEnum object when using addPrivateParam, even if the parameter " 1314 "is not required!");
1319 InputParameters::addPrivateParam<MultiMooseEnum>(
const std::string & )
1321 mooseError(
"You must supply a MultiMooseEnum object when using addPrivateParam, even if the " 1322 "parameter is not required!");
1327 InputParameters::addDeprecatedParam<MooseEnum>(
const std::string & ,
1328 const std::string & ,
1329 const std::string & )
1331 mooseError(
"You must supply a MooseEnum object and the deprecation string when using " 1332 "addDeprecatedParam, even if the parameter is not required!");
1337 InputParameters::addDeprecatedParam<MultiMooseEnum>(
const std::string & ,
1338 const std::string & ,
1339 const std::string & )
1341 mooseError(
"You must supply a MultiMooseEnum object and the deprecation string when using " 1342 "addDeprecatedParam, even if the parameter is not required!");
1347 InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
1348 const std::string & ,
1349 const std::string & ,
1350 const std::string & )
1352 mooseError(
"You must supply a vector of MooseEnum object(s) and the deprecation string when " 1353 "using addDeprecatedParam, even if the parameter is not required!");
1360 ". A functor is any of the following: a variable, a functor material property, a " 1361 "function, a post-processor, or a number.";
1366 InputParameters::setParamHelper<PostprocessorName, Real>(
const std::string & ,
1367 PostprocessorName & l_value,
1368 const Real & r_value)
1371 std::ostringstream oss;
1373 l_value = oss.str();
1378 InputParameters::setParamHelper<PostprocessorName, int>(
const std::string & ,
1379 PostprocessorName & l_value,
1380 const int & r_value)
1383 std::ostringstream oss;
1385 l_value = oss.str();
1390 InputParameters::setParamHelper<FunctionName, Real>(
const std::string & ,
1391 FunctionName & l_value,
1392 const Real & r_value)
1395 std::ostringstream oss;
1397 l_value = oss.str();
1402 InputParameters::setParamHelper<FunctionName, int>(
const std::string & ,
1403 FunctionName & l_value,
1404 const int & r_value)
1407 std::ostringstream oss;
1409 l_value = oss.str();
1414 InputParameters::setParamHelper<MaterialPropertyName, Real>(
const std::string & ,
1415 MaterialPropertyName & l_value,
1416 const Real & r_value)
1419 std::ostringstream oss;
1421 l_value = oss.str();
1426 InputParameters::setParamHelper<MaterialPropertyName, int>(
const std::string & ,
1427 MaterialPropertyName & l_value,
1428 const int & r_value)
1431 std::ostringstream oss;
1433 l_value = oss.str();
1438 InputParameters::setParamHelper<MooseFunctorName, Real>(
const std::string & ,
1439 MooseFunctorName & l_value,
1440 const Real & r_value)
1443 std::ostringstream oss;
1445 l_value = oss.str();
1450 InputParameters::setParamHelper<MooseFunctorName, int>(
const std::string & ,
1451 MooseFunctorName & l_value,
1452 const int & r_value)
1455 std::ostringstream oss;
1457 l_value = oss.str();
1462 InputParameters::getParamHelper<MooseEnum>(
const std::string & name_in,
1467 const auto name = pars.checkForRename(name_in);
1473 InputParameters::getParamHelper<MultiMooseEnum>(
const std::string & name_in,
1478 const auto name = pars.checkForRename(name_in);
1484 const std::set<std::string> & reserved)
1490 std::set<std::string>
1496 return std::set<std::string>();
1497 return it->second._reserved_values;
1504 return hit_node->fileLocation(
false);
1512 return hit_node->fullpath();
1524 const hit::Node & node,
1527 mooseAssert(node.type() == hit::NodeType::Field,
"Must be a field");
1535 return hit_node->fileLocation(
false);
1543 return hit_node->fullpath();
1550 const static pcrecpp::RE
valid(
"[\\w:/]+");
1561 return it->second._ignore;
1565 std::set<std::string>
1568 std::set<std::string> names;
1570 if (it->second._group == group)
1571 names.emplace(it->first);
1575 std::set<std::string>
1578 std::set<std::string> param_set;
1580 param_set.emplace(it->first);
1584 std::set<std::string>
1587 std::set<std::string> controllable;
1589 if (it->second._controllable)
1590 controllable.emplace(it->first);
1591 return controllable;
1597 auto prefix = param +
":";
1607 return hit_node->strVal();
1613 const std::string & moose_object_with_var_param_name)
const 1616 std::string variable_name =
getMooseType(var_param_name);
1617 if (variable_name ==
"")
1627 moose_object_with_var_param_name,
1628 "' while retrieving value for '",
1630 "' parameter! Did you forget to set '",
1632 "' or set it to '' (empty string) by accident?");
1636 variable_name = vec[0];
1639 return variable_name;
1644 const std::string & new_name,
1646 const std::string & removal_date)
1648 auto params_it =
_params.find(old_name);
1649 if (params_it ==
_params.end())
1650 mooseError(
"Requested to rename parameter '",
1652 "' but that parameter name doesn't exist in the parameters object.");
1653 mooseAssert(params_it->second._deprecation_message.empty(),
1654 "Attempting to rename the parameter, '" << old_name <<
"', that is deprecated");
1656 auto new_metadata = std::move(params_it->second);
1659 _params.emplace(new_name, std::move(new_metadata));
1662 auto values_it =
_values.find(old_name);
1663 auto new_value = std::move(values_it->second);
1664 _values.emplace(new_name, std::move(new_value));
1667 std::string deprecation_message;
1668 if (!removal_date.empty())
1669 deprecation_message =
"'" + old_name +
"' has been deprecated and will be removed on " +
1670 removal_date +
". Please use '" + new_name +
"' instead.";
1678 const std::string & new_name,
1680 const std::string & removal_date)
1684 mooseError(
"Requested to rename coupled variable '",
1686 "' but that coupled variable name doesn't exist in the parameters object.");
1696 const std::string & new_name,
1697 const std::string & new_docstring)
1704 const std::string & new_name,
1705 const std::string & new_docstring)
1712 const std::string & new_name,
1713 const std::string & removal_date)
1720 const std::string & new_name,
1721 const std::string & removal_date)
1730 return it->second.first;
1735 std::vector<std::string>
1739 "The parameter we are searching for aliases for should exist in our parameter map");
1740 std::vector<std::string> aliases = {param_name};
1743 aliases.push_back(pr.second);
1748 std::optional<Moose::DataFileUtils::Path>
std::string name(const ElemQuality q)
bool show_trace
Set to true (the default) to print the stack trace with error and warning messages - false to omit it...
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 ...
RelationshipManagerType
Main types of Relationship Managers.
Base class for everything in MOOSE with a name and a type.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
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 trim(const std::string &str, const std::string &white_space=" \\\)
Standard scripting language trim function.
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.
void mooseDeprecatedStream(S &oss, const bool expired, const bool print_title, Args &&... args)
void callMooseError(std::string msg, const bool with_prefix) const
Calls moose error with the message msg.
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.
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)
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
ExecFlagEnum execute_flags
Storage for the registered execute flags.